ru-srl-model / app.py
dl-ru's picture
Update app.py
731a992
from transformers import pipeline
import gradio as gr
ner_pipeline = pipeline("ner", model="dl-ru/rubert-tiny2-srl")
examples = [
"Мне всё нрав",
]
def ner(text):
output = ner_pipeline(text)
return {"text": text, "entities": output}
demo = gr.Interface(ner,
gr.Textbox(placeholder="Введите предложение ..."),
gr.HighlightedText(),
examples=examples)
demo.launch()