mt-dspec-legislation-en-cy
A language translation model for translating between English and Welsh, specialised to the specific domain of Legislation.
This model was trained using custom DVC pipeline employing Marian NMT, the datasets prepared were generated from the following sources:
The data was split into train, validation and test sets; the test set containing legislation-specific segments were selected randomly from TMX files originating from the Cofion Techiaith Cymru website, which have been pre-classified as pertaining to the specific domain, and data files scraped from the UK Government Legislation website.
Having extracted the test set, the aggregation of remaining data was then split into 10 training and validation sets, and fed into 10 marian training sessions.
Evaluation
Evaluation scores were produced using the python libraries SacreBLEU and torchmetrics.
Usage
Ensure you have the prerequisite python libraries installed:
# The constraint imposed on the transformers version below
# is due to the following issue:
# https://github.com/huggingface/transformers/issues/26271
pip install sentencepiece "transformers>4.26.1<=4.30.2"
import trnasformers
model_id = "techiaith/mt-spec-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)
translated = translate(
"The Curriculum and Assessment (Wales) Act 2021 (the Act) "
"established the Curriculum for Wales and replaced the general "
"curriculum used up until that point."
)
print(translated["translation_text"])
- Downloads last month
- 23
Collection including techiaith/mt-dspec-legislation-en-cy
Evaluation results
- bleu on variousself-reported65.510
- cer on variousself-reported0.280
- chrf on variousself-reported74.690
- wer on variousself-reported0.390
- wil on variousself-reported0.540
- wip on variousself-reported0.460