yinlinfu commited on
Commit
cc8fc07
·
1 Parent(s): 9b2e9c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -187,8 +187,6 @@ def generate_query_expansion_candidates(query):
187
  value = final_candidates[query_candidate]
188
  value['gms'] = query_gms_dict.get(query_candidate, 0)
189
  final_candidates[query_candidate] = value
190
- # Total Results
191
- st.write("E-Commerce Query Expansion Candidates: \n")
192
  return final_candidates
193
 
194
  def re_rank_candidates(query, candidates, method):
@@ -232,8 +230,10 @@ def re_rank_candidates(query, candidates, method):
232
  )
233
  return filtered_sorted_result
234
 
235
- col1, col2 = st.columns(2)
236
  if st.button('Generated Expansion'):
 
 
237
  candidates = generate_query_expansion_candidates(query = user_query)
238
  with col1:
239
  st.subheader('Raw Candidates:')
@@ -243,5 +243,5 @@ if st.button('Generated Expansion'):
243
  with col2:
244
  st.subheader('Rerank By GMS:')
245
  candidates_rerank = re_rank_candidates(user_query, candidates, method='gms')[:maxtags_sidebar]
246
- result = [{item[0]: item[1]['gms']} for item in candidates_rerank]
247
  st.write(result)
 
187
  value = final_candidates[query_candidate]
188
  value['gms'] = query_gms_dict.get(query_candidate, 0)
189
  final_candidates[query_candidate] = value
 
 
190
  return final_candidates
191
 
192
  def re_rank_candidates(query, candidates, method):
 
230
  )
231
  return filtered_sorted_result
232
 
233
+
234
  if st.button('Generated Expansion'):
235
+ st.write("E-Commerce Query Expansion Candidates: \n")
236
+ col1, col2 = st.columns(2)
237
  candidates = generate_query_expansion_candidates(query = user_query)
238
  with col1:
239
  st.subheader('Raw Candidates:')
 
243
  with col2:
244
  st.subheader('Rerank By GMS:')
245
  candidates_rerank = re_rank_candidates(user_query, candidates, method='gms')[:maxtags_sidebar]
246
+ result = [(item[0], item[1]['gms']) for item in candidates_rerank]
247
  st.write(result)