File size: 1,431 Bytes
0e62bb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d5f129
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import gradio as gr
import spacy
import spacy_conll
import warnings

nlp = spacy.load("fo_sent_split_parse_final")
nlp.add_pipe("conll_formatter", last=True)
warnings.simplefilter(action='ignore', category=FutureWarning)

def parse_faroese_text(text):
    doc = nlp(text)
    return doc._.conll_str

interface = gr.Interface(
    fn=parse_faroese_text,
    inputs=gr.Textbox(label="Введите текст на фарерском языке:"),
    outputs=gr.Textbox(label="Результат в формате CoNLL-U"),
    title="Faroese Text Parser",
    description="Введите текст на фарерском языке, чтобы получить его разбор в формате CoNLL-U."
)

interface.launch()
import gradio as gr
import spacy
import spacy_conll

nlp = spacy.load("fo_sent_split_parse_final")
nlp.add_pipe("conll_formatter", last=True)

def parse_faroese_text(text):
    doc = nlp(text)
    return doc._.conll_str

interface = gr.Interface(
    fn=parse_faroese_text,
    inputs=gr.Textbox(label="Введите текст на фарерском языке:"),
    outputs=gr.Textbox(label="Результат в формате CoNLL-U"),
    title="Faroese Text Parser",
    description="Введите текст на фарерском языке, чтобы получить его разбор в формате CoNLL-U."
)

interface.launch()