yinlinfu commited on
Commit
069cb5e
·
1 Parent(s): 65cd7ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -223,7 +223,10 @@ def re_rank_candidates(query, candidates, method):
223
  # first sort by cross_score + bi_score
224
  filtered_sorted_result = sorted(filtered_sorted_by_encoder, key=lambda x: x[1]['gms'], reverse=True
225
  )
226
- return filtered_sorted_result
 
 
 
227
 
228
 
229
  # def reranking():
@@ -256,5 +259,5 @@ if st.button('Generated Expansion'):
256
  if st.button('Rerank By Encoder'):
257
  out_res = re_rank_candidates(user_query, candidates, method='encoder')
258
  st.write("Reranking By Encoder: \n")
259
- st.write(out_res)
260
  st.success(out_res)
 
223
  # first sort by cross_score + bi_score
224
  filtered_sorted_result = sorted(filtered_sorted_by_encoder, key=lambda x: x[1]['gms'], reverse=True
225
  )
226
+ data_dicts = [{'query': item[0], **item[1]} for item in filtered_sorted_result]
227
+ # Convert the list of dictionaries into a DataFrame
228
+ df = pd.DataFrame(data_dicts)
229
+ return df
230
 
231
 
232
  # def reranking():
 
259
  if st.button('Rerank By Encoder'):
260
  out_res = re_rank_candidates(user_query, candidates, method='encoder')
261
  st.write("Reranking By Encoder: \n")
262
+ st.write(out_res[:maxtags_sidebar])
263
  st.success(out_res)