Cross-Lingual Semantic Fidelity Auditor: 1→5 Translate, Then Score Meaning
Stage 1 (Xenova/opus-mt-en-ROMANCE, 113.11 MB WASM q8,
Apache-2.0) fans out an English source into French, Spanish, Italian,
Portuguese, and Romanian. Stage 2
(Xenova/paraphrase-multilingual-MiniLM-L12-v2, 118 MB WASM q8,
Apache-2.0) embeds the original English and all five translations into one
shared 384-d cross-lingual space to measure real cos(EN, target) semantic fidelity
per language (~231.1 MB total, 100% on-device).
1. Two Independent On-Device Models (~231.1 MB Combined)
2. Configure Source, Target Languages & Audit Pipeline
Clear technical prose typically preserves high cross-lingual cosine fidelity (0.85+) across all 5 Romance targets.
Target languages:
Best preserved–
Lowest cos(EN, target)–
Mean Romance fidelity–
Stage 1 / Stage 2 ms–
NaN check–
3. Cross-Lingual Semantic Preservation Table
Every Romance output from Stage 1 is embedded alongside the original English sentence in the
same 384-d Multilingual MiniLM space. Higher cos(EN, target) means tighter
meaning preservation; idiomatic or literal drift shows up as a measurable drop.
Per-language Romance translations scored by cross-lingual MiniLM cosine similarity against English source
Language
Stage 1 Translation
cos(EN, target)
Fidelity Meter
Assessment
Stage 1 ms
Initialise both models above and run the pipeline to score cross-lingual fidelity.
4. Inspect Cross-Lingual Embedding & Cosine Code
Show the code — embed-worker.js scoreFidelity() 384-d mean-pooled cross-lingual embeddingsShow the code — romance-core.mjs cosineSimilarity() cross-lingual cos(EN, target)