Skip to content

Commit

Permalink
Change DPR accuracy reporting to 4 digits: better implementation (#1094)
Browse files Browse the repository at this point in the history
Ref #1092
  • Loading branch information
lintool authored Mar 27, 2022
1 parent 8d2a67c commit 5668edd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyserini/eval/evaluate_dpr_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def evaluate_retrieval(retrieval_file, topk, regex=False):
accuracy[k].append(0 if has_ans_idx >= k else 1)

for k in topk:
print(f'Top{k}\taccuracy: {np.around(np.mean(accuracy[k]), 4)}')
print(f'Top{k}\taccuracy: {np.mean(accuracy[k]):.4f}')


if __name__ == '__main__':
Expand Down

0 comments on commit 5668edd

Please sign in to comment.