Machine Translation Models
Collection
8 items • Updated
English-to-Welsh translation model specialised for the legislation domain, built using Marian NMT.
pip install sentencepiece transformers
import transformers
model_id = "techiaith/mt-dspec-legislation-en-cy"
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_id)
translate = transformers.pipeline("translation", model=model, tokenizer=tokenizer)
result = translate(
"The Curriculum and Assessment (Wales) Act 2021 established "
"the Curriculum for Wales."
)
print(result[0]["translation_text"])
# Sefydlodd Deddf Cwricwlwm ac Asesu (Cymru) 2021 y Cwricwlwm i Gymru.
| Metric | Score |
|---|---|
| SacreBLEU | 65.51 |
| CER | 0.28 |
| WER | 0.39 |
| CHRF | 74.69 |
2026-02-26: Re-converted with weight tying fix. The previous version required
transformers<=4.30.2 due to issue #26271.
This version works with all transformers versions.
Apache 2.0