README.md 23.0 KB
Newer Older
1
# DeepSpeech2 on PaddlePaddle
2

L
lfchener 已提交
3 4
[中文版](README_cn.md)

L
lfchener 已提交
5
*DeepSpeech2 on PaddlePaddle* is an open-source implementation of end-to-end Automatic Speech Recognition (ASR) engine, based on [Baidu's Deep Speech 2 paper](http://proceedings.mlr.press/v48/amodei16.pdf), with [PaddlePaddle](https://github.com/PaddlePaddle/Paddle) platform. Our vision is to empower both industrial application and academic research on speech recognition, via an easy-to-use, efficient and scalable implementation, including training, inference & testing module, and demo deployment. Besides, several pre-trained models for both English and Mandarin are also released.
6 7 8 9 10 11 12 13

## Table of Contents
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Data Preparation](#data-preparation)
- [Training a Model](#training-a-model)
- [Inference and Evaluation](#inference-and-evaluation)
- [Hyper-parameters Tuning](#hyper-parameters-tuning)
14
- [Training for Mandarin Language](#training-for-mandarin-language)
15
- [Trying Live Demo with Your Own Voice](#trying-live-demo-with-your-own-voice)
16
- [Released Models](#released-models)
17
- [Experiments and Benchmarks](#experiments-and-benchmarks)
18 19
- [Questions and Help](#questions-and-help)

20

21

22
## Installation
23

L
lfchener 已提交
24 25 26
To avoid the trouble of environment setup, [running in Docker container](#running-in-docker-container) is highly recommended. Otherwise follow the guidelines below to install the dependencies manually.

### Prerequisites
H
Hui Zhang 已提交
27
- Python >= 3.6
L
lfchener 已提交
28
- PaddlePaddle 1.8.0 or later (please refer to the [Installation Guide](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html))
L
lfchener 已提交
29 30 31 32 33

### Setup
- Make sure these libraries or tools installed: `pkg-config`, `flac`, `ogg`, `vorbis`, `boost` and `swig`, e.g. installing them via `apt-get`:

```bash
H
Hui Zhang 已提交
34
sudo apt-get install -y pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev
L
lfchener 已提交
35 36 37 38 39
```

or, installing them via `yum`:

```bash
H
Hui Zhang 已提交
40
sudo yum install pkgconfig libogg-devel libvorbis-devel boost-devel python3-devel
L
lfchener 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.1.tar.xz
xz -d flac-1.3.1.tar.xz
tar -xvf flac-1.3.1.tar
cd flac-1.3.1
./configure
make
make install
```

- Run the setup script for the remaining dependencies

```bash
git clone https://github.com/PaddlePaddle/DeepSpeech.git
cd DeepSpeech
sh setup.sh
```
57

H
Hui Zhang 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
### Running in Docker Container

Docker is an open source tool to build, ship, and run distributed applications in an isolated environment. A Docker image for this project has been provided in [hub.docker.com](https://hub.docker.com) with all the dependencies installed, including the pre-built PaddlePaddle, CTC decoders, and other necessary Python and third-party packages. This Docker image requires the support of NVIDIA GPU, so please make sure its availiability and the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) has been installed.

Take several steps to launch the Docker image:

- Download the Docker image

```bash
nvidia-docker pull hub.baidubce.com/paddlepaddle/deep_speech_fluid:latest-gpu
```

- Clone this repository

```
git clone https://github.com/PaddlePaddle/DeepSpeech.git
```

- Run the Docker image

```bash
sudo nvidia-docker run -it -v $(pwd)/DeepSpeech:/DeepSpeech hub.baidubce.com/paddlepaddle/deep_speech_fluid:latest-gpu /bin/bash
```
Now go back and start from the [Getting Started](#getting-started) section, you can execute training, inference and hyper-parameters tuning similarly in the Docker container.


- Install PaddlePaddle

For example, for CUDA 10.1, CuDNN7.5:
```bash
python3 -m pip install paddlepaddle-gpu==1.8.0.post107
```

91
## Getting Started
92

93
Several shell scripts provided in `./examples` will help us to quickly give it a try, for most major modules, including data preparation, model training, case inference and model evaluation, with a few public dataset (e.g. [LibriSpeech](http://www.openslr.org/12/), [Aishell](http://www.openslr.org/33)). Reading these examples will also help you to understand how to make it work with your own data.
94

L
lfchener 已提交
95
Some of the scripts in `./examples` are configured with 8 GPUs. If you don't have 8 GPUs available, please modify `CUDA_VISIBLE_DEVICES`. If you don't have any GPU available, please set `--use_gpu` to False to use CPUs instead. Besides, if out-of-memory problem occurs, just reduce `--batch_size` to fit.
96 97 98 99 100

Let's take a tiny sampled subset of [LibriSpeech dataset](http://www.openslr.org/12/) for instance.

- Go to directory

101
    ```bash
102
    cd examples/tiny
103 104
    ```

105
    Notice that this is only a toy example with a tiny sampled subset of LibriSpeech. If you would like to try with the complete dataset (would take several days for training), please go to `examples/librispeech` instead.
H
Hui Zhang 已提交
106 107 108 109 110 111 112 113 114 115 116
- Source env
    
    ```bash
    source path.sh
    ```
    Set `MAIN_ROOT` as project dir.
- Main entrypoint

    ```bash
    bash run.sh
    ```
117

X
Xinghai Sun 已提交
118
More detailed information are provided in the following sections. Wish you a happy journey with the *DeepSpeech2 on PaddlePaddle* ASR engine!
119

120

121
## Data Preparation
122

X
Xinghai Sun 已提交
123
### Generate Manifest
124

125
*DeepSpeech2 on PaddlePaddle* accepts a textual **manifest** file as its data set interface. A manifest file summarizes a set of speech data, with each line containing some meta data (e.g. filepath, transcription, duration) of one audio clip, in [JSON](http://www.json.org/) format, such as:
126

127
```
128 129
{"audio_filepath": "/home/work/.cache/paddle/Libri/134686/1089-134686-0001.flac", "duration": 3.275, "text": "stuff it into you his belly counselled him"}
{"audio_filepath": "/home/work/.cache/paddle/Libri/134686/1089-134686-0007.flac", "duration": 4.275, "text": "a cold lucid indifference reigned in his soul"}
130
```
131

132
To use your custom data, you only need to generate such manifest files to summarize the dataset. Given such summarized manifests, training, inference and all other modules can be aware of where to access the audio files, as well as their meta data including the transcription labels.
133

H
Hui Zhang 已提交
134
For how to generate such manifest files, please refer to `examples/librispeech/local/librispeech.py`, which will download data and generate manifest files for LibriSpeech dataset.
X
Xinghai Sun 已提交
135

X
Xinghai Sun 已提交
136
### Compute Mean & Stddev for Normalizer
X
Xinghai Sun 已提交
137

138
To perform z-score normalization (zero-mean, unit stddev) upon audio features, we have to estimate in advance the mean and standard deviation of the features, with some training samples:
X
Xinghai Sun 已提交
139

140
```bash
H
Hui Zhang 已提交
141
python3 tools/compute_mean_std.py \
142 143
--num_samples 2000 \
--specgram_type linear \
H
Hui Zhang 已提交
144 145
--manifest_path examples/librispeech/data/manifest.train \
--output_path examples/librispeech/data/mean_std.npz
X
Xinghai Sun 已提交
146 147
```

H
Hui Zhang 已提交
148
It will compute the mean and standard deviatio of power spectrum feature with 2000 random sampled audio clips listed in `examples/librispeech/data/manifest.train` and save the results to `examples/librispeech/data/mean_std.npz` for further usage.
X
Xinghai Sun 已提交
149

150

X
Xinghai Sun 已提交
151
### Build Vocabulary
X
Xinghai Sun 已提交
152

X
Xinghai Sun 已提交
153
A vocabulary of possible characters is required to convert the transcription into a list of token indices for training, and in decoding, to convert from a list of indices back to text again. Such a character-based vocabulary can be built with `tools/build_vocab.py`.
Y
Yibing Liu 已提交
154

155
```bash
H
Hui Zhang 已提交
156
python3 tools/build_vocab.py \
157
--count_threshold 0 \
H
Hui Zhang 已提交
158 159
--vocab_path examples/librispeech/data/eng_vocab.txt \
--manifest_paths examples/librispeech/data/manifest.train
Y
Yibing Liu 已提交
160
```
161

H
Hui Zhang 已提交
162
It will write a vocabuary file `examples/librispeech/data/eng_vocab.txt` with all transcription text in `examples/librispeech/data/manifest.train`, without vocabulary truncation (`--count_threshold 0`).
163

X
Xinghai Sun 已提交
164
### More Help
165

166
For more help on arguments:
167

168
```bash
H
Hui Zhang 已提交
169
python3 examples/librispeech/local/librispeech.py --help
H
Hui Zhang 已提交
170 171
python3 tools/compute_mean_std.py --help
python3 tools/build_vocab.py --help
172 173
```

174
## Training a model
175

176
`train.py` is the main caller of the training module. Examples of usage are shown below.
177

178
- Start training from scratch with 8 GPUs:
179

180
    ```
H
Hui Zhang 已提交
181
    CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py
182
    ```
183

L
lfchener 已提交
184
- Start training from scratch with CPUs:
185 186

    ```
H
Hui Zhang 已提交
187
    python3 train.py --use_gpu False
188
    ```
189
- Resume training from a checkpoint:
190 191

    ```
X
Xinghai Sun 已提交
192
    CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
H
Hui Zhang 已提交
193
    python3 train.py \
194
    --init_from_pretrained_model CHECKPOINT_PATH_TO_RESUME_FROM
195
    ```
196

197
For more help on arguments:
198

199
```bash
H
Hui Zhang 已提交
200
python3 train.py --help
201
```
H
Hui Zhang 已提交
202
or refer to `example/librispeech/local/run_train.sh`.
203

L
lfchener 已提交
204

H
Hui Zhang 已提交
205
### Data Augmentation Pipeline
Y
Yibing Liu 已提交
206

207
Data augmentation has often been a highly effective technique to boost the deep learning performance. We augment our speech data by synthesizing new audios with small random perturbation (label-invariant transformation) added upon raw audios. You don't have to do the syntheses on your own, as it is already embedded into the data provider and is done on the fly, randomly for each epoch during training.
208

209
Six optional augmentation components are provided to be selected, configured and inserted into the processing pipeline.
210 211 212 213

  - Volume Perturbation
  - Speed Perturbation
  - Shifting Perturbation
X
Xinghai Sun 已提交
214
  - Online Bayesian normalization
215 216 217
  - Noise Perturbation (need background noise audio files)
  - Impulse Response (need impulse audio files)

H
Hu Weiwei 已提交
218
In order to inform the trainer of what augmentation components are needed and what their processing orders are, it is required to prepare in advance an *augmentation configuration file* in [JSON](http://www.json.org/) format. For example:
Y
Yibing Liu 已提交
219 220

```
221 222 223 224 225 226 227 228 229 230 231 232
[{
    "type": "speed",
    "params": {"min_speed_rate": 0.95,
               "max_speed_rate": 1.05},
    "prob": 0.6
},
{
    "type": "shift",
    "params": {"min_shift_ms": -5,
               "max_shift_ms": 5},
    "prob": 0.8
}]
Y
Yibing Liu 已提交
233 234
```

235
When the `--augment_conf_file` argument of `trainer.py` is set to the path of the above example configuration file, every audio clip in every epoch will be processed: with 60% of chance, it will first be speed perturbed with a uniformly random sampled speed-rate between 0.95 and 1.05, and then with 80% of chance it will be shifted in time with a random sampled offset between -5 ms and 5 ms. Finally this newly synthesized audio clip will be feed into the feature extractor for further training.
236

237
For other configuration examples, please refer to `conf/augmenatation.config.example`.
Y
Yibing Liu 已提交
238

239
Be careful when utilizing the data augmentation technique, as improper augmentation will do harm to the training, due to the enlarged train-test gap.
240

241
## Inference and Evaluation
242

243
### Prepare Language Model
Y
Yibing Liu 已提交
244

245
A language model is required to improve the decoder's performance. We have prepared two language models (with lossy compression) for users to download and try. One is for English and the other is for Mandarin. Users can simply run this to download the preprared language models:
X
Xinghai Sun 已提交
246

247
```bash
X
Xinghai Sun 已提交
248
cd models/lm
L
lfchener 已提交
249 250
bash download_lm_en.sh
bash download_lm_ch.sh
X
Xinghai Sun 已提交
251
```
252

Y
yangyaming 已提交
253
If you wish to train your own better language model, please refer to [KenLM](https://github.com/kpu/kenlm) for tutorials. Here we provide some tips to show how we preparing our English and Mandarin language models. You can take it as a reference when you train your own.
Y
yangyaming 已提交
254 255 256

#### English LM

H
Hu Weiwei 已提交
257
The English corpus is from the [Common Crawl Repository](http://commoncrawl.org) and you can download it from [statmt](http://data.statmt.org/ngrams/deduped_en). We use part en.00 to train our English language model. There are some preprocessing steps before training:
Y
yangyaming 已提交
258

L
lfchener 已提交
259
  * Characters not in \['A-Za-z0-9\s'\] (\s represents whitespace characters) are removed and Arabic numbers are converted to English numbers like 1000 to one thousand.
Y
yangyaming 已提交
260 261
  * Repeated whitespace characters are squeezed to one and the beginning whitespace characters are removed. Notice that all transcriptions are lowercase, so all characters are converted to lowercase.
  * Top 400,000 most frequent words are selected to build the vocabulary and the rest are replaced with 'UNKNOWNWORD'.
Y
yangyaming 已提交
262

Y
yangyaming 已提交
263
Now the preprocessing is done and we get a clean corpus to train the language model. Our released language model are trained with agruments '-o 5 --prune 0 1 1 1 1'. '-o 5' means the max order of language model is 5. '--prune 0 1 1 1 1' represents count thresholds for each order and more specifically it will prune singletons for orders two and higher. To save disk storage we convert the arpa file to 'trie' binary file with arguments '-a 22 -q 8 -b 8'. '-a' represents the maximum number of leading bits of pointers in 'trie' to chop. '-q -b' are quantization parameters for probability and backoff.
Y
yangyaming 已提交
264

Y
yangyaming 已提交
265 266
#### Mandarin LM

Y
yangyaming 已提交
267
Different from the English language model, Mandarin language model is character-based where each token is a Chinese character. We use internal corpus to train the released Mandarin language models. The corpus contain billions of tokens. The preprocessing has tiny difference from English language model and main steps include:
Y
yangyaming 已提交
268 269

  * The beginning and trailing whitespace characters are removed.
Y
yangyaming 已提交
270 271
  * English punctuations and Chinese punctuations are removed.
  * A whitespace character between two tokens is inserted.
Y
yangyaming 已提交
272

Y
yangyaming 已提交
273
Please notice that the released language models only contain Chinese simplified characters. After preprocessing done we can begin to train the language model. The key training arguments for small LM is '-o 5 --prune 0 1 2 4 4' and '-o 5' for large LM. Please refer above section for the meaning of each argument. We also convert the arpa file to binary file using default settings.
274

275
### Speech-to-text Inference
276

277
An inference module caller `infer.py` is provided to infer, decode and visualize speech-to-text results for several given audio clips. It might help to have an intuitive and qualitative evaluation of the ASR model's performance.
278 279 280

- Inference with GPU:

281
    ```bash
H
Hui Zhang 已提交
282
    CUDA_VISIBLE_DEVICES=0 python3 infer.py
283
    ```
Y
Yibing Liu 已提交
284

X
Xinghai Sun 已提交
285
- Inference with CPUs:
286

287
    ```bash
H
Hui Zhang 已提交
288
    python3 infer.py --use_gpu False
289 290
    ```

X
Xinghai Sun 已提交
291
We provide two types of CTC decoders: *CTC greedy decoder* and *CTC beam search decoder*. The *CTC greedy decoder* is an implementation of the simple best-path decoding algorithm, selecting at each timestep the most likely token, thus being greedy and locally optimal. The [*CTC beam search decoder*](https://arxiv.org/abs/1408.2873) otherwise utilizes a heuristic breadth-first graph search for reaching a near global optimality; it also requires a pre-trained KenLM language model for better scoring and ranking. The decoder type can be set with argument `--decoding_method`.
292 293

For more help on arguments:
294 295

```
H
Hui Zhang 已提交
296
python3 infer.py --help
297
```
H
Hui Zhang 已提交
298
or refer to `example/librispeech/local/run_infer.sh`.
Y
Yibing Liu 已提交
299

300
### Evaluate a Model
Y
Yibing Liu 已提交
301

302
To evaluate a model's performance quantitatively, please run:
303

X
Xinghai Sun 已提交
304
- Evaluation with GPUs:
305

306
    ```bash
H
Hui Zhang 已提交
307
    CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 test.py
308 309
    ```

X
Xinghai Sun 已提交
310
- Evaluation with CPUs:
Y
Yibing Liu 已提交
311

312
    ```bash
H
Hui Zhang 已提交
313
    python3 test.py --use_gpu False
314 315
    ```

316
The error rate (default: word error rate; can be set with `--error_rate_type`) will be printed.
317 318

For more help on arguments:
Y
Yibing Liu 已提交
319

320
```bash
H
Hui Zhang 已提交
321
python3 test.py --help
Y
Yibing Liu 已提交
322
```
H
Hui Zhang 已提交
323
or refer to `example/librispeech/local/run_test.sh`.
Y
Yibing Liu 已提交
324

325
## Hyper-parameters Tuning
Y
Yibing Liu 已提交
326

327
The hyper-parameters $\alpha$ (language model weight) and $\beta$ (word insertion weight) for the [*CTC beam search decoder*](https://arxiv.org/abs/1408.2873) often have a significant impact on the decoder's performance. It would be better to re-tune them on the validation set when the acoustic model is renewed.
Y
Yibing Liu 已提交
328

329
`tools/tune.py` performs a 2-D grid search over the hyper-parameter $\alpha$ and $\beta$. You must provide the range of $\alpha$ and $\beta$, as well as the number of their attempts.
Y
Yibing Liu 已提交
330

331
- Tuning with GPU:
Y
Yibing Liu 已提交
332

333
    ```bash
X
Xinghai Sun 已提交
334
    CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
H
Hui Zhang 已提交
335
    python3 tools/tune.py \
336 337 338 339 340 341
    --alpha_from 1.0 \
    --alpha_to 3.2 \
    --num_alphas 45 \
    --beta_from 0.1 \
    --beta_to 0.45 \
    --num_betas 8
342
    ```
Y
Yibing Liu 已提交
343

344
- Tuning with CPU:
Y
Yibing Liu 已提交
345

346
    ```bash
H
Hui Zhang 已提交
347
    python3 tools/tune.py --use_gpu False
348
    ```
Y
yangyaming 已提交
349
 The grid search will print the WER (word error rate) or CER (character error rate) at each point in the hyper-parameters space, and draw the error surface optionally. A proper hyper-parameters range should include the global minima of the error surface for WER/CER, as illustrated in the following figure.
350

351
<p align="center">
Y
Yibing Liu 已提交
352
<img src="docs/images/tuning_error_surface.png" width=550>
353 354 355
<br/>An example error surface for tuning on the dev-clean set of LibriSpeech
</p>

Y
Yibing Liu 已提交
356
Usually, as the figure shows, the variation of language model weight ($\alpha$) significantly affect the performance of CTC beam search decoder. And a better procedure is to first tune on serveral data batches (the number can be specified) to find out the proper range of hyper-parameters, then change to the whole validation set to carray out an accurate tuning.
357 358

After tuning, you can reset $\alpha$ and $\beta$ in the inference and evaluation modules to see if they really help improve the ASR performance. For more help
Y
Yibing Liu 已提交
359

360
```bash
H
Hui Zhang 已提交
361
python3 tune.py --help
Y
Yibing Liu 已提交
362
```
H
Hui Zhang 已提交
363
or refer to `example/librispeech/local/run_tune.sh`.
Y
Yibing Liu 已提交
364

365 366
## Training for Mandarin Language

H
Hui Zhang 已提交
367
The key steps of training for Mandarin language are same to that of English language and we have also provided an example for Mandarin training with Aishell in ```examples/aishell/local```. As mentioned above, please execute ```sh run_data.sh```, ```sh run_train.sh```, ```sh run_test.sh``` and ```sh run_infer.sh``` to do data preparation, training, testing and inference correspondingly. We have also prepared a pre-trained model (downloaded by ./models/aishell/download_model.sh) for users to try with ```sh run_infer_golden.sh``` and ```sh run_test_golden.sh```. Notice that, different from English LM, the Mandarin LM is character-based and please run ```tools/tune.py``` to find an optimal setting.
X
Xinghai Sun 已提交
368

369
## Trying Live Demo with Your Own Voice
370

L
lfchener 已提交
371
Until now, an ASR model is trained and tested qualitatively (`infer.py`) and quantitatively (`test.py`) with existing audio files. But it is not yet tested with your own speech. `deploy/demo_english_server.py` and `deploy/demo_client.py` helps quickly build up a real-time demo ASR engine with the trained model, enabling you to test and play around with the demo, with your own voice.
X
Xinghai Sun 已提交
372

373
To start the demo's server, please run this in one console:
X
Xinghai Sun 已提交
374

375
```bash
X
Xinghai Sun 已提交
376
CUDA_VISIBLE_DEVICES=0 \
H
Hui Zhang 已提交
377
python3 deploy/demo_server.py \
X
Xinghai Sun 已提交
378 379 380 381
--host_ip localhost \
--host_port 8086
```

382
For the machine (might not be the same machine) to run the demo's client, please do the following installation before moving on.
383 384 385

For example, on MAC OS X:

386
```bash
387 388
brew install portaudio
pip install pyaudio
L
lfchener 已提交
389
pip install keyboard
390
```
X
Xinghai Sun 已提交
391

392
Then to start the client, please run this in another console:
393

394
```bash
X
Xinghai Sun 已提交
395
CUDA_VISIBLE_DEVICES=0 \
H
Hui Zhang 已提交
396
python3 -u deploy/demo_client.py \
X
Xinghai Sun 已提交
397
--host_ip 'localhost' \
X
Xinghai Sun 已提交
398
--host_port 8086
399
```
X
Xinghai Sun 已提交
400

401
Now, in the client console, press the `whitespace` key, hold, and start speaking. Until finishing your utterance, release the key to let the speech-to-text results shown in the console. To quit the client, just press `ESC` key.
X
Xinghai Sun 已提交
402

403
Notice that `deploy/demo_client.py` must be run on a machine with a microphone device, while `deploy/demo_server.py` could be run on one without any audio recording hardware, e.g. any remote server machine. Just be careful to set the `host_ip` and `host_port` argument with the actual accessible IP address and port, if the server and client are running with two separate machines. Nothing should be done if they are running on one single machine.
X
Xinghai Sun 已提交
404

H
Hui Zhang 已提交
405
Please also refer to `examples/deploy_demo/run_english_demo_server.sh`, which will first download a pre-trained English model (trained with 3000 hours of internal speech data) and then start the demo server with the model. With running `examples/deploy_demo/run_demo_client.sh`, you can speak English to test it. If you would like to try some other models, just update `--model_path` argument in the script.  
X
Xinghai Sun 已提交
406 407

For more help on arguments:
408

409
```bash
H
Hui Zhang 已提交
410 411
python3 deploy/demo_server.py --help
python3 deploy/demo_client.py --help
412
```
413

414 415 416 417
## Released Models

#### Speech Model Released

X
Xinghai Sun 已提交
418
Language  | Model Name | Training Data | Hours of Speech
419
:-----------: | :------------: | :----------: |  -------:
L
lfchener 已提交
420 421 422 423
English  | [LibriSpeech Model](https://deepspeech.bj.bcebos.com/eng_models/librispeech_model_fluid.tar.gz) | [LibriSpeech Dataset](http://www.openslr.org/12/) | 960 h
English  | [BaiduEN8k Model](https://deepspeech.bj.bcebos.com/demo_models/baidu_en8k_model_fluid.tar.gz) | Baidu Internal English Dataset | 8628 h
Mandarin | [Aishell Model](https://deepspeech.bj.bcebos.com/mandarin_models/aishell_model_fluid.tar.gz) | [Aishell Dataset](http://www.openslr.org/33/) | 151 h
Mandarin | [BaiduCN1.2k Model](https://deepspeech.bj.bcebos.com/demo_models/baidu_cn1.2k_model_fluid.tar.gz) | Baidu Internal Mandarin Dataset | 1204 h
424 425 426

#### Language Model Released

Y
yangyaming 已提交
427 428
Language Model | Training Data | Token-based | Size | Descriptions
:-------------:| :------------:| :-----: | -----: | :-----------------
Y
Yibing Liu 已提交
429 430 431
[English LM](https://deepspeech.bj.bcebos.com/en_lm/common_crawl_00.prune01111.trie.klm) |  [CommonCrawl(en.00)](http://web-language-models.s3-website-us-east-1.amazonaws.com/ngrams/en/deduped/en.00.deduped.xz) | Word-based | 8.3 GB | Pruned with 0 1 1 1 1; <br/> About 1.85 billion n-grams; <br/> 'trie'  binary with '-a 22 -q 8 -b 8'
[Mandarin LM Small](https://deepspeech.bj.bcebos.com/zh_lm/zh_giga.no_cna_cmn.prune01244.klm) | Baidu Internal Corpus | Char-based | 2.8 GB | Pruned with 0 1 2 4 4; <br/> About 0.13 billion n-grams; <br/> 'probing' binary with default settings
[Mandarin LM Large](https://deepspeech.bj.bcebos.com/zh_lm/zhidao_giga.klm) | Baidu Internal Corpus | Char-based | 70.4 GB | No Pruning; <br/> About 3.7 billion n-grams; <br/> 'probing' binary with default settings
432

433
## Experiments and Benchmarks
434

X
Xinghai Sun 已提交
435
#### Benchmark Results for English Models (Word Error Rate)
X
Xinghai Sun 已提交
436

X
Xinghai Sun 已提交
437
Test Set                | LibriSpeech Model | BaiduEN8K Model
X
Xinghai Sun 已提交
438
:---------------------  | ---------------:  | -------------------:
439 440 441 442 443 444 445
LibriSpeech Test-Clean  |   6.85            |   5.41
LibriSpeech Test-Other  |   21.18           |   13.85
VoxForge American-Canadian | 12.12          |   7.13
VoxForge Commonwealth   |   19.82           |   14.93
VoxForge European       |   30.15           |   18.64
VoxForge Indian         |   53.73           |   25.51
Baidu Internal Testset  |   40.75           |   8.48
446

447
For reproducing benchmark results on VoxForge data, we provide a script to download data and generate VoxForge dialect manifest files. Please go to ```data/voxforge``` and execute ```sh run_data.sh``` to get VoxForge dialect manifest files. Notice that VoxForge data may keep updating and the generated manifest files may have difference from those we evaluated on.
448

X
Xinghai Sun 已提交
449
#### Benchmark Results for Mandarin Model (Character Error Rate)
450

X
Xinghai Sun 已提交
451 452 453
Test Set                |  BaiduCN1.2k Model
:---------------------  |  -------------------:
Baidu Internal Testset  |   12.64
454

455 456
#### Acceleration with Multi-GPUs

L
lfchener 已提交
457
We compare the training time with 1, 2, 4, 8 Tesla V100 GPUs (with a subset of LibriSpeech samples whose audio durations are between 6.0 and 7.0 seconds).  And it shows that a **near-linear** acceleration with multiple GPUs has been achieved. In the following figure, the time (in seconds) cost for training is printed on the blue bars.
458 459 460 461 462 463

<img src="docs/images/multi_gpu_speedup.png" width=450><br/>

| # of GPU  | Acceleration Rate |
| --------  | --------------:   |
| 1         | 1.00 X |
L
lfchener 已提交
464 465 466
| 2         | 1.98 X |
| 4         | 3.73 X |
| 8         | 6.95 X |
467

468
`tools/profile.sh` provides such a profiling tool.
X
Xinghai Sun 已提交
469

470
## Questions and Help
X
Xinghai Sun 已提交
471

Y
Yibing Liu 已提交
472
You are welcome to submit questions and bug reports in [Github Issues](https://github.com/PaddlePaddle/DeepSpeech/issues). You are also welcome to contribute to this project.