pi194046 commited on
Commit
b427b6e
1 Parent(s): 1497923

cross encoder changes

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -190,7 +190,7 @@ with tab3:
190
  st.info("Performing semantic search. Please wait...")
191
 
192
  # Mock payload for processing the URL
193
- payload = {"url": presentation_url, "id": uuid_from_js,"search_query":search_query}
194
  response = requests.post(f"{BASE_URL}/semantic_search", json=payload, headers=headers)
195
  print("response",response.json())
196
  if response.status_code == 200:
@@ -215,16 +215,16 @@ with tab3:
215
 
216
  # Convert the list of dictionaries to a DataFrame
217
  df = pd.DataFrame(data)
218
- #st.dataframe(df)
219
  df["page_content"]=df["page_content"].str.split('#####',n=1).str[1].str.strip()
220
- df = df["page_content"]
221
 
222
  # Display the DataFrame in Streamlit as an interactive dataframe
223
  #
224
 
225
 
226
  # Alternatively, display it as a static table
227
- st.table(df)
228
  else:
229
  st.error("error in downloading the presentation file ")
230
  else:
 
190
  st.info("Performing semantic search. Please wait...")
191
 
192
  # Mock payload for processing the URL
193
+ payload = {"url": presentation_url, "id": uuid_from_js,"search_query":search_query,"rerank": True}
194
  response = requests.post(f"{BASE_URL}/semantic_search", json=payload, headers=headers)
195
  print("response",response.json())
196
  if response.status_code == 200:
 
215
 
216
  # Convert the list of dictionaries to a DataFrame
217
  df = pd.DataFrame(data)
218
+
219
  df["page_content"]=df["page_content"].str.split('#####',n=1).str[1].str.strip()
220
+ df = df[["page_content","similarity_score","reranking_score"]]
221
 
222
  # Display the DataFrame in Streamlit as an interactive dataframe
223
  #
224
 
225
 
226
  # Alternatively, display it as a static table
227
+ st.dataframe(df)
228
  else:
229
  st.error("error in downloading the presentation file ")
230
  else: