translation · Arabic RTL→English MarianMT · q8 · WASM · 110.88 MB · Apache-2.0
Opus-MT Arabic → English
University of Helsinki's OPUS-MT AR→EN
(Helsinki-NLP/opus-mt-ar-en,
quantized to 110.88 MB INT8 ONNX in
Xenova/opus-mt-ar-en)
is a dedicated 6+6 MarianMT encoder-decoder for right-to-left Arabic script, vocalization diacritics
(tashkeel / harakat), Eastern Arabic numerals (٠١٢٣٤٥٦٧٨٩), and mixed Bidi text —
running 100% locally in CPU WebAssembly with zero cloud APIs.
1 · On-device model (110.88 MB q8 WASM · encoder 51.79 MB + decoder 59.09 MB)
2 · Live Arabic RTL → English Neural Translator
Select an Arabic RTL preset, type or paste right-to-left Arabic, or drop/upload a
.txt, .md, .srt, or .csv file anywhere below.
.txt, .md, .srt, or .csv file here, paste via
Ctrl/Cmd+V, or choose a local file:
English translation
Waiting for runPrepare Opus-MT AR→EN above to translate Arabic RTL prose locally in CPU WebAssembly.
3 · Sentence Alignment, Script Inspector & MarianTokenizer Subwords
Arabic verbs, attached prepositions (بـ / لـ / كـ), definite article الـ, and
optional tashkeel diacritics split into SentencePiece subwords inside the 62,834-token vocabulary.
| # | Arabic RTL segment | English translation | Tokens (in→out) | Latency |
|---|---|---|---|---|
| Run a translation above to inspect sentence-by-sentence alignment. | ||||
Real SentencePiece Subword Pieces (MarianTokenizer · 62,834 vocab)
Run a translation to inspect real MarianTokenizer subwords and root/affix fertility.
Waiting for first on-device run.
4 · At a Glance, Show the Code & Use-Case Ladder
| Upstream model | Helsinki-NLP/opus-mt-ar-en (Tatoeba ar→en: BLEU 49.4 · chr-F 0.661) |
|---|---|
| Browser ONNX repo | Xenova/opus-mt-ar-en (encoder_model_quantized.onnx 51.79 MB + decoder_model_merged_quantized.onnx 59.09 MB = 110.88 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=62834) |
| Special tokens | pad=<pad> (62833, also decoder_start_token_id), eos=</s> (0), unk=<unk> · pair baked into weights |
| License | Apache-2.0 (University of Helsinki Language Technology Research Group) |
Show the code — Real Transformers.js MarianMT inference, streaming & NaN check
Show the code — Arabic RTL sentence segmentation for 512-token safety
Compare Beam 1 vs Beam 2 vs Beam 4 side-by-side and measure real SentencePiece token inflation from vocalized tashkeel.
Practical · .SRT, CSV & TXT Batch LocalizerBatch-translate Arabic subtitles, product/ticket CSVs, or prose documents off-thread with Cancel & safe exports.
Wild · Tashkeel, Numerals, Hamza & Dialect LabStress-test MSA vs Gulf/Egyptian/Levantine, Eastern vs Western digits, missing Alef hamzas, and RTL+LTR Bidi code.
Multi-Model · Arabic Ticket → DeBERTa-v3 NLI TriageChain Opus-MT AR→EN (110.88 MB) + DeBERTa-v3 Zero-Shot NLI (87.25 MB) to translate & route RTL tickets offline.