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.
36 lines
1.0 KiB
36 lines
1.0 KiB
4 years ago
|
#!/bin/bash
|
||
|
set -e
|
||
|
source path.sh
|
||
|
stage=0
|
||
|
stop_stage=100
|
||
|
EXP_DIR=exp
|
||
4 years ago
|
# LEXICON_NAME in {'phone', 'syllable', 'word'}
|
||
4 years ago
|
LEXICON_NAME='phone'
|
||
4 years ago
|
# set MFA num_jobs as half of machine's cpu core number
|
||
|
NUM_JOBS=$((`nproc`/2))
|
||
4 years ago
|
source ${MAIN_ROOT}/utils/parse_options.sh || exit 1;
|
||
|
|
||
|
# download dataset、unzip and generate manifest
|
||
4 years ago
|
# gen lexicon relink gen dump
|
||
4 years ago
|
if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
|
||
|
# prepare data
|
||
3 years ago
|
echo "Start prepare thchs30 data for MFA ..."
|
||
|
bash ./local/data.sh $LEXICON_NAME || exit -1
|
||
4 years ago
|
fi
|
||
|
|
||
3 years ago
|
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
|
||
|
# run MFA
|
||
|
if [ ! -d "$EXP_DIR/thchs30_alignment" ]; then
|
||
|
echo "Start MFA training ..."
|
||
|
mfa_train_and_align data/thchs30_corpus data/dict/$LEXICON_NAME.lexicon $EXP_DIR/thchs30_alignment -o $EXP_DIR/thchs30_model --clean --verbose --temp_directory exp/.mfa_train_and_align --num_jobs $NUM_JOBS
|
||
|
echo "MFA training done! \nresults: $EXP_DIR/thchs30_alignment \nmodel: $EXP_DIR/thchs30_model\n"
|
||
|
fi
|
||
4 years ago
|
fi
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|