pere commited on
Commit
c0d914a
1 Parent(s): 5eb8ec2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -1
README.md CHANGED
@@ -1,3 +1,95 @@
1
  ---
2
- license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ tags:
4
+ - automatic-speech-recognition
5
+ - NbAiLab/NPSC
6
+ - xxx-robust-speech-event
7
+ - no
8
+ - nb-NO
9
+ datasets:
10
+ - NbAiLab/NPSC
11
+ language:
12
+ - nb-NO
13
+ model-index:
14
+ - name: wav2vec2-xls-r-1b-npsc-bokmaal-low-27k
15
+ results:
16
+ - task:
17
+ name: Automatic Speech Recognition
18
+ type: automatic-speech-recognition
19
+ dataset:
20
+ name: NPSC
21
+ type: NbAiLab/NPSC
22
+ args: 16K_mp3_bokmaal
23
+ metrics:
24
+ - name: Test (Bokmål) WER
25
+ type: wer
26
+ value: 0.06686424124625939
27
+ - name: Test (Bokmål) CER
28
+ type: cer
29
+ value: 0.025697763468940576
30
  ---
31
+
32
+ # Norwegian Wav2Vec2 Model - 1B - Bokmål
33
+ This achieves the following results on the evaluation set:
34
+ - WER: 0.0668
35
+ - CER: 0.0256
36
+
37
+ ## Model description
38
+ This is one of several Wav2Vec-models created during the HuggingFace hosted [Robust Speech Event](https://discuss.huggingface.co/t/open-to-the-community-robust-speech-recognition-challenge/13614?s=09). In parallell with the event, the team also converted the [Norwegian Parliamentary Speech Corpus (NPSC)](https://huggingface.co/datasets/NbAiLab/NPSC) to the HuggingFace Dataset format and used that as the main source for training.
39
+
40
+
41
+ We do release all code developed during the event so that the Norwegian NLP community can build upon this to develop even better Norwegian ASR models. The finetuning of these models are not very compute demanding. You should after following the instructions here, be able to train your own automatic speech recognition system in less than a day with an average GPU.
42
+
43
+ ## Training procedure
44
+ To reproduce this, we strongly recommend that you follow the [instructions from HuggingFace](https://github.com/huggingface/transformers/tree/master/examples/research_projects/robust-speech-event#talks) to train a simple Swedish model.
45
+
46
+ When you have verified that you are able to do this, create a new repo. You can then start by copying the files **run.sh** and **run_speech_recognition_ctc.py** from our repo. You should be able to reproduce our results by just running this script. With some tweaking, you will most likely be able to build an even better ASR.
47
+
48
+ ### 5-gram Language Model
49
+ HuggingFace has provided another [very nice blog](https://huggingface.co/blog/wav2vec2-with-ngram) about how to add a 5-gram language model to improve the ASR model. You can build this from your own corpus, for instance by extracting some suitable text from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC). You can also skip some of the steps in the guide, and copy the [5-gram model from this repo](https://huggingface.co/NbAiLab/XLSR-300M-bokmaal/tree/main/language_model).
50
+
51
+
52
+ ### Training settings
53
+
54
+ The following settings and hyperparameters were used during training:
55
+ ```
56
+ --dataset_name="NbAiLab/NPSC"
57
+ --model_name_or_path="facebook/wav2vec2-xls-r-1b"
58
+ --dataset_config_name="16K_mp3_bokmaal"
59
+ --output_dir="./"
60
+ --overwrite_output_dir
61
+ --num_train_epochs="40"
62
+ --per_device_train_batch_size="12"
63
+ --per_device_eval_batch_size="12"
64
+ --gradient_accumulation_steps="2"
65
+ --learning_rate="2e-5"
66
+ --warmup_steps="2000"
67
+ --length_column_name="input_length"
68
+ --evaluation_strategy="steps"
69
+ --text_column_name="text"
70
+ --save_steps="500"
71
+ --eval_steps="500"
72
+ --logging_steps="100"
73
+ --layerdrop="0.041"
74
+ --attention_dropout="0.094"
75
+ --activation_dropout="0.055"
76
+ --hidden_dropout="0.047"
77
+ --save_total_limit="3"
78
+ --freeze_feature_encoder
79
+ --feat_proj_dropout="0.04"
80
+ --mask_time_prob="0.082"
81
+ --mask_time_length="10"
82
+ --mask_feature_prob="0.25"
83
+ --mask_feature_length="64"
84
+ --gradient_checkpointing \
85
+ --min_duration_in_seconds="0.5"
86
+ --max_duration_in_seconds="30.0"
87
+ --ctc_zero_infinity=True
88
+ --use_auth_token
89
+ --seed="42"
90
+ --fp16
91
+ --group_by_length
92
+ --do_train --do_eval
93
+ --push_to_hub
94
+ --preprocessing_num_workers="16"
95
+ ```