Skip to main content

Axiomatic constraints for information retrieval and retrieval-augmented generation.

Project description

CI status Code coverage Maintenance
PyPI version PyPI downloads Python versions
Issues Pull requests Commit activity License

↕️ ir_axioms

Axiomatic constraints for information retrieval and retrieval-augmented generation.

ir_axioms is a Python framework for experimenting with axioms in information retrieval in a declarative way. It includes reference implementations of many commonly used traditional retrieval axioms as well as axioms for retrieval-augmented generation. The library is well integrated with the PyTerrier framework and supports Pyserini retrieval indices too. Use-cases of ir_axioms include search-result re-ranking, analyses of (neural) retrieval systems, and analyses of generated RAG answers.

Note: If you're looking out for ir_axioms<1.0, please go here.

Publications

Read more about the ir_axioms framework and the new RAG axioms in these publications:

Installation

  1. Install the package from PyPI:

    pip install ir_axioms>=1.0
    
  2. Install spaCy model:

    python -m spacy download en_core_web_sm
    

Optional Dependencies

Tag Description
pyserini Use index statistics, document contents, and tokenization from Pyserini/Anserini indices.
pyterrier Use index statistics, document contents, and tokenization from PyTerrier/Terrier indices. Apply KwikSort re-ranking to PyTerrier pipelines. Run axiomatic analyses.
keybert Use KeyBERT for aspect extraction (must be enabled manually).
sbert Use Sentence Transformers for sentence similarity (enabled automatically).

Note: To reproduce our results from ICTIR'25, please use these extras: pyterrier,keybert,sbert

Usage

Run the CLI with:

ir_axioms --help

Development

  1. Install Python 3.11 or later.

  2. Create and activate a virtual environment:

    python3 -m venv venv/
    source venv/bin/activate
    
  3. Install project dependencies:

    pip install -e .[tests]
    
  4. Install spaCy model:

    python -m spacy download en_core_web_sm
    
  5. After having implemented a new feature, please check the code format, inspect common LINT errors, and run all unit tests with the following commands:

    ruff check .                   # Code format and LINT
    mypy .                         # Static typing
    bandit -c pyproject.toml -r .  # Security
    pytest .                       # Unit tests
    

Contribute

If you have found an important feature missing from our tool, please suggest it by creating an issue. We also gratefully accept pull requests!

If you are unsure about anything, post an issue or contact us:

We are happy to help!

License

This repository is released under the MIT license. Files in the data/ directory are exempt from this license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ir_axioms-1.1.2.tar.gz (29.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ir_axioms-1.1.2-py3-none-any.whl (19.9 MB view details)

Uploaded Python 3

File details

Details for the file ir_axioms-1.1.2.tar.gz.

File metadata

  • Download URL: ir_axioms-1.1.2.tar.gz
  • Upload date:
  • Size: 29.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ir_axioms-1.1.2.tar.gz
Algorithm Hash digest
SHA256 40c035540dcef9eb7e60b77d62b403dd2bf7d0a3b6eb7ef7ecee57aade103313
MD5 7ffd223a3b628e17bd28fc7a7e0f9409
BLAKE2b-256 c49579f25c0d0a9a1a42cf78c490e1f1f180f35768240af58ba328f12cfcb702

See more details on using hashes here.

Provenance

The following attestation bundles were made for ir_axioms-1.1.2.tar.gz:

Publisher: ci.yml on webis-de/ir_axioms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ir_axioms-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: ir_axioms-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ir_axioms-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53bc3b48780e9e565927144647fdd9d7a6596b4f9e6b9835040faaa34cd92808
MD5 6fe5ed48b9e1657d2ac258a30201404f
BLAKE2b-256 cd979eb3df4efcbc1d9dfd9acb9039fb2b6f73cf88fda85eac47b6c54c733f00

See more details on using hashes here.

Provenance

The following attestation bundles were made for ir_axioms-1.1.2-py3-none-any.whl:

Publisher: ci.yml on webis-de/ir_axioms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page