How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("translation", model="techiaith/mt-dspec-health-en-cy")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("techiaith/mt-dspec-health-en-cy")
model = AutoModelForSeq2SeqLM.from_pretrained("techiaith/mt-dspec-health-en-cy")
Quick Links

mt-dspec-health-en-cy

English-to-Welsh translation model specialised for the health and care domain, built using Marian NMT.

Installation

pip install sentencepiece transformers

Usage

import transformers

model_id = "techiaith/mt-dspec-health-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 patient has a headache.")
print(result[0]["translation_text"])
# Mae gan y claf gur pen.

Training Data

  • UK Government Legislation data
  • OPUS-cy-en corpus
  • Cofnod y Cynulliad (Welsh Assembly Records)
  • Cofion Techiaith Cymru

Evaluation

Metric Score
SacreBLEU 54.16
CER 0.31
WER 0.47
CHRF 69.03

Version History

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.

Links

License

Apache 2.0

Downloads last month
65
Safetensors
Model size
69.8M params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including techiaith/mt-dspec-health-en-cy