File size: 2,107 Bytes
4296ea1
 
 
 
 
 
 
 
 
 
ffec1ea
 
 
4296ea1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ffec1ea
 
 
 
 
 
4296ea1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ffec1ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
license: apache-2.0
base_model: Helsinki-NLP/opus-mt-en-zh
tags:
- generated_from_trainer
datasets:
- zetavg/coct-en-zh-tw-translations-twp-300k
model-index:
- name: en-zhtw
  results: []
language:
- en
- zh
---

# en-zhtw

English-to-Traditional Chinese sentence translator

This model is a fine-tuned version of [Helsinki-NLP/opus-mt-en-zh](https://huggingface.co/Helsinki-NLP/opus-mt-en-zh) on the [zetavg/coct-en-zh-tw-translations-twp-300k](https://huggingface.co/datasets/zetavg/coct-en-zh-tw-translations-twp-300k) dataset.

This is so it can output Traditional Chinese by default and make the translations more natural sounding.

## Model description

- input: English text only
- output: Traditional Chinese text translation

How to use:

```python
from transformers import pipeline

model_checkpoint = "agentlans/en-zhtw"
translator = pipeline("translation", model=model_checkpoint)

translator(
    [
        "Even if you spend a day in Windsor you'll notice that it's a very multicultural city, yet still retaining a small town feel.",
        "Its main waterfront park stretches about 5 km (3.1 mi), from the 1929 Ambassador suspension bridge past the contemporary Windsor Sculpture Park.",
    ]
)

# [{'translation_text': '儘管在風沙住了一天,都會發現這裡是個非常多樣化的城市,但還是保留了一個小鎮的感覺。'}, {'translation_text': '從 1929 年的大使吊橋到今天的風雕公園,總長約 5 公里。'}]
```

## Intended uses & limitations

- English to Traditional Chinese translation
- Single sentence
- Limitations: may hallucinate or omit information, doesn't understand context, can still sound awkward or strange (as the above example shows)

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3.0

### Framework versions

- Transformers 4.43.3
- Pytorch 2.3.0+cu121
- Datasets 2.20.0
- Tokenizers 0.19.1