22
33# This is not necessarily the top-level run.sh as it is in other directories. see README.txt first.
44tri5_only=false
5+
56[ ! -f ./lang.conf ] && echo " Language configuration does not exist! Use the configurations in conf/lang/* as a startup" && exit 1
67[ ! -f ./conf/common_vars.sh ] && echo " the file conf/common_vars.sh does not exist!" && exit 1
78
@@ -10,6 +11,8 @@ tri5_only=false
1011
1112[ -f local.conf ] && . ./local.conf
1213
14+ . ./utils/parse_options.sh
15+
1316set -e # Exit on non-zero return code from any command
1417set -o pipefail # Exit if any of the commands in the pipeline will
1518 # return non-zero return code
@@ -24,12 +27,12 @@ if [ ! -d data/raw_train_data ]; then
2427 local/make_corpus_subset.sh " $train_data_dir " " $train_data_list " ./data/raw_train_data
2528 train_data_dir=` readlink -f ./data/raw_train_data`
2629
27- nj_max= ` cat $train_data_list | wc -l `
28- if [[ " $ nj_max" -lt " $train_nj " ]] ; then
29- echo " The maximum reasonable number of jobs is $nj_max (you have $train_nj )! (The training and decoding process has file-granularity) "
30- exit 1 ;
31- train_nj= $nj_max
32- fi
30+ fi
31+ nj_max= ` cat $train_data_list | wc -l `
32+ if [[ " $nj_max " -lt " $train_nj " ]] ; then
33+ echo " The maximum reasonable number of jobs is $nj_max (you have $train_nj )! (The training and decoding process has file-granularity) "
34+ exit 1 ;
35+ train_nj= $nj_max
3336fi
3437train_data_dir=` readlink -f ./data/raw_train_data`
3538
@@ -59,8 +62,9 @@ if [[ ! -f data/local/lexicon.txt || data/local/lexicon.txt -ot "$lexicon_file"
5962 echo ---------------------------------------------------------------------
6063 echo " Preparing lexicon in data/local on" ` date`
6164 echo ---------------------------------------------------------------------
65+ local/make_lexicon_subset.sh $train_data_dir /transcription $lexicon_file data/local/filtered_lexicon.txt
6266 local/prepare_lexicon.pl --phonemap " $phoneme_mapping " \
63- $lexiconFlags $lexicon_file data/local
67+ $lexiconFlags data/local/filtered_lexicon.txt data/local
6468fi
6569
6670mkdir -p data/lang
@@ -116,6 +120,7 @@ if [[ ! -f data/srilm/lm.gz || data/srilm/lm.gz -ot data/train/text ]]; then
116120 local/train_lms_srilm.sh --dev-text data/dev2h/text \
117121 --train-text data/train/text data data/srilm
118122fi
123+
119124if [[ ! -f data/lang/G.fst || data/lang/G.fst -ot data/srilm/lm.gz ]]; then
120125 echo ---------------------------------------------------------------------
121126 echo " Creating G.fst on " ` date`
@@ -152,8 +157,7 @@ if [ ! -f data/train/.plp.done ]; then
152157 rm -rf {plp,ffv}_tmp_train data/train_{plp,ffv}
153158 fi
154159 utils/fix_data_dir.sh data/train
155- steps/compute_cmvn_stats.sh \
156- data/train exp/make_plp/train plp
160+ steps/compute_cmvn_stats.sh data/train exp/make_plp/train plp
157161 # In case plp or pitch extraction failed on some utterances, delist them
158162 utils/fix_data_dir.sh data/train
159163 touch data/train/.plp.done
@@ -273,6 +277,12 @@ if [ ! -f exp/tri5_ali/.done ]; then
273277 touch exp/tri5_ali/.done
274278fi
275279
280+ if $tri5_only ; then
281+ echo " Exiting after stage TRI5, as requested. "
282+ echo " Everything went fine. Done"
283+ exit 0;
284+ fi
285+
276286if [ ! -f exp/ubm5/.done ]; then
277287 echo ---------------------------------------------------------------------
278288 echo " Starting exp/ubm5 on" ` date`
@@ -311,11 +321,6 @@ if [ ! -f exp/sgmm5_ali/.done ]; then
311321 touch exp/sgmm5_ali/.done
312322fi
313323
314- if $tri5_only ; then
315- echo " Exiting after stage TRI5, as requested. "
316- echo " Everything went fine. Done"
317- exit 0;
318- fi
319324
320325if [ ! -f exp/sgmm5_denlats/.done ]; then
321326 echo ---------------------------------------------------------------------
@@ -334,7 +339,7 @@ if [ ! -f exp/sgmm5_mmi_b0.1/.done ]; then
334339 echo ---------------------------------------------------------------------
335340 steps/train_mmi_sgmm2.sh \
336341 --cmd " $train_cmd " " ${sgmm_mmi_extra_opts[@]} " \
337- --zero-if-disjoint true --transform-dir exp/tri5_ali --boost 0.1 \
342+ --drop-frames true --transform-dir exp/tri5_ali --boost 0.1 \
338343 data/train data/lang exp/sgmm5_ali exp/sgmm5_denlats \
339344 exp/sgmm5_mmi_b0.1
340345 touch exp/sgmm5_mmi_b0.1/.done
0 commit comments