Skip to main content

Fast-Forward Indexes

This is the implementation of Fast-Forward indexes.

[!IMPORTANT] As this library is still in its early stages, the API is subject to change!

Installation

Install the package via pip:

pip install fast-forward-indexes

Getting Started

Using a Fast-Forward index is as simple as providing a TREC run with retrieval scores:

from pathlib import Path

from fast_forward import Ranking
from fast_forward.index import OnDiskIndex, Mode
from fast_forward.encoder import TCTColBERTQueryEncoder

# choose a pre-trained query encoder
encoder = TCTColBERTQueryEncoder("castorini/tct_colbert-msmarco")

# load an index on disk
ff_index = OnDiskIndex.load(Path("/path/to/index.h5"), encoder, mode=Mode.MAXP)

# load a run (TREC format) and attach all required queries
first_stage_ranking = (
    Ranking.from_file(Path("/path/to/input/run.tsv"))
    .attach_queries(
        {
            "q1": "query 1",
            "q2": "query 2",
            # ...
            "qn": "query n",
        }
    )
    .cut(5000)
)

# compute the corresponding semantic scores
out = ff_index(first_stage_ranking)

# interpolate scores and create a new TREC runfile
first_stage_ranking.interpolate(out, 0.1).save(Path("/path/to/output/run.tsv"))

Documentation

A more detailed documentation is available here.

Metadata

Release files for fast-forward-indexes 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast-forward-indexes 0.8.0
File Size Uploaded
fast_forward_indexes-0.8.0.tar.gz 37.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fast-forward-indexes 0.8.0
File Interpreter ABI Platform
fast_forward_indexes-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.2 kB

Release files / fast_forward_indexes-0.8.0.tar.gz

Download URL fast_forward_indexes-0.8.0.tar.gz
Size 37.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4113275f4097be8ebd2c43be3ee77ebc5af2ced74a34c831f46066ec2eaa4a9f
BLAKE2b-256 checksum
How to use checksums
164b111efbe1a2830909424dc2be89f477156747257fa69b6a47f54a0a258fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 25, 2025.

Transparency log

Release files / fast_forward_indexes-0.8.0-py3-none-any.whl

Download URL fast_forward_indexes-0.8.0-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0b3a739230d3311a24420728942dab5267ae9ef6bab4f7d443c1b2c88bf7401
BLAKE2b-256 checksum
How to use checksums
eb964455a3d43504dfbbb368469612f28a8761bdea18ba768e7f6b164532ad58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page