CoolFace
Modelpublic

vivekkopthsd/embeddinggemma-300m-taxrag-ft

sourceHugging Facegemmaupdated 1mo agoView on Hugging Face
0likes113downloads
Model Card

✨ embeddinggemma-300m-taxrag-ft

The multilingual retrieval encoder for Indian tax & finance — English, Hindi, and Hinglish, one model.

Fine-tuned from `google/embeddinggemma-300m` on 29.4k curated retrieval pairs from the Income-Tax Act, 2025 plus financial-QA data. It finds the exact statutory section for a taxpayer question — asked in English, Devanagari Hindi, or code-mixed Hinglish — with perfect top-5 recall on Hindi and English and the highest Recall@1 and MRR of every encoder we evaluated.

Headline results

MetricScore
Hindi Recall@51.000
English Recall@51.000
English Recall@10.990
Hindi Recall@10.880
Aggregate MRR@50.887 — best of all six evaluated configurations
Aggregate Recall@10.861 — best of all six evaluated configurations

Measured on 180 held-out queries (100 EN / 50 HI / 30 Hinglish) against the 2,474-passage bilingual statute corpus — the same eval set that chose the checkpoint, never seen in training.

Quick start

python
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("vivekkopthsd/embeddinggemma-300m-taxrag-ft")

query = model.encode(
    ["mera HRA deduction kaise claim karu?"],
    prompt_name="query",          # instruction prompts preserved from base
    normalize_embeddings=True,
)
doc = model.encode(
    ["Section 134: Deduction in respect of rent paid\n\n134. (1) ..."],
    prompt_name="document",
    normalize_embeddings=True,
)
sim = query @ doc.T

Trained with Matryoshka objectives — truncate embeddings to 512 or 384 dims for smaller indices and faster scoring with minimal quality loss:

python
query_512 = query[..., :512]

Model details

FieldValue
Base model`google/embeddinggemma-300m` (300M params, Gemma architecture)
Output dim768 (Matryoshka: 512, 384)
Max sequence length2048
Promptsquery / document (registered)
TrainingFull-parameter bf16, CachedMNRL + hard negatives, effective batch 64, LR 1e-5, 3 epochs, seed 7
LanguagesEnglish · Hindi (Devanagari) · Hinglish (code-mixed)
LicenseGemma Terms of Use (derived from a Gemma model)

Evaluation

180 held-out queries (100 English paraphrases, 50 Hindi translations, 30 hand-written Hinglish), gold-section retrieval over the 2,474-passage bilingual corpus.

SliceR@1R@5MRR@5
English0.9901.0000.995
Hindi0.8801.0000.937
Hinglish0.4000.5330.447
Aggregate0.8610.9220.887

Generalization (held-out): BeIR/fiqa test R@5 0.653 vs base 0.665 — Δ −0.012. Domain fine-tuning keeps general financial-QA ability intact.

Training data

  • —Tier 1 — bilingual statute (19,440 pairs): every section of the Income-Tax Act, 2025 (EN + Hindi), with 3 English, 3 Hindi and 2 Hinglish query paraphrases each, paired with both the EN and the HI passage — including cross-lingual EN→HI / HI→EN alignment.
  • —Tier 2 — general finance (10,000 pairs): sampled from `BeIR/fiqa` (CC-BY-SA-4.0).
  • —Hard negatives: BM25 top-1 non-gold passage per query — the model learns to separate confusable sections that differ by a single word.
  • —Reproduce: build_ft_pairs.py → fine_tune_encoder.py (training pairs also published as a HF dataset).

Intended use

Retrieval for RAG over Indian tax/finance documents in English, Hindi and Hinglish. Educational tool output — not legal or financial advice. Evaluated on the Income-Tax Act, 2025 corpus; expect domain shift elsewhere.

License & attribution

Derived from EmbeddingGemma-300m → Gemma Terms of Use. Training data: MIT-licensed statute-text dataset + NLLB machine translations + BeIR/fiqa (CC-BY-SA-4.0). The reranker used alongside this model in production (Qwen/Qwen3-Reranker-0.6B) is Apache-2.0.