translation · English→Spanish MarianMT · q8 · WASM · 113.11 MB · Apache-2.0
Opus-MT English → Spanish
University of Helsinki's OPUS-MT EN→ES
(Helsinki-NLP/opus-mt-en-es,
quantized to 113.11 MB INT8 ONNX in
Xenova/opus-mt-en-es)
is a dedicated 6+6 MarianMT encoder-decoder neural translator converting English into Spanish with
grammatical gender agreement, subjunctive mood, and Spanish diacritics (á é í ó ú ü ñ ¿ ¡)
— running 100% locally in CPU WebAssembly with zero cloud APIs.
1 · On-device model (113.11 MB q8 WASM · encoder 52.90 MB + decoder 60.21 MB)
2 · Live English → Spanish MarianMT Studio
Pick one of 5 domain presets, type or paste English text, or drop/upload a
.txt, .md, .srt, or .csv file below.
.txt, .md, .srt, or .csv file anywhere here,
paste via Ctrl/Cmd+V, or choose a local file:
Spanish translation (Español)
Waiting for runPrepare Opus-MT EN→ES above to translate English prose into Spanish locally in CPU WebAssembly.
3 · Sentence Alignment, Spanish Output Inspector & SentencePiece Subwords
Inspect sentence-by-sentence English→Spanish alignment, Spanish diacritic & inverted punctuation counts
(áéíóúüñ ¿¡), and real MarianTokenizer subwords inside the 65,001-token vocabulary.
| # | English segment | Spanish translation | Tokens (in→out) | Latency |
|---|---|---|---|---|
| Run a translation above to inspect sentence-by-sentence alignment. | ||||
Real SentencePiece Subword Pieces (MarianTokenizer · 65,001 vocab)
Run a translation to inspect real MarianTokenizer subwords and fertility.
Waiting for first on-device run.
4 · At a Glance, Show the Code & Use-Case Ladder
| Upstream model | Helsinki-NLP/opus-mt-en-es (Tatoeba eng→spa: BLEU 54.9 · chr-F 0.721) |
|---|---|
| Browser ONNX repo | Xenova/opus-mt-en-es (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> · eng→spa 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 — English sentence segmentation for 512-token safety
Compare Beam 1 vs 2 vs 4 live and test how context steers formal usted vs informal tú and Spanish gender agreement.
Practical · .SRT, CSV & TXT Batch TranslatorBatch-translate English subtitles, UI localization CSVs, or docs off-thread with Cancel, i18n JSON & formula-safe exports.
Wild · Spanglish, Idioms & UI Expansion LabProbe 6 edge cases: EN/ES code-switching, phrasal verbs, regional terms, singular 'they', acronyms, and UI expansion %.
Multi-Model · EN→ES + MiniLM Semantic FidelityChain Opus-MT EN→ES (113.11 MB) + Multilingual MiniLM-L12-v2 (118 MB) to score real cross-lingual cosine fidelity.