provides a common interface to many IR ad-hoc ranking benchmarks, training datasets, etc.
Maintained. Last release 4 months ago, commits in 5 of the last 26 weeks. Weaker on commit activity.
pip install ir-datasetsir_datasets
ir_datasets is a python package that provides a common interface to many IR ad-hoc ranking
benchmarks, training datasets, etc.
The package takes care of downloading datasets (including documents, queries, relevance judgments, etc.) when available from public sources. Instructions on how to obtain datasets are provided when they are not publicly available.
ir_datasets provides a common iterator format to allow them to be easily used in python. It
attempts to provide the data in an unaltered form (i.e., keeping all fields and markup), while
handling differences in file formats, encoding, etc. Adapters provide extra functionality, e.g., to
allow quick lookups of documents by ID.
A command line interface is also available.
You can find a list of datasets and their features here. Want a new dataset, added functionality, or a bug fixed? Feel free to post an issue or make a pull request!
Getting Started
For a quick start with the Python API, check out our Colab tutorials: Python Command Line
Install via pip:
pip install ir_datasets
If you want the main branch, you install as such:
pip install git+https://github.com/ir-datasets/ir-datasets.git
If you want to run an editable version locally:
$ git clone https://github.com/ir-datasets/ir-datasets
$ cd ir_datasets
$ pip install -e .
Tested with python versions 3.7, 3.8, 3.9, and 3.10. (Mininum python version is 3.7.)
Features
Python and Command Line Interfaces. Access datasts both through a simple Python API and via the command line.
import ir_datasets
dataset = ir_datasets.load('msmarco-passage/train')
# Documents
for doc in dataset.docs_iter():
print(doc)
# GenericDoc(doc_id='0', text='The presence of communication amid scientific minds was equa...
# GenericDoc(doc_id='1', text='The Manhattan Project and its atomic bomb helped bring an en...
# ...
ir_datasets export msmarco-passage/train docs | head -n2
0 The presence of communication amid scientific minds was equally important to the success of the Manh...
1 The Manhattan Project and its atomic bomb helped bring an end to World War II. Its legacy of peacefu...