Simplified Data Wrangling with ir_datasets

Sean MacAvaney, Andrew Yates, Sergey Feldman, Doug Downey, Arman Cohan, Nazli Goharian

Abstract

Managing the data for Information Retrieval (IR) experiments can be challenging. Dataset documentation is scattered across the Internet and once one obtains a copy of the data, there are numerous different data formats to work with. Even basic formats can have subtle dataset-specific nuances that need to be considered for proper use. To help mitigate these challenges, we introduce a new robust and lightweight tool (ir_datasets) for acquiring, managing, and performing typical operations over datasets used in IR. We primarily focus on textual datasets used for ad-hoc search. This tool provides both a Python and command line interface to numerous IR datasets and benchmarks. To our knowledge, this is the most extensive tool of its kind. Integrations with popular IR indexing and experimentation toolkits demonstrate the tool's utility. We also provide documentation of these datasets through the ir_datasets catalog: https://ir-datasets.com/. The catalog acts as a hub for information on datasets used in IR, providing core information about what data each benchmark provides as well as links to more detailed information. We welcome community contributions and intend to continue to maintain and grow this tool.

Introduction

In Information Retrieval (IR) research, data management often presents a significant bottleneck. Datasets are frequently distributed across disparate servers and archives, utilizing a wide array of idiosyncratic formats such as XML, TSV, and JSONL. Even standard formats can contain subtle complexities, such as the double-encoding issues found in the MS-MARCO dataset. Historically, researchers were forced to develop custom, often brittle, scripts to download and parse each new benchmark. While some existing toolkits offered dataset support, it was often patchy and tightly coupled to specific frameworks, leading to redundant code and wasted storage. ir_datasets addresses this "data wrangling tax" by providing a standardized, lightweight interface to over 30 popular IR benchmarks.

The ir_datasets Framework

The design of ir_datasets follows a "just enough" processing philosophy, focusing on robust data provision rather than full search engine functionality. Key features include:

  • Standardized Identifiers: A hierarchical naming convention (e.g., cord19/trec-covid) simplifies dataset discovery.
  • Stateless Iterators: Data is provided through Python iterators (docs_iter(), queries_iter()), ensuring low memory overhead even when processing millions of documents.
  • High-Performance Lookup: The docs_store API enables rapid access to specific documents by ID using lz4 compression and sorted indexing, often outperforming traditional databases.
  • Automated Acquisition: The tool automates downloading and integrity verification via hashing where possible. For restricted datasets, it provides clear instructions for manual placement.
Example of the ir_datasets catalog and Python API for the TREC COVID dataset.

Dataset Coverage and Catalog

ir_datasets serves as a unified gateway to a vast array of IR benchmarks, including news (NYT, TREC Robust), question answering (MS-MARCO, Natural Questions), scientific data (CORD-19, NFCorpus), and web collections (ClueWeb, ORCAS). The tool currently supports nearly 350 downloadable files.

Complementing the library is a web-based catalog that allows researchers to browse dataset characteristics, components, and citations. This interface helps users quickly identify which benchmarks include documents, queries, and relevance judgments (qrels).

The ir_datasets catalog provides a clear overview of available data components for each benchmark.

Performance and Ecosystem Adoption

By decoupling data management from retrieval algorithms, ir_datasets can be seamlessly integrated into various pipelines, such as PyTerrier, Anserini, and OpenNIR. This integration has effectively expanded the dataset support of these tools significantly.

Performance benchmarks demonstrate the efficiency of the docs_store API. On the MS-MARCO passage task, ir_datasets achieved a "warm" lookup time of just 7ms per query, outperforming SQLite (27ms) and Pyserini (51ms). This efficiency scales to web-scale data; for ClueWeb12, the tool maintains a 14ms warm lookup time while requiring significantly less storage overhead (4.5GB vs. ~6TB for some alternatives).

Conclusion and Future Work

While ir_datasets streamlines data processing, legal restrictions on certain datasets still require manual acquisition by users. Future development aims to incorporate machine-readable metadata formats like DCAT and schema.org, and create a Graphical User Interface (GUI) for visual data exploration. The authors remain committed to "backfilling" historical datasets to ensure the longevity and accessibility of IR research data.

Summary updated

BibTeX
@inproceedings{macavaney2021simplified,
  author = {Sean MacAvaney and Andrew Yates and Sergey Feldman and Doug Downey and Arman Cohan and Nazli Goharian},
  title = {{Simplified Data Wrangling with ir\_datasets}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2021},
  url = {https://openreview.net/forum?id=B2V-311BHg9},
}
Figure