tirendazakademi
modified
764740b
raw
history blame contribute delete
566 Bytes
from transformers import pipeline
import gradio as gr
ner_pipeline = pipeline("ner", model = "Tirendaz/roberta-base-NER")
examples = [
"My name is Tim and I live in California.",
"Ich arbeite bei Google in Berlin",
"Ali, Ankara'lı mı?"
]
def ner(text):
output = ner_pipeline(text, aggregation_strategy="simple")
return {"text": text, "entities": output}
demo = gr.Interface(ner,
gr.Textbox(placeholder="Enter sentence here..."),
gr.HighlightedText(),
examples=examples)
demo.launch(share=True)