Added model card
Browse files
README.md
CHANGED
@@ -2,22 +2,78 @@
|
|
2 |
language:
|
3 |
- en
|
4 |
- cy
|
5 |
-
license: apache-2.0
|
6 |
pipeline_tag: translation
|
7 |
tags:
|
8 |
- translation
|
9 |
- marian
|
10 |
metrics:
|
11 |
-
-
|
12 |
-
|
13 |
-
-
|
14 |
-
|
15 |
-
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
-
|
20 |
-
|
21 |
-
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
language:
|
3 |
- en
|
4 |
- cy
|
|
|
5 |
pipeline_tag: translation
|
6 |
tags:
|
7 |
- translation
|
8 |
- marian
|
9 |
metrics:
|
10 |
+
- bleu
|
11 |
+
- cer
|
12 |
+
- wer
|
13 |
+
- wil
|
14 |
+
- wip
|
15 |
+
- chrf
|
16 |
+
license: apache-2.0
|
17 |
+
model-index:
|
18 |
+
- name: "mt-dspec-health-en-cy"
|
19 |
+
results:
|
20 |
+
- task:
|
21 |
+
name: Translation
|
22 |
+
type: translation
|
23 |
+
metrics:
|
24 |
+
- name: SacreBLEU
|
25 |
+
type: bleu
|
26 |
+
value: 54.16
|
27 |
+
- name: CER
|
28 |
+
type: cer
|
29 |
+
value: 0.31
|
30 |
+
- name: WER
|
31 |
+
type: wer
|
32 |
+
value: 0.47
|
33 |
+
- name: WIL
|
34 |
+
type: wil
|
35 |
+
value: 0.67
|
36 |
+
- name: WIP
|
37 |
+
type: wip
|
38 |
+
value: 0.33
|
39 |
+
- name: SacreBLEU CHRF
|
40 |
+
type: chrf
|
41 |
+
value: 69.03
|
42 |
---
|
43 |
+
# mt-dspec-health-en-cy
|
44 |
+
A language translation model for translating between English and Welsh, specialised to the specific domain of Health and care.
|
45 |
+
|
46 |
+
This model was trained using custom DVC pipeline employing [Marian NMT](https://marian-nmt.github.io/),
|
47 |
+
the datasets prepared were generated from the following sources:
|
48 |
+
- [UK Government Legislation data](https://www.legislation.gov.uk)
|
49 |
+
- [OPUS-cy-en](https://opus.nlpl.eu/)
|
50 |
+
- [Cofnod Y Cynulliad](https://record.assembly.wales/)
|
51 |
+
- [Cofion Techiaith Cymru](https://cofion.techiaith.cymru)
|
52 |
+
|
53 |
+
The data was split into train, validation and tests sets, the test set containing health-specific segments from TMX files
|
54 |
+
selected at random from the [Cofion Techiaith Cymru](https://cofion.techiaith.cymru) website, which have been pre-classified as pertaining to the specific domain.
|
55 |
+
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.
|
56 |
+
|
57 |
+
A website demonstrating use of this model is available at http://cyfieithu.techiaith.cymru.
|
58 |
+
|
59 |
+
## Evaluation
|
60 |
+
|
61 |
+
Evaluation was done using the python libraries [SacreBLEU](https://github.com/mjpost/sacrebleu) and [torchmetrics](https://torchmetrics.readthedocs.io/en/stable/).
|
62 |
+
|
63 |
+
## Usage
|
64 |
+
|
65 |
+
Ensure you have the prerequisite python libraries installed:
|
66 |
+
|
67 |
+
```bash
|
68 |
+
pip install transformers sentencepiece
|
69 |
+
```
|
70 |
+
|
71 |
+
```python
|
72 |
+
import trnasformers
|
73 |
+
model_id = "techiaith/mt-spec-health-en-cy"
|
74 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
|
75 |
+
model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_id)
|
76 |
+
translate = transformers.pipeline("translation", model=model, tokenizer=tokenizer)
|
77 |
+
translated = translate("The doctor had many patients to attend to this morning.")
|
78 |
+
print(translated["translation_text"])
|
79 |
+
```
|