Commit
·
a7fdc57
1
Parent(s):
33a5b65
Update helper.py
Browse files
helper.py
CHANGED
@@ -256,9 +256,6 @@ def identify_locations(sentence):
|
|
256 |
locations = []
|
257 |
|
258 |
try:
|
259 |
-
|
260 |
-
# this is because there were cases were a city followed by comma was not understood by the system
|
261 |
-
sentence = sentence.replace(",", " $ ")
|
262 |
|
263 |
# ner
|
264 |
locations.append(identify_loc_ner(sentence))
|
@@ -326,6 +323,7 @@ def identify_locations(sentence):
|
|
326 |
|
327 |
# if a city does not exist
|
328 |
else:
|
|
|
329 |
# we only accept for one country
|
330 |
if len(locations_dict['country']) == 1:
|
331 |
locations_dict['country'][0] = locations_dict['country'][0].capitalize()
|
|
|
256 |
locations = []
|
257 |
|
258 |
try:
|
|
|
|
|
|
|
259 |
|
260 |
# ner
|
261 |
locations.append(identify_loc_ner(sentence))
|
|
|
323 |
|
324 |
# if a city does not exist
|
325 |
else:
|
326 |
+
|
327 |
# we only accept for one country
|
328 |
if len(locations_dict['country']) == 1:
|
329 |
locations_dict['country'][0] = locations_dict['country'][0].capitalize()
|