OPUS-MT zh→ru (Custom Trained)
This is a custom-trained Marian-based translation model for zh→ru.
It was fine-tuned from Helsinki-NLP/opus-mt-zh-en
and converted to MNN format via the mnn-opus-mt-toolkit.
Model Details
| Parameter | Value |
|---|---|
| Architecture | MarianMT (encoder-decoder Transformer) |
| Source language | zh |
| Target language | ru |
| Base model | Helsinki-NLP/opus-mt-zh-en |
| BLEU score | 4.33 |
| chrF score | 18.33 |
| Training pairs | 61,747 |
| Training epochs | 3 |
Usage
With Hugging Face Transformers
from transformers import AutoModelForSeq2SeqLM, MarianTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("Hosstia/opus-mt-zh-ru")
tokenizer = MarianTokenizer.from_pretrained("Hosstia/opus-mt-zh-ru")
text = "Your source text here"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs)
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
With MNN (on-device Android)
Convert to MNN format using the mnn-opus-mt-toolkit:
./run_all.sh --hf-user <username> --src zh --dst ru --format fp16 \
--model-repo Hosstia/opus-mt-zh-ru --tokenizer-repo Hosstia/opus-mt-zh-ru
License
Apache License 2.0 (model weights); see the toolkit repository for details.
Acknowledgments
- Helsinki-NLP for the original OPUS-MT models
- Marian NMT for the training framework
- Alibaba MNN for the on-device inference engine
- Hugging Face for model hosting and the Transformers library