Skip to main content

rag-reranker

A lightweight cross-encoder reranker for LangChain Document objects.

Installation

pip install rag-reranker

Usage

from langchain_core.documents import Document
from rag_reranker import CrossEncoderReranker

docs = [
    Document(page_content="Paris is the capital of France."),
    Document(page_content="Berlin is the capital of Germany."),
]

reranker = CrossEncoderReranker()
results = reranker.rerank("what is the capital of france?", docs, top_k=1)

print(results[0].document.page_content, results[0].score)

Development

Build locally:

python -m pip install --upgrade build
python -m build

This produces distributable files in the dist/ folder.

Publish to PyPI

python -m pip install --upgrade twine
python -m twine check dist/*
python -m twine upload dist/*

You can use TestPyPI first:

python -m twine upload --repository testpypi dist/*

Metadata

Release files for rag-reranker 0.1.1

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

Source distribution (sdist)

Source distribution for rag-reranker 0.1.1
File Size Uploaded
rag_reranker-0.1.1.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rag-reranker 0.1.1
File Interpreter ABI Platform
rag_reranker-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / rag_reranker-0.1.1.tar.gz

Download URL rag_reranker-0.1.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40f165dcf4a38c50fee5361bfffe526b7e6cd1a0113ca922249c63f896d6f8c7
BLAKE2b-256 checksum
How to use checksums
4be16182f8ae2633f95c760b007446a0bbc5459ef63b59021e4b8d459def7bd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / rag_reranker-0.1.1-py3-none-any.whl

Download URL rag_reranker-0.1.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
868ddefdd9a661f41d3a208bed8e2aba8e3cefe0b79d734abb53ec8b3e02ac46
BLAKE2b-256 checksum
How to use checksums
c42f50442b785c902a897cfc7d45cae2db1772e921c1d03b5f87ab3a32c5f0f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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