Downloads · 30 days
280
57% of all-time downloads
Tsengel-mn/nllb-mongolian
nllb-mongolian is a translation model from Tsengel-mn. Use it when you need text moved from one language to another. The card lists the license as cc-by-nc-4.0.
A state-of-the-art bidirectional translation model for Mongolian (Cyrillic) ↔ English, fine-tuned from Meta's NLLB-200 (600M Distilled).
Downloads · 30 days
280
57% of all-time downloads
All-time downloads
491
Public
Parameters
615M
3.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 97%
From the Hugging Face model README
A state-of-the-art bidirectional translation model for Mongolian (Cyrillic) ↔ English, fine-tuned from Meta's NLLB-200 (600M Distilled).
Version 2.0 is a complete overhaul trained on over 711,800 parallel sentence pairs with dedicated native idiomatic and technical anchor injection. It completely eliminates the Russian loanword bias, broken literal calques, and hallucinated grammar common in older or baseline models.
| English Input | Baseline / Argos v1.1 | NLLB-600M Mongolian v2.0 | Linguistic Note |
|---|---|---|---|
| "Where is the hotel?" | Хотель хаана байна? | Зочид буудал хаана байна вэ? | Russian loanword eliminated |
| "Good morning, how are you today?" | Сайн өглөө, өнөөдөр яаж байна? | Өглөөний мэнд, та сайн байна уу? | Authentic greeting idiom |
| "The server ran out of memory and crashed." | Сервер дурсамжгүй болж сүйрсэн | Санах ой дууссан тул сервер гацсан. | Correct IT terminology (RAM = санах ой) |
| "We need to fix the bugs in the application." | ...алдаанууд засах шаардлагатай | Бид програмын алдааг засах хэрэгтэй. | Natural syntax and modal auxiliary |
| "Can you help me assemble the robotic arm?" | Надад туслах уу угсрах... | Робот гарыг угсрахад надад туслахгүй юу? | Polite Mongolian request suffix (-хгүй юу?) |
| "Database migration completed successfully." | Өгөгдлийн сангийн шилжилт... | Мэдээллийн сангийн нүүлгэн шилжилт амжилттай дууссан. | Industry-standard tech term |
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_id = "Tsengel-mn/nllb-mongolian"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id).to("cuda" if torch.cuda.is_available() else "cpu")
def translate(text: str, direction: str = "en-mn") -> str:
if direction == "en-mn":
src, tgt = "eng_Latn", "khk_Cyrl"
else:
src, tgt = "khk_Cyrl", "eng_Latn"
tokenizer.src_lang = src
inputs = tokenizer(text, return_tensors="pt").to(model.device)
tgt_id = tokenizer.convert_tokens_to_ids(tgt)
with torch.no_grad():
tokens = model.generate(
**inputs,
forced_bos_token_id=tgt_id,
max_length=128,
num_beams=2
)
return tokenizer.decode(tokens[0], skip_special_tokens=True)
# English -> Mongolian
print(translate("The database migration completed successfully.", "en-mn"))
# Output: Мэдээллийн сангийн нүүлгэн шилжилт амжилттай дууссан.
# Mongolian -> English
print(translate("Өглөөний мэнд, та сайн байна уу?", "mn-en"))
# Output: Good morning, how are you today?
q_proj, k_proj, v_proj, out_proj, fc1, fc2).adamw_bnb_8bit), Cosine Learning Rate schedule with 300 warmup steps, BF16 mixed precision.0.9372.model.safetensors).When calling the tokenizer, use standard NLLB language identifiers:
khk_Cyrleng_LatnThis model is licensed under Meta's Creative Commons Attribution-NonCommercial 4.0 International (CC-BY-NC 4.0) license in alignment with the underlying NLLB-200 weights.
Maintained by Tsengel-mn for the Mongolian open-source AI language ecosystem.