TomData commited on
Commit
90a016d
·
1 Parent(s): b6312c1

keyword search update

Browse files
Files changed (1) hide show
  1. src/chatbot.py +3 -3
src/chatbot.py CHANGED
@@ -70,13 +70,13 @@ def keyword_search(query, db=db, embeddings=embeddings):
70
  # Format vector store query results into dataframe
71
  #print(results[0][0].metadata.keys())
72
 
73
- df_res = pd.DataFrame(columns=['Speech Content', 'Relevance']) # Add Date/Party/Politician
74
  for doc in results:
75
  speech_content = doc[0].page_content
76
- #speech_date = doc[0].metadata["date"]
77
  score = doc[1] # Relevance based on relevance search
78
  df_res = pd.concat([df_res, pd.DataFrame({'Speech Content': [speech_content],
79
- #'Date': [speech_date],
80
  'Relevance': [score]})], ignore_index=True)
81
 
82
  df_res.sort_values('Relevance', inplace=True)
 
70
  # Format vector store query results into dataframe
71
  #print(results[0][0].metadata.keys())
72
 
73
+ df_res = pd.DataFrame(columns=['Speech Content','Date','Relevance']) # Add Date/Party/Politician
74
  for doc in results:
75
  speech_content = doc[0].page_content
76
+ speech_date = doc[0].metadata["date"]
77
  score = doc[1] # Relevance based on relevance search
78
  df_res = pd.concat([df_res, pd.DataFrame({'Speech Content': [speech_content],
79
+ 'Date': [speech_date],
80
  'Relevance': [score]})], ignore_index=True)
81
 
82
  df_res.sort_values('Relevance', inplace=True)