Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,6 +59,10 @@ def ner(text):
|
|
59 |
output = my_classifier(text)
|
60 |
for entity in output:
|
61 |
entity['entity'] = entity.pop('entity_group')
|
|
|
|
|
|
|
|
|
62 |
|
63 |
return {'text': text, 'entities': output}
|
64 |
|
@@ -70,7 +74,7 @@ examples = ['Tôi cần thuê à tôi muốn bay một chuyến khứ hồi từ
|
|
70 |
]
|
71 |
|
72 |
demo = gr.Interface(ner,
|
73 |
-
gr.Textbox(label='
|
74 |
outputs=gr.HighlightedText(label='Highlighted Output'),
|
75 |
examples=examples,
|
76 |
title="Disfluency Detection",
|
|
|
59 |
output = my_classifier(text)
|
60 |
for entity in output:
|
61 |
entity['entity'] = entity.pop('entity_group')
|
62 |
+
|
63 |
+
text = text.replace("_", " ")
|
64 |
+
text = text.replace(" , ", ", ").replace(" . ", ". ")
|
65 |
+
|
66 |
|
67 |
return {'text': text, 'entities': output}
|
68 |
|
|
|
74 |
]
|
75 |
|
76 |
demo = gr.Interface(ner,
|
77 |
+
gr.Textbox(label='Sentence', placeholder="Enter your sentence here..."),
|
78 |
outputs=gr.HighlightedText(label='Highlighted Output'),
|
79 |
examples=examples,
|
80 |
title="Disfluency Detection",
|