You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
7 years ago
|
#! /usr/bin/bash
|
||
|
|
||
7 years ago
|
pushd ../.. > /dev/null
|
||
7 years ago
|
|
||
|
# download data, generate manifests
|
||
|
python data/librispeech/librispeech.py \
|
||
|
--manifest_prefix='data/librispeech/manifest' \
|
||
7 years ago
|
--target_dir='~/.cache/paddle/dataset/speech/Libri' \
|
||
|
--full_download='True'
|
||
7 years ago
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo "Prepare LibriSpeech failed. Terminated."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
7 years ago
|
cat data/librispeech/manifest.train-* | shuf > data/librispeech/manifest.train
|
||
7 years ago
|
|
||
|
|
||
7 years ago
|
# build vocabulary
|
||
|
python tools/build_vocab.py \
|
||
|
--count_threshold=0 \
|
||
|
--vocab_path='data/librispeech/vocab.txt' \
|
||
|
--manifest_paths='data/librispeech/manifest.train'
|
||
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo "Build vocabulary failed. Terminated."
|
||
|
exit 1
|
||
|
fi
|
||
7 years ago
|
|
||
|
|
||
|
# compute mean and stddev for normalizer
|
||
|
python tools/compute_mean_std.py \
|
||
|
--manifest_path='data/librispeech/manifest.train' \
|
||
|
--num_samples=2000 \
|
||
|
--specgram_type='linear' \
|
||
|
--output_path='data/librispeech/mean_std.npz'
|
||
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo "Compute mean and stddev failed. Terminated."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
echo "LibriSpeech Data preparation done."
|
||
7 years ago
|
exit 0
|