A persistent implementation of BM25 retrieval.
Project description
persistent_bm25
persistent_bm25 is a Python package that provides a persistent implementation of BM25 retrieval.
Installation
You can install it via pip:
pip install persistent_bm25
Usage
from persistent_bm25 import PersistentBM25Retriever
from langchain_core.documents import Document
docs = [
Document(page_content="LangChain makes AI powerful"),
Document(page_content="BM25 is a ranking function for search"),
]
# Create retriever
bm25_retriever = PersistentBM25Retriever.from_documents(docs)
bm25_retriever.persist("./bm25_retriever")
loaded_bm25_retriever = PersistentBM25Retriever.from_persist_dir("./bm25_retriever")
results = loaded_bm25_retriever.get_relevant_documents("AI search")
print(results)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 persistent_bm25_v2-1.0.0-py3-none-any.whl.
File metadata
- Download URL: persistent_bm25_v2-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85dffcd771bce8384140f40859d6f5767d00adb7fa8da0eb474dbe8df50c422
|
|
| MD5 |
457f044b26e35a149447aceea619f969
|
|
| BLAKE2b-256 |
fb850f493d4a2a351e495b74a1428101886c3268ce8c536796342fa1f181c4d7
|