Downloads · 30 days
3
6% of all-time downloads
tuckj90/mbart-fa-religious-final
mbart-fa-religious-final is a machine learning model from tuckj90. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
3
6% of all-time downloads
All-time downloads
52
Public
Parameters
611M
2.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.4 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of facebook/mbart-large-50-many-to-many-mmt
for English-to-Persian (Farsi) translation of religious and doctrinal text.
Off-the-shelf multilingual MT models handle general-purpose text reasonably well, but often struggle with the specific register, vocabulary, and phrasing conventions of religious/doctrinal writing. This model adapts mBART-50 to that domain using a purpose-built parallel corpus of religious text.
Intended for translating English religious/doctrinal text (e.g. talks, sermons, devotional writing) into Persian. Performance on general-domain or conversational text is expected to be weaker than the base multilingual model, since fine-tuning specialized the model toward this domain's vocabulary and register.
This is a personal/portfolio project, not a production translation system. Translations should be reviewed by a fluent Persian speaker before use in any setting where accuracy matters (e.g. official communication, publication).
Usage:
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
tokenizer = MBart50TokenizerFast.from_pretrained("your-username/mbart-fa-religious-final", src_lang="en_XX") model = MBartForConditionalGeneration.from_pretrained("your-username/mbart-fa-religious-final") model.eval()
def translate(text, num_beams=4): encoded = tokenizer(text, return_tensors="pt") generated_tokens = model.generate( **encoded, forced_bos_token_id=tokenizer.lang_code_to_id["fa_IR"], num_beams=num_beams, ) return tokenizer.decode(generated_tokens[0], skip_special_tokens=True)
Trained on ~49,000 English-Persian sentence pairs scraped from published religious texts (General Conference talks 2014-2025, Liahona messages, and several doctrinal manuals), split 90/10 into train/test.
Sentence pairs were strictly aligned: a document was discarded entirely if its English and Persian paragraph counts didn't match, and individual paragraphs were discarded unless their sentence counts matched exactly on both sides. This trades dataset size for alignment quality.
Evaluated on the full held-out test split (~4,900 pairs):
Full training code, data collection methodology, and development notes are available at: https://github.com/tuckj11/mbart-fa-religious
Training data was derived from copyrighted materials published by The Church of Jesus Christ of Latter-day Saints; this model is a personal/educational project and is not affiliated with or endorsed by the Church.
The model was fine-tuned from facebook/mbart-large-50-many-to-many-mmt using
Hugging Face's Seq2SeqTrainer, with source/target languages set to en_XX/fa_IR.
A few adjustments were made from initial defaults during development, documented in the repo's development notes:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 9.4660 | 3.0 | 4122 | 1.1712 |
Note: reported training loss is averaged across the entire run, including early, less-stable steps before learning rate warmup completed -- it is not directly comparable to validation loss, which reflects only the final, best checkpoint.
Final evaluation (on the full ~4,900-example held-out test set):