translation · English→Arabic RTL MarianMT · q8 · WASM · 117.60 MB · Apache-2.0

Opus-MT English → Arabic

University of Helsinki's OPUS-MT EN→AR (Helsinki-NLP/opus-mt-en-ar, quantized to 117.60 MB first-visit q8 ONNX in Xenova/opus-mt-en-ar) is a 6+6 MarianMT encoder-decoder translating English prose into right-to-left Arabic script (dir="rtl" lang="ar") using sentence-initial target control tokens (>>ara<< #4) — running 100% locally in CPU WebAssembly.

Runs in browser · WASM translation 117.60 MB q8 ONNX Apache-2.0 MarianMT · 62,802 SentencePiece

1 · On-device model (117.60 MB q8 WASM · encoder 51.77 MB + decoder 59.08 MB + tokenizer 6.75 MB)

2 · Live English → Arabic RTL Neural Translator

Select an English preset, type or paste English (or mixed bidi text), or drop/upload a .txt, .md, .srt, or .csv file anywhere below.

Curated English → Arabic presets (Browser AI, Travel, Bidi Release, Product & Civic)
Drop a .txt, .md, .srt, or .csv file here, paste via Ctrl/Cmd+V, or choose a local file:
0 chars

Arabic RTL Translation (العربية)

Waiting for run
حضّر نموذج Opus-MT EN→AR أعلاه ثم اضغط ترجمة لتشغيل الاستدلال محلياً داخل المتصفح.

Prepare Opus-MT EN→AR above to translate English text into RTL Arabic locally in CPU WebAssembly.

Latency—
Throughput—
Src → Tgt tokens—
Source fertility—
Output script—
Backend · dtypeWASM · q8
NaN count—

3 · See Inside: Sentence Alignment, Arabic Script Breakdown & MarianTokenizer Subwords

Inspect the prepended target control token (>>ara<< #4), English SentencePiece subwords from the 62,802-token vocabulary, and generated Arabic script density (letters, hamza/ة, digits, and bidi Latin tokens).

Arabic letters0
Alef hamza / ة0 / 0
Tashkeel marks0
Western / Eastern digits0 / 0
Bidi Latin chars0
Sentence-by-sentence English to Arabic RTL translation alignment
# English segment Arabic RTL translation Tokens (in→out) Latency
Run a translation above to inspect sentence-by-sentence alignment.

Real SentencePiece Source Subwords (MarianTokenizer · 62,802 vocab)

Run a translation to inspect real MarianTokenizer control tags and SentencePiece subwords.

Waiting for first on-device run.

4 · At a Glance, Why It Matters, Code & Use-Case Ladder

Upstream model Helsinki-NLP/opus-mt-en-ar (Tatoeba eng-ara: BLEU 14.0 · chr-F 0.437)
Browser ONNX repo Xenova/opus-mt-en-ar (encoder_model_quantized.onnx 51.77 MB + decoder_model_merged_quantized.onnx 59.08 MB + tokenizer.json 6.75 MB + configs = 117.60 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=62802)
Special & control tokens pad=<pad> (62801, also decoder_start_token_id), eos=</s> (0), unk=<unk> (1), >>ara<< (4)
License Apache-2.0 (University of Helsinki Language Technology Research Group)

Why it matters: Teams shipping offline documentation portals, local i18n copy previews, or privacy-sensitive customer communications into Arabic can localize English text, .srt captions, and CSV tables entirely inside the visitor's browser with zero server round-trips.

Show the code — Real Transformers.js MarianMT EN→AR inference, >>ara<< prepending & NaN check
Show the code — Abbreviation-safe English sentence segmentation for 512-token safety