Vishnu-add's picture
Update app.py
7d7ce6f
raw
history blame contribute delete
302 Bytes
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()