One place stop for BM25 and it's variants
Project description
Installation
You can install retrival25 with pip:
pip install retrival25
Quick Start
Here is a simple example of how to use retrival25:
from retrival25.rank import ranker
# Add you data here
corpus = [
"a cat is a feline and likes to purr",
"a dog is the human's best friend and loves to play",
"a bird is a beautiful animal that can fly",
"a fish is a creature that lives in water and swims",
]
# pass data to be preprocessed and indexed
obj = ranker(corpus=corpus, type="robertson", k=1.2, b=0.75)
# return top n retrived documents
obj.get_top_n(query=query[0], n=10)
Variants
You can use the following variants of BM25
- Original implementation (
type="robertson") - ATIRE (
type="atire_bm25") - BM25L (
type="bm25_L") - BM25+ (
type="bm25_plus+") - BM25-adbt (
type="bm25_adbt")
By default ranker uses type="robertson"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
retrival25-0.1.2.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file retrival25-0.1.2.tar.gz.
File metadata
- Download URL: retrival25-0.1.2.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04cb864b9c266bd7522fed06b93b2d826888f290068669ec754d2a88e9d18af9
|
|
| MD5 |
bc8b254daf02c6b3443d5320ac2a7221
|
|
| BLAKE2b-256 |
b2498fdeef9d7df5e647aee9998921509d2e05b331ee09ca85c4e803c9ac3428
|
File details
Details for the file retrival25-0.1.2-py3-none-any.whl.
File metadata
- Download URL: retrival25-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b76568a185355467985d3435010ed3bc17b01b4b5241200b9acc8c7206a7e4b0
|
|
| MD5 |
a837974161a4458083a56cf8fcb0fc4f
|
|
| BLAKE2b-256 |
5d00c9b7c8863ebfb47ad96f7f8b4bd3085c98b3e57207ee3508395343ba2146
|