beir-cellar / beir

A Heterogeneous Benchmark for Information Retrieval. Easy to use, evaluate your models across 15+ diverse IR datasets.
http://beir.ai
Apache License 2.0
1.49k stars 177 forks source link

How to Save Retrieved Documents in Retrieval Tasks #171

Open AugustLHHHHHH opened 2 months ago

AugustLHHHHHH commented 2 months ago

I am currently working on an information retrieval task and I want to save the retrieved documents for bad case analysis. I have printed the output of the search function in beir/retrieval/search/dense/exact_search.py, and the format is {q_id: {pid: score}}. such as:

image

However, it seems that the corpus ids are not sorted according to the scores. Should I sort the results by cosine similarity from high to low and save them so that the most relevant documents are placed at the beginning?

Thanks!