Spaces:
Runtime error
Runtime error
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() |