File size: 655 Bytes
2c4822c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d5f129
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()