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-1.0.0.tar.gz
(8.9 kB
view details)
Built Distribution
File details
Details for the file retrival25-1.0.0.tar.gz
.
File metadata
- Download URL: retrival25-1.0.0.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 | 9c644b3c157f73eabdbfc1f5a426a738deb3c218c4728c6771e45bf27dd2f155 |
|
MD5 | 30a92447edcf4a46a359b4ef8e08c838 |
|
BLAKE2b-256 | efe8134887a7bdf27c79c4d6cfb33e57e7ca3ad4e5691d1e904017663fbffb11 |
File details
Details for the file retrival25-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: retrival25-1.0.0-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 | bd34d90ed5bbeee2e3e02c69b7a0a5710030af07c9eb22788fba56e0179ab913 |
|
MD5 | 4a520fac24398129371a68154890ddce |
|
BLAKE2b-256 | ce255d28817f2b309aec4e308ff46f596d037af7336db0211c239ad378cde07e |