Spaces:
Runtime error
Runtime error
File size: 302 Bytes
3e43257 1785439 3e43257 |
1 2 3 4 5 6 7 8 9 10 11 |
import spacy
import gradio as gr
nlp = spacy.load("en_core_web_sm")
def ner(sentence):
doc = nlp(sentence)
ents = [(e.text, e.label_) for e in doc.ents]
return ents,ents
app = gr.Interface(fn=ner, inputs="text", outputs=["text",gr.HighlightedText(label="Text with entites")])
app.launch() |