↕️ 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.
Refer to the ir_axioms documentation for:
- Installation and a quickstart
- Axiom intuitions, formalizations, and implementations
- Related information retrieval literature
- Walkthroughs on re-ranking, post-hoc analyses, and RAG evaluation
- Instructions for developing new axioms
TL;DR
To get started without reading the documentation, follow these steps:
-
Install the package from PyPI:
pip install ir_axioms>=1.0
-
Install a spaCy model:
python -m spacy download en_core_web_sm
-
Load and combine axioms:
from ir_axioms.axiom import TFC1, PROX1, ORIG axiom = (TFC1() & PROX1()) | ORIG()
-
Define some test data:
from ir_axioms.model import Query, Document query = Query(id="q1", text="axiomatic information retrieval") documents = [ Document(id="d1", text="Retrieval axioms formalize constraints for retrieval models.", rank=1), Document(id="d2", text="Axiomatic information retrieval: axiomatic constraints guide retrieval.", rank=2), ]
-
Compute axiom preferences or re-rank documents:
axiom.preferences(input=query, outputs=documents) axiom.rerank_kwiksort(input=query, ranking=documents)
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! Get started by following our development guides.
License
This repository is released under the MIT license.
Files in the data/ directory are exempt from this license.
If you use ir_axioms in your research, consider citing us.
Metadata
Release files for ir-axioms 1.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ir_axioms-1.2.5.tar.gz | 28.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ir_axioms-1.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.6 MB
Release files / ir_axioms-1.2.5.tar.gz
| Download URL | ir_axioms-1.2.5.tar.gz |
|---|---|
| Size | 28.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbb90f78a9de4260619ca6e67c0204e56e0a0155e0d77e80856a2fe4a1af15a5
|
|
BLAKE2b-256 checksum How to use checksums |
8133cf2ed9be897d39ba28072226839b5d527155d3dc88453fc71f745782f402
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / ir_axioms-1.2.5-py3-none-any.whl
| Download URL | ir_axioms-1.2.5-py3-none-any.whl |
|---|---|
| Size | 20.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2457e8ebfc33f7e7de11f7a4e2b629c5bc7e6e891b70ebc7e71a8f9f794f49e9
|
|
BLAKE2b-256 checksum How to use checksums |
77806f60d8f24af22d05535a349e6a1aab5c0346dcf1957feaa672ca9648e74f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log