fffiloni commited on
Commit
5c69bb5
·
verified ·
1 Parent(s): 24b0f60

do not use synonyms

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -313,7 +313,7 @@ def extract_notes_for_comparison(data: Union[str, dict]) -> list[str]:
313
 
314
  olfactory_pyramid = data.get("Olfactory Pyramid") or data.get("olfactory pyramid")
315
  if not olfactory_pyramid:
316
- return [] # Safely return empty
317
 
318
  notes = []
319
  for layer in ["Top Notes", "Heart Notes", "Base Notes"]:
@@ -333,7 +333,7 @@ from rapidfuzz import fuzz
333
  def find_best_perfumes_from_json(data: Union[str, dict], top_n: int = 5, threshold: int = 80):
334
  """
335
  Finds top N matching perfumes using fuzzy matching on notes.
336
- If no notes found, returns an empty dataframe with message.
337
  """
338
  user_notes = extract_notes_for_comparison(data)
339
  if not user_notes:
@@ -345,7 +345,8 @@ def find_best_perfumes_from_json(data: Union[str, dict], top_n: int = 5, thresho
345
  'similarity_score': 0
346
  }])
347
 
348
- user_notes_clean = [apply_note_synonyms(n) for n in user_notes]
 
349
 
350
  matches = []
351
  for _, row in df.iterrows():
 
313
 
314
  olfactory_pyramid = data.get("Olfactory Pyramid") or data.get("olfactory pyramid")
315
  if not olfactory_pyramid:
316
+ return [] # Safe fallback
317
 
318
  notes = []
319
  for layer in ["Top Notes", "Heart Notes", "Base Notes"]:
 
333
  def find_best_perfumes_from_json(data: Union[str, dict], top_n: int = 5, threshold: int = 80):
334
  """
335
  Finds top N matching perfumes using fuzzy matching on notes.
336
+ If no notes found or no matches, returns an informative result.
337
  """
338
  user_notes = extract_notes_for_comparison(data)
339
  if not user_notes:
 
345
  'similarity_score': 0
346
  }])
347
 
348
+ # Lowercase user notes
349
+ user_notes_clean = [n.strip().lower() for n in user_notes]
350
 
351
  matches = []
352
  for _, row in df.iterrows():