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

add party to keywordsearch

Browse files
Files changed (2) hide show
  1. .gitignore +2 -1
  2. src/chatbot.py +3 -1
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  __pycache__
2
- hf_upload.py
 
 
1
  __pycache__
2
+ hf_upload.py
3
+ .env
src/chatbot.py CHANGED
@@ -74,10 +74,12 @@ def keyword_search(query, db=db, embeddings=embeddings):
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)
83
  return df_res
 
74
  for doc in results:
75
  speech_content = doc[0].page_content
76
  speech_date = doc[0].metadata["date"]
77
+ party = doc[0].metadata["party"]
78
  score = doc[1] # Relevance based on relevance search
79
  df_res = pd.concat([df_res, pd.DataFrame({'Speech Content': [speech_content],
80
  'Date': [speech_date],
81
+ 'Party': [party],
82
  'Relevance': [score]})], ignore_index=True)
83
 
84
+ df_res.sort_values('Relevance', inplace=True, ascending=False)
85
  return df_res