Downloads · 30 days
13
57% of all-time downloads
projecte-aina/aina-translator-es-ca-legal
aina-translator-es-ca-legal is a machine learning model from projecte-aina. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for fairseq. The card lists the license as apache-2.0.
<details <summaryClick to expand</summary
Downloads · 30 days
13
57% of all-time downloads
All-time downloads
23
Public
Repo size
1.9 GB
Likes
0
Public
Click a slice to open those files.
.bin1.9 GB · 100%
From the Hugging Face model README
aina-translator-es-ca-legal is a bilingual MT model specialized in the translation of texts from the legal domain. The base model from which it is derived is aina-translator-es-ca.
The model is intended to be used for the translation of legal, juridical and forensic Spanish texts into Catalan.
Required libraries:
pip install ctranslate2 pyonmttok
Translate a sentence using python
import ctranslate2
import pyonmttok
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="projecte-aina/aina-translator-es-ca-legal", revision="main")
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/spm.model")
tokenized=tokenizer.tokenize("¡Este es el traductor automático de textos legales del proyecto Aina!")
translator = ctranslate2.Translator(model_dir)
translated = translator.translate_batch([tokenized[0]])
print(tokenizer.detokenize(translated[0][0]['tokens']))
At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are well aware that our models may be biased. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
This model is a fine-tuned version of the base model aina-translator-es-ca. Detailed information about the pre-training can be found in the model card of the latter. The fine-tuned model was trained for a further 34 epochs on a domain-specific dataset.
Information about the pre-training data con be found in the model card of aina-translator-es-ca. The fine-tuning corpus consists of 6.8M es-ca parallel sentences. This corpus was built from legal, juridical and forensic texts provided by various representatives of the Generalitat de Catalunya. The corpus may contain synthetically generated text on the target side (in this case, Catalan). The data was partially extracted from pdf and docx documents, semi-manually cleaned, filtered and aligned to obtain the final corpus.
We use the BLEU score for evaluation on various domain-specific testsets:
AAPP Corpus of texts from the Public Administrations of Catalonia
CAJG - Corpus of resolutions of the Comissió d'Assistència Jurídica Gratuïta de Catalunya (CAJG): Internal, domain-specific evaluation set, specifically created for evaluation purposes.
Actas2020 - Corpus of proceedings of the Sala de Govern of the Tribunal Superior de Justicia de Catalunya: Internal, domain-specific evaluation set, specifically created for evaluation purposes.
Below are the evaluation results expressed in BLEU for machine translation from Catalan to Spanish compared to Google Translate and our generalist model aina-translator-es-ca:
| Test set | Google Translate | aina-translator-es-ca | aina-translator-es-ca-legal |
|---|---|---|---|
| AAPP | 76,9 | 79,5 | 79,8 |
| CAJG | 60,7 | 63,7 | 62,9 |
| Actas2020 | 58,7 | 52,0 | 66,6 |
| Average | 65,4 | 65,1 | 69,8 |
The Language Technologies Unit from Barcelona Supercomputing Center.
For further information, please send an email to [email protected].
Copyright(c) 2024 by Language Technologies Unit, Barcelona Supercomputing Center.
This work/research has been promoted and financed by the Government of Catalonia through the Aina project.
The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.
Be aware that the model may have biases and/or any other undesirable distortions.
When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
In no event shall the owner and creator of the model (Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties.
</details>