Skip to main content

No project description provided

Project description

BMP

Install

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})
...
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)
# -> 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)
# -> Tuple[List[str], List[float]] (doc IDs, scores) for this query

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.1-cp312-cp312-manylinux_2_34_x86_64.whl (868.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

bmp-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl (869.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

bmp-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl (869.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for bmp-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f00a4f6d0be9dbf55e5c42d04155e1733e88bd7448edbd507a7f54c52ab26d34
MD5 a2eb958578f75ff11da7cf8e4f4b1484
BLAKE2b-256 18aa89b1051a1089bed2ddf9337ad920b0377da7f72d37edc7b98b7273a29561

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bmp-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e7616b248f6cb2ee734c10b0d6c530ff2158ffdc9b3d17967bd4966e679c2017
MD5 ae3ea3894fa5c2a5c99bcf1216d95bf4
BLAKE2b-256 42f8f1417b62e3786e6e7e47a878a976d81edda9b13529f9fb91fca3a3640cb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bmp-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 43a60e4a98a9d81632a7d024e08767e9d0fe675cdda158e57ab0a7b981471956
MD5 0cdbd98240f2c361ca787b2884b02e24
BLAKE2b-256 1f27a7f18ee514f0af14787503349047b02975db84853f3ca046fb71d08de596

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