Skip to main content

small-hybrid-reranker

small-hybrid-reranker is a lightweight reranker package with a baked-in trained model.

It reranks a list of passages for a query using a hybrid feature stack:

  • static embeddings (cnmoro/static-nomic-384-pten-v2)
  • lexical overlap and token interaction sketches
  • BM25 and dense retrieval priors
  • listwise LightGBM ranker

The model artifact is included in the package, so there is no separate checkpoint download.

Model In This Release

  • Version 0.2.1 packages a model retrained with cnmoro/static-nomic-384-pten-v2.
  • Training used the SciFact train split in this repository with strict BM25 top-100 candidates and LightGBM LambdaRank over hybrid features.
  • In-split training metric from the full training run:
    • ndcg@10: 0.90908
    • recall@10: 0.90766

Inference remains lightweight and CPU-friendly: the API is still a single HybridReranker().rerank(query, passages) call.

Install

pip install small-hybrid-reranker

Quickstart

from small_hybrid_reranker import HybridReranker

reranker = HybridReranker()

query = "What is the speed of light?"
passages = [
    "The speed of light in a vacuum is about 299,792 km/s.",
    "Earth orbits the Sun in about 365 days.",
    "Newton described laws of motion.",
]

ranked = reranker.rerank(query, passages)
print(ranked[0])
# {'passage': 'The speed of light in a vacuum is about 299,792 km/s.', 'score': 100.0}

API

HybridReranker(model_path: str | None = None)

  • model_path=None: uses baked-in model inside package.
  • model_path="...joblib": load your own compatible artifact.

rerank(query: str, passages: list[str], top_k: int | None = None) -> list[dict]

Returns:

[
  {"passage": "...", "score": 82.31},
  {"passage": "...", "score": 40.87},
]

Scores are floats in [0, 100] and sorted descending.

Notes

  • This package is optimized for reranking a provided candidate list.
  • It is not a full retrieval system by itself.

Metadata

Release files for small-hybrid-reranker 0.2.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 small-hybrid-reranker 0.2.1
File Size Uploaded Provenance
small_hybrid_reranker-0.2.1.tar.gz 11.8 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for small-hybrid-reranker 0.2.1
File Interpreter ABI Platform
small_hybrid_reranker-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 MB

Release files / small_hybrid_reranker-0.2.1.tar.gz

Download URL small_hybrid_reranker-0.2.1.tar.gz
Size 11.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c9e1f22222756e27b8b61804fd48b04822f844d14e507426e2498ce73a925767
BLAKE2b-256 checksum
How to use checksums
e3731dce9fcbcb3039363a90689f0c5be1cd233920765ab9d2d53356dde10b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / small_hybrid_reranker-0.2.1-py3-none-any.whl

Download URL small_hybrid_reranker-0.2.1-py3-none-any.whl
Size 11.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2e6a82461ce4d876da12266cfad4983d49fd837bb5add98ac297faa734e53111
BLAKE2b-256 checksum
How to use checksums
c1897a22c1ad91feade53a32106a485c0fb266d644031aa89abbff2eef292155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for small-hybrid-reranker 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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