run.sh 1.1 KB
Newer Older
F
Feiyu Chan 已提交
1
#!/usr/bin/env bash
H
Hui Zhang 已提交
2

F
Feiyu Chan 已提交
3 4 5 6 7
source path.sh

stage=-1
stop_stage=100

H
Hui Zhang 已提交
8
exp_dir=exp
H
Hui Zhang 已提交
9
data=data
H
Hui Zhang 已提交
10

F
Feiyu Chan 已提交
11
source ${MAIN_ROOT}/utils/parse_options.sh || exit -1
H
Hui Zhang 已提交
12

F
Feiyu Chan 已提交
13
mkdir -p ${exp_dir}
H
Hui Zhang 已提交
14

H
Hui Zhang 已提交
15
if [ $stage -le -1 ] && [ $stop_stage -ge -1 ];then
H
huangyuxin 已提交
16 17 18 19 20 21 22
    mkdir -p ${data}
    cd ${data}
    if [ ! -f BZNSYP.rar ]; then
        wget https://paddlespeech.bj.bcebos.com/datasets/BZNSYP.rar
    fi
    cd -
    test -e ${data}/BZNSYP.rar || { echo "Please download BZNSYP.rar and put it in "${data}; exit -1; }
H
Hui Zhang 已提交
23
fi
H
Hui Zhang 已提交
24 25 26

if [ $stage -le 0 ] && [ $stop_stage -ge 0 ];then
    echo "stage 0: Extracting Prosody Labeling"
H
Hui Zhang 已提交
27
    bash local/prepare_dataset.sh --exp-dir ${exp_dir} --data-dir ${data}
H
Hui Zhang 已提交
28
fi
F
Feiyu Chan 已提交
29 30 31 32

# convert transcription in chinese into pinyin with pypinyin or jieba+pypinyin
filename="000001-010000.txt"

H
Hui Zhang 已提交
33 34 35 36 37 38 39
if [ $stage -le 1 ] && [ $stop_stage -ge 1 ]; then
    echo "stage 1: Processing transcriptions..."
    python3 local/extract_pinyin_label.py ${exp_dir}/${filename} ${exp_dir}/ref.pinyin

    python3 local/convert_transcription.py ${exp_dir}/${filename} ${exp_dir}/trans.pinyin
    python3 local/convert_transcription.py --use-jieba ${exp_dir}/${filename} ${exp_dir}/trans.jieba.pinyin
fi
F
Feiyu Chan 已提交
40 41 42

echo "done"
exit 0