Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,8 +75,10 @@ def process_input(query, slider_value):
|
|
75 |
search_words = query.title().split()
|
76 |
pattern = r"(?=.*\b" + r"\b)(?=.*\b".join(map(re.escape, search_words)) + r"\b)"
|
77 |
filtered_items = [item for item in item_list if re.search(pattern, item)]
|
|
|
78 |
# filtered_df = fashion.filter(lambda x: x['productDisplayName'] in filtered_items)
|
79 |
filtered_df = fashion_df[fashion_df['productDisplayName'].isin(filtered_items)]
|
|
|
80 |
#####################
|
81 |
try:
|
82 |
slider_value = float(slider_value)
|
@@ -97,7 +99,8 @@ def process_input(query, slider_value):
|
|
97 |
###########
|
98 |
# exact_match = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['productDisplayName']
|
99 |
# exact_img = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['image']
|
100 |
-
exact_match = filtered_df.loc[filtered_df['productDisplayName']==query, 'productDisplayName'].iat[0
|
|
|
101 |
exact_img = filtered_df.loc[filtered_df['productDisplayName']==query, 'image'].iat[0]
|
102 |
|
103 |
if exact_match is not None:
|
|
|
75 |
search_words = query.title().split()
|
76 |
pattern = r"(?=.*\b" + r"\b)(?=.*\b".join(map(re.escape, search_words)) + r"\b)"
|
77 |
filtered_items = [item for item in item_list if re.search(pattern, item)]
|
78 |
+
print(f"Filtered items: {filtered_items}")
|
79 |
# filtered_df = fashion.filter(lambda x: x['productDisplayName'] in filtered_items)
|
80 |
filtered_df = fashion_df[fashion_df['productDisplayName'].isin(filtered_items)]
|
81 |
+
print(f"Length of filtered_df: {len(filtered_df)}")
|
82 |
#####################
|
83 |
try:
|
84 |
slider_value = float(slider_value)
|
|
|
99 |
###########
|
100 |
# exact_match = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['productDisplayName']
|
101 |
# exact_img = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['image']
|
102 |
+
exact_match = filtered_df.loc[filtered_df['productDisplayName']==query, 'productDisplayName'].iat[0
|
103 |
+
print(f"Exact match: {exact_match}")
|
104 |
exact_img = filtered_df.loc[filtered_df['productDisplayName']==query, 'image'].iat[0]
|
105 |
|
106 |
if exact_match is not None:
|