|
|
|
@ -112,8 +112,8 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then
|
|
|
|
|
utils/compute-wer.py --char=1 --v=1 $text $exp/${label_file}_lm > $exp/${wer}.lm
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
wfst=$data/wfst/
|
|
|
|
|
if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
|
|
|
|
|
wfst=$data/wfst/
|
|
|
|
|
mkdir -p $wfst
|
|
|
|
|
if [ ! -f $wfst/aishell_graph.zip ]; then
|
|
|
|
|
pushd $wfst
|
|
|
|
@ -122,18 +122,18 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
|
|
|
|
|
mv aishell_graph/* $wfst
|
|
|
|
|
popd
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
graph_dir=$wfst/
|
|
|
|
|
|
|
|
|
|
if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
|
|
|
|
|
# TLG decoder
|
|
|
|
|
utils/run.pl JOB=1:$nj $data/split${nj}/JOB/recog.wfst.log \
|
|
|
|
|
wfst-decoder-ol \
|
|
|
|
|
--feature_rspecifier=scp:$data/split${nj}/JOB/feat.scp \
|
|
|
|
|
--model_path=$model_dir/avg_1.jit.pdmodel \
|
|
|
|
|
--param_path=$model_dir/avg_1.jit.pdiparams \
|
|
|
|
|
--word_symbol_table=$graph_dir/words.txt \
|
|
|
|
|
--word_symbol_table=$wfst/words.txt \
|
|
|
|
|
--model_output_names=softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0 \
|
|
|
|
|
--graph_path=$graph_dir/TLG.fst --max_active=7500 \
|
|
|
|
|
--graph_path=$wfst/TLG.fst --max_active=7500 \
|
|
|
|
|
--acoustic_scale=1.2 \
|
|
|
|
|
--result_wspecifier=ark,t:$data/split${nj}/JOB/result_tlg
|
|
|
|
|
|
|
|
|
@ -142,40 +142,21 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then
|
|
|
|
|
|
|
|
|
|
cmvn=$data/cmvn.ark
|
|
|
|
|
if [ ! -f $data/split${nj}/1/${aishell_wav_scp} ]; then
|
|
|
|
|
cmvn-json2kaldi --json_file=$ckpt_dir/data/mean_std.json --cmvn_write_path=$cmvn
|
|
|
|
|
./local/split_data.sh $data ${data}/${aishell_wav_scp} $aishell_wav_scp $nj
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
wfst=$data/wfst/
|
|
|
|
|
mkdir -p $wfst
|
|
|
|
|
if [ ! -f $wfst/aishell_graph.zip ]; then
|
|
|
|
|
pushd $wfst
|
|
|
|
|
wget -c https://paddlespeech.bj.bcebos.com/s2t/paddle_asr_online/aishell_graph.zip
|
|
|
|
|
unzip aishell_graph.zip
|
|
|
|
|
popd
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
graph_dir=$wfst/aishell_graph
|
|
|
|
|
|
|
|
|
|
# TLG decoder
|
|
|
|
|
utils/run.pl JOB=1:$nj $data/split${nj}/JOB/recognizer.log \
|
|
|
|
|
recognizer_test_main \
|
|
|
|
|
--wav_rspecifier=scp:$data/split${nj}/JOB/${aishell_wav_scp} \
|
|
|
|
|
--cmvn_file=$cmvn \
|
|
|
|
|
--model_path=$model_dir/avg_1.jit.pdmodel \
|
|
|
|
|
--convert2PCM32=true \
|
|
|
|
|
--to_float32=true \
|
|
|
|
|
--streaming_chunk=30 \
|
|
|
|
|
--params_path=$model_dir/avg_1.jit.pdiparams \
|
|
|
|
|
--word_symbol_table=$graph_dir/words.txt \
|
|
|
|
|
--param_path=$model_dir/avg_1.jit.pdiparams \
|
|
|
|
|
--word_symbol_table=$wfst/words.txt \
|
|
|
|
|
--model_output_names=softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0 \
|
|
|
|
|
--graph_path=$graph_dir/TLG.fst --max_active=7500 \
|
|
|
|
|
--graph_path=$wfst/TLG.fst --max_active=7500 \
|
|
|
|
|
--acoustic_scale=1.2 \
|
|
|
|
|
--result_wspecifier=ark,t:$data/split${nj}/JOB/result_recognizer
|
|
|
|
|
|
|
|
|
|
cat $data/split${nj}/*/result_recognizer > $exp/${label_file}_recognizer
|
|
|
|
|
utils/compute-wer.py --char=1 --v=1 $text $exp/${label_file}_recognizer > $exp/${wer}.recognizer
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|