Text-to-Speech
speechbrain
English
TTS
speech-synthesis
Tacotron2
Mirco commited on
Commit
cd2eec6
1 Parent(s): 8550244

model upload

Browse files
Files changed (3) hide show
  1. README.md +116 -0
  2. hyperparams.yaml +69 -0
  3. model.ckpt +3 -0
README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: "en"
3
+ thumbnail:
4
+ pipeline_tag: automatic-speech-recognition
5
+ tags:
6
+ - CTC
7
+ - Attention
8
+ - pytorch
9
+ - speechbrain
10
+ - Transformer
11
+ license: "apache-2.0"
12
+ datasets:
13
+ - commonvoice
14
+ metrics:
15
+ - wer
16
+ - cer
17
+ ---
18
+
19
+ <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>
20
+ <br/><br/>
21
+
22
+ # wav2vec 2.0 with CTC/Attention trained on CommonVoice Italian (No LM)
23
+
24
+ This repository provides all the necessary tools to perform automatic speech
25
+ recognition from an end-to-end system pretrained on CommonVoice (Italian Language) within
26
+ SpeechBrain. For a better experience, we encourage you to learn more about
27
+ [SpeechBrain](https://speechbrain.github.io).
28
+
29
+ The performance of the model is the following:
30
+
31
+ | Release | Test WER | GPUs |
32
+ |:--------------:|:--------------:| :--------:|
33
+ | 03-06-21 | 9.86 | 2xV100 32GB |
34
+
35
+ ## Pipeline description
36
+
37
+ This ASR system is composed of 2 different but linked blocks:
38
+ - Tokenizer (unigram) that transforms words into subword units and trained with
39
+ the train transcriptions (train.tsv) of CommonVoice (EN).
40
+ - Acoustic model (wav2vec2.0 + CTC/Attention). A pretrained wav2vec 2.0 model ([facebook/wav2vec2-large-it-voxpopuli](https://huggingface.co/facebook/wav2vec2-large-it-voxpopuli)) is combined with two DNN layers and finetuned on CommonVoice En.
41
+ The obtained final acoustic representation is given to the CTC and attention decoders.
42
+
43
+ The system is trained with recordings sampled at 16kHz (single channel).
44
+ The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *transcribe_file* if needed.
45
+
46
+ ## Install SpeechBrain
47
+
48
+ First of all, please install tranformers and SpeechBrain with the following command:
49
+
50
+ ```
51
+ pip install speechbrain transformers
52
+ ```
53
+
54
+ Please notice that we encourage you to read our tutorials and learn more about
55
+ [SpeechBrain](https://speechbrain.github.io).
56
+
57
+ ### Transcribing your own audio files (in Italian)
58
+
59
+ ```python
60
+ from speechbrain.pretrained import EncoderDecoderASR
61
+
62
+ asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-it", savedir="pretrained_models/asr-wav2vec2-commonvoice-it")
63
+ asr_model.transcribe_file("speechbrain/asr-wav2vec2-commonvoice-it/example-it.wav")
64
+
65
+ ```
66
+ ### Inference on GPU
67
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
68
+
69
+ ## Parallel Inference on a Batch
70
+ 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.
71
+
72
+ ### Training
73
+ The model was trained with SpeechBrain.
74
+ To train it from scratch follow these steps:
75
+ 1. Clone SpeechBrain:
76
+ ```bash
77
+ git clone https://github.com/speechbrain/speechbrain/
78
+ ```
79
+ 2. Install it:
80
+ ```bash
81
+ cd speechbrain
82
+ pip install -r requirements.txt
83
+ pip install -e .
84
+ ```
85
+
86
+ 3. Run Training:
87
+ ```bash
88
+ cd recipes/CommonVoice/ASR/seq2seq
89
+ python train_with_wav2vec.py hparams/train_it_with_wav2vec.yaml --data_folder=your_data_folder
90
+ ```
91
+
92
+ You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1tjz6IZmVRkuRE97E7h1cXFoGTer7pT73?usp=sharing).
93
+
94
+ ### Limitations
95
+ The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
96
+
97
+ # **About SpeechBrain**
98
+ - Website: https://speechbrain.github.io/
99
+ - Code: https://github.com/speechbrain/speechbrain/
100
+ - HuggingFace: https://huggingface.co/speechbrain/
101
+
102
+
103
+ # **Citing SpeechBrain**
104
+ Please, cite SpeechBrain if you use it for your research or business.
105
+
106
+ ```bibtex
107
+ @misc{speechbrain,
108
+ title={{SpeechBrain}: A General-Purpose Speech Toolkit},
109
+ 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},
110
+ year={2021},
111
+ eprint={2106.04624},
112
+ archivePrefix={arXiv},
113
+ primaryClass={eess.AS},
114
+ note={arXiv:2106.04624}
115
+ }
116
+ ```
hyperparams.yaml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ################################
2
+ # Model: Tacotroon2 for TTS
3
+ # Authors: Artem Ploujnikov, Yingzhi Wang
4
+ # ################################
5
+
6
+ mask_padding: True
7
+ n_mel_channels: 80
8
+ n_symbols: 148
9
+ symbols_embedding_dim: 512
10
+ encoder_kernel_size: 5
11
+ encoder_n_convolutions: 3
12
+ encoder_embedding_dim: 512
13
+ attention_rnn_dim: 1024
14
+ attention_dim: 128
15
+ attention_location_n_filters: 32
16
+ attention_location_kernel_size: 31
17
+ n_frames_per_step: 1
18
+ decoder_rnn_dim: 1024
19
+ prenet_dim: 256
20
+ max_decoder_steps: 1000
21
+ gate_threshold: 0.5
22
+ p_attention_dropout: 0.1
23
+ p_decoder_dropout: 0.1
24
+ postnet_embedding_dim: 512
25
+ postnet_kernel_size: 5
26
+ postnet_n_convolutions: 5
27
+ decoder_no_early_stopping: False
28
+
29
+ # Model
30
+ model: !new:speechbrain.lobes.models.Tacotron2.Tacotron2
31
+ mask_padding: !ref <mask_padding>
32
+ n_mel_channels: !ref <n_mel_channels>
33
+ # symbols
34
+ n_symbols: !ref <n_symbols>
35
+ symbols_embedding_dim: !ref <symbols_embedding_dim>
36
+ # encoder
37
+ encoder_kernel_size: !ref <encoder_kernel_size>
38
+ encoder_n_convolutions: !ref <encoder_n_convolutions>
39
+ encoder_embedding_dim: !ref <encoder_embedding_dim>
40
+ # attention
41
+ attention_rnn_dim: !ref <attention_rnn_dim>
42
+ attention_dim: !ref <attention_dim>
43
+ # attention location
44
+ attention_location_n_filters: !ref <attention_location_n_filters>
45
+ attention_location_kernel_size: !ref <attention_location_kernel_size>
46
+ # decoder
47
+ n_frames_per_step: !ref <n_frames_per_step>
48
+ decoder_rnn_dim: !ref <decoder_rnn_dim>
49
+ prenet_dim: !ref <prenet_dim>
50
+ max_decoder_steps: !ref <max_decoder_steps>
51
+ gate_threshold: !ref <gate_threshold>
52
+ p_attention_dropout: !ref <p_attention_dropout>
53
+ p_decoder_dropout: !ref <p_decoder_dropout>
54
+ # postnet
55
+ postnet_embedding_dim: !ref <postnet_embedding_dim>
56
+ postnet_kernel_size: !ref <postnet_kernel_size>
57
+ postnet_n_convolutions: !ref <postnet_n_convolutions>
58
+ decoder_no_early_stopping: !ref <decoder_no_early_stopping>
59
+
60
+ # Function that converts the text into a sequence of valid characters.
61
+ text_to_sequence: !name:recipes.LJSpeech.TTS.tacotron2.text_to_sequence.text_to_sequence
62
+
63
+ modules:
64
+ model: !ref <model>
65
+
66
+ pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer
67
+ loadables:
68
+ model: !ref <model>
69
+
model.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23cd4a95396aada9128d5d9f7d99e20183a4eb8fa91e250fa5b4f5004ae1d07b
3
+ size 112830206