run_data.sh 879 字节
Newer Older
Y
yangyaming 已提交
1 2 3
#! /usr/bin/env bash

# download data, generate manifests
H
Hui Zhang 已提交
4 5 6
PYTHONPATH=.:$PYTHONPATH python3 local/aishell.py \
--manifest_prefix="data/manifest" \
--target_dir="./dataset/aishell"
Y
yangyaming 已提交
7 8 9 10 11 12 13 14

if [ $? -ne 0 ]; then
    echo "Prepare Aishell failed. Terminated."
    exit 1
fi


# build vocabulary
H
Hui Zhang 已提交
15
python3 ${MAIN_ROOT}/tools/build_vocab.py \
Y
yangyaming 已提交
16
--count_threshold=0 \
H
Hui Zhang 已提交
17 18
--vocab_path="data/vocab.txt" \
--manifest_paths "data/manifest.train" "data/manifest.dev"
Y
yangyaming 已提交
19 20 21 22 23 24 25 26

if [ $? -ne 0 ]; then
    echo "Build vocabulary failed. Terminated."
    exit 1
fi


# compute mean and stddev for normalizer
H
Hui Zhang 已提交
27 28
python3 ${MAIN_ROOT}/tools/compute_mean_std.py \
--manifest_path="data/manifest.train" \
Y
yangyaming 已提交
29
--num_samples=2000 \
H
Hui Zhang 已提交
30 31
--specgram_type="linear" \
--output_path="data/mean_std.npz"
Y
yangyaming 已提交
32 33 34 35 36 37 38 39 40

if [ $? -ne 0 ]; then
    echo "Compute mean and stddev failed. Terminated."
    exit 1
fi


echo "Aishell data preparation done."
exit 0