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
Metadata
Release files for bmp 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 16.1 MB
Release files / bmp-0.2.7-cp315-cp315-win_amd64.whl
| Download URL | bmp-0.2.7-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 648.8 kB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b2e787a077c3a0420b200d54d8150e16591262c7a6e91b1e129fbb1daa15cb5e
|
|
BLAKE2b-256 checksum How to use checksums |
1f2290c74f41e5e7f9de844b5ac0f34e94f627bc8040f3b63afd8c190ba81869
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp315-cp315-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp315-cp315-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 893.4 kB |
| Tags | CPython 3.15 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
4b5dbc32178eb3115fcfd58db1a41a4bad62fb4eeab2b755375bb7d3bb01893b
|
|
BLAKE2b-256 checksum How to use checksums |
e03ca2da0323fe346dc9e63ee46f8874ae830b2c82aecb82521e4ba779da9b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp315-cp315-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp315-cp315-macosx_10_12_x86_64.whl |
|---|---|
| Size | 758.8 kB |
| Tags | CPython 3.15 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d5bbe4f53a09082f7aea737893ea63a9fe6fe9ed75642db2acbdbc04ac9777a0
|
|
BLAKE2b-256 checksum How to use checksums |
78bd07a04737b82e485fc761a3092ab061e55452b9c0a2aab175057dd47c6575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp314-cp314-win_amd64.whl
| Download URL | bmp-0.2.7-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 646.5 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
06a81f937d0a76e37c5400c3121dd9b4145643956cb308223b0627fd07ef8f3f
|
|
BLAKE2b-256 checksum How to use checksums |
b42d90c6dc42fb3d5a525a6977f7d000966c45287f1c9030fef6d09664734fe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 888.9 kB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
82be2d51e83b495ae1c65ac14545a064f1fc451b3d6fb63e10f0dc7aec430240
|
|
BLAKE2b-256 checksum How to use checksums |
0fc249ec1ebbb7820c777a2509dbce6e9baf7d89f3282983a2ad571152d1aa66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp314-cp314-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp314-cp314-macosx_10_12_x86_64.whl |
|---|---|
| Size | 758.4 kB |
| Tags | CPython 3.14 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4603a5b2e323e59ffc8e3f5c1c6589e7b2d53fd0cc0a30cf3ea095b6d2d811a6
|
|
BLAKE2b-256 checksum How to use checksums |
a795df2d494972852a436f9eb70fb73ff49ba19e7b0d4a4162e718ccb4d2b8da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp313-cp313-win_amd64.whl
| Download URL | bmp-0.2.7-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 649.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b2c22ead80b3727aca870968507222d677babf1056b3bcf2e25df8ef1454310e
|
|
BLAKE2b-256 checksum How to use checksums |
91258bd854450ca75efe90e02c1aa510b050fae20a22ba3aa081d132e48b8843
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 892.5 kB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
c3d4afb54eae6c2aa54529b71c8f26f7b0811c41a8d992975144a275dd3ee957
|
|
BLAKE2b-256 checksum How to use checksums |
12fc912aa998bfc8e4c2661ab0c41f215dc448cd1ae85c9595351a4abc29bdc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 757.3 kB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f1dce26d8453317b63ec3ea22c6a6ac596f9b467676998683f5c51f5b588f236
|
|
BLAKE2b-256 checksum How to use checksums |
ef2c8a1896750f9dfeafe250594b03cfe16fb370c1f9f4abf403acbc0afedd44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp312-cp312-win_amd64.whl
| Download URL | bmp-0.2.7-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 650.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c570df1efdc5e737507228cceb0a038e6f834ccfe9a09a3ef135665e235fdb15
|
|
BLAKE2b-256 checksum How to use checksums |
4efe0db5dd241457eb448dd1765692bc8cb343089e1f75306e53dd471b1ce756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 893.5 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
65a9a6082cd28e530bced5bddf8c3b8d1f4654d78a5e7c9a115843e0883d9458
|
|
BLAKE2b-256 checksum How to use checksums |
a912d364e85fd8094b9ebd8d3dc0895ad76c81e2ebf96f98999ec6cdcde7b74f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 757.4 kB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f438ec4a12169129c7e6091e55def72fed9f918a5477e3abbd7d8e50b5f4fc65
|
|
BLAKE2b-256 checksum How to use checksums |
b172d212421a2cf0d6ce06da2e2c27a6414e9a5953023535c6cc17c64a811d86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp311-cp311-win_amd64.whl
| Download URL | bmp-0.2.7-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 653.7 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3fd6266e8386b436184e44293634c6dcf16720bd68fd9944cdd5d3de4f31ddcc
|
|
BLAKE2b-256 checksum How to use checksums |
0ee0c35446ce7b776a951038f150ee95e24bd97a0ea1ef88bba0732e9dbc43b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 888.4 kB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
30a8e549ff4b5a4ef490e4cb740176f71eada4dc02c16556a864452837ea81d4
|
|
BLAKE2b-256 checksum How to use checksums |
a093b79ba27e6c8b0c3340ca17a848084210add88bd1d48aebd986804e4354eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 761.6 kB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
60533ef642a19c5bb4679147b95c064941ba3220fb7ff09ce87115258ca730bc
|
|
BLAKE2b-256 checksum How to use checksums |
5198ff2e759facc804aa75849a8f56e0a5337d1f8fa6774c747924f7b1965dd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp310-cp310-win_amd64.whl
| Download URL | bmp-0.2.7-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 652.6 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
151e222747f1160fd50fae6a7c99a49fbc958f7163b353af5fa6fc56a2b2e232
|
|
BLAKE2b-256 checksum How to use checksums |
8ba9c9aba766ed9a186ad8deec4c5b2edd6150db4e874f577a5b986fc330a7c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 891.2 kB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
f771254bdf410cfe1b7ad654e2ed6d2a3ede11d61668f54de7f59984f954b087
|
|
BLAKE2b-256 checksum How to use checksums |
f4cc4c2e35f2cdd193a457332e9f20e6585a959fcefe0c4138140d6e0cb78daa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp310-cp310-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp310-cp310-macosx_10_12_x86_64.whl |
|---|---|
| Size | 761.6 kB |
| Tags | CPython 3.10 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
701dc999b58dd3f1cd5f2b5d2a1ce12a0f5a01d011b23fa55d94489d2dd1e5d6
|
|
BLAKE2b-256 checksum How to use checksums |
0d73b7abb5f7b129d49befa399d9a28319d4b834a2c09ab881b26a53f467fc30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp39-cp39-win_amd64.whl
| Download URL | bmp-0.2.7-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 654.9 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
db396ae0435d3c63fad5ba66edc3f8485fec94e84b2959f2edbb779080ab80a2
|
|
BLAKE2b-256 checksum How to use checksums |
2c11990e7e84c20b0f52b21b05e4021486c312c25745d549dc94873689c797f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp39-cp39-manylinux_2_34_x86_64.whl
| Download URL | bmp-0.2.7-cp39-cp39-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 896.5 kB |
| Tags | CPython 3.9 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
f5a68646c553bf2c95f700e36c14c71e0df4c7a8e5057b8e6368d52e2a0dae45
|
|
BLAKE2b-256 checksum How to use checksums |
dc4dfb34dce6370996c106bf4c2e3850615f64910a321b2e994ca56c09e897c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / bmp-0.2.7-cp39-cp39-macosx_10_12_x86_64.whl
| Download URL | bmp-0.2.7-cp39-cp39-macosx_10_12_x86_64.whl |
|---|---|
| Size | 763.8 kB |
| Tags | CPython 3.9 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
63d37ef86d37fb401b4efe6c368f97ffc8ee6c1b20778b43a46fd40e310585a7
|
|
BLAKE2b-256 checksum How to use checksums |
22c05bf30acdbf484c724ba04be6b54c9a8818c23604d5cc04d8f8d5fed4dbf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Security for bmp 0.2.7
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.