Kilos1 commited on
Commit
dba5970
·
verified ·
1 Parent(s): f70baa1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ def ner(text):
11
+ output = ner_pipeline(text)
12
+ return {"text": text, "entities": output}
13
+
14
+ demo = gr.Interface(ner,
15
+ gr.Textbox(placeholder="Enter sentence here..."),
16
+ gr.HighlightedText(),
17
+ examples=examples)
18
+
19
+ demo.launch()