recognizer.sh 1.1 KB
Newer Older
H
Hui Zhang 已提交
1 2 3 4 5
#!/bin/bash
set -e

data=data
exp=exp
H
Hui Zhang 已提交
6
nj=20
H
Hui Zhang 已提交
7

8
. utils/parse_options.sh
H
Hui Zhang 已提交
9

H
Hui Zhang 已提交
10 11
mkdir -p $exp
ckpt_dir=./data/model
12
model_dir=$ckpt_dir/asr1_chunk_conformer_u2pp_wenetspeech_static_1.3.0.model/
H
Hui Zhang 已提交
13
aishell_wav_scp=aishell_test.scp
H
Hui Zhang 已提交
14
text=$data/test/text
H
Hui Zhang 已提交
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

./local/split_data.sh $data $data/$aishell_wav_scp $aishell_wav_scp $nj

utils/run.pl JOB=1:$nj $data/split${nj}/JOB/recognizer.log \
u2_recognizer_main \
    --use_fbank=true \
    --num_bins=80 \
    --cmvn_file=$exp/cmvn.ark \
    --model_path=$model_dir/export.jit \
    --vocab_path=$model_dir/unit.txt \
    --nnet_decoder_chunk=16 \
    --receptive_field_length=7 \
    --subsampling_rate=4 \
    --wav_rspecifier=scp:$data/split${nj}/JOB/${aishell_wav_scp} \
    --result_wspecifier=ark,t:$data/split${nj}/JOB/result_recognizer.ark


H
Hui Zhang 已提交
32 33
cat $data/split${nj}/*/result_recognizer.ark > $exp/aishell_recognizer
utils/compute-wer.py --char=1 --v=1 $text $exp/aishell_recognizer > $exp/aishell.recognizer.err
H
Hui Zhang 已提交
34
echo "recognizer test have finished!!!"
H
Hui Zhang 已提交
35
echo "please checkout in $exp/aishell.recognizer.err"
H
Hui Zhang 已提交
36
tail -n 7 $exp/aishell.recognizer.err