w11wo commited on
Commit
2190b47
·
1 Parent(s): 100c57f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +152 -112
README.md CHANGED
@@ -1,139 +1,179 @@
1
  ---
2
- language:
3
- - zh-HK
4
  license: apache-2.0
5
  tags:
6
- - automatic-speech-recognition
7
- - common_voice
8
- - generated_from_trainer
9
  datasets:
10
- - common_voice
11
  model-index:
12
- - name: ''
13
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ---
15
 
16
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
17
- should probably proofread and complete it, then remove this comment. -->
18
 
19
- #
20
 
21
- This model is a fine-tuned version of [facebook/wav2vec2-xls-r-300m](https://huggingface.co/facebook/wav2vec2-xls-r-300m) on the COMMON_VOICE - ZH-HK dataset.
22
- It achieves the following results on the evaluation set:
23
- - Loss: 0.8089
24
- - Wer: 1.2499
25
- - Cer: 0.3173
26
 
27
- ## Model description
28
 
29
- More information needed
30
 
31
- ## Intended uses & limitations
32
 
33
- More information needed
 
 
34
 
35
- ## Training and evaluation data
36
 
37
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ## Training procedure
40
 
 
 
41
  ### Training hyperparameters
42
 
43
  The following hyperparameters were used during training:
44
- - learning_rate: 0.0001
45
- - train_batch_size: 8
46
- - eval_batch_size: 8
47
- - seed: 42
48
- - gradient_accumulation_steps: 4
49
- - total_train_batch_size: 32
50
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
51
- - lr_scheduler_type: linear
52
- - lr_scheduler_warmup_steps: 2000
53
- - num_epochs: 100.0
54
- - mixed_precision_training: Native AMP
 
55
 
56
  ### Training results
57
 
58
- | Training Loss | Epoch | Step | Validation Loss | Wer | Cer |
59
- |:-------------:|:-----:|:-----:|:---------------:|:------:|:------:|
60
- | 69.8341 | 1.34 | 500 | 80.0722 | 1.0 | 1.0 |
61
- | 6.6418 | 2.68 | 1000 | 6.6346 | 1.0 | 1.0 |
62
- | 6.2419 | 4.02 | 1500 | 6.2909 | 1.0 | 1.0 |
63
- | 6.0813 | 5.36 | 2000 | 6.1150 | 1.0 | 1.0 |
64
- | 5.9677 | 6.7 | 2500 | 6.0301 | 1.1386 | 1.0028 |
65
- | 5.9296 | 8.04 | 3000 | 5.8975 | 1.2113 | 1.0058 |
66
- | 5.6434 | 9.38 | 3500 | 5.5404 | 2.1624 | 1.0171 |
67
- | 5.1974 | 10.72 | 4000 | 4.5440 | 2.1702 | 0.9366 |
68
- | 4.3601 | 12.06 | 4500 | 3.3839 | 2.2464 | 0.8998 |
69
- | 3.9321 | 13.4 | 5000 | 2.8785 | 2.3097 | 0.8400 |
70
- | 3.6462 | 14.74 | 5500 | 2.5108 | 1.9623 | 0.6663 |
71
- | 3.5156 | 16.09 | 6000 | 2.2790 | 1.6479 | 0.5706 |
72
- | 3.32 | 17.43 | 6500 | 2.1450 | 1.8337 | 0.6244 |
73
- | 3.1918 | 18.77 | 7000 | 1.8536 | 1.9394 | 0.6017 |
74
- | 3.1139 | 20.11 | 7500 | 1.7205 | 1.9112 | 0.5638 |
75
- | 2.8995 | 21.45 | 8000 | 1.5478 | 1.0624 | 0.3250 |
76
- | 2.7572 | 22.79 | 8500 | 1.4068 | 1.1412 | 0.3367 |
77
- | 2.6881 | 24.13 | 9000 | 1.3312 | 2.0100 | 0.5683 |
78
- | 2.5993 | 25.47 | 9500 | 1.2553 | 2.0039 | 0.6450 |
79
- | 2.5304 | 26.81 | 10000 | 1.2422 | 2.0394 | 0.5789 |
80
- | 2.4352 | 28.15 | 10500 | 1.1582 | 1.9970 | 0.5507 |
81
- | 2.3795 | 29.49 | 11000 | 1.1160 | 1.8255 | 0.4844 |
82
- | 2.3287 | 30.83 | 11500 | 1.0775 | 1.4123 | 0.3780 |
83
- | 2.2622 | 32.17 | 12000 | 1.0704 | 1.7445 | 0.4894 |
84
- | 2.2225 | 33.51 | 12500 | 1.0272 | 1.7237 | 0.5058 |
85
- | 2.1843 | 34.85 | 13000 | 0.9756 | 1.8042 | 0.5028 |
86
- | 2.1 | 36.19 | 13500 | 0.9527 | 1.8909 | 0.6055 |
87
- | 2.0741 | 37.53 | 14000 | 0.9418 | 1.9026 | 0.5880 |
88
- | 2.0179 | 38.87 | 14500 | 0.9363 | 1.7977 | 0.5246 |
89
- | 2.0615 | 40.21 | 15000 | 0.9635 | 1.8112 | 0.5599 |
90
- | 1.9448 | 41.55 | 15500 | 0.9249 | 1.7250 | 0.4914 |
91
- | 1.8966 | 42.89 | 16000 | 0.9023 | 1.5829 | 0.4319 |
92
- | 1.8662 | 44.24 | 16500 | 0.9002 | 1.4833 | 0.4230 |
93
- | 1.8136 | 45.58 | 17000 | 0.9076 | 1.1828 | 0.2987 |
94
- | 1.7908 | 46.92 | 17500 | 0.8774 | 1.5773 | 0.4258 |
95
- | 1.7354 | 48.26 | 18000 | 0.8727 | 1.5037 | 0.4024 |
96
- | 1.6739 | 49.6 | 18500 | 0.8636 | 1.1239 | 0.2789 |
97
- | 1.6457 | 50.94 | 19000 | 0.8516 | 1.2269 | 0.3104 |
98
- | 1.5847 | 52.28 | 19500 | 0.8399 | 1.3309 | 0.3360 |
99
- | 1.5971 | 53.62 | 20000 | 0.8441 | 1.3153 | 0.3335 |
100
- | 1.602 | 54.96 | 20500 | 0.8590 | 1.2932 | 0.3433 |
101
- | 1.5063 | 56.3 | 21000 | 0.8334 | 1.1312 | 0.2875 |
102
- | 1.4631 | 57.64 | 21500 | 0.8474 | 1.1698 | 0.2999 |
103
- | 1.4997 | 58.98 | 22000 | 0.8638 | 1.4279 | 0.3854 |
104
- | 1.4301 | 60.32 | 22500 | 0.8550 | 1.2737 | 0.3300 |
105
- | 1.3798 | 61.66 | 23000 | 0.8266 | 1.1802 | 0.2934 |
106
- | 1.3454 | 63.0 | 23500 | 0.8235 | 1.3816 | 0.3711 |
107
- | 1.3678 | 64.34 | 24000 | 0.8550 | 1.6427 | 0.5035 |
108
- | 1.3761 | 65.68 | 24500 | 0.8510 | 1.6709 | 0.4907 |
109
- | 1.2668 | 67.02 | 25000 | 0.8515 | 1.5842 | 0.4505 |
110
- | 1.2835 | 68.36 | 25500 | 0.8283 | 1.5353 | 0.4221 |
111
- | 1.2961 | 69.7 | 26000 | 0.8339 | 1.5743 | 0.4369 |
112
- | 1.2656 | 71.05 | 26500 | 0.8331 | 1.5331 | 0.4217 |
113
- | 1.2556 | 72.39 | 27000 | 0.8242 | 1.4708 | 0.4109 |
114
- | 1.2043 | 73.73 | 27500 | 0.8245 | 1.4469 | 0.4031 |
115
- | 1.2722 | 75.07 | 28000 | 0.8202 | 1.4924 | 0.4096 |
116
- | 1.202 | 76.41 | 28500 | 0.8290 | 1.3807 | 0.3719 |
117
- | 1.1679 | 77.75 | 29000 | 0.8195 | 1.4097 | 0.3749 |
118
- | 1.1967 | 79.09 | 29500 | 0.8059 | 1.2074 | 0.3077 |
119
- | 1.1241 | 80.43 | 30000 | 0.8137 | 1.2451 | 0.3270 |
120
- | 1.1414 | 81.77 | 30500 | 0.8117 | 1.2031 | 0.3121 |
121
- | 1.132 | 83.11 | 31000 | 0.8234 | 1.4266 | 0.3901 |
122
- | 1.0982 | 84.45 | 31500 | 0.8064 | 1.3712 | 0.3607 |
123
- | 1.0797 | 85.79 | 32000 | 0.8167 | 1.3356 | 0.3562 |
124
- | 1.0119 | 87.13 | 32500 | 0.8215 | 1.2754 | 0.3268 |
125
- | 1.0216 | 88.47 | 33000 | 0.8163 | 1.2512 | 0.3184 |
126
- | 1.0375 | 89.81 | 33500 | 0.8137 | 1.2685 | 0.3290 |
127
- | 0.9794 | 91.15 | 34000 | 0.8220 | 1.2724 | 0.3255 |
128
- | 1.0207 | 92.49 | 34500 | 0.8165 | 1.2906 | 0.3361 |
129
- | 1.0169 | 93.83 | 35000 | 0.8153 | 1.2819 | 0.3305 |
130
- | 1.0127 | 95.17 | 35500 | 0.8187 | 1.2832 | 0.3252 |
131
- | 0.9978 | 96.51 | 36000 | 0.8111 | 1.2612 | 0.3210 |
132
- | 0.9923 | 97.85 | 36500 | 0.8076 | 1.2278 | 0.3122 |
133
- | 1.0451 | 99.2 | 37000 | 0.8086 | 1.2451 | 0.3156 |
134
-
135
-
136
- ### Framework versions
 
 
 
 
 
 
 
137
 
138
  - Transformers 4.17.0.dev0
139
  - Pytorch 1.10.2+cu102
 
1
  ---
2
+ language: zh-HK
 
3
  license: apache-2.0
4
  tags:
5
+ - automatic-speech-recognition
6
+ - generated_from_trainer
7
+ - robust-speech-event
8
  datasets:
9
+ - common_voice
10
  model-index:
11
+ - name: Wav2Vec2 XLS-R 300M Cantonese (zh-HK) LM
12
+ results:
13
+ - task:
14
+ name: Automatic Speech Recognition
15
+ type: automatic-speech-recognition
16
+ dataset:
17
+ name: Common Voice
18
+ type: common_voice
19
+ args: zh-HK
20
+ metrics:
21
+ - name: Test CER
22
+ type: cer
23
+ value: 12.14
24
+ - task:
25
+ name: Automatic Speech Recognition
26
+ type: automatic-speech-recognition
27
+ dataset:
28
+ name: Robust Speech Event - Dev Data
29
+ type: speech-recognition-community-v2/dev_data
30
+ args: zh-HK
31
+ metrics:
32
+ - name: Test CER
33
+ type: cer
34
+ value: 56.86
35
  ---
36
 
37
+ # Wav2Vec2 XLS-R 300M Cantonese (zh-HK) LM
 
38
 
39
+ Wav2Vec2 XLS-R 300M Cantonese (zh-HK) LM is an automatic speech recognition model based on the [XLS-R](https://arxiv.org/abs/2111.09296) architecture. This model is a fine-tuned version of [Wav2Vec2-XLS-R-300M](https://huggingface.co/facebook/wav2vec2-xls-r-300m) on the `zh-HK` subset of the [Common Voice](https://huggingface.co/datasets/common_voice) dataset. A 5-gram Language model, trained on multiple [PyCantonese](https://pycantonese.org/data.html) corpora, was then subsequently added to this model.
40
 
41
+ This model was trained using HuggingFace's PyTorch framework and is part of the [Robust Speech Challenge Event](https://discuss.huggingface.co/t/open-to-the-community-robust-speech-recognition-challenge/13614) organized by HuggingFace. All training was done on a Tesla V100, sponsored by OVH.
 
 
 
 
42
 
43
+ All necessary scripts used for training could be found in the [Files and versions](https://huggingface.co/w11wo/wav2vec2-xls-r-300m-zh-HK-lm-v2/tree/main) tab, as well as the [Training metrics](https://huggingface.co/w11wo/wav2vec2-xls-r-300m-zh-HK-lm-v2/tensorboard) logged via Tensorboard.
44
 
45
+ As for the N-gram language model training, we followed the [blog post tutorial](https://huggingface.co/blog/wav2vec2-with-ngram) provided by HuggingFace.
46
 
47
+ ## Model
48
 
49
+ | Model | #params | Arch. | Training/Validation data (text) |
50
+ | --------------------------------- | ------- | ----- | ------------------------------- |
51
+ | `wav2vec2-xls-r-300m-zh-HK-lm-v2` | 300M | XLS-R | `Common Voice zh-HK` Dataset |
52
 
53
+ ## Evaluation Results
54
 
55
+ The model achieves the following results on evaluation without a language model:
56
+
57
+ | Dataset | CER |
58
+ | -------------------------------- | ------ |
59
+ | `Common Voice` | 31.73% |
60
+ | `Robust Speech Event - Dev Data` | 56.60% |
61
+
62
+ With the addition of the language model, it achieves the following results:
63
+
64
+ | Dataset | CER |
65
+ | -------------------------------- | ------ |
66
+ | `Common Voice` | 12.14% |
67
+ | `Robust Speech Event - Dev Data` | 56.86% |
68
 
69
  ## Training procedure
70
 
71
+ The training process did not involve the addition of a language model. The following results were simply lifted from the original automatic speech recognition [model training](https://huggingface.co/w11wo/wav2vec2-xls-r-300m-korean).
72
+
73
  ### Training hyperparameters
74
 
75
  The following hyperparameters were used during training:
76
+
77
+ - `learning_rate`: 0.0001
78
+ - `train_batch_size`: 8
79
+ - `eval_batch_size`: 8
80
+ - `seed`: 42
81
+ - `gradient_accumulation_steps`: 4
82
+ - `total_train_batch_size`: 32
83
+ - `optimizer`: Adam with `betas=(0.9, 0.999)` and `epsilon=1e-08`
84
+ - `lr_scheduler_type`: linear
85
+ - `lr_scheduler_warmup_steps`: 2000
86
+ - `num_epochs`: 100.0
87
+ - `mixed_precision_training`: Native AMP
88
 
89
  ### Training results
90
 
91
+ | Training Loss | Epoch | Step | Validation Loss | Wer | Cer |
92
+ | :-----------: | :---: | :---: | :-------------: | :----: | :----: |
93
+ | 69.8341 | 1.34 | 500 | 80.0722 | 1.0 | 1.0 |
94
+ | 6.6418 | 2.68 | 1000 | 6.6346 | 1.0 | 1.0 |
95
+ | 6.2419 | 4.02 | 1500 | 6.2909 | 1.0 | 1.0 |
96
+ | 6.0813 | 5.36 | 2000 | 6.1150 | 1.0 | 1.0 |
97
+ | 5.9677 | 6.7 | 2500 | 6.0301 | 1.1386 | 1.0028 |
98
+ | 5.9296 | 8.04 | 3000 | 5.8975 | 1.2113 | 1.0058 |
99
+ | 5.6434 | 9.38 | 3500 | 5.5404 | 2.1624 | 1.0171 |
100
+ | 5.1974 | 10.72 | 4000 | 4.5440 | 2.1702 | 0.9366 |
101
+ | 4.3601 | 12.06 | 4500 | 3.3839 | 2.2464 | 0.8998 |
102
+ | 3.9321 | 13.4 | 5000 | 2.8785 | 2.3097 | 0.8400 |
103
+ | 3.6462 | 14.74 | 5500 | 2.5108 | 1.9623 | 0.6663 |
104
+ | 3.5156 | 16.09 | 6000 | 2.2790 | 1.6479 | 0.5706 |
105
+ | 3.32 | 17.43 | 6500 | 2.1450 | 1.8337 | 0.6244 |
106
+ | 3.1918 | 18.77 | 7000 | 1.8536 | 1.9394 | 0.6017 |
107
+ | 3.1139 | 20.11 | 7500 | 1.7205 | 1.9112 | 0.5638 |
108
+ | 2.8995 | 21.45 | 8000 | 1.5478 | 1.0624 | 0.3250 |
109
+ | 2.7572 | 22.79 | 8500 | 1.4068 | 1.1412 | 0.3367 |
110
+ | 2.6881 | 24.13 | 9000 | 1.3312 | 2.0100 | 0.5683 |
111
+ | 2.5993 | 25.47 | 9500 | 1.2553 | 2.0039 | 0.6450 |
112
+ | 2.5304 | 26.81 | 10000 | 1.2422 | 2.0394 | 0.5789 |
113
+ | 2.4352 | 28.15 | 10500 | 1.1582 | 1.9970 | 0.5507 |
114
+ | 2.3795 | 29.49 | 11000 | 1.1160 | 1.8255 | 0.4844 |
115
+ | 2.3287 | 30.83 | 11500 | 1.0775 | 1.4123 | 0.3780 |
116
+ | 2.2622 | 32.17 | 12000 | 1.0704 | 1.7445 | 0.4894 |
117
+ | 2.2225 | 33.51 | 12500 | 1.0272 | 1.7237 | 0.5058 |
118
+ | 2.1843 | 34.85 | 13000 | 0.9756 | 1.8042 | 0.5028 |
119
+ | 2.1 | 36.19 | 13500 | 0.9527 | 1.8909 | 0.6055 |
120
+ | 2.0741 | 37.53 | 14000 | 0.9418 | 1.9026 | 0.5880 |
121
+ | 2.0179 | 38.87 | 14500 | 0.9363 | 1.7977 | 0.5246 |
122
+ | 2.0615 | 40.21 | 15000 | 0.9635 | 1.8112 | 0.5599 |
123
+ | 1.9448 | 41.55 | 15500 | 0.9249 | 1.7250 | 0.4914 |
124
+ | 1.8966 | 42.89 | 16000 | 0.9023 | 1.5829 | 0.4319 |
125
+ | 1.8662 | 44.24 | 16500 | 0.9002 | 1.4833 | 0.4230 |
126
+ | 1.8136 | 45.58 | 17000 | 0.9076 | 1.1828 | 0.2987 |
127
+ | 1.7908 | 46.92 | 17500 | 0.8774 | 1.5773 | 0.4258 |
128
+ | 1.7354 | 48.26 | 18000 | 0.8727 | 1.5037 | 0.4024 |
129
+ | 1.6739 | 49.6 | 18500 | 0.8636 | 1.1239 | 0.2789 |
130
+ | 1.6457 | 50.94 | 19000 | 0.8516 | 1.2269 | 0.3104 |
131
+ | 1.5847 | 52.28 | 19500 | 0.8399 | 1.3309 | 0.3360 |
132
+ | 1.5971 | 53.62 | 20000 | 0.8441 | 1.3153 | 0.3335 |
133
+ | 1.602 | 54.96 | 20500 | 0.8590 | 1.2932 | 0.3433 |
134
+ | 1.5063 | 56.3 | 21000 | 0.8334 | 1.1312 | 0.2875 |
135
+ | 1.4631 | 57.64 | 21500 | 0.8474 | 1.1698 | 0.2999 |
136
+ | 1.4997 | 58.98 | 22000 | 0.8638 | 1.4279 | 0.3854 |
137
+ | 1.4301 | 60.32 | 22500 | 0.8550 | 1.2737 | 0.3300 |
138
+ | 1.3798 | 61.66 | 23000 | 0.8266 | 1.1802 | 0.2934 |
139
+ | 1.3454 | 63.0 | 23500 | 0.8235 | 1.3816 | 0.3711 |
140
+ | 1.3678 | 64.34 | 24000 | 0.8550 | 1.6427 | 0.5035 |
141
+ | 1.3761 | 65.68 | 24500 | 0.8510 | 1.6709 | 0.4907 |
142
+ | 1.2668 | 67.02 | 25000 | 0.8515 | 1.5842 | 0.4505 |
143
+ | 1.2835 | 68.36 | 25500 | 0.8283 | 1.5353 | 0.4221 |
144
+ | 1.2961 | 69.7 | 26000 | 0.8339 | 1.5743 | 0.4369 |
145
+ | 1.2656 | 71.05 | 26500 | 0.8331 | 1.5331 | 0.4217 |
146
+ | 1.2556 | 72.39 | 27000 | 0.8242 | 1.4708 | 0.4109 |
147
+ | 1.2043 | 73.73 | 27500 | 0.8245 | 1.4469 | 0.4031 |
148
+ | 1.2722 | 75.07 | 28000 | 0.8202 | 1.4924 | 0.4096 |
149
+ | 1.202 | 76.41 | 28500 | 0.8290 | 1.3807 | 0.3719 |
150
+ | 1.1679 | 77.75 | 29000 | 0.8195 | 1.4097 | 0.3749 |
151
+ | 1.1967 | 79.09 | 29500 | 0.8059 | 1.2074 | 0.3077 |
152
+ | 1.1241 | 80.43 | 30000 | 0.8137 | 1.2451 | 0.3270 |
153
+ | 1.1414 | 81.77 | 30500 | 0.8117 | 1.2031 | 0.3121 |
154
+ | 1.132 | 83.11 | 31000 | 0.8234 | 1.4266 | 0.3901 |
155
+ | 1.0982 | 84.45 | 31500 | 0.8064 | 1.3712 | 0.3607 |
156
+ | 1.0797 | 85.79 | 32000 | 0.8167 | 1.3356 | 0.3562 |
157
+ | 1.0119 | 87.13 | 32500 | 0.8215 | 1.2754 | 0.3268 |
158
+ | 1.0216 | 88.47 | 33000 | 0.8163 | 1.2512 | 0.3184 |
159
+ | 1.0375 | 89.81 | 33500 | 0.8137 | 1.2685 | 0.3290 |
160
+ | 0.9794 | 91.15 | 34000 | 0.8220 | 1.2724 | 0.3255 |
161
+ | 1.0207 | 92.49 | 34500 | 0.8165 | 1.2906 | 0.3361 |
162
+ | 1.0169 | 93.83 | 35000 | 0.8153 | 1.2819 | 0.3305 |
163
+ | 1.0127 | 95.17 | 35500 | 0.8187 | 1.2832 | 0.3252 |
164
+ | 0.9978 | 96.51 | 36000 | 0.8111 | 1.2612 | 0.3210 |
165
+ | 0.9923 | 97.85 | 36500 | 0.8076 | 1.2278 | 0.3122 |
166
+ | 1.0451 | 99.2 | 37000 | 0.8086 | 1.2451 | 0.3156 |
167
+
168
+ ## Disclaimer
169
+
170
+ Do consider the biases which came from pre-training datasets that may be carried over into the results of this model.
171
+
172
+ ## Authors
173
+
174
+ Wav2Vec2 XLS-R 300M Cantonese (zh-HK) LM was trained and evaluated by [Wilson Wongso](https://w11wo.github.io/). All computation and development are done on OVH Cloud.
175
+
176
+ ## Framework versions
177
 
178
  - Transformers 4.17.0.dev0
179
  - Pytorch 1.10.2+cu102