abidlabs HF staff commited on
Commit
b8572b1
1 Parent(s): bd8ba9b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ import gradio as gr
4
+
5
+ ner_pipeline = pipeline("ner")
6
+
7
+ examples = [
8
+ "Does Chicago have any stores and does Joe live here?",
9
+ ]
10
+
11
+ def ner(text):
12
+ output = ner_pipeline(text)
13
+ return {"text": text, "entities": output}
14
+
15
+ gr.Interface(ner,
16
+ gr.Textbox(placeholder="Enter sentence here..."),
17
+ gr.HighlightedText(),
18
+ examples=examples).launch()