pytorch m2m_100 text2text-generation ca de dataset:Softcatala/parallel-catalan-corpus/deu-cat transformers license:cc-by-4.0 model-index autotrain_compatible
---
license: cc-by-4.0
language:
- ca
- de
datasets:
- Softcatala/parallel-catalan-corpus/deu-cat
metrics:
- "bleu"
- "meteor"
- "chrf"
- "ter"
model-index:
- name: m2m100_418M_ft_de_ca
  results:
  - task:
      type: translation 
    dataset:
      type: flores
      name: Flores
    metrics:
      - name: BLEU
        type: bleu
        value: 28.5
  - task:
      type: translation 
    dataset:
      type: wmt/wmt13
      name: WMT13
    metrics:
      - name: BLEU
        type: bleu
        value: 22.9
  - task:
      type: translation 
    dataset:
      type: flores
      name: Flores
    metrics:
      - name: TER
        type: ter
        value: 60.7
  - task:
      type: translation 
    dataset:
      type: wmt/wmt13
      name: WMT13
    metrics:
      - name: TER
        type: ter
        value: 71.0
  - task:
      type: translation 
    dataset:
      type: flores
      name: Flores
    metrics:
      - name: METEOR
        type: meteor
        value: 55.9
  - task:
      type: translation 
    dataset:
      type: wmt/wmt13
      name: WMT13
    metrics:
      - name: METEOR
        type: meteor
        value: 49.5
  - task:
      type: translation 
    dataset:
      type: flores
      name: Flores
    metrics:
      - name: chrF
        type: chrf
        value: 55.9
  - task:
      type: translation 
    dataset:
      type: wmt/wmt13
      name: WMT13
    metrics:
      - name: chrF
        type: chrf
        value: 54.1
---
## m2m100 fine-tuned on Softcatalà's parallel Catalan-German dataset for machine translation

## Table of Contents
- [Model Description](#model-description)
- [Intended Uses and Limitations](#intended-use)
- [How to Use](#how-to-use)
- [Training](#training)
  - [Training Data](#training-data)
  - [Training Procedure](#training-procedure)
    - [Tokenization](#tokenization)
    - [Hyperparameters](#hyperparameters)
- [Evaluation](#evaluation)
   - [Variable and Metrics](#variable-and-metrics)
   - [Evaluation Results](#evaluation-results)
- [Licensing Information](#licensing-information)
- [Citation Information](#citation-information)
- [Funding](#funding)

## Model description

This model was obtained by fine-tuning the [m2m100_418M](https://huggingface.co/facebook/m2m100_418M) model on a De-Ca machine translation task with the [Softcatalà Catalan-German parallel corpus](https://github.com/Softcatala/parallel-catalan-corpus/tree/master/deu-cat) dataset, with sentences deduplicated and filtered by the [GEnCaTa quality filter](https://huggingface.co/projecte-aina/mbert-base-gencata). We also evaluate it on a general-domain multilingual testset [Flores-200](https://github.com/facebookresearch/flores) and [WMT13](https://www.statmt.org/wmt13/).

## Intended Uses and Limitations

You can use this model for machine translation from German to Catalan.

## How to use

```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("projecte-aina/2m100-418M-ft-de-ca")

model = AutoModelForSeq2SeqLM.from_pretrained("projecte-aina/2m100-418M-ft-de-ca")
```

## Training

### Training Data

As a data for fine-tuning we used the [Softcatalà Catalan-German parallel corpus](https://github.com/Softcatala/parallel-catalan-corpus/tree/master/deu-cat) dataset, with sentences deduplicated and filtered by the [GEnCaTa quality filter](https://huggingface.co/projecte-aina/mbert-base-gencata).

### Training Procedure

#### Tokenization

The original [m2m100_418M](https://huggingface.co/facebook/m2m100_418M) model's sentencepiece tokenizer was used.

#### Hyperparameters

The model was trained for 2 epochs with the default parameters and \\(LR = 2\mathrm{e}{-5}\\).

## Evaluation

### Variable and Metrics

We use the BLEU score for evaluation on test sets: [Flores-200](https://github.com/facebookresearch/flores) and [WMT13](https://www.statmt.org/wmt13/).

### Evaluation Results

Below are the evaluation results on the machine translation from German to Catalan compared with the original m2m100 on a testset: [Flores-200](https://github.com/facebookresearch/flores).

|Test set  | Model  | BLEU  | TER | METEOR | chrF
| ------------|-------------| -----| -----| -----| -----|
|Flores-200 | m2m100  | 26.6 | 63.1 | 54.0 | 53.5 |
| | m2m100-418M-ft-de-ca  |  **28.5**  |  **60.7** | **55.9** | **55.9** |
|WMT13 | m2m100  | 21.8 | 72.8 | 48.0 | 53.5 |
| | m2m100-418M-ft-de-ca  |  **22.9**  |  **71.0** | **49.5** | **54.1** |

## Licensing Information

[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)

## Funding

This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
