sangeet2020 commited on
Commit
ef649a5
1 Parent(s): b1600e8

push model files

Browse files
Files changed (5) hide show
  1. README.md +121 -0
  2. config.json +0 -0
  3. example_de.wav +0 -0
  4. hyperparams.yaml +68 -0
  5. whisper.ckpt +3 -0
README.md CHANGED
@@ -1,3 +1,124 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - de
4
+ thumbnail: null
5
+ pipeline_tag: automatic-speech-recognition
6
+ tags:
7
+ - whisper
8
+ - pytorch
9
+ - speechbrain
10
+ - Transformer
11
+ - hf-asr-leaderboard
12
  license: apache-2.0
13
+ datasets:
14
+ - RescueSpeech
15
+ metrics:
16
+ - wer
17
+ - cer
18
+ model-index:
19
+ - name: rescuespeech_whisper
20
+ results:
21
+ - task:
22
+ name: Automatic Speech Recognition
23
+ type: automatic-speech-recognition
24
+ dataset:
25
+ name: RescueSpeech
26
+ config: de
27
+ split: test
28
+ args:
29
+ language: de
30
+ metrics:
31
+ - name: Test WER
32
+ type: wer
33
+ value: '23.14'
34
  ---
35
+
36
+ <iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
37
+ <br/><br/>
38
+
39
+ # Whisper large-v2 fine-tuned on RescueSpeech dataset.
40
+
41
+ This repository provides all the necessary tools to perform automatic speech
42
+ recognition from an end-to-end whisper model fine-tuned on the RescueSpeech dataset within
43
+ SpeechBrain. For a better experience, we encourage you to learn more about
44
+ [SpeechBrain](https://speechbrain.github.io).
45
+
46
+ The performance of the model is the following:
47
+
48
+ | Release | Test CER | Test WER | GPUs |
49
+ |:-------------:|:--------------:|:--------------:| :--------:|
50
+ | 01-07-23 | 10.82 | 23.14 | 1xA100 80 GB |
51
+
52
+ ## Pipeline description
53
+
54
+ This ASR system is composed of whisper encoder-decoder blocks:
55
+ - The pretrained whisper-large-v2 encoder is frozen.
56
+ - The pretrained Whisper tokenizer is used.
57
+ - A pretrained Whisper-large-v2 decoder ([openai/whisper-large-v2](https://huggingface.co/openai/whisper-large-v2)) is finetuned on RescueSpeech dataset.
58
+ The obtained final acoustic representation is given to the greedy decoder.
59
+
60
+ The system is trained with recordings sampled at 16kHz (single channel).
61
+ The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *transcribe_file* if needed.
62
+
63
+ ## Install SpeechBrain
64
+
65
+ First of all, please install tranformers and SpeechBrain with the following command:
66
+
67
+ ```
68
+ pip install speechbrain transformers==4.26.0
69
+ ```
70
+
71
+ Please notice that we encourage you to read our tutorials and learn more about
72
+ [SpeechBrain](https://speechbrain.github.io).
73
+
74
+ ### Transcribing your own audio files (in French)
75
+
76
+ ```python
77
+
78
+ from speechbrain.pretrained import WhisperASR
79
+
80
+ asr_model = WhisperASR.from_hparams(source="speechbrain/rescuespeech_whisper", savedir="pretrained_models/rescuespeech_whisper")
81
+ asr_model.transcribe_file("speechbrain/rescuespeech_whisper/example_de.wav")
82
+
83
+
84
+ ```
85
+ ### Inference on GPU
86
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
87
+
88
+
89
+ You can find our training results (models, logs, etc) [here](https://www.dropbox.com/sh/45wk44h8e0wkc5f/AABjEJJJ_OJp2fDYz3zEihmPa?dl=0).
90
+
91
+ ### Limitations
92
+ The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
93
+
94
+ #### Referencing SpeechBrain
95
+
96
+ ```
97
+ @misc{SB2021,
98
+ author = {Ravanelli, Mirco and Parcollet, Titouan and Rouhe, Aku and Plantinga, Peter and Rastorgueva, Elena and Lugosch, Loren and Dawalatabad, Nauman and Ju-Chieh, Chou and Heba, Abdel and Grondin, Francois and Aris, William and Liao, Chien-Feng and Cornell, Samuele and Yeh, Sung-Lin and Na, Hwidong and Gao, Yan and Fu, Szu-Wei and Subakan, Cem and De Mori, Renato and Bengio, Yoshua },
99
+ title = {SpeechBrain},
100
+ year = {2021},
101
+ publisher = {GitHub},
102
+ journal = {GitHub repository},
103
+ howpublished = {\\\\url{https://github.com/speechbrain/speechbrain}},
104
+ }
105
+ ```
106
+
107
+ ### Referencing RescueSpeech
108
+ ```bibtex
109
+ @misc{sagar2023rescuespeech,
110
+ title={RescueSpeech: A German Corpus for Speech Recognition in Search and Rescue Domain},
111
+ author={Sangeet Sagar and Mirco Ravanelli and Bernd Kiefer and Ivana Kruijff Korbayova and Josef van Genabith},
112
+ year={2023},
113
+ eprint={2306.04054},
114
+ archivePrefix={arXiv},
115
+ primaryClass={eess.AS}
116
+ }
117
+ ```
118
+
119
+ #### About SpeechBrain
120
+ SpeechBrain is an open-source and all-in-one speech toolkit. It is designed to be simple, extremely flexible, and user-friendly. Competitive or state-of-the-art performance is obtained in various domains.
121
+
122
+ Website: https://speechbrain.github.io/
123
+
124
+ GitHub: https://github.com/speechbrain/speechbrain
config.json ADDED
File without changes
example_de.wav ADDED
Binary file (445 kB). View file
 
hyperparams.yaml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated 2023-06-24 from:
2
+ # /netscratch/sagar/thesis/speechbrain/recipes/RescueSpeech/ASR/transformer/hparams/train_hf_whisper.yaml
3
+ # yamllint disable
4
+ # ################################
5
+ # Model: Whisper (Encoder-Decoder) + NLL
6
+ # Augmentation: TimeDomainSpecAugment
7
+ # Authors: Sangeet Sagar 2022
8
+ # ################################
9
+
10
+
11
+ # URL for the biggest Fairseq english whisper model.
12
+ whisper_hub: openai/whisper-large-v2
13
+ language: german
14
+
15
+ # Normalize the english inputs with
16
+ # the same normalization done in the paper
17
+ normalized_transcripts: true
18
+ test_only: false # Set it to True if you only want to do the evaluation
19
+
20
+ auto_mix_prec: false
21
+ sample_rate: 16000
22
+
23
+ # These values are only used for the searchers.
24
+ # They needs to be hardcoded and should not be changed with Whisper.
25
+ # They are used as part of the searching process.
26
+ # The bos token of the searcher will be timestamp_index
27
+ # and will be concatenated with the bos, language and task tokens.
28
+ timestamp_index: 50363
29
+ eos_index: 50257
30
+ bos_index: 50258
31
+
32
+ # Decoding parameters
33
+ min_decode_ratio: 0.0
34
+ max_decode_ratio: 1.0
35
+ test_beam_size: 8
36
+
37
+ # Model parameters
38
+ freeze_whisper: false
39
+ freeze_encoder_only: false
40
+ freeze_encoder: true
41
+
42
+ #
43
+ # Functions and classes
44
+ #
45
+ whisper: &id001 !new:speechbrain.lobes.models.huggingface_whisper.HuggingFaceWhisper
46
+ source: openai/whisper-large-v2/
47
+ freeze: false
48
+ save_path: openai/whisper-large-v2/
49
+ encoder_only: false
50
+ freeze_encoder: true
51
+
52
+
53
+ modules:
54
+ whisper: *id001
55
+ whisper_opt_class: !name:torch.optim.AdamW
56
+ lr: 0.00003
57
+ weight_decay: 0.01
58
+
59
+ decoder: !new:speechbrain.decoders.seq2seq.S2SWhisperGreedySearch
60
+ model: *id001
61
+ bos_index: 50363
62
+ eos_index: 50257
63
+ min_decode_ratio: 0.0
64
+ max_decode_ratio: 1.0
65
+
66
+ pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer
67
+ loadables:
68
+ whisper: !ref <whisper>
whisper.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed33c072cfd8f184b189375df94e587df7afac08d65106b9ad42a761df14b65c
3
+ size 6173767281