mtoft20 commited on
Commit
03f75be
·
verified ·
1 Parent(s): 7e91872

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -5
src/streamlit_app.py CHANGED
@@ -268,16 +268,16 @@ def get_similar_content(content, n_recommendations=5):
268
 
269
  # URLs for both similarity tables using table IDs
270
  similarity_table_urls = [
271
- "https://mtoft20-potm.hf.space/api/v1/db/data/noco/p9pozkcw81t9aee/mtsx4yp45gi12tm", # Part 1
272
- "https://mtoft20-potm.hf.space/api/v1/db/data/noco/p9pozkcw81t9aee/mca47f9wyoubouk" # Part 2
273
  ]
274
 
275
  similar_items = []
276
 
277
  # Check both tables for similarities
278
  for table_url in similarity_table_urls:
279
- # Using NocoDB's filter format
280
- query = f"(title,eq,{clean_title})"
281
  params = {
282
  "where": query
283
  }
@@ -328,7 +328,7 @@ def get_similar_content(content, n_recommendations=5):
328
  similar_content = []
329
  for item in similar_items:
330
  # Query main content table for full details
331
- query = f"(title,eq,{item['title']})"
332
  content_params = {
333
  "where": query
334
  }
 
268
 
269
  # URLs for both similarity tables using table IDs
270
  similarity_table_urls = [
271
+ "https://mtoft20-potm.hf.space/api/v1/db/data/noco/p9pozkcw81t9aee/m759i7v77ojwf", # Part 1 similarities
272
+ "https://mtoft20-potm.hf.space/api/v1/db/data/noco/p9pozkcw81t9aee/m7597v77ojwf" # Part 2 similarities
273
  ]
274
 
275
  similar_items = []
276
 
277
  # Check both tables for similarities
278
  for table_url in similarity_table_urls:
279
+ # Using NocoDB's filter format with quotes around the title
280
+ query = f'(title,eq,"{clean_title}")'
281
  params = {
282
  "where": query
283
  }
 
328
  similar_content = []
329
  for item in similar_items:
330
  # Query main content table for full details
331
+ query = f'(title,eq,"{item["title"]}")'
332
  content_params = {
333
  "where": query
334
  }