crystina-z commited on
Commit
a264df4
·
1 Parent(s): 37046f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -46,7 +46,7 @@ if name and model_name:
46
  query2outputs[query] = [x['hits'] for x in output]
47
 
48
  search_query = st.selectbox(
49
- "",
50
  sorted(query2outputs),
51
  # index=None,
52
  # placeholder="Choose a query from the list..."
@@ -98,10 +98,9 @@ if name and model_name:
98
 
99
  return [id2doc[id] for id in y_optimal]
100
 
101
-
102
- def write_ranking(search_results):
103
- # st.write(
104
- # f'<p align=\"right\" style=\"color:grey;\"> Before aggregation for query [{search_query}] ms</p>', unsafe_allow_html=True)
105
 
106
  qid = {result["qid"] for result in search_results}
107
  assert len(qid) == 1
@@ -142,8 +141,8 @@ if name and model_name:
142
  if search_query:
143
  with col1:
144
  if search_query or button_clicked:
145
- write_ranking(search_results=query2outputs[search_query][0])
146
 
147
  with col2:
148
  if search_query or button_clicked:
149
- write_ranking(search_results=aggregated_ranking)
 
46
  query2outputs[query] = [x['hits'] for x in output]
47
 
48
  search_query = st.selectbox(
49
+ "Choose a query from the list",
50
  sorted(query2outputs),
51
  # index=None,
52
  # placeholder="Choose a query from the list..."
 
98
 
99
  return [id2doc[id] for id in y_optimal]
100
 
101
+
102
+ def write_ranking(search_results, text):
103
+ st.write(f'<p align=\"right\" style=\"color:grey;\"> {text} ms</p>', unsafe_allow_html=True)
 
104
 
105
  qid = {result["qid"] for result in search_results}
106
  assert len(qid) == 1
 
141
  if search_query:
142
  with col1:
143
  if search_query or button_clicked:
144
+ write_ranking(search_results=query2outputs[search_query][0], "w/o PSC")
145
 
146
  with col2:
147
  if search_query or button_clicked:
148
+ write_ranking(search_results=aggregated_ranking, "w/ PSC")