Spaces:
Running
Running
Update retrieval.py
Browse files- retrieval.py +2 -1
retrieval.py
CHANGED
|
@@ -36,6 +36,7 @@ def compute_anchor_scores_for_hadiths(
|
|
| 36 |
def hybrid_search_fixed(query,
|
| 37 |
df,
|
| 38 |
bm25,
|
|
|
|
| 39 |
model,
|
| 40 |
hadith_embeddings,
|
| 41 |
anchor_index,
|
|
@@ -60,7 +61,7 @@ def hybrid_search_fixed(query,
|
|
| 60 |
eps = 1e-8
|
| 61 |
|
| 62 |
# 1) BM25 candidates and scores
|
| 63 |
-
bm25_indices, bm25_scores = bm25_retrieve(query, bm25, top_k=top_bm25)
|
| 64 |
# make dictionary mapping hadith_idx -> bm25_score
|
| 65 |
bm25_map = {int(idx): float(score) for idx, score in zip(bm25_indices, bm25_scores)}
|
| 66 |
|
|
|
|
| 36 |
def hybrid_search_fixed(query,
|
| 37 |
df,
|
| 38 |
bm25,
|
| 39 |
+
preprocess_query,
|
| 40 |
model,
|
| 41 |
hadith_embeddings,
|
| 42 |
anchor_index,
|
|
|
|
| 61 |
eps = 1e-8
|
| 62 |
|
| 63 |
# 1) BM25 candidates and scores
|
| 64 |
+
bm25_indices, bm25_scores = bm25_retrieve(query, bm25, preprocess_query,top_k=top_bm25)
|
| 65 |
# make dictionary mapping hadith_idx -> bm25_score
|
| 66 |
bm25_map = {int(idx): float(score) for idx, score in zip(bm25_indices, bm25_scores)}
|
| 67 |
|