File size: 252 Bytes
3e43257
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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

app = gr.Interface(fn=ner, inputs="text", outputs = "text")
app.launch()