hatim00101 commited on
Commit
1707604
1 Parent(s): 8f7d1c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -46,17 +46,13 @@ def format_results(results):
46
  google_maps_url = f"https://www.google.com/maps/search/?api=1&query={row.get('hotel_name', 'N/A').replace(' ', '+')}"
47
  result = (
48
  f"<b>Hotel Name</b>: {row.get('hotel_name', 'N/A')}<br>"
49
- f"<b></b><br>"
50
- f"<b>Description</b>: {row.get('hotel_description', 'N/A')}<br>"
51
- f"<b></b><br>"
52
- f"<b>Review Title</b>: {row.get('review_title', 'N/A')}<br>"
53
  f"<b>Review Text</b>: {row.get('review_text', 'N/A')}<br>"
54
- f"<b></b><br>"
55
  f"<b>Rating</b>: {row.get('rate', 'N/A')}<br>"
56
  f"<b>Trip Date</b>: {row.get('tripdate', 'N/A')}<br>"
57
  f"<b>Price Range</b>: {row.get('price_range', 'N/A')}<br>"
58
  f"<b>Location</b>: {row.get('locality', 'N/A')} , {row.get('country', 'N/A')}<br>"
59
- f"<b></b><br>"
60
  f"<b>Hotel Website URL</b>: <a href='{row.get('hotel_url', 'N/A')}' target='_blank'>Link</a><br>"
61
  f"<b>Google Maps</b>: <a href='{google_maps_url}' target='_blank'>View on Maps</a><br>"
62
  f"<b>Image</b>: <img src='{row.get('hotel_image', 'N/A')}' width='200' /><br>"
@@ -81,6 +77,7 @@ def format_results(results):
81
 
82
  return "<br><br>".join(formatted_results)
83
 
 
84
  def search_interface(query_text):
85
  results = search_in_combined(query_text, model, k=5)
86
  return format_results(results)
 
46
  google_maps_url = f"https://www.google.com/maps/search/?api=1&query={row.get('hotel_name', 'N/A').replace(' ', '+')}"
47
  result = (
48
  f"<b>Hotel Name</b>: {row.get('hotel_name', 'N/A')}<br>"
49
+ + (f"<b>Description</b>: {row.get('hotel_description', 'N/A')}<br>" if not pd.isna(row.get('hotel_description', '')) else "")
50
+ + f"<b>Review Title</b>: {row.get('review_title', 'N/A')}<br>"
 
 
51
  f"<b>Review Text</b>: {row.get('review_text', 'N/A')}<br>"
 
52
  f"<b>Rating</b>: {row.get('rate', 'N/A')}<br>"
53
  f"<b>Trip Date</b>: {row.get('tripdate', 'N/A')}<br>"
54
  f"<b>Price Range</b>: {row.get('price_range', 'N/A')}<br>"
55
  f"<b>Location</b>: {row.get('locality', 'N/A')} , {row.get('country', 'N/A')}<br>"
 
56
  f"<b>Hotel Website URL</b>: <a href='{row.get('hotel_url', 'N/A')}' target='_blank'>Link</a><br>"
57
  f"<b>Google Maps</b>: <a href='{google_maps_url}' target='_blank'>View on Maps</a><br>"
58
  f"<b>Image</b>: <img src='{row.get('hotel_image', 'N/A')}' width='200' /><br>"
 
77
 
78
  return "<br><br>".join(formatted_results)
79
 
80
+
81
  def search_interface(query_text):
82
  results = search_in_combined(query_text, model, k=5)
83
  return format_results(results)