translation · 113.11 MB WASM q8 · Spanish → English · MarianMT · Apache-2.0

OPUS-MT ES→EN — On-Device Spanish → English Neural Translator

Helsinki-NLP/opus-mt-es-en (ONNX export Xenova/opus-mt-es-en, Apache-2.0) is a dedicated 6+6-layer MarianMT encoder-decoder (52.90 MB encoder + 60.21 MB merged KV-cached decoder = 113.11 MB q8) trained only for Spanish → English — it restores the subjects Spanish drops, unpacks enclitic verbs like dímelo, and keeps ¿ ¡ ñ and accents intact, entirely inside a local Web Worker.

Loaded ONNX ID Xenova/opus-mt-es-en
Upstream Card Helsinki-NLP/opus-mt-es-en
Pipeline Task translation
Weights & Quant 113.11 MB · WASM q8
Architecture 6+6 MarianMT · 65,001 SP
License Apache-2.0

1. Live Spanish → English Neural Translator

Private bilingual engine: Loads encoder_model_quantized.onnx (52.90 MB) + decoder_model_merged_quantized.onnx (60.21 MB) via shared Transformers.js 3.7.5 inside a dedicated Web Worker. No Spanish text or uploaded file leaves your browser.

Pick a curated Spanish register preset, type your own Spanish text, or upload a local .txt / .srt / .md document:

Adjust beam width (1 = fast greedy, 2–4 = beam search) or max tokens, then press Translate to English (or Ctrl/⌘ + Enter).
Latency–
Decode speed–
In / Out tokens–
Beam width1 (greedy)
NaN check–
Backend / dtypeWASM · q8

Spanish Input

Select a preset or enter Spanish text above.

English Translation (Live MarianMT)

Download or initialise OPUS-MT ES→EN above to translate locally.

2. Sentence-by-Sentence Alignment (¿ ¡ & Abbreviation Aware)

When Sentence alignment is enabled, Spanish paragraphs are split by splitSpanishSentences(): a ? or ! only closes a sentence once its inverted ¿ / ¡ opener is matched, and abbreviations like Sr., Sra., Dr., p. ej. and EE.UU. never split. Each sentence is translated separately with its own token counts, fertility, and measured latency.

Sentence-by-sentence Spanish to English alignment with token counts, fertility and latency
# Spanish Source Sentence English Translation Tokens (In → Out) Fertility Latency
Run a translation above to inspect sentence alignment.

3. Word-Level Subword Fertility & SentencePiece Pills

OPUS-MT ES→EN uses a shared 65,001-piece SentencePiece model. Each Spanish word below shows its live split and piece count — clitic-laden verbs (córtalas, añádelos) and rare words cost more pieces than common function words. This is the tokenizer's real segmentation of your input, not an attention alignment.

1 piece (whole word in vocabulary) 2 pieces 3+ pieces (high fertility)

Fertility ratio (pieces per Spanish word) will appear after translation.

Translate above to inspect per-word fertility.

Raw SentencePiece pieces

Word start (▁) Continuation piece (+) Special token (</s>)
Translate above to inspect SentencePiece tokenization.

4. Inside MarianMT ES→EN & Source Code

Trained by the Language Technology Research Group at the University of Helsinki (Helsinki-NLP/opus-mt-es-en, Apache-2.0) on OPUS Spanish–English parallel corpora and converted to quantized ONNX by Xenova (Xenova/opus-mt-es-en).

Show the code — worker.js runSingleTranslation() (MarianMT WASM q8 pipeline call)
Show the code — opus-es-core.mjs splitSpanishSentences() (¿ ¡ pairing & abbreviation-aware splitter)
Show the code — opus-es-core.mjs groupPiecesByWord() (per-word subword fertility)