Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,8 +69,9 @@ def ner(text):
|
|
69 |
|
70 |
list_str[start:end] = ' '
|
71 |
|
72 |
-
fluency_sentence = "".join(list_str).strip()
|
73 |
-
|
|
|
74 |
|
75 |
# Replace words like "Đà_Nẵng" to "Đà Nẵng"
|
76 |
text = text.replace("_", " ")
|
|
|
69 |
|
70 |
list_str[start:end] = ' '
|
71 |
|
72 |
+
fluency_sentence = "".join(list_str).strip() # use strip() in case we need to remove entity at the beginning or the end of sentence
|
73 |
+
# (without strip(): "Giá vé khứ hồi à nhầm giá vé một chiều ..." -> " giá vé một chiều ...")
|
74 |
+
fluency_sentence = fluency_sentence[0].upper() + fluency_sentence[1:] # since capitalize() just lowercase whole sentence first then uppercase the first letter
|
75 |
|
76 |
# Replace words like "Đà_Nẵng" to "Đà Nẵng"
|
77 |
text = text.replace("_", " ")
|