translation · MarianMT 6+6 English→Chinese · q8 · WASM · 113.11 MB · Apache-2.0
Opus-MT English → Chinese
University of Helsinki's OPUS-MT EN→ZH
(Helsinki-NLP/opus-mt-en-zh,
quantized to 113.11 MB INT8 ONNX in
Xenova/opus-mt-en-zh)
is a dedicated 6+6 MarianMT SentencePiece neural translator converting English into fluent
Simplified Chinese (简体中文 / Hanzi) with CJK punctuation
(,。?!) directly in CPU WebAssembly — 100% private, zero cloud APIs,
offline after first cache.
1 · On-device model (113.11 MB q8 WASM · encoder 52.90 MB + decoder 60.21 MB)
2 · Live English → Chinese (Simplified Hanzi) Studio
Pick a domain preset, type or paste (Ctrl/Cmd+V) English text, or drop/upload a
.txt, .md, .srt, or .csv file. All inference runs off
the main thread in a dedicated Web Worker.
.txt / .md / .srt / .csv file here,
paste with Ctrl/Cmd+V, or choose a local file:
Chinese translation (简体中文)
Waiting for runPrepare Opus-MT EN→ZH above to translate English to Simplified Chinese locally in CPU WebAssembly.
3 · Sentence Alignment & SentencePiece Subword Fertility
MarianMT caps each sequence at 512 tokens. Segmenting English sentences cleanly (preserving
Dr., e.g., and decimals) exposes per-clause Hanzi translation, CJK punctuation
density, and English SentencePiece subword fertility.
| # | English segment | Simplified Chinese translation | Tokens (in→out) | Latency |
|---|---|---|---|---|
| Run a translation above to inspect sentence-by-sentence alignment. | ||||
Real SentencePiece Subwords (MarianTokenizer · 65,001 vocab)
Run a translation to inspect real MarianTokenizer SentencePiece subwords.
4 · At a Glance, Show the Code & Use-Case Ladder
| Upstream model | Helsinki-NLP/opus-mt-en-zh (Tatoeba-test.eng.zho: BLEU 31.4 · chr-F 0.268) |
|---|---|
| Browser ONNX repo | Xenova/opus-mt-en-zh (encoder_model_quantized.onnx 52.90 MB + decoder_model_merged_quantized.onnx 60.21 MB = 113.11 MB q8) |
| Pipeline task & runtime | translation · @huggingface/transformers@3.7.5 (shared pin in lib/webai.js) · CPU WASM |
| Architecture | MarianMTModel (6 encoder + 6 decoder layers, d_model=512, 8 heads, ffn=2048, swish, max_length=512, vocab_size=65001) |
| Special tokens | pad=<pad> (65000, also decoder_start_token_id), eos=</s> (0), unk=<unk> · inline script tags >>cmn_Hans<< (5) / >>cmn_Hant<< (21) |
| License | Apache-2.0 (University of Helsinki Language Technology Research Group) |
Show the code — Real Transformers.js MarianMT inference & streaming
Show the code — English sentence segmentation for 512-token safety
Benchmark Beam 1 vs 2 vs 4 and probe Hanzi measure words (量词), aspect particles (了/过), and 您 vs 你 register.
Practical · .SRT, CSV & TXT LocalizerBatch-translate English subtitles, UI localization CSVs, or .txt docs off-thread with formula-safe CSV & i18n JSON export.
Wild · Compaction, Loanwords & Idioms LabMeasure EN→ZH UI compaction, acronym retention, English idioms, voice ambiguity, numbers, negation, and paragraph splits.
Multi-Model · EN→ZH→EN Round-Trip AuditorChain Opus-MT EN→ZH (113.11 MB) into Opus-MT ZH→EN (113.11 MB) to audit back-translation drift and key-term recall.