|
|
|
@ -2,18 +2,19 @@
|
|
|
|
|
set +x
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
. path.sh
|
|
|
|
|
|
|
|
|
|
# 1. compile
|
|
|
|
|
if [ ! -d ../../build/examples ]; then
|
|
|
|
|
cd ../..
|
|
|
|
|
if [ ! -d ${SPEECHX_EXAMPLES} ]; then
|
|
|
|
|
pushd ${SPEECHX_ROOT}
|
|
|
|
|
bash build.sh
|
|
|
|
|
cd -
|
|
|
|
|
popd
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
. ../path.sh
|
|
|
|
|
|
|
|
|
|
# 2. download model
|
|
|
|
|
if [ ! -d ../paddle_asr_model ]; then
|
|
|
|
|
wget https://paddlespeech.bj.bcebos.com/s2t/paddle_asr_online/paddle_asr_model.tar.gz
|
|
|
|
|
wget -c https://paddlespeech.bj.bcebos.com/s2t/paddle_asr_online/paddle_asr_model.tar.gz
|
|
|
|
|
tar xzfv paddle_asr_model.tar.gz
|
|
|
|
|
mv ./paddle_asr_model ../
|
|
|
|
|
# produce wav scp
|
|
|
|
@ -25,8 +26,15 @@ feat_wspecifier=./feats.ark
|
|
|
|
|
cmvn=./cmvn.ark
|
|
|
|
|
|
|
|
|
|
# 3. run feat
|
|
|
|
|
linear_spectrogram_main --wav_rspecifier=scp:$model_dir/wav.scp --feature_wspecifier=ark:$feat_wspecifier --cmvn_write_path=$cmvn
|
|
|
|
|
linear_spectrogram_main \
|
|
|
|
|
--wav_rspecifier=scp:$model_dir/wav.scp \
|
|
|
|
|
--feature_wspecifier=ark,t:$feat_wspecifier \
|
|
|
|
|
--cmvn_write_path=$cmvn
|
|
|
|
|
|
|
|
|
|
# 4. run decoder
|
|
|
|
|
offline_decoder_main --feature_respecifier=ark:$feat_wspecifier --model_path=$model_dir/avg_1.jit.pdmodel --param_path=$model_dir/avg_1.jit.pdparams --dict_file=$model_dir/vocab.txt --lm_path=$model_dir/avg_1.jit.klm
|
|
|
|
|
|
|
|
|
|
offline_decoder_main \
|
|
|
|
|
--feature_respecifier=ark:$feat_wspecifier \
|
|
|
|
|
--model_path=$model_dir/avg_1.jit.pdmodel \
|
|
|
|
|
--param_path=$model_dir/avg_1.jit.pdparams \
|
|
|
|
|
--dict_file=$model_dir/vocab.txt \
|
|
|
|
|
--lm_path=$model_dir/avg_1.jit.klm
|