Skip to main content

Adaptive Retrieval component for Efficient Retrieval

Project description

FFAR

Adaptive Retrieval component for Efficient Retrieval

Installation

Install the package via pip:

pip install ff-adaptive

Getting Started

  1. Create an Index
  2. Run the following code:
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

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

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

ff_adaptive-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

ff_adaptive-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file ff_adaptive-0.1.0.tar.gz.

File metadata

  • Download URL: ff_adaptive-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ff_adaptive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 49337adc42eb28fadfc76c14fa9b530f17ef85d8ed0f805b7caa4616669be724
MD5 8a1a9d133f47a59d06c90e3ca79d4bcb
BLAKE2b-256 dd626111a2b656516afff724f703350f97f84993a6b181f1173ae989a121b85d

See more details on using hashes here.

File details

Details for the file ff_adaptive-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ff_adaptive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ff_adaptive-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fffcdf87ece3c26fc0dfb0a7407f9a9b89c627a90453b08d85a7185faab3226c
MD5 38471c520397494a3b8edac1414bc3ad
BLAKE2b-256 e4eae1b793ce8daf96fd96ea6ac6c27844af39f9421d4ed89912aea64b60615d

See more details on using hashes here.

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