DD0101 commited on
Commit
3743aa7
1 Parent(s): 87b9111

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -69,8 +69,9 @@ def ner(text):
69
 
70
  list_str[start:end] = ' '
71
 
72
- fluency_sentence = "".join(list_str).strip().capitalize() # 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
 
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("_", " ")