Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,11 @@ def predict_label(text):
|
|
| 23 |
|
| 24 |
ent_scores = extract_ent_scores(entity_model,ip,ensemble_pooled_scores)
|
| 25 |
combined_sequences, ent_pred_tags = pool_ent_scores(ent_scores, ip_len)
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
return
|
| 28 |
|
| 29 |
|
| 30 |
if __name__ == '__main__':
|
|
@@ -66,13 +69,14 @@ if __name__ == '__main__':
|
|
| 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,
|
| 70 |
outputs=prediction,theme="smooth_slate",
|
| 71 |
-
title="Flat Entity Classification for
|
| 72 |
gr.Examples(
|
| 73 |
examples=["النشرة الإخبارية الصادرة عن الأونروا رقم 113 (1986/1/8).",
|
| 74 |
"صورة لمدينة أريحا القديمة :تل السلطان",
|
| 75 |
-
"صورة اطفال مخيم للاجئين الفلسطينيين ي لبنان"],
|
| 76 |
inputs= example_input)
|
| 77 |
|
| 78 |
iface.launch(show_api=False)
|
|
|
|
| 23 |
|
| 24 |
ent_scores = extract_ent_scores(entity_model,ip,ensemble_pooled_scores)
|
| 25 |
combined_sequences, ent_pred_tags = pool_ent_scores(ent_scores, ip_len)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
ops = [[i,o] for i,o in zip(ip,combined_sequences[-1]]
|
| 29 |
|
| 30 |
+
return ops
|
| 31 |
|
| 32 |
|
| 33 |
if __name__ == '__main__':
|
|
|
|
| 69 |
example_input=gr.Textbox(label="Input Example", lines=3)
|
| 70 |
prediction=gr.Text(label="Predicted Entities")
|
| 71 |
|
| 72 |
+
|
| 73 |
gr.Interface(fn=predict_label, inputs=example_input,
|
| 74 |
outputs=prediction,theme="smooth_slate",
|
| 75 |
+
title="Flat Entity Classification for Levantine Arabic")
|
| 76 |
gr.Examples(
|
| 77 |
examples=["النشرة الإخبارية الصادرة عن الأونروا رقم 113 (1986/1/8).",
|
| 78 |
"صورة لمدينة أريحا القديمة :تل السلطان",
|
| 79 |
+
"صورة اطفال مخيم للاجئين الفلسطينيين في لبنان"],
|
| 80 |
inputs= example_input)
|
| 81 |
|
| 82 |
iface.launch(show_api=False)
|