# `pip install "transformers<5.0.0"`
# translation is no longer supported
# on transformers 5.0.0+
from transformers import pipeline
pipe = pipeline("translation", model="Rishi-Jain-27/hindi-english-translator", trust_remote_code=True)
# Load the model.
from transformers import AutoModel
model = AutoModel.from_pretrained("Rishi-Jain-27/hindi-english-translator", trust_remote_code=True, dtype="auto")
On test set (2,507 pairs, EMA weights):
| Decoding | BLEU | chrF++ | TER |
|---|---|---|---|
| Greedy (KV-cache) | 19.25 | 48.70 | 69.75 |
| Beam-5 (length penalty 0.6) | 20.07 | 49.08 | 68.28 |
Single-domain corpus: IITB skews to government, news, and religious/literary text.
Translation quality degrades on converstional, technical, or code-switched input.
Sentence-level only: no document context; pronouns, discourse markers, and cross-sentence coreference can be mistranslated.
Length bias: greedy/beam decoding favors shorter outputs; very long source sentences (>~100 subwords) lose content. Length-penalty 0.6 partially mitigates this.
LaBSE filtering bias: ~33% of cleaned train pairs were dropped for low cross-lingual similarity, which can over-represent literal/easy alignments and under-represent free translations.
Inherits corpus biases: gender defaults, named-entity coverage, and dialect/register reflect what IITB contains — primarily Standard Hindi (Devanagari), regional variants.
Hindi→English direction only in this checkpoint. The reverse (en→hi) model exists but was trained for back-translation use, not for end-user translation (dev NLL 2.167, weaker direction).
nn.Transformer / nn.MultiheadAttention, no pretrained weights anywhere).Hindi→English translation of well-formed, sentence-level Devanagari text in domains close to the IITB distribution.
Component in a speech-to-speech demo (pretrained ASR -> this translator -> pretrained TTS) deployed on HuggingFace Spaces.
Not intended for: production translation, medical/legal/safety-critical text, conversational Hinglish, or any setting where translation errors carry real-world cost.