Spaces:
Running
Running
Commit
·
76ed729
1
Parent(s):
f24b674
addition of intro_msg
Browse files- helpmate_ai.py +2 -2
helpmate_ai.py
CHANGED
|
@@ -119,7 +119,7 @@ def retreive_results(query):
|
|
| 119 |
# Query the collection against the user query and return the top 10 results
|
| 120 |
results = insurance_collection.query(
|
| 121 |
query_texts=query,
|
| 122 |
-
n_results=
|
| 123 |
)
|
| 124 |
|
| 125 |
# Store the query in cache_collection as document w.r.t to ChromaDB so that it can be embedded and searched against later
|
|
@@ -156,7 +156,7 @@ from sentence_transformers import CrossEncoder, util
|
|
| 156 |
cross_encoder = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
| 157 |
|
| 158 |
#function to re-rank results using cross-encoder
|
| 159 |
-
def rerank_with_cross_encoder(query, results_df, top_k=
|
| 160 |
|
| 161 |
# Input (query, response) pairs for each of the top 10 responses received from the semantic search to the cross encoder
|
| 162 |
# Generate the cross_encoder scores for these pairs
|
|
|
|
| 119 |
# Query the collection against the user query and return the top 10 results
|
| 120 |
results = insurance_collection.query(
|
| 121 |
query_texts=query,
|
| 122 |
+
n_results=10
|
| 123 |
)
|
| 124 |
|
| 125 |
# Store the query in cache_collection as document w.r.t to ChromaDB so that it can be embedded and searched against later
|
|
|
|
| 156 |
cross_encoder = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
| 157 |
|
| 158 |
#function to re-rank results using cross-encoder
|
| 159 |
+
def rerank_with_cross_encoder(query, results_df, top_k=3):
|
| 160 |
|
| 161 |
# Input (query, response) pairs for each of the top 10 responses received from the semantic search to the cross encoder
|
| 162 |
# Generate the cross_encoder scores for these pairs
|