aapot commited on
Commit
aea7479
1 Parent(s): ef897f0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -22
README.md CHANGED
@@ -32,43 +32,58 @@ model-index:
32
  value: 2.23
33
  ---
34
 
35
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
36
- should probably proofread and complete it, then remove this comment. -->
37
 
38
- # wav2vec2-xlsr-1b-finnish
 
39
 
40
- **Note**: there is a better V2 version of this model which has been fine-tuned longer with 16 hours of more data: [aapot/wav2vec2-xlsr-1b-finnish-v2](https://huggingface.co/aapot/wav2vec2-xlsr-1b-finnish-v2)
41
 
42
- **Note**: there is a language model version of this acoustic only model which achieves better test results thanks to the added language model: [aapot/wav2vec2-xlsr-1b-finnish-lm](https://huggingface.co/aapot/wav2vec2-xlsr-1b-finnish-lm)
43
-
44
- This acoustic model is a fine-tuned version of [facebook/wav2vec2-xls-r-1b](https://huggingface.co/facebook/wav2vec2-xls-r-1b) for Finnish ASR. The model has been fine-tuned with 259.57 hours of Finnish transcribed speech data.
45
- It achieves the following results on the Common Voice 7 test set together without language model:
46
- - Wer: 13.11
47
- - Cer: 2.23
48
 
49
  ## Model description
50
 
51
- TODO
 
 
 
 
52
 
53
  ## Intended uses & limitations
54
 
55
- TODO
 
 
 
 
 
 
56
 
57
- ## Training and evaluation data
 
 
 
 
58
 
59
  This model was fine-tuned with 259.57 hours of Finnish transcribed speech data from following datasets:
60
 
61
- | Dataset | Hours | % of total hours |
62
- |:------------------------------------------------------------------------------------------------------------------------------|:--------:|:----------------:|
63
- | [Common Voice 7.0 Finnish train+evaluation+other splits](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0) | 9.70 h | 3.74 % |
64
- | [Finnish parliament session 2](https://b2share.eudat.eu/records/4df422d631544ce682d6af1d4714b2d4) | 0.24 h | 0.09 % |
65
- | [VoxPopuli Finnish](https://github.com/facebookresearch/voxpopuli) | 5.94 h | 2.29 % |
66
- | [CSS10 Finnish](https://github.com/kyubyong/css10) | 10.32 h | 3.98 % |
67
- | [Aalto Finnish Parliament ASR Corpus](http://urn.fi/urn:nbn:fi:lb-2021051903) | 228.00 h | 87.84 % |
68
- | [Finnish Broadcast Corpus](http://urn.fi/urn:nbn:fi:lb-2016042502) | 5.37 h | 2.07 % |
 
 
69
 
70
  ## Training procedure
71
 
 
 
 
 
72
  ### Training hyperparameters
73
 
74
  The following hyperparameters were used during training:
@@ -82,6 +97,15 @@ The following hyperparameters were used during training:
82
  - num_epochs: 5
83
  - mixed_precision_training: Native AMP
84
 
 
 
 
 
 
 
 
 
 
85
  ### Training results
86
 
87
  | Training Loss | Epoch | Step | Validation Loss | Wer |
@@ -119,5 +143,30 @@ The following hyperparameters were used during training:
119
 
120
  - Transformers 4.17.0.dev0
121
  - Pytorch 1.10.2+cu102
122
- - Datasets 1.18.2.dev0
123
  - Tokenizers 0.11.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  value: 2.23
33
  ---
34
 
35
+ # Wav2Vec2 XLS-R for Finnish ASR
 
36
 
37
+ This acoustic model is a fine-tuned version of [facebook/wav2vec2-xls-r-1b](https://huggingface.co/facebook/wav2vec2-xls-r-1b) for Finnish ASR. The model has been fine-tuned with 259.57 hours of Finnish transcribed speech data. Wav2Vec2 XLS-R was introduced in
38
+ [this paper](https://arxiv.org/abs/2111.09296) and first released at [this page](https://github.com/pytorch/fairseq/tree/main/examples/wav2vec#wav2vec-20).
39
 
40
+ **Note**: there is a version with KenLM language model used in the decoding phase producing better transcriptions: [Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm](https://huggingface.co/Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm)
41
 
42
+ **Note**: there is a better V2 version of this model which has been fine-tuned longer with 16 hours of more data: [Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm-v2](https://huggingface.co/Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm-v2)
 
 
 
 
 
43
 
44
  ## Model description
45
 
46
+ Wav2Vec2 XLS-R is Facebook AI's large-scale multilingual pretrained model for speech. It is pretrained on 436k hours of unlabeled speech, including VoxPopuli, MLS, CommonVoice, BABEL, and VoxLingua107. It uses the wav2vec 2.0 objective, in 128 languages.
47
+
48
+ You can read more about the pretrained model from [this blog](https://ai.facebook.com/blog/xls-r-self-supervised-speech-processing-for-128-languages) and [this paper](https://arxiv.org/abs/2111.09296).
49
+
50
+ This model is fine-tuned version of the pretrained model (1 billion parameter variant) for Finnish ASR.
51
 
52
  ## Intended uses & limitations
53
 
54
+ You can use this model for Finnish ASR (speech-to-text) task.
55
+
56
+ ### How to use
57
+
58
+ Check the [run-finnish-asr-models.ipynb](https://huggingface.co/aapot/wav2vec2-xlsr-1b-finnish/blob/main/run-finnish-asr-models.ipynb) notebook in this repository for an detailed example on how to use this model.
59
+
60
+ ### Limitations and bias
61
 
62
+ This model was fine-tuned with audio samples which maximum length was 20 seconds so this model most likely works the best for quite short audios of similar length. However, you can try this model with a lot longer audios too and see how it works. If you encounter out of memory errors with very long audio files you can use the audio chunking method introduced in [this blog post](https://huggingface.co/blog/asr-chunking).
63
+
64
+ A vast majority of the data used for fine-tuning was from the Finnish Parliament dataset so this model may not generalize so well to very different domains like common daily spoken Finnish with dialects etc. In addition, audios of the datasets tend to be adult male dominated so this model may not work as well for speeches of children and women, for example.
65
+
66
+ ## Training data
67
 
68
  This model was fine-tuned with 259.57 hours of Finnish transcribed speech data from following datasets:
69
 
70
+ | Dataset | Hours | % of total hours |
71
+ |:----------------------------------------------------------------------------------------------------------------------------------|:--------:|:----------------:|
72
+ | [Common Voice 7.0 Finnish train + evaluation + other splits](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0) | 9.70 h | 3.74 % |
73
+ | [Finnish parliament session 2](https://b2share.eudat.eu/records/4df422d631544ce682d6af1d4714b2d4) | 0.24 h | 0.09 % |
74
+ | [VoxPopuli Finnish](https://github.com/facebookresearch/voxpopuli) | 5.94 h | 2.29 % |
75
+ | [CSS10 Finnish](https://github.com/kyubyong/css10) | 10.32 h | 3.98 % |
76
+ | [Aalto Finnish Parliament ASR Corpus](http://urn.fi/urn:nbn:fi:lb-2021051903) | 228.00 h | 87.84 % |
77
+ | [Finnish Broadcast Corpus](http://urn.fi/urn:nbn:fi:lb-2016042502) | 5.37 h | 2.07 % |
78
+
79
+ Datasets were filtered to include maximum length of 20 seconds long audio samples.
80
 
81
  ## Training procedure
82
 
83
+ This model was trained during [Robust Speech Challenge Event](https://discuss.huggingface.co/t/open-to-the-community-robust-speech-recognition-challenge/13614) organized by Hugging Face. Training was done on a Tesla V100 GPU, sponsored by OVHcloud.
84
+
85
+ Training script was provided by Hugging Face and it is available [here](https://github.com/huggingface/transformers/blob/main/examples/research_projects/robust-speech-event/run_speech_recognition_ctc_bnb.py). We only modified its data loading for our custom datasets.
86
+
87
  ### Training hyperparameters
88
 
89
  The following hyperparameters were used during training:
 
97
  - num_epochs: 5
98
  - mixed_precision_training: Native AMP
99
 
100
+ The pretrained `facebook/wav2vec2-xls-r-1b` model was initialized with following hyperparameters:
101
+ - attention_dropout: 0.094
102
+ - hidden_dropout: 0.047
103
+ - feat_proj_dropout: 0.04
104
+ - mask_time_prob: 0.082
105
+ - layerdrop: 0.041
106
+ - activation_dropout: 0.055
107
+ - ctc_loss_reduction: "mean"
108
+
109
  ### Training results
110
 
111
  | Training Loss | Epoch | Step | Validation Loss | Wer |
 
143
 
144
  - Transformers 4.17.0.dev0
145
  - Pytorch 1.10.2+cu102
146
+ - Datasets 1.18.3
147
  - Tokenizers 0.11.0
148
+
149
+ ## Evaluation results
150
+
151
+ Evaluation was done with the [Common Voice 7.0 Finnish test split](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0).
152
+
153
+ To evaluate this model, run the `eval.py` script in this repository:
154
+
155
+ ```bash
156
+ python3 eval.py --model_id aapot/wav2vec2-xlsr-1b-finnish-lm --dataset mozilla-foundation/common_voice_7_0 --config fi --split test
157
+ ```
158
+
159
+ This model (the second row of the table) achieves the following WER (Word Error Rate) and CER (Character Error Rate) results compared to our other models:
160
+
161
+ | | WER (with LM) | WER (without LM) | CER (with LM) | CER (without LM) |
162
+ |-----------------------------------------|---------------|------------------|---------------|------------------|
163
+ |aapot/wav2vec2-xlsr-1b-finnish-lm-v2 |**4.09** |**9.73** |**0.88** |**1.65** |
164
+ |aapot/wav2vec2-xlsr-1b-finnish-lm |5.65 |13.11 |1.20 |2.23 |
165
+ |aapot/wav2vec2-xlsr-300m-finnish-lm |8.16 |17.92 |1.97 |3.36 |
166
+
167
+ ## Team Members
168
+
169
+ - Aapo Tanskanen, [Hugging Face profile](https://huggingface.co/aapot), [LinkedIn profile](https://www.linkedin.com/in/aapotanskanen/)
170
+ - Rasmus Toivanen, [Hugging Face profile](https://huggingface.co/RASMUS), [LinkedIn profile](https://www.linkedin.com/in/rasmustoivanen/)
171
+
172
+ Feel free to contact us for more details 🤗