Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -279,15 +279,21 @@ def search_nolog(query):
|
|
279 |
def reranking():
|
280 |
rerank_list = []
|
281 |
reres = []
|
|
|
282 |
rerank_list = search_nolog(query = user_query)
|
283 |
unique_list = list(set(rerank_list))
|
284 |
new_unique_list = [item for item in unique_list if item != user_query]
|
285 |
Lowercasing_list = [item.lower() for item in new_unique_list]
|
286 |
|
|
|
|
|
|
|
|
|
|
|
287 |
st.write("E-Commerce Query Expansion Results: \n")
|
288 |
-
st.write(
|
289 |
|
290 |
-
for i in
|
291 |
reres.append(i)
|
292 |
np.random.seed(7)
|
293 |
np.random.shuffle(reres)
|
|
|
279 |
def reranking():
|
280 |
rerank_list = []
|
281 |
reres = []
|
282 |
+
remove_dup = []
|
283 |
rerank_list = search_nolog(query = user_query)
|
284 |
unique_list = list(set(rerank_list))
|
285 |
new_unique_list = [item for item in unique_list if item != user_query]
|
286 |
Lowercasing_list = [item.lower() for item in new_unique_list]
|
287 |
|
288 |
+
for i in Lowercasing_list:
|
289 |
+
clean_string = i.strip()
|
290 |
+
if clean_string not in remove_dup:
|
291 |
+
remove_dup.append(clean_string)
|
292 |
+
|
293 |
st.write("E-Commerce Query Expansion Results: \n")
|
294 |
+
st.write(remove_dup[0:maxtags_sidebar])
|
295 |
|
296 |
+
for i in remove_dup[0:maxtags_sidebar]:
|
297 |
reres.append(i)
|
298 |
np.random.seed(7)
|
299 |
np.random.shuffle(reres)
|