ValadisCERTH commited on
Commit
41b424b
·
1 Parent(s): 73e6a6e

Update helper.py

Browse files
Files changed (1) hide show
  1. helper.py +5 -2
helper.py CHANGED
@@ -256,6 +256,9 @@ def identify_locations(sentence):
256
  locations = []
257
 
258
  try:
 
 
 
259
 
260
  # ner
261
  locations.append(identify_loc_ner(sentence))
@@ -295,8 +298,8 @@ def identify_locations(sentence):
295
  if loc_type not in locations_dict:
296
  locations_dict[loc_type] = []
297
  locations_dict[loc_type].append(location)
298
-
299
-
300
  # conditions for multiple references
301
  # it is mandatory that a country will exist
302
  if 'country' in locations_dict:
 
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))
 
298
  if loc_type not in locations_dict:
299
  locations_dict[loc_type] = []
300
  locations_dict[loc_type].append(location)
301
+
302
+
303
  # conditions for multiple references
304
  # it is mandatory that a country will exist
305
  if 'country' in locations_dict: