Downloads · 30 days
14
12% of all-time downloads
NyayaLabs98/nyaya-reranker-mini-v1
nyaya-reranker-mini-v1 is a text ranking model from NyayaLabs98. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers. The card lists the license as apache-2.0.
cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 (Apache-2.0) fine-tuned to score a citizen's question against a candidate section of current Indian law. It reorders the BM25 top-20 from NyayaLabs98/nyaya-statute-db in the…
Downloads · 30 days
14
12% of all-time downloads
All-time downloads
115
Public
Parameters
118M
493 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors471 MB · 96%
From the Hugging Face model README
cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 (Apache-2.0) fine-tuned to score a citizen's
question against a candidate section of current Indian law. It reorders the BM25
top-20 from NyayaLabs98/nyaya-statute-db
in the Nyaya retriever. One fifth the size
of the BAAI/bge-reranker-v2-m3 the project also supports, and weaker than it.
⚖️ Not legal advice. This model ranks statute sections. What to do about them is a question for an advocate enrolled under the Advocates Act, 1961.
Full-hit recall (every gold section of a question inside the top-k) after reranking the
BM25 top-20, on the Eval-v1 questions never used to tune retrieval (n=118),
scripts/15_retrieval_recall.py --rerank:
| Ranker over BM25 top-20 | @1 | @3 | @5 | @8 | Size | CPU latency, depth 20 |
|---|---|---|---|---|---|---|
| none (BM25 order) | 45.8% | 61.0% | 74.6% | 81.4% | – | – |
| nyaya-reranker-mini-v1 | 51.7% | 70.3% | 76.3% | 82.2% | 118M | 3.2 s (Kaggle CPU) |
| bge-reranker-v2-m3 | 58.5% | 69.5% | 74.6% | 83.9% | 568M | slower |
Report: reports/retrieval_recall_rerank_mini.json. The 3.2 s CPU latency is why the
browser demo still runs BM25 only.
scripts/41_build_retriever_pairs.py; all Eval-v1 questions excluded).CrossEncoder.fit, binary relevance, batch 32, 1 epoch, 200 warm-up
steps, mixed precision, one Kaggle T4 (272 s). Final training loss 0.30.nyaya.rerank.passage_text (act name, section title, first 1,600
characters of the section).from sentence_transformers import CrossEncoder
model = CrossEncoder("NyayaLabs98/nyaya-reranker-mini-v1", max_length=512)
scores = model.predict([("police FIR nahi likh rahi, kya karu?", "Bharatiya Nagarik Suraksha Sanhita, 2023 — Section 173 ...")])
In the repository: python scripts/15_retrieval_recall.py --rerank NyayaLabs98/nyaya-reranker-mini-v1 --rerank-depth 20.
bge-reranker-v2-m3 at k=1 by 6.8 points on n=118; use bge when you can afford it.