Spaces:
Runtime error
Runtime error
naghamghanim
commited on
Commit
•
65a3873
1
Parent(s):
c7f67f8
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#import gradio as gr
|
2 |
+
|
3 |
+
#gr.load("models/SinaLab/ArabicWojood-FlatNER").launch()
|
4 |
+
|
5 |
+
from transformers import pipeline
|
6 |
+
|
7 |
import gradio as gr
|
8 |
|
9 |
+
ner_pipeline = pipeline("ner")
|
10 |
+
|
11 |
+
examples = [
|
12 |
+
"Does Chicago have any stores and does Joe live here?",
|
13 |
+
]
|
14 |
+
|
15 |
+
def ner(text):
|
16 |
+
output = ner_pipeline(text)
|
17 |
+
return {"text": text, "entities": output}
|
18 |
+
|
19 |
+
demo = gr.Interface(ner,
|
20 |
+
gr.Textbox(placeholder="انا اسمي سامي"),
|
21 |
+
gr.HighlightedText(),
|
22 |
+
examples=examples)
|
23 |
+
|
24 |
+
demo.launch()
|