Downloads · 30 days
51
12% of all-time downloads
HPLT/translate-ca-en-v1.0-hplt
translate-ca-en-v1.0-hplt is a translation model from HPLT. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as cc-by-4.0.
This repository contains the translation model for Catalan-English trained with HPLT data only. The model is available in both Marian and Hugging Face formats.
Downloads · 30 days
51
12% of all-time downloads
All-time downloads
435
Public
Repo size
748 MB
Likes
0
Public
Click a slice to open those files.
.npz308 MB · 58%
From the Hugging Face model README
This repository contains the translation model for Catalan-English trained with HPLT data only. The model is available in both Marian and Hugging Face formats.
You can check out our deliverable report, GitHub repository, and website for more details.
Note that for quality considerations, we recommend using HPLT/translate-ca-en-v1.0-hplt_opus instead of this model.
The model has been trained with MarianNMT and the weights are in the Marian format. We have also converted the model into the Hugging Face format so it is compatible with transformers.
To run inference with MarianNMT, refer to the Inference/Decoding/Translation section of our GitHub repository. You will need the model file model.npz.best-chrf.npz and the vocabulary file model.ca-en.spm from this repository.
We have also converted this model to the Hugging Face format and you can get started with the script below. Note that due a known issue in weight conversion, the checkpoint cannot work with transformer versions <4.26 or >4.30. We tested and suggest pip install transformers==4.28.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("HPLT/translate-ca-en-v1.0-hplt")
model = AutoModelForSeq2SeqLM.from_pretrained("HPLT/translate-ca-en-v1.0-hplt")
inputs = ["Input goes here.", "Make sure the language is right."]
batch_tokenized = tokenizer(inputs, return_tensors="pt", padding=True)
model_output = model.generate(
**batch_tokenized, num_beams=6, max_new_tokens=512
)
batch_detokenized = tokenizer.batch_decode(
model_output,
skip_special_tokens=True,
)
print(batch_detokenized)
When decoded using Marian, the model has the following test scores.
| Test set | BLEU | chrF++ | COMET22 |
|---|---|---|---|
| FLORES200 | 41.0 | 64.4 | 0.8676 |
| NTREX | 31.3 | 57.7 | 0.8398 |
This project has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No 101070350 and from UK Research and Innovation (UKRI) under the UK government's Horizon Europe funding guarantee [grant number 10052546]
Brought to you by researchers from the University of Edinburgh and Charles University in Prague with support from the whole HPLT consortium.