Titouan commited on
Commit
cbece1d
2 Parent(s): 830ac4a da545ba

Merge branch 'main' of https://huggingface.co./speechbrain/asr-wav2vec2-librispeech into main

Browse files
Files changed (1) hide show
  1. README.md +150 -0
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ thumbnail: null
5
+ tags:
6
+ - automatic-speech-recognition
7
+ - CTC
8
+ - Attention
9
+ - Transformer
10
+ - pytorch
11
+ - speechbrain
12
+ - hf-asr-leaderboard
13
+ license: apache-2.0
14
+ datasets:
15
+ - librispeech
16
+ metrics:
17
+ - wer
18
+ - cer
19
+ model-index:
20
+ - name: wav2vec2+CTC by SpeechBrain
21
+ results:
22
+ - task:
23
+ name: Automatic Speech Recognition
24
+ type: automatic-speech-recognition
25
+ dataset:
26
+ name: LibriSpeech (clean)
27
+ type: librispeech_asr
28
+ config: clean
29
+ split: test
30
+ args:
31
+ language: en
32
+ metrics:
33
+ - name: Test WER
34
+ type: wer
35
+ value: 1.90
36
+ - task:
37
+ name: Automatic Speech Recognition
38
+ type: automatic-speech-recognition
39
+ dataset:
40
+ name: LibriSpeech (other)
41
+ type: librispeech_asr
42
+ config: other
43
+ split: test
44
+ args:
45
+ language: en
46
+ metrics:
47
+ - name: Test WER
48
+ type: wer
49
+ value: 3.96
50
+ ---
51
+
52
+ <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>
53
+ <br/><br/>
54
+
55
+ # wav2vec 2.0 with CTC trained on LibriSpeech
56
+
57
+ This repository provides all the necessary tools to perform automatic speech
58
+ recognition from an end-to-end system pretrained on LibriSpeech (English Language) within
59
+ SpeechBrain. For a better experience, we encourage you to learn more about
60
+ [SpeechBrain](https://speechbrain.github.io).
61
+
62
+ The performance of the model is the following:
63
+
64
+ | Release | Test clean WER | Test other WER | GPUs |
65
+ |:-------------:|:--------------:|:--------------:|:--------:|
66
+ | 24-03-22 | 1.90 | 3.96 | 1xA100 40GB |
67
+
68
+ ## Pipeline description
69
+
70
+ This ASR system is composed of 2 different but linked blocks:
71
+ - Tokenizer (unigram) that transforms words into characters and trained with
72
+ the train transcriptions (EN).
73
+ - Acoustic model (wav2vec2.0 + CTC). A pretrained wav2vec 2.0 model ([wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self)) is combined with two DNN layers and finetuned on LibriSpeech.
74
+ The obtained final acoustic representation is given to the CTC.
75
+
76
+ The system is trained with recordings sampled at 16kHz (single channel).
77
+ The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *transcribe_file* if needed.
78
+
79
+ ## Install SpeechBrain
80
+
81
+ First of all, please install tranformers and SpeechBrain with the following command:
82
+
83
+ ```
84
+ pip install speechbrain transformers
85
+ ```
86
+
87
+ Please notice that we encourage you to read our tutorials and learn more about
88
+ [SpeechBrain](https://speechbrain.github.io).
89
+
90
+ ### Transcribing your own audio files (in English)
91
+
92
+ ```python
93
+ from speechbrain.pretrained import EncoderDecoderASR
94
+
95
+ asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-wav2vec2-librispeech", savedir="pretrained_models/asr-wav2vec2-librispeech")
96
+ asr_model.transcribe_file("speechbrain/asr-wav2vec2-commonvoice-en/example.wav")
97
+
98
+ ```
99
+ ### Inference on GPU
100
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
101
+
102
+ ## Parallel Inference on a Batch
103
+ Please, [see this Colab notebook](https://colab.research.google.com/drive/1hX5ZI9S4jHIjahFCZnhwwQmFoGAi3tmu?usp=sharing) to figure out how to transcribe in parallel a batch of input sentences using a pre-trained model.
104
+
105
+ ### Training
106
+ The model was trained with SpeechBrain.
107
+ To train it from scratch follow these steps:
108
+ 1. Clone SpeechBrain:
109
+ ```bash
110
+ git clone https://github.com/speechbrain/speechbrain/
111
+ ```
112
+ 2. Install it:
113
+ ```bash
114
+ cd speechbrain
115
+ pip install -r requirements.txt
116
+ pip install -e .
117
+ ```
118
+
119
+ 3. Run Training:
120
+ ```bash
121
+ cd recipes/LibriSpeech/ASR/CTC
122
+ python train_with_wav2vec.py hparams/train_en_with_wav2vec.yaml --data_folder=your_data_folder
123
+ ```
124
+
125
+ You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1pg0QzW-LqAISG8Viw_lUTGjXwOqh7gkl?usp=sharing).
126
+
127
+ ### Limitations
128
+ The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
129
+
130
+
131
+ # **About SpeechBrain**
132
+ - Website: https://speechbrain.github.io/
133
+ - Code: https://github.com/speechbrain/speechbrain/
134
+ - HuggingFace: https://huggingface.co/speechbrain/
135
+
136
+
137
+ # **Citing SpeechBrain**
138
+ Please, cite SpeechBrain if you use it for your research or business.
139
+
140
+ ```bibtex
141
+ @misc{speechbrain,
142
+ title={{SpeechBrain}: A General-Purpose Speech Toolkit},
143
+ author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
144
+ year={2021},
145
+ eprint={2106.04624},
146
+ archivePrefix={arXiv},
147
+ primaryClass={eess.AS},
148
+ note={arXiv:2106.04624}
149
+ }
150
+ ```