Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from camel_tools.tagger.default import DefaultTagger
|
|
7 |
from camel_tools.disambig.bert import BERTUnfactoredDisambiguator
|
8 |
|
9 |
def predict_label(text):
|
10 |
-
|
11 |
ip = text.split()
|
12 |
ip_len = [len(ip)]
|
13 |
|
@@ -59,17 +59,19 @@ if __name__ == '__main__':
|
|
59 |
# span_model = SpanNet.load_model(span_path)
|
60 |
# msa_span_model = SpanNet.load_model(msa_span_path)
|
61 |
# entity_model = EntNet.load_model(entity_path)
|
62 |
-
|
63 |
|
64 |
|
65 |
with gr.Blocks(theme='finlaymacklon/smooth_slate') as iface:
|
66 |
-
example_input=gr.Textbox(label="Input Example", lines=
|
|
|
67 |
|
68 |
-
gr.Interface(fn=predict_label, inputs=example_input, outputs=
|
69 |
theme="smooth_slate")
|
70 |
gr.Examples(
|
71 |
examples=["النشرة الإخبارية الصادرة عن الأونروا رقم 113 (1986/1/8).",
|
72 |
"صورة لمدينة أريحا القديمة :تل السلطان",
|
73 |
-
"
|
74 |
inputs= example_input)
|
|
|
75 |
iface.launch(show_api=False)
|
|
|
7 |
from camel_tools.disambig.bert import BERTUnfactoredDisambiguator
|
8 |
|
9 |
def predict_label(text):
|
10 |
+
return "hello"
|
11 |
ip = text.split()
|
12 |
ip_len = [len(ip)]
|
13 |
|
|
|
59 |
# span_model = SpanNet.load_model(span_path)
|
60 |
# msa_span_model = SpanNet.load_model(msa_span_path)
|
61 |
# entity_model = EntNet.load_model(entity_path)
|
62 |
+
|
63 |
|
64 |
|
65 |
with gr.Blocks(theme='finlaymacklon/smooth_slate') as iface:
|
66 |
+
example_input=gr.Textbox(label="Input Example", lines=3)
|
67 |
+
prediction=gr.Text(label="Predicted Entities")
|
68 |
|
69 |
+
gr.Interface(fn=predict_label, inputs=example_input, outputs=prediction,
|
70 |
theme="smooth_slate")
|
71 |
gr.Examples(
|
72 |
examples=["النشرة الإخبارية الصادرة عن الأونروا رقم 113 (1986/1/8).",
|
73 |
"صورة لمدينة أريحا القديمة :تل السلطان",
|
74 |
+
"صورة اطفال مخيم للاجئين الفلسطينيين ي لبنان"],
|
75 |
inputs= example_input)
|
76 |
+
|
77 |
iface.launch(show_api=False)
|