faroese_parser / app.py
Zlovoblachko's picture
Add application
0e62bb4
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()