Spaces:
Runtime error
Runtime error
keyword search update
Browse files- 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',
|
74 |
for doc in results:
|
75 |
speech_content = doc[0].page_content
|
76 |
-
|
77 |
score = doc[1] # Relevance based on relevance search
|
78 |
df_res = pd.concat([df_res, pd.DataFrame({'Speech Content': [speech_content],
|
79 |
-
|
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)
|