Skip to content

Commit

Permalink
fix bug introduced by the previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Almeida committed Oct 24, 2023
1 parent 774150c commit 573fc63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ do
for at in 10 100 1000 10000
do
echo $f $at
python benchmark_pyserini.py $f $at
python benchmark_pyserini.py $f $at --threads 16
python benchmark_pyterrier.py $f $at
#python benchmark_pyserini.py $f $at
#python benchmark_pyserini.py $f $at --threads 16
#python benchmark_pyterrier.py $f $at

CUDA_VISIBLE_DEVICES="0" python benchmark_sparse_retrieval_from_pyserini.py $f $at
CUDA_VISIBLE_DEVICES="0" python benchmark_sparse_retrieval_from_pyterrier.py $f $at
Expand Down
5 changes: 3 additions & 2 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ def evaluate_spare(qrels, spare_result, question_ids):
spare_result_ids = spare_result.ids#.tolist()
spare_result_scores = spare_result.scores#.tolist()

max_at = 1000
# lets truncate to 1000 since the metrics are related to 1k
max_at = 1000

print("Converting to ranx format")
for i in range(len(spare_result_ids)):
scores = spare_result_scores[i]
for j in range(max_at):
for j in range(min(len(spare_result_scores[0]),max_at)):
ranx_run[question_ids[i]][str(spare_result_ids[i][j])] = scores[j]


Expand Down

0 comments on commit 573fc63

Please sign in to comment.