use case · basics · inside 6+6 MarianMT PL→EN · q8 WASM · 111.50 MB ONNX · Apache-2.0

Inside 6+6 MarianMT PL→EN: Diacritic Ablation, Beams & Fertility Lab

Compare Beam 1 (Greedy) vs Beam 2 vs Beam 4 decoding with live length_penalty and a max_length: 512 truncation guard, run live Polish diacritic ablation comparing proper ą ć ę ł ń ó ś ź ż orthography against ASCII-stripped transliteration, and inspect 63,430-piece SentencePiece token-to-word fertility.

1 · OPUS-MT PL→EN worker (111.50 MB q8 ONNX · auto-inits from cache)

2 · Live Beam 1 vs Beam 2 vs Beam 4 & Length Penalty Benchmark

Each beam width runs sequentially in the same WASM worker on your Polish sentence using the chosen length_penalty (0.5 favors compact outputs; 2.0 favors fuller English clauses) and max_length: 512 truncation guard. Highlighted tokens in Beam 2 and Beam 4 mark word-choice or case-reordering differences relative to Beam 1 (Greedy).

Select a Polish benchmark sentence

Prepare OPUS-MT PL→EN above to run live Beam 1 vs Beam 2 vs Beam 4 decoding.

Beam 1 (Greedy baseline)

—

Latency: — · Tokens: —

Beam 2 (diff vs Beam 1)

—

Latency: — · Overlap: —

Beam 4 (diff vs Beam 1)

—

Latency: — · Overlap: —

Measured Beam Search Latency & Throughput (CPU WASM)

Real SentencePiece Source Subwords (MarianTokenizer)

Run Beam comparison to inspect SentencePiece source subwords.

3 · Live Polish Diacritic Ablation (ą ć ę ł ń ó ś ź ż vs ASCII-Stripped)

Edit the proper Polish text or pick a minimal pair below — Variant B is automatically generated via stripPolishDiacritics() (or edited directly) so you can watch how missing diacritics change SentencePiece fertility and English meaning (sąd vs sad, łaska vs laska, kąt vs kat).

Polish Diacritic Ablation Minimal Pairs

Linguistic note: —

Select a minimal pair and click Run Diacritic Ablation Probe once the model is ready.

Variant A · Proper Polish Diacritics

—

Tokens: — · Fertility: — · Latency: —

Variant B · ASCII-Stripped Transliteration

—

Tokens: — · Fertility: — · Latency: —

4 · Live SentencePiece Polish Consonant-Cluster & Fertility Explorer (63,430 vocab)

Inspect how the 63,430-piece vocabulary segments dense Polish consonant clusters (Chrząszcz, Szczebrzeszynie), long derived nouns (współodpowiedzialność), and capitalized vs lowercase homographs (Łódź vs łódź).

Prepare OPUS-MT PL→EN above to tokenize and translate Polish words & clusters.

Polish word Kind · Morphology gloss Live SentencePiece pieces Live English ms
Click Tokenize & Translate Probes once the model is ready.
Show the code — Off-thread Beam 1 vs Beam 2 vs Beam 4 & length_penalty comparison
Show the code — Polish 9-diacritic ASCII transliteration helper

Model: Helsinki-NLP/opus-mt-pl-en → Xenova/opus-mt-pl-en (111.50 MB q8 ONNX, Apache-2.0).