plebias commited on
Commit
aacf2d3
·
verified ·
1 Parent(s): aad53f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -190,10 +190,12 @@ def extract_location_from_summary(summary):
190
  # Split the string by commas
191
  if " and " in landmark:
192
  landmark= landmark.replace(" and ", ',')
 
 
193
  landmark_list = landmark.split(",")
194
 
195
  # Trim whitespace from each element and append to a list
196
- landmark_list = [item.strip() for item in landmark_list]
197
  except:
198
  landmark_list = []
199
 
@@ -204,10 +206,12 @@ def extract_location_from_summary(summary):
204
  # Split the string by commas
205
  if " and " in road:
206
  road= road.replace(" and ", ',')
 
 
207
  road_list = road.split(",")
208
 
209
  # Trim whitespace from each element and append to a list
210
- road_list = [item.strip() for item in road_list]
211
  except:
212
  road_list = []
213
 
 
190
  # Split the string by commas
191
  if " and " in landmark:
192
  landmark= landmark.replace(" and ", ',')
193
+ if "N/A" in landmark:
194
+ landmark= landmark.replace("N/A", ',')
195
  landmark_list = landmark.split(",")
196
 
197
  # Trim whitespace from each element and append to a list
198
+ landmark_list = [item.strip() for item in landmark_list if item.strip()]
199
  except:
200
  landmark_list = []
201
 
 
206
  # Split the string by commas
207
  if " and " in road:
208
  road= road.replace(" and ", ',')
209
+ if "N/A" in road:
210
+ road= road.replace("N/A", ',')
211
  road_list = road.split(",")
212
 
213
  # Trim whitespace from each element and append to a list
214
+ road_list = [item.strip() for item in road_list if item.strip()]
215
  except:
216
  road_list = []
217