Instructions to use quanfire-ai/rerank-gov-indic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use quanfire-ai/rerank-gov-indic with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("quanfire-ai/rerank-gov-indic") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
Quanfire Government Reranker β rerank-gov-indic (cross-lingual, Indian government press releases)
A cross-encoder reranker that reorders the top candidates of a first-stage retriever
over Indian government press-release text across 16 Indian languages. It is a full
fine-tune of intfloat/multilingual-e5-small
(MIT) with a single-logit ranking head (max_length 256), trained to score a
(query, passage) pair jointly.
It is a reranker, not a retriever. It does not produce embeddings and cannot be searched with cosine similarity. It takes a query and a shortlist of candidate passages (produced by a bi-encoder such as
embed-gov-indic) and re-scores each pair, moving the right passage up the list. Use it on top of a retriever, never instead of one.
The point of this model is the same as its retriever's: cross-lingual government-domain retrieval β a query in one Indian language finding the passage about the same release in another language. The reranker's job is to convert "the right passage is somewhere in the top 100" into "the right passage is #1."
- Framework & code: github.com/quanfire-ai/quanfire-multilingual-embedding (Apache-2.0)
- Weights licence: Apache-2.0. The reranker is ours; the training text is PIB press-release content reused under PIB's reproduction policy (royalty-free reproduction with attribution; by our four-gate reading, no NonCommercial and no ShareAlike constraints apply). The model is non-reconstructive β it emits a relevance score, never the source text.
- Pairs with:
embed-gov-indicas the first-stage retriever (the reranker was trained and evaluated against that retriever's own candidate lists).
What it is for
Retrieve-then-rerank over Indian government press releases. A bi-encoder retrieves a
shortlist (e.g. embed-gov-indic top-100); this cross-encoder re-scores each (query,
passage) pair and re-ranks. It improves the rank of the correct passage; it does not change
what is retrievable β if the retriever misses a passage entirely, the reranker cannot
recover it.
Measured result β read this before you use it
Retrieve-then-rerank, 1,200 held-out cross-lingual queries against a pool of 1,096
passages, first-stage retriever = the shipped embed-gov-indic adapter (empty prefixes, its
serving regime). Recall@1 = the correct passage ranked first. 95% CIs are paired bootstrap
(B=2,000, seeded) β the retriever and reranker share queries, so the delta is bootstrapped
paired.
| Recall@1 | 95% CI | |
|---|---|---|
embed-gov-indic retriever (first stage) |
0.3083 | [0.2833, 0.3350] |
+ rerank-gov-indic (this model) |
0.4067 | [0.3783, 0.4358] |
- Delta +0.0983 (+31.9%), paired 95% CI [+0.0692, +0.1275] β the interval excludes 0.
- Of the queries whose gold passage is anywhere in the retriever's top-100 (a 0.9475 ceiling), the reranker lifts 42.9% of them to #1.
- Numbers are measured on CUDA. Absolute Recall@1 is modest by construction: retrieving and then top-ranking the one correct passage out of a 1,096-passage pool spanning 16 languages is a hard cross-lingual task, and the single-gold labelling treats near-duplicate releases about the same event as misses. This is a single aggregate across the mixed-language query set, not a per-language guarantee.
Note on the first-stage figure. The
embed-gov-indicRecall@1 shown here (0.3083) is measured under this evaluation's own regime β empty prefixes, a 1,096-passage pool, this specific 1,200-query cross-lingual sample. It is therefore not the identical slice as the headline Recall@1 on theembed-gov-indiccard (0.281, measured on that card's larger held-out pool) and will differ from it. Both are correct on their own eval; the reranker delta above is the paired, like-for-like comparison that matters here.
We report disjoint / excludes-0 confidence intervals, and deliberately avoid the phrase "statistically significant."
Scope β what is and isn't validated
| Validated? | |
|---|---|
Reranking a cross-lingual government-press-release shortlist (16 Indian languages), on top of embed-gov-indic |
β Yes β aggregate Recall@1, measured above |
| Other domains (legal, finance, news, conversational, product) | β Not validated β this is a government-press-release specialist |
| Use as a standalone retriever / embedding model | β No β it is a cross-encoder; it has no embedding output |
Reranking on top of a different retriever than embed-gov-indic |
β οΈ Untested β it was trained against this retriever's candidate distribution |
| Per-language reranker gains | β οΈ Not separately reported β the validated claim is the aggregate cross-lingual Recall@1; a per-language breakdown is future work |
How to use
from sentence_transformers import CrossEncoder
# 1) First stage: retrieve a shortlist with embed-gov-indic (see that model's card).
# shortlist = top-100 passages for `query` from your gov corpus.
# 2) Rerank the shortlist with this cross-encoder.
reranker = CrossEncoder("quanfire-ai/rerank-gov-indic", max_length=256)
scores = reranker.predict([(query, passage) for passage in shortlist])
ranked = [p for _, p in sorted(zip(scores, shortlist), key=lambda x: -x[0])]
# ranked[0] is the reranker's top pick.
The reranker uses no query/passage prefixes (matching the embed-gov-indic serving
regime it was trained against). Feed raw query and passage text.
Training
Base:
intfloat/multilingual-e5-small(MIT), full fine-tune with a single-logit sequence-classification head;max_length256; 2 epochs, lr 2e-5, seed 0 (bf16, CUDA).Data: PIB press releases β the same release published in many languages, giving naturally-parallel cross-lingual pairs. Same corpus family as
embed-gov-indic.Negatives β semi-hard, and this mattered: for each query, the negatives are drawn from the first-stage retriever's own candidate ranks [20, 100) β hard enough to teach real cross-lingual discrimination, but past the near-duplicate head. Two guards: the gold passage is excluded, and any candidate that is a parallel translation of the query's own press release (shares its source document) is excluded as a false negative.
The negative-hardness curve is why. We ran three single-variable versions and the choice of negative made or broke the model:
- random global negatives (too easy): +10.5% over the retriever β a real but thin gain;
- the retriever's hardest top candidates (too hard): β45.1% β a regression. Those top ranks are dominated by near-duplicate releases about the same event, so treating them as negatives teaches the model to demote correct answers;
- semi-hard negatives from ranks [20, 100) (this model): +31.9%.
The shipped version's CI lower bound (+0.0692) sits above the random-negative version's CI upper bound (+0.0600), so it strictly dominates the thin one. Negative hardness for this corpus is non-monotonic: the best negatives are hard enough to teach cross-lingual discrimination but past the near-duplicate head.
Limitations
- Ceiling-bound by the retriever. The reranker can only reorder what the first stage returns; a gold passage absent from the shortlist is unrecoverable.
- Domain specialist. Government press-release text only; no cross-domain validation.
- Single-gold evaluation understates it. The corpus contains many near-duplicate releases about the same event across ministries and dates; when the reranker ranks such a near-duplicate first it counts as a miss, so the measured gain is conservative.
- Lowest-resource languages are thin in the underlying corpus (e.g. Khasi, Nepali, Manipuri); treat any implied per-language behaviour there as indicative only.
Attribution
Training text: Press Information Bureau (PIB), Government of India press releases, reused under PIB's reproduction policy (royalty-free reproduction with attribution). By our four-gate reading of that policy, no NonCommercial and no ShareAlike constraints apply. This model is non-reconstructive: it outputs relevance scores, not source text.
Citation
@software{quanfire_rerank_gov_indic,
title = {rerank-gov-indic: a cross-lingual reranker for Indian government press releases},
author = {Quanfire},
year = {2026},
url = {https://huggingface.co/quanfire-ai/rerank-gov-indic}
}
- Downloads last month
- 7
Model tree for quanfire-ai/rerank-gov-indic
Base model
intfloat/multilingual-e5-small