Update app.py
Browse files
app.py
CHANGED
@@ -218,7 +218,7 @@ def search_func(query, top_k=top_k):
|
|
218 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
219 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
220 |
question_embedding = question_embedding.cpu()
|
221 |
-
hits = util.semantic_search(question_embedding, corpus_embeddings, top_k=top_k)
|
222 |
hits = hits[0] # Get the hits for the first query
|
223 |
|
224 |
##### Re-Ranking #####
|
|
|
218 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
219 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
220 |
question_embedding = question_embedding.cpu()
|
221 |
+
hits = util.semantic_search(question_embedding, corpus_embeddings, top_k=top_k,score_function=util.dot_score)
|
222 |
hits = hits[0] # Get the hits for the first query
|
223 |
|
224 |
##### Re-Ranking #####
|