Skip to main content

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()
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.8

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

Built distributions (wheels)

Table of built distributions (wheels) for bmp 0.2.8
File Actions
bmp-0.2.8-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for bmp-0.2.8-cp315-cp315-win_amd64.whl
bmp-0.2.8-cp315-cp315-manylinux_2_34_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp315-cp315-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp315-cp315-macosx_10_12_x86_64.whl CPython 3.15 CPython 3.15 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp315-cp315-macosx_10_12_x86_64.whl
bmp-0.2.8-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for bmp-0.2.8-cp314-cp314-win_amd64.whl
bmp-0.2.8-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp314-cp314-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp314-cp314-macosx_10_12_x86_64.whl
bmp-0.2.8-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for bmp-0.2.8-cp313-cp313-win_amd64.whl
bmp-0.2.8-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp313-cp313-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp313-cp313-macosx_10_12_x86_64.whl
bmp-0.2.8-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for bmp-0.2.8-cp312-cp312-win_amd64.whl
bmp-0.2.8-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp312-cp312-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp312-cp312-macosx_10_12_x86_64.whl
bmp-0.2.8-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for bmp-0.2.8-cp311-cp311-win_amd64.whl
bmp-0.2.8-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp311-cp311-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp311-cp311-macosx_10_12_x86_64.whl
bmp-0.2.8-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for bmp-0.2.8-cp310-cp310-win_amd64.whl
bmp-0.2.8-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp310-cp310-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp310-cp310-macosx_10_12_x86_64.whl
bmp-0.2.8-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for bmp-0.2.8-cp39-cp39-win_amd64.whl
bmp-0.2.8-cp39-cp39-manylinux_2_34_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.34+ x86-64 Details for bmp-0.2.8-cp39-cp39-manylinux_2_34_x86_64.whl
bmp-0.2.8-cp39-cp39-macosx_10_12_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.12+ x86-64 Details for bmp-0.2.8-cp39-cp39-macosx_10_12_x86_64.whl

Total release size: 15.7 MB

Release files / bmp-0.2.8-cp315-cp315-win_amd64.whl

Download URL bmp-0.2.8-cp315-cp315-win_amd64.whl
Size 623.6 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
c9effbf9fa88b636d6010eb1ce223e1f0b658c3b7ffe6836c44a1627adcde3e1
BLAKE2b-256 checksum
How to use checksums
af416b4600eb0473538e3a2aff366c8c9cbd4e0544d5b3839af45c48aa0ae786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp315-cp315-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp315-cp315-manylinux_2_34_x86_64.whl
Size 856.9 kB
Tags CPython 3.15 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
42c5e6f5c8a68b872e634e2bf071f5a6c9b18f1ee5672bfe1b12019d6b65a852
BLAKE2b-256 checksum
How to use checksums
1dbcacd89c9d7c2568b4c608733bcda44b47712e830752c376f36fd48be547bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp315-cp315-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp315-cp315-macosx_10_12_x86_64.whl
Size 759.4 kB
Tags CPython 3.15 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
611d6d625cff04ff07a7df628f6f7f715e2f5e0ea845f834ec35f7e427e97db2
BLAKE2b-256 checksum
How to use checksums
142470322847c0bf8e57bc29b2aa11e949ebb65a6932fcb1fa541128c8f69955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp314-cp314-win_amd64.whl

Download URL bmp-0.2.8-cp314-cp314-win_amd64.whl
Size 623.2 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
d15b9b3ca881a334419ea72d64f3062b317ede318fdbbe63b8ddcc34e31b9f45
BLAKE2b-256 checksum
How to use checksums
c5512749124a9524c761060ea487a5e113873339eede885463f8225d2214dc41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp314-cp314-manylinux_2_34_x86_64.whl
Size 856.7 kB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
eab59302e13b1b6fe9902dbc3e45406f82d14e800685e7d5aae33900c59fa127
BLAKE2b-256 checksum
How to use checksums
b3fbc29e8e4ca84ae14a5a59acb9e2bb13d7abb073c51437c46dfbdb021263a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp314-cp314-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp314-cp314-macosx_10_12_x86_64.whl
Size 759.1 kB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bc1086bf54bc75229311afc848e1326e17c018437567df579edaf4c9f3bcbf71
BLAKE2b-256 checksum
How to use checksums
11d0b990b8cdc72669795ad2f2340a42feef1aeceec67748c4c0bec162367840
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp313-cp313-win_amd64.whl

Download URL bmp-0.2.8-cp313-cp313-win_amd64.whl
Size 622.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e2c27bb598a45065befb1816ed2994e4be7a7737a7eeaec4516e1cffbb5080cd
BLAKE2b-256 checksum
How to use checksums
a8ef6cedcb6dd5852cd64c0cf697e5046c61a49a7cd6e163df00b23f0069049f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp313-cp313-manylinux_2_34_x86_64.whl
Size 856.1 kB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
1f703810a8e42f20cf99d221f1d3e122cff45487c337a1f4969df12616d45c36
BLAKE2b-256 checksum
How to use checksums
cadaee3e8a240a9845c457d64060d74af9826eb3c6a58b695afe96d5f611b8e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp313-cp313-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp313-cp313-macosx_10_12_x86_64.whl
Size 758.0 kB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2de771d84342ed7dccb0aeab5adc78a94e6a5927481d4bad2785760ed7bb1350
BLAKE2b-256 checksum
How to use checksums
2da4d62df0a251e9c15005510c87f2db1b3e5eb685d2c6cb8eaf31fc15492047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp312-cp312-win_amd64.whl

Download URL bmp-0.2.8-cp312-cp312-win_amd64.whl
Size 623.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
12a48363466ba815daa3c81be0a3b4be082cf92766062177f578cf2a35d8b95d
BLAKE2b-256 checksum
How to use checksums
f0ff80e36e5768a25fbc52982edd3a88178bf1c351b07a8ba871d36a1b87311b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp312-cp312-manylinux_2_34_x86_64.whl
Size 856.9 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f75c9013753c68333934b0bfc575775081a9567490ad97d29268f6e300266853
BLAKE2b-256 checksum
How to use checksums
8fa7ae4dd20bc804d93abb8b671a9f4edf654d058efd0391db904be2d2ef539a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp312-cp312-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp312-cp312-macosx_10_12_x86_64.whl
Size 758.3 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1b2e4b259129b02f400866ba9686afaef55eef64051e0bbd708683a75e7e1fba
BLAKE2b-256 checksum
How to use checksums
15e6f4a8d2eaac8f20e915519c312485b117fba54d620aa634b10d855b6f65d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp311-cp311-win_amd64.whl

Download URL bmp-0.2.8-cp311-cp311-win_amd64.whl
Size 626.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5259bfdd6b8b53edfbbfa97e0181666d0c6a1f54d1423eaed2c609b2a9a088bd
BLAKE2b-256 checksum
How to use checksums
019495d8a99e5e76664de14ec89e655db9d719f088ee95f752132d5b3320ab19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp311-cp311-manylinux_2_34_x86_64.whl
Size 859.3 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
b31fe552c5179e1b81f46474d17fea2e1ea131ff3620d9c4cea7d85c985a27a9
BLAKE2b-256 checksum
How to use checksums
6178e4231673c6c02138fe3e263f9509f2fee0ba2dbaa6c80c0537dde8a390e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp311-cp311-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp311-cp311-macosx_10_12_x86_64.whl
Size 762.2 kB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9f09a4df300c8d9670cde4734ef006db4d7cb1da7a3a485793cd28f6dfd5d87a
BLAKE2b-256 checksum
How to use checksums
bd5cdb9aba34b2aa4722be661984b14c1816448c9ba27fdf6a5ce88816ac7c2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp310-cp310-win_amd64.whl

Download URL bmp-0.2.8-cp310-cp310-win_amd64.whl
Size 625.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
c97ad387628df620b62c978d175580ade4d0d168cb538a648914838372edb0c8
BLAKE2b-256 checksum
How to use checksums
31135909f82a87656bfd8aeddbc2d4a2b581a251d49923966238e319ecc43ce1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp310-cp310-manylinux_2_34_x86_64.whl
Size 860.4 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
0d76291e679793d3c159aecac7d38692a150cfaa0183a6db22ce9acd3bf03b0d
BLAKE2b-256 checksum
How to use checksums
fbf64c01468ad467e0496e2dd9caeb4ce838c026adcb936989b93a681157c915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp310-cp310-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp310-cp310-macosx_10_12_x86_64.whl
Size 762.2 kB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3b66e71b894bf2c735c4971cd7a720bbcac452ebc72df43c6d2e4212abea0141
BLAKE2b-256 checksum
How to use checksums
af99fd7a9b3470b92355bf260c99c3949aed4caaf42e068c2cb957bbb61ecce8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp39-cp39-win_amd64.whl

Download URL bmp-0.2.8-cp39-cp39-win_amd64.whl
Size 627.7 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
aca8788f88e299b872a74ee948b78c7413c5d98991f0a07b7f40f56816c5f02f
BLAKE2b-256 checksum
How to use checksums
d03ec54b68bb1f307a3b9ddc4e87495081d94224765b3d0cee1d4de50e153e6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp39-cp39-manylinux_2_34_x86_64.whl

Download URL bmp-0.2.8-cp39-cp39-manylinux_2_34_x86_64.whl
Size 863.6 kB
Tags CPython 3.9 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
32c6f7e096d1663149a72c2fba05577979b1629df98b0a9aae3e3a410f0a0a3a
BLAKE2b-256 checksum
How to use checksums
50b5ba83cf9af6d344aa2b986c2243fe9594b6806aa8350602ac393249aa5d3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / bmp-0.2.8-cp39-cp39-macosx_10_12_x86_64.whl

Download URL bmp-0.2.8-cp39-cp39-macosx_10_12_x86_64.whl
Size 764.5 kB
Tags CPython 3.9 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4a40a421f74a4752606fd1aa61e02cdc02d71e06ed6ce462fb9af7ead80097a2
BLAKE2b-256 checksum
How to use checksums
8b59d85560068ef294d5e28e9f9ac8f79443cbdbf02dbfb626567e43d8a892aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Security for bmp 0.2.8

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.

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