terrier-org/pyterrier

A Python framework for performing information retrieval experiments, building on http://terrier.org/

What it solves

PyTerrier provides a unified framework for building and testing information retrieval (IR) pipelines. It simplifies the process of creating complex search systems—combining different indexing and retrieval methods—and allows researchers and developers to rigorously compare their effectiveness using standard datasets and evaluation metrics.

How it works

PyTerrier uses a "transformer" architecture where retrieval components (like BM25 or neural rerankers) can be chained together using a pipeline operator. This allows users to build sophisticated workflows, such as starting with a fast sparse retriever and refining the results with a neural reranker. It also integrates with the ir_datasets package to easily pull in standard benchmarks for experimentation.

Who it’s for

It is designed for researchers and developers working on search engines, Retrieval Augmented Generation (RAG) systems, and information retrieval experimentation.

Highlights

  • Flexible Pipelines: Build sparse, learned sparse, or dense retrieval pipelines using a declarative approach.
  • Experimentation Framework: Built-in pt.Experiment function to compare multiple pipelines using metrics like nDCG and AP.
  • Extensive Ecosystem: Supports a wide range of plugins for dense retrieval (ColBERT), neural reranking (MonoT5), and RAG.
  • Standard Dataset Integration: Seamless access to a vast catalogue of IR datasets for benchmarking.

Related

  • Project
  • Project
  • Project
  • Project
  • Project