Downloads · 30 days
7
4% of all-time downloads
jiaxinnnnn/EN-ZH_Transformer_Model
EN-ZH_Transformer_Model is a translation model from jiaxinnnnn. Use it when you need text moved from one language to another. The card lists the license as mit.
A Transformer-based neural machine translation model for English-to-Chinese translation, trained on 100,000 parallel sentence pairs from diverse domains.
Downloads · 30 days
7
4% of all-time downloads
All-time downloads
175
Public
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.pt801 MB · 100%
From the Hugging Face model README
A Transformer-based neural machine translation model for English-to-Chinese translation, trained on 100,000 parallel sentence pairs from diverse domains.
This model implements a standard encoder-decoder Transformer architecture optimized for English-to-Chinese translation. It uses BPE tokenization for English and character-level BPE tokenization for Chinese, achieving better handling of Chinese morphology.
Evaluated on 500 test samples:
| Metric | Greedy Decoding | Beam Search (size=5) |
|---|---|---|
| chrF | 51.24 | 54.47 |
| BLEU | 66.82 | 69.15 |
Beam search provides +3.23 chrF improvement over greedy decoding.
Vocabulary Sizes:
This model is suitable for:
Best for: Formal and political text, as the model was trained primarily on such content.
Try the model interactively: EN-ZH Transformer Space
The easiest way to use this model is through the Gradio interface:
from huggingface_hub import hf_hub_download
import torch
import json
from tokenizers import Tokenizer
# Download model files
REPO_ID = "jiaxinnnnn/EN-ZH_Transformer_Model"
config_path = hf_hub_download(repo_id=REPO_ID, filename="config.json")
model_path = hf_hub_download(repo_id=REPO_ID, filename="best_model_finetuned.pt")
en_tokenizer_path = hf_hub_download(repo_id=REPO_ID, filename="en_tokenizer.json")
zh_tokenizer_path = hf_hub_download(repo_id=REPO_ID, filename="zh_tokenizer.json")
# Load tokenizers
en_tokenizer = Tokenizer.from_file(en_tokenizer_path)
zh_tokenizer = Tokenizer.from_file(zh_tokenizer_path)
# Load model (see Space code for full implementation)
For complete implementation details, refer to the Space code.
The model uses two primary metrics:
| English | Model Translation (Beam Search) |
|---|---|
| Iraqi president saddam expressed satisfaction with this resolution on 4 july. | 伊拉克 总统 萨达姆 4日 对 这 一 决议 表示 满意。 |
| The people of cambodia have expressed their lofty respect for president jiang. | 柬埔寨 人民 在 街头 前 向 江主席 表示 崇高 的 敬意,欢迎 他 来访。 |
Note: The model performs best on political and diplomatic text similar to its training data.
Domain Specificity: Model is optimized for political/diplomatic text and may underperform on:
Idiomatic Expressions: Struggles with culturally-specific idioms and expressions, often producing overly literal translations.
Length Issues: Tends to under-generate, producing translations slightly shorter than human references.
Specialized Terminology: Difficulty with formal titles and organizational terms specific to Chinese administrative contexts.
Sentence Length: Optimized for sentences up to 128 tokens; very long texts should be split into smaller segments.
The model reflects the characteristics of its training data:
This repository contains:
best_model_finetuned.pt - Trained model weights (~250MB)config.json - Model configurationen_tokenizer.json - English BPE tokenizerzh_tokenizer.json - Chinese character-level BPE tokenizerIf you use this model in your research or applications, please cite:
@misc{en-zh-transformer-2025,
author = {jiaxinnnnn},
title = {EN-ZH Transformer: English to Chinese Neural Machine Translation},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/jiaxinnnnn/EN-ZH_Transformer_Model}},
note = {chrF: 54.47, BLEU: 69.15}
}
For questions, issues, or feedback: