Metadata-Version: 2.4
Name: ff-adaptive
Version: 0.1.0
Summary: Adaptive Retrieval component for Efficient Retrieval
Author: Martijn Smits
License: MIT License
        
        Copyright (c) 2025 Martijn Smits
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/martijnsmits/ffar
Keywords: information retrieval,corpus graph,efficient retrieval,adaptive retrieval
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-terrier<1,>=0.10.0
Requires-Dist: pyterrier-adaptive<1,>=0.1.0
Requires-Dist: pandas<3,>=2.0.3
Dynamic: license-file

# FFAR
Adaptive Retrieval component for Efficient Retrieval

## Installation
Install the package via `pip`:
```bash
pip install ff-adaptive
```
## Getting Started
1. Create an [Index](https://pyterrier.readthedocs.io/en/latest/terrier-indexing.html)
2. Run the following code:
```bash
import pyterrier as pt
from pyterrier_adaptive import CorpusGraph
from pyterrier_pisa import PisaIndex

from ff_adaptive import FFAdaptive

if __name__ == "__main__":
    corpus_graph = CorpusGraph.from_hf("macavaney/msmarco-passage.corpusgraph.bm25.128")
    dataset = pt.get_dataset(f"irds:msmarco-passage/trec-dl-2019/judged")
    index = pt.IndexFactory.of("/path/to/your/index") # Replace with index path
    bm25 = pt.terrier.Retriever(index, wmodel="BM25")

    rerank_model = pt.terrier.Retriever(index, wmodel="BM25") # Replace with a re-ranker of choice

    pipeline = bm25 >> FFAdaptive(corpus_graph=corpus_graph, retriever=bm25, k=16) >> rerank_model

    result = pipeline.transform(dataset.get_topics())
    print(result)
```

## Citation
```bibtex
@inproceedings{rear2025,
    title = {Resource Efficient Adaptive Retrieval},
    author = {Martijn Smits},
    year = {2025},
}
```
