Spaces:
Runtime error
Runtime error
Commit
•
c775592
1
Parent(s):
19141e1
Update retrieval/retrieval.py
Browse files- retrieval/retrieval.py +4 -1
retrieval/retrieval.py
CHANGED
@@ -140,10 +140,13 @@ class Retrieval:
|
|
140 |
scores_index = np.argsort(scores)
|
141 |
|
142 |
results = []
|
|
|
143 |
for k in range(1, self.k+1):
|
144 |
index = scores_index[-k]
|
145 |
-
result = {'
|
146 |
results.append(result)
|
|
|
|
|
147 |
return results
|
148 |
|
149 |
def split(self, document):
|
|
|
140 |
scores_index = np.argsort(scores)
|
141 |
|
142 |
results = []
|
143 |
+
ss = []
|
144 |
for k in range(1, self.k+1):
|
145 |
index = scores_index[-k]
|
146 |
+
result = {'score_bm':scores[index], 'index':index, 'context':self.contexts[index]}
|
147 |
results.append(result)
|
148 |
+
ss.append(scores[index])
|
149 |
+
print("BM25:", ss)
|
150 |
return results
|
151 |
|
152 |
def split(self, document):
|