rajesh1729 commited on
Commit
3c4fd84
·
1 Parent(s): fd444c5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import spacy as sp
2
+ import gradio as gr
3
+
4
+ def ner(sentence):
5
+ nlp = sp.load("en_core_web_sm")
6
+ doc = nlp(sentence)
7
+ ents = [(e.text, e.label_) for e in doc.ents]
8
+ return ents
9
+
10
+ iface = gr.Interface(fn=ner, inputs="text", outputs = "text")
11
+ iface.launch()