Spaces:
Sleeping
Sleeping
Upload with huggingface_hub
Browse files
README.md
CHANGED
@@ -5,8 +5,7 @@ emoji: 🔥
|
|
5 |
colorFrom: indigo
|
6 |
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
-
sdk_version: 3.
|
9 |
-
|
10 |
-
app_file: app.py
|
11 |
pinned: false
|
12 |
---
|
|
|
5 |
colorFrom: indigo
|
6 |
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
+
sdk_version: 3.4.1
|
9 |
+
app_file: run.py
|
|
|
10 |
pinned: false
|
11 |
---
|
run.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
demo = gr.Interface(ner,
|
16 |
+
gr.Textbox(placeholder="Enter sentence here..."),
|
17 |
+
gr.HighlightedText(),
|
18 |
+
examples=examples)
|
19 |
+
|
20 |
+
if __name__ == "__main__":
|
21 |
+
demo.launch()
|