Skip to main content

Faster Learned Sparse Retrieval with Block-Max Pruning

Project description

BMP - Block-Max Pruning

Faster Learned Sparse Retrieval with Block-Max Pruning

Installation

From PyPI:

pip install bmp

From source:

pip install maturin
maturin build -r
pip install target/wheels/*.whl

Usage

Index from CIFF

from bmp import ciff2bmp
ciff2bmp(ciff_file="/path/to/ciff", output="/path/to/index", bsize=32, compress_range=False)

Index with Python

from bmp import Indexer
indexer = Indexer('/path/to/index', bsize=32, compress_range=False)
indexer.add_document('doc1', {'a': 1, 'b': 5, 'c': 8}) # docid, vector
indexer.add_document('doc2', {'a': 2, 'c': 1, 'd': 8, 'f': 2})
# ... add more documents
indexer.finish()

Search

from bmp import search, Searcher

# Batch operation
results = search(index="/path/to/index", queries="/path/to/queries", k=10, alpha=1.0, beta=1.0)
# Returns: str (TREC run file)

# Query-by-query operation
searcher = Searcher("/path/to/index") # loads index into memory once
searcher.search({'tok1': 5.3, 'tok2': 1.1}, k=10, alpha=1.0, beta=1.0)
# Returns: Tuple[List[str], List[float]] (doc IDs, scores) for this query

Citation

If you use this code, please cite:

@inproceedings{BMP,
  author = {Antonio Mallia and Torsten Suel and Nicola Tonellotto},
  title = {Faster Learned Sparse Retrieval with Block-Max Pruning},
  booktitle = {The 47th International ACM SIGIR Conference on Research and Development in Information Retrieval ({SIGIR})},
  publisher = {ACM},
  year = {2024}
}

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

bmp-0.2.5-cp312-cp312-win_amd64.whl (625.0 kB view details)

Uploaded CPython 3.12Windows x86-64

bmp-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl (883.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

bmp-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl (762.0 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

bmp-0.2.5-cp311-cp311-win_amd64.whl (623.8 kB view details)

Uploaded CPython 3.11Windows x86-64

bmp-0.2.5-cp311-cp311-manylinux_2_34_x86_64.whl (883.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

bmp-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl (762.5 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

bmp-0.2.5-cp310-cp310-win_amd64.whl (625.4 kB view details)

Uploaded CPython 3.10Windows x86-64

bmp-0.2.5-cp310-cp310-manylinux_2_34_x86_64.whl (883.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

bmp-0.2.5-cp310-cp310-macosx_10_12_x86_64.whl (763.4 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

bmp-0.2.5-cp39-cp39-win_amd64.whl (625.8 kB view details)

Uploaded CPython 3.9Windows x86-64

bmp-0.2.5-cp39-cp39-manylinux_2_34_x86_64.whl (885.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

bmp-0.2.5-cp39-cp39-macosx_10_12_x86_64.whl (764.6 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

bmp-0.2.5-cp38-cp38-win_amd64.whl (625.4 kB view details)

Uploaded CPython 3.8Windows x86-64

bmp-0.2.5-cp38-cp38-manylinux_2_34_x86_64.whl (885.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

bmp-0.2.5-cp38-cp38-macosx_10_12_x86_64.whl (765.1 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

bmp-0.2.5-cp37-cp37m-win_amd64.whl (625.3 kB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file bmp-0.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 625.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2309ca4bcef5e5b91c4113eabb8b12dbd9905e8d101497dcb74cd86544fd6822
MD5 ed6cc1e2ce1bd061a9c57d19c8b7f88f
BLAKE2b-256 ab0d6ddb34b66352e1544dc72d599e85e5079dce55790235f245f80de9098191

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1db02fd732d6b9153f59c510891f9963238e5a2b6f58c4e6170bb699b6c8f489
MD5 a251d9abcffd78406354ed0c065b0d8e
BLAKE2b-256 a79795585588c12ebdff77347dbdb7746c271f625b4600b8b2c0e3a9f940b23b

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d0a45229019af9d5780a4db84b3daeaad32c1de786ed5a2116f5545dfa2a540f
MD5 3134a7c144edabbc7ed783a3400be54a
BLAKE2b-256 8d52311db2b7acee19c660f17fbfb7e480c18cd9c19ac06c7e67c6b6d94a4c6c

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 623.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 91b5f7af845f31cfb16a8fea4176e41fc2359dfc4a2016112b78d00b2fa347ff
MD5 61ccc41be6f61b02abb7d45ae26a88a0
BLAKE2b-256 ae135749de3429f164c8f5388bc674135a40a1e7bee2e3399b78b7015413b0ba

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 994caf052e6ec6a54d4284a4a3a3091dc4eebea86e267c600f3adbefcf5f1700
MD5 63a38cc57ae5eb25961003374dbb179d
BLAKE2b-256 3ab6256205a884d7b3e1438b0af6687e12eb403e9556ea9e29a4ceefd6bf12bf

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 23c04c6fffd3cb32ac3d9131916ef86857e569b292eb594975582658e775743b
MD5 3bbc31e50386a0979a5d4fd84c0db1fa
BLAKE2b-256 5f29fd46477c3e883490388b48252c7b3907fd6bacaf96d016336dc1c6d62c0d

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 625.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 890b61628b7dfd98b02aa0ae376bce190f401e954ec2dff5f8c15f433b150c9c
MD5 ed30c9a5e7eeae6d7f723a6e5830ef58
BLAKE2b-256 094d631f9ba1d8d2f2ec82793ece04d53021fccb55592c55afc8870dc590cecd

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0a384090642ea3a3d8f843f4d94451208c3f355c7c7d6560f73c222ee206ab5f
MD5 7b49e301ecf134141beb0260d625b4de
BLAKE2b-256 8cc5e83eedebcc60aff2e8c9af4fba377806d95757c3738f226ebaae0c23c8aa

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2a1570079fb26a8be064af8e829aefda908791f371fe44ebcd2f4b3af9c3e560
MD5 cc8e9ba532242130efbb97e8a657d5a3
BLAKE2b-256 630f0bfa6e6fb566d5ccc0ffebff2ab97bc62a727232c53870a1f6fbd07ddcd3

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 625.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0efdbf285b53e2e1abde74cdcf97ce41f4667bc138f565c39947b6014df494ea
MD5 8405afbdab3350a111ccd929fde816ae
BLAKE2b-256 37e0992a4c61b7875de6b2b8ca06074963a0e59abf7145957ad4be3b28b6637d

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5d97a10115c99878483ea55b1f882b33dfdba224a1426d1a9784b635380e40cd
MD5 f5ff675d2cba8536163c491bf628b1ec
BLAKE2b-256 66acdd74a1653c666995faedf35ffbac846c0b9d23a4c4ab10c38ca61eb4fbe3

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f32ea43e69e74a1583179c4c36035b8e31738927dff3f0ede4f182ba1395243d
MD5 3310fe4e6f3000523168f44afd4f99f8
BLAKE2b-256 0b8aae25f52199a3e563c7b6707e3068de1b28b2b4817f1b91cc0b7490bc45dd

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 625.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8774764543fa24fa4c0daa4a3f1baf1fafc7972210c0aa8eb11364cb1bbd9c96
MD5 dfd03a3d1e9f6125d4011b8a861b25ad
BLAKE2b-256 f86e834d6325d751dda6f5b6985f469e680b1f0b48aa64c6219bfbf825680d63

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 12f18f0c4390922baf4122be8e43157ea6ac64a3f19d086c0563708cd510edd2
MD5 426f79f26204799a637ba01d8d03c05c
BLAKE2b-256 0ede58e48b23e548b578726ecc3727a1ffc2f656b59ace3dbbccb460d80e96a8

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bmp-0.2.5-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dfe7bcfb243243784876d9f384ccc9818870851db1fca585ea8cf83b4293b10f
MD5 57b0e80a00e3b44d323c8cabcb965df8
BLAKE2b-256 c07eb43b8bd4e6bec228dd8ae955ecf59e7d6d24490b6b798dff425018564a49

See more details on using hashes here.

File details

Details for the file bmp-0.2.5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: bmp-0.2.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 625.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for bmp-0.2.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b1a1683373e6c83f5b8ca5842476cc71245be56c5f2d13f41f56940a80d6fea8
MD5 acb6aa298334f0af798f3fc396ad2ecd
BLAKE2b-256 a55c14e9a4193dd70ade9e118dd5a3891c8aa15be94e7d571a0d23b928801856

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