rajesh1729's picture
Create app.py
3c4fd84
raw
history blame
262 Bytes
import spacy as sp
import gradio as gr
def ner(sentence):
nlp = sp.load("en_core_web_sm")
doc = nlp(sentence)
ents = [(e.text, e.label_) for e in doc.ents]
return ents
iface = gr.Interface(fn=ner, inputs="text", outputs = "text")
iface.launch()