Name | fast-forward-indexes JSON |
Version |
0.7.0
JSON |
| download |
home_page | None |
Summary | Efficient interpolation-based ranking on CPUs |
upload_time | 2024-12-19 13:49:00 |
maintainer | None |
docs_url | None |
author | Jurek Leonhardt |
requires_python | <3.13,>=3.10 |
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. |
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 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](https://mrjleo.github.io/fast-forward-indexes/docs).
Raw data
{
"_id": null,
"home_page": null,
"name": "fast-forward-indexes",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": "information retrieval, ranking, search",
"author": "Jurek Leonhardt",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/6c/4c/b91376d3598a5380b4c8ccf0b6ebe883a65be13c3a08b1a2a5dc86d2dc59/fast_forward_indexes-0.7.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]\n> 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\n\nfrom fast_forward import Ranking\nfrom fast_forward.index import OnDiskIndex, Mode\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=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.7.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": "460db7b3dc46019125ca6f4965b3e9b855fdd169bbd3bcd67d04ec1e4b4c7f11",
"md5": "054204848596fe8cb2b98cb3f1c088dc",
"sha256": "df58521c303673638076b525fd646fa54cda2cb55eb4858fb494a198043bf438"
},
"downloads": -1,
"filename": "fast_forward_indexes-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "054204848596fe8cb2b98cb3f1c088dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 37057,
"upload_time": "2024-12-19T13:48:58",
"upload_time_iso_8601": "2024-12-19T13:48:58.270991Z",
"url": "https://files.pythonhosted.org/packages/46/0d/b7b3dc46019125ca6f4965b3e9b855fdd169bbd3bcd67d04ec1e4b4c7f11/fast_forward_indexes-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c4cb91376d3598a5380b4c8ccf0b6ebe883a65be13c3a08b1a2a5dc86d2dc59",
"md5": "1b42fdda87ca1297644fa417ebbfb704",
"sha256": "fc69663d6f3b0b95c8a6cd56b788e9dcb323b69af6bb4bd3062355807e09d9ac"
},
"downloads": -1,
"filename": "fast_forward_indexes-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "1b42fdda87ca1297644fa417ebbfb704",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 36310,
"upload_time": "2024-12-19T13:49:00",
"upload_time_iso_8601": "2024-12-19T13:49:00.589952Z",
"url": "https://files.pythonhosted.org/packages/6c/4c/b91376d3598a5380b4c8ccf0b6ebe883a65be13c3a08b1a2a5dc86d2dc59/fast_forward_indexes-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 13:49:00",
"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"
}