Spaces:
Sleeping
Sleeping
fschwartzer
commited on
Commit
•
eacc5b2
1
Parent(s):
5ef4720
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def refinar_resultados(df, exclude_word="conjunto", include_word=False):
|
|
37 |
def get_best_match(query, choices, limit=50):
|
38 |
# Using RapidFuzz for improved performance and fuzzy matching
|
39 |
matches = process.extract(query, choices, scorer=fuzz.WRatio, limit=limit)
|
40 |
-
return [match[0] for match in matches if match[1] >
|
41 |
|
42 |
def filtrar_itens_similares(df, termo_pesquisa, limit=50):
|
43 |
titulos = df['Title'].tolist()
|
@@ -61,7 +61,7 @@ def calcular_fator_avaliacao(titulo, EC, PU):
|
|
61 |
def select_nearest_items(df, query):
|
62 |
# Lower the title similarity threshold if necessary
|
63 |
df['Title_Similarity'] = df['Title'].apply(lambda x: fuzz.WRatio(query, x))
|
64 |
-
df_filtered = df[df['Title_Similarity'] >
|
65 |
|
66 |
# Calculate mode price in a more inclusive manner
|
67 |
mode_price = df_filtered['Price'].mode()
|
|
|
37 |
def get_best_match(query, choices, limit=50):
|
38 |
# Using RapidFuzz for improved performance and fuzzy matching
|
39 |
matches = process.extract(query, choices, scorer=fuzz.WRatio, limit=limit)
|
40 |
+
return [match[0] for match in matches if match[1] > 60]
|
41 |
|
42 |
def filtrar_itens_similares(df, termo_pesquisa, limit=50):
|
43 |
titulos = df['Title'].tolist()
|
|
|
61 |
def select_nearest_items(df, query):
|
62 |
# Lower the title similarity threshold if necessary
|
63 |
df['Title_Similarity'] = df['Title'].apply(lambda x: fuzz.WRatio(query, x))
|
64 |
+
df_filtered = df[df['Title_Similarity'] > 80] # Adjusted threshold
|
65 |
|
66 |
# Calculate mode price in a more inclusive manner
|
67 |
mode_price = df_filtered['Price'].mode()
|