Xetu English → Assamese Translation Model (Fine-tuned OPUS-MT)
This repository contains a fine-tuned OPUS-MT multilingual model (opus-mt-en-mul) designed for English → Assamese translation.
The model was trained as part of the Xetu Chat App , enabling real-time bilingual messaging.
🔍 Overview
Base Model: opus-mt-en-mul (MarianMT Transformer)
Task: Machine Translation (English → Assamese)
Architecture: Seq2Seq Transformer (Marian)
Use Case: Chat translation, real-time multilingual messaging, conversational AI
This fine-tuned model improves translation quality for conversational English and Assamese.
📊 Dataset & Training Details
Dataset Sizes
Split Size Train 90,000 pairsValidation 1,000 pairsTest 4,000 pairs
Format
All data files are JSON with keys:
1 {
2 "source_text" : "English sentence" ,
3 "target_text" : "Assamese sentence"
4 }
Language Tagging
A target language prefix was used:
This ensures multilingual OPUS-MT generates Assamese output.
##⚙️ Preprocessing & Tokenization
Tokenizer loaded from local OPUS-MT model (AutoTokenizer)
Max source length: 128
Max target length: 128
Truncation enabled
Labels padded to -100 so they are ignored in loss
Example preprocessing:
">>asm<< " + source_sentence
🧠 Training Configuration
Hyperparameters
Epochs: 7
Learning rate: 3e-5
Warmup steps: 800
Weight decay: 0.01
Batch size per device: 6
Gradient accumulation: 8
Effective batch size: 48
Optimizer: AdamW
Mixed precision: No (fp16=False)
Steps Breakdown
Steps per epoch: 15,000
Optimizer updates per epoch: 1,875
Total optimizer updates: 13,125
Total training time: ~3 hours
📈 Training Progress
Loss
Training loss decreased smoothly:
Gradient Norm
Stable between 1.7–2.5 , no explosions.
Learning Rate
Warmup to 3e-5
Gradual linear decay to nearly zero by epoch 7
Overall, training was very stable.
🧪 Validation Results (BLEU & Loss)
Epoch Eval Loss BLEU 1 0.8784 18.79 2 0.7369 22.88 3 0.6786 24.20 4 0.6483 25.37 5 0.6292 25.96 6 0.6184 26.68 7 0.6148 26.78 ✔️ (Best)
The best model was correctly selected using:
load_best_model_at_end = True
metric_for_best_model = "eval_bleu"
🚀 Usage
Python Example
1 from transformers import MarianMTModel , MarianTokenizer
2
3 model_name = "Ijaj7/Xetu-english-to-assamese-translator"
4 tokenizer = MarianTokenizer . from_pretrained ( model_name )
5 model = MarianMTModel . from_pretrained ( model_name )
6
7 text = "They are very happy."
8 inputs = tokenizer ( ">>asm<< " + text , return_tensors = "pt" )
9 outputs = model . generate ( ** inputs )
10
11 print ( tokenizer . decode ( outputs [ 0 ] , skip_special_tokens = True ) )
🌐 Hugging Face Inference API
1 curl -X POST \
2 -H "Authorization: Bearer YOUR_HF_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{"inputs": "How are you?"}' \
5 https://api-inference.huggingface.co/models/Ijaj7/Xetu-english-to-assamese-translator
📱 Integration With Xetu Chat App
This model is optimized for:
Auto translate incoming messages
Manual translation mode
Real-time Assamese responses
Fast inference on mobile via cloud
A Firebase Cloud Function or direct HuggingFace API can be used.
📝 Sample Outputs
English Assamese What is your name? আপোনাৰ নাম কি? I will call you later. মই পিছত তোমাক ফোন কৰিম। What are you doing right now? তুমি এতিয়া কি কৰি আছা? I need some time to think before making a decision. সিদ্ধান্ত লোৱাৰ আগতে মোৰ চিন্তা কৰিবলৈ কিছু সময়ৰ প্ৰয়োজন। Our goal is to make Assamese language technology more accessible to everyone. আমাৰ লক্ষ্য হৈছে অসমীয়া ভাষাৰ প্ৰযুক্তি সকলোৰে বাবে অধিক সুবিধাজনক কৰি তুলিব।
📄 License
This model is released under the MIT License.
🙏 Acknowledgements
Helsinki-NLP OPUS-MT Models
Hugging Face Transformers
Assamese NLP Community
Xetu App Project
📚 Citation
@misc{Ijaj7_Xetu_en_as_2025,
title = {Xetu: English-to-Assamese Translation Model},
author = {Ijaj Ahmed},
year = {2025},
howpublished = {\url{https://huggingface.co/Ijaj7/Xetu-english-to-assamese-translator}},
note = {Accessed: 2025-11-20}
}