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.

Runs in browser · WASM translation 113.11 MB q8 ONNX Apache-2.0 MarianMT · 65,001 SentencePiece

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.

Curated English presets (Tech, E-Commerce, Privacy, Travel, Literature)
Drop an English .txt / .md / .srt / .csv file here, paste with Ctrl/Cmd+V, or choose a local file:
0 words

Chinese translation (简体中文)

Waiting for run
Prepare Opus-MT EN→ZH above and click Translate to run real on-device MarianMT inference.

Prepare Opus-MT EN→ZH above to translate English to Simplified Chinese locally in CPU WebAssembly.

Latency—
Throughput—
Src → Tgt tokens—
Hanzi · CJK punct—
Compaction ratio—
Subword fertility—
Backend · dtypeWASM · q8
NaN count—

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.

Sentence-by-sentence English to Simplified Chinese translation alignment
# 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)

Subword classes: —

Run a translation to inspect real MarianTokenizer SentencePiece subwords.

4 · At a Glance, Show the Code & Use-Case Ladder

Model card and runtime specifications for Helsinki-NLP/opus-mt-en-zh
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