fschwartzer commited on
Commit
48dc5ed
1 Parent(s): de13740

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ def refinar_resultados(df, exclude_word="conjunto", include_word=False):
39
  def get_best_match(query, choices, limit=50):
40
  # Using RapidFuzz for improved performance and fuzzy matching
41
  matches = process.extract(query, choices, scorer=fuzz.WRatio, limit=limit)
42
- return [match[0] for match in matches if match[1] > 60]
43
 
44
  def filtrar_itens_similares(df, termo_pesquisa, limit=50):
45
  titulos = df['Title'].tolist()
@@ -63,7 +63,7 @@ def calcular_fator_avaliacao(titulo, EC, PU):
63
  def select_nearest_items(df, query):
64
  # Lower the title similarity threshold if necessary
65
  df['Title_Similarity'] = df['Title'].apply(lambda x: fuzz.WRatio(query, x))
66
- df_filtered = df[df['Title_Similarity'] > 80] # Adjusted threshold
67
 
68
  # Calculate mode price in a more inclusive manner
69
  mode_price = df_filtered['Price'].mode()
 
39
  def get_best_match(query, choices, limit=50):
40
  # Using RapidFuzz for improved performance and fuzzy matching
41
  matches = process.extract(query, choices, scorer=fuzz.WRatio, limit=limit)
42
+ return [match[0] for match in matches if match[1] > 90]
43
 
44
  def filtrar_itens_similares(df, termo_pesquisa, limit=50):
45
  titulos = df['Title'].tolist()
 
63
  def select_nearest_items(df, query):
64
  # Lower the title similarity threshold if necessary
65
  df['Title_Similarity'] = df['Title'].apply(lambda x: fuzz.WRatio(query, x))
66
+ df_filtered = df[df['Title_Similarity'] > 90] # Adjusted threshold
67
 
68
  # Calculate mode price in a more inclusive manner
69
  mode_price = df_filtered['Price'].mode()