fast-forward-indexes


Namefast-forward-indexes JSON
Version 0.2.0 PyPI version JSON
download
home_page
SummaryEfficient interpolation-based ranking on CPUs
upload_time2024-03-10 20:49:02
maintainer
docs_urlNone
authorJurek Leonhardt
requires_python>=3.8
licenseMIT License Copyright (c) 2022-2024 Jurek Leonhardt 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.
keywords information retrieval ranking search
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fast-Forward Indexes

This is the implementation of [Fast-Forward indexes](https://dl.acm.org/doi/abs/10.1145/3485447.3511955).

**Important**: As this library is still in its early stages, the API is subject to change!

## Installation

Install the package via `pip`:

```bash
pip install fast-forward-indexes
```

## Getting Started

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

```python
from pathlib import Path
from fast_forward import OnDiskIndex, Mode, Ranking
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.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](https://mrjleo.github.io/fast-forward-indexes/docs).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fast-forward-indexes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "information retrieval,ranking,search",
    "author": "Jurek Leonhardt",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/03/39/273a00666b72af220d3009976e7d035e231e94426b2805375fd839cffe88/fast-forward-indexes-0.2.0.tar.gz",
    "platform": null,
    "description": "# Fast-Forward Indexes\n\nThis is the implementation of [Fast-Forward indexes](https://dl.acm.org/doi/abs/10.1145/3485447.3511955).\n\n**Important**: As this library is still in its early stages, the API is subject to change!\n\n## Installation\n\nInstall the package via `pip`:\n\n```bash\npip install fast-forward-indexes\n```\n\n## Getting Started\n\nUsing a Fast-Forward index is as simple as providing a TREC run with retrieval scores:\n\n```python\nfrom pathlib import Path\nfrom fast_forward import OnDiskIndex, Mode, Ranking\nfrom fast_forward.encoder import TCTColBERTQueryEncoder\n\n# choose a pre-trained query encoder\nencoder = TCTColBERTQueryEncoder(\"castorini/tct_colbert-msmarco\")\n\n# load an index on disk\nff_index = OnDiskIndex.load(Path(\"/path/to/index.h5\"), encoder, Mode.MAXP)\n\n# load a run (TREC format) and attach all required queries\nfirst_stage_ranking = (\n    Ranking.from_file(Path(\"/path/to/input/run.tsv\"))\n    .attach_queries(\n        {\n            \"q1\": \"query 1\",\n            \"q2\": \"query 2\",\n            # ...\n            \"qn\": \"query n\",\n        }\n    )\n    .cut(5000)\n)\n\n# compute the corresponding semantic scores\nout = ff_index(first_stage_ranking)\n\n# interpolate scores and create a new TREC runfile\nfirst_stage_ranking.interpolate(out, 0.1).save(Path(\"/path/to/output/run.tsv\"))\n```\n\n## Documentation\n\nA more detailed documentation is available [here](https://mrjleo.github.io/fast-forward-indexes/docs).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022-2024 Jurek Leonhardt  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. ",
    "summary": "Efficient interpolation-based ranking on CPUs",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://mrjleo.github.io/fast-forward-indexes/docs/",
        "Repository": "https://github.com/mrjleo/fast-forward-indexes"
    },
    "split_keywords": [
        "information retrieval",
        "ranking",
        "search"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "628ded155da84f0467cb6bf90e72ab24258290c843a48e7ea6ad48cb5223c16e",
                "md5": "ad768d9f78cbe697938144670ee55944",
                "sha256": "4602a32dd6ca1c86a1f21c56f18aba13c25bb541ff4cae19d3d9da37638b7225"
            },
            "downloads": -1,
            "filename": "fast_forward_indexes-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad768d9f78cbe697938144670ee55944",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25555,
            "upload_time": "2024-03-10T20:49:01",
            "upload_time_iso_8601": "2024-03-10T20:49:01.006188Z",
            "url": "https://files.pythonhosted.org/packages/62/8d/ed155da84f0467cb6bf90e72ab24258290c843a48e7ea6ad48cb5223c16e/fast_forward_indexes-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0339273a00666b72af220d3009976e7d035e231e94426b2805375fd839cffe88",
                "md5": "ebab0e717f413f0bdc589308d95d4a51",
                "sha256": "82b53d2a05e8b04d920d2aab15f5544dd92c3326b26350a043d0236d111066a1"
            },
            "downloads": -1,
            "filename": "fast-forward-indexes-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ebab0e717f413f0bdc589308d95d4a51",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24868,
            "upload_time": "2024-03-10T20:49:02",
            "upload_time_iso_8601": "2024-03-10T20:49:02.976285Z",
            "url": "https://files.pythonhosted.org/packages/03/39/273a00666b72af220d3009976e7d035e231e94426b2805375fd839cffe88/fast-forward-indexes-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-10 20:49:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mrjleo",
    "github_project": "fast-forward-indexes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fast-forward-indexes"
}
        
Elapsed time: 0.21057s