JasonTPhillipsJr commited on
Commit
0e51129
1 Parent(s): ffa1ad8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -258,12 +258,13 @@ user_selection = st.selectbox("Select an example review", options=dropdown_optio
258
  # Extract the original review key from the selected option
259
  selected_key = user_selection.split(" (")[0] # Remove the label part
260
  selected_review = example_reviews[selected_key]
 
261
 
262
  # Process the text when the button is clicked
263
  if st.button("Process Review"):
264
- if selected_review.strip():
265
- bert_embedding = get_bert_embedding(selected_review)
266
- spaBert_embedding, current_pseudo_sentences = processSpatialEntities(selected_review,nlp)
267
  combined_embedding = torch.cat((bert_embedding,spaBert_embedding),dim=-1)
268
 
269
  if(dev_mode == True):
@@ -275,7 +276,7 @@ if st.button("Process Review"):
275
  prediction = get_prediction(combined_embedding)
276
 
277
  # Process the text using spaCy
278
- doc = nlp(selected_review)
279
 
280
  # Highlight geo-entities with different colors
281
  highlighted_text = selected_review
 
258
  # Extract the original review key from the selected option
259
  selected_key = user_selection.split(" (")[0] # Remove the label part
260
  selected_review = example_reviews[selected_key]
261
+ lower_case_review = selected_review.lower()
262
 
263
  # Process the text when the button is clicked
264
  if st.button("Process Review"):
265
+ if lower_case_review.strip():
266
+ bert_embedding = get_bert_embedding(lower_case_review)
267
+ spaBert_embedding, current_pseudo_sentences = processSpatialEntities(lower_case_review,nlp)
268
  combined_embedding = torch.cat((bert_embedding,spaBert_embedding),dim=-1)
269
 
270
  if(dev_mode == True):
 
276
  prediction = get_prediction(combined_embedding)
277
 
278
  # Process the text using spaCy
279
+ doc = nlp(lower_case_review)
280
 
281
  # Highlight geo-entities with different colors
282
  highlighted_text = selected_review