danschnurp commited on
Commit
854d1c6
·
verified ·
1 Parent(s): 20f654b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -138,13 +138,10 @@ def recommend_books(target_book: str, num_recommendations: int = 10) -> str:
138
 
139
  target_book = target_book.lower()
140
  # Fuzzy match the input to the closest book title
141
- closest_match, score = process.extractOne(target_book, book_titles)
142
 
143
- if score < 50: # threshold
144
- return f"No close match found for '{target_book}'. Please try a different title."
145
 
146
-
147
- correlations = compute_correlations_faiss(faiss_index, normalized_data, book_titles, closest_match)
148
 
149
  recommendations = correlations[correlations['book'] != target_book].head(num_recommendations)
150
 
 
138
 
139
  target_book = target_book.lower()
140
  # Fuzzy match the input to the closest book title
141
+ closest_match = process.extractOne(target_book, book_titles)
142
 
 
 
143
 
144
+ correlations = compute_correlations_faiss(faiss_index, book_titles, closest_match)
 
145
 
146
  recommendations = correlations[correlations['book'] != target_book].head(num_recommendations)
147