Spaces:
Sleeping
Sleeping
adding ( text = text.replace("đà ", " đà") )
Browse files
app.py
CHANGED
|
@@ -56,6 +56,9 @@ import gradio as gr
|
|
| 56 |
def ner(text):
|
| 57 |
text = " ".join(rdrsegmenter.word_segment(text))
|
| 58 |
|
|
|
|
|
|
|
|
|
|
| 59 |
output = my_classifier(text)
|
| 60 |
for entity in output:
|
| 61 |
entity['entity'] = entity.pop('entity_group')
|
|
@@ -77,7 +80,6 @@ def ner(text):
|
|
| 77 |
text = text.replace("_", " ")
|
| 78 |
fluency_sentence = fluency_sentence.replace("_", " ")
|
| 79 |
|
| 80 |
-
|
| 81 |
return {'text': text, 'entities': output}, fluency_sentence
|
| 82 |
|
| 83 |
examples = ['Tôi cần thuê à tôi muốn bay một chuyến khứ hồi từ Đà Nẵng đến Đà Lạt',
|
|
|
|
| 56 |
def ner(text):
|
| 57 |
text = " ".join(rdrsegmenter.word_segment(text))
|
| 58 |
|
| 59 |
+
# Some words in lowercase like "đà nẵng" will get error (due to vncorenlp)
|
| 60 |
+
text = text.replace("đà ", " đà")
|
| 61 |
+
|
| 62 |
output = my_classifier(text)
|
| 63 |
for entity in output:
|
| 64 |
entity['entity'] = entity.pop('entity_group')
|
|
|
|
| 80 |
text = text.replace("_", " ")
|
| 81 |
fluency_sentence = fluency_sentence.replace("_", " ")
|
| 82 |
|
|
|
|
| 83 |
return {'text': text, 'entities': output}, fluency_sentence
|
| 84 |
|
| 85 |
examples = ['Tôi cần thuê à tôi muốn bay một chuyến khứ hồi từ Đà Nẵng đến Đà Lạt',
|