Spaces:
Running
Running
ashwinpatti
commited on
Commit
·
704a86e
1
Parent(s):
1cd386f
Update app.py
Browse files
app.py
CHANGED
@@ -51,10 +51,14 @@ def search_cross_encoder(query,candidates):
|
|
51 |
cross_scores = cross_encoder.predict(cross_inp)
|
52 |
for idx in range(len(cross_scores)):
|
53 |
candidates[idx]['cross-score'] = cross_scores[idx]
|
54 |
-
|
55 |
|
56 |
|
57 |
sortedResult = sorted(candidates, key=lambda x: x['cross-score'], reverse=True)
|
|
|
|
|
|
|
|
|
58 |
return sortedResult
|
59 |
|
60 |
|
|
|
51 |
cross_scores = cross_encoder.predict(cross_inp)
|
52 |
for idx in range(len(cross_scores)):
|
53 |
candidates[idx]['cross-score'] = cross_scores[idx]
|
54 |
+
|
55 |
|
56 |
|
57 |
sortedResult = sorted(candidates, key=lambda x: x['cross-score'], reverse=True)
|
58 |
+
|
59 |
+
for idx in range(len(sortedResult)):
|
60 |
+
sortedResult[idx]['re-rank'] = idx+1
|
61 |
+
|
62 |
return sortedResult
|
63 |
|
64 |
|