Zlovoblachko commited on
Commit
0e62bb4
·
2 Parent(s): 0d5f129 0d22853

Add application

Browse files
Files changed (1) hide show
  1. app.py +41 -19
app.py CHANGED
@@ -1,20 +1,42 @@
1
- import gradio as gr
2
- import spacy
3
- import spacy_conll
4
-
5
- nlp = spacy.load("fo_sent_split_parse_final")
6
- nlp.add_pipe("conll_formatter", last=True)
7
-
8
- def parse_faroese_text(text):
9
- doc = nlp(text)
10
- return doc._.conll_str
11
-
12
- interface = gr.Interface(
13
- fn=parse_faroese_text,
14
- inputs=gr.Textbox(label="Введите текст на фарерском языке:"),
15
- outputs=gr.Textbox(label="Результат в формате CoNLL-U"),
16
- title="Faroese Text Parser",
17
- description="Введите текст на фарерском языке, чтобы получить его разбор в формате CoNLL-U."
18
- )
19
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  interface.launch()
 
1
+ import gradio as gr
2
+ import spacy
3
+ import spacy_conll
4
+ import warnings
5
+
6
+ nlp = spacy.load("fo_sent_split_parse_final")
7
+ nlp.add_pipe("conll_formatter", last=True)
8
+ warnings.simplefilter(action='ignore', category=FutureWarning)
9
+
10
+ def parse_faroese_text(text):
11
+ doc = nlp(text)
12
+ return doc._.conll_str
13
+
14
+ interface = gr.Interface(
15
+ fn=parse_faroese_text,
16
+ inputs=gr.Textbox(label="Введите текст на фарерском языке:"),
17
+ outputs=gr.Textbox(label="Результат в формате CoNLL-U"),
18
+ title="Faroese Text Parser",
19
+ description="Введите текст на фарерском языке, чтобы получить его разбор в формате CoNLL-U."
20
+ )
21
+
22
+ interface.launch()
23
+ import gradio as gr
24
+ import spacy
25
+ import spacy_conll
26
+
27
+ nlp = spacy.load("fo_sent_split_parse_final")
28
+ nlp.add_pipe("conll_formatter", last=True)
29
+
30
+ def parse_faroese_text(text):
31
+ doc = nlp(text)
32
+ return doc._.conll_str
33
+
34
+ interface = gr.Interface(
35
+ fn=parse_faroese_text,
36
+ inputs=gr.Textbox(label="Введите текст на фарерском языке:"),
37
+ outputs=gr.Textbox(label="Результат в формате CoNLL-U"),
38
+ title="Faroese Text Parser",
39
+ description="Введите текст на фарерском языке, чтобы получить его разбор в формате CoNLL-U."
40
+ )
41
+
42
  interface.launch()