-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_sys_generic.sh
59 lines (49 loc) · 1.54 KB
/
test_sys_generic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# this script is the generic script for test ASR results (different test corpus, different LMs and different ditcs)
if [ $# -ne 10 ]; then
echo "usage ${0} lm_dmp_dir gt dic_dir acoustic_dir test_dir test_corpus wav_dir hyp_dir log_dir dic_name";
exit -1;
fi
lm_dmp_dir=${1}
gt=${2}
dic_dir=${3}
acoustic_dir=${4}
test_dir=${5}
test_corpus=${6}
wav_dir=${7}
hyp_dir=${8}
log_dir=${9}
dic_name=${10}
# you can comment the line above and use one of dict_names below
#dic_name=4in1_gt1_var5
#dic_name=3in1_gt1_var5
log_dir=${test_dir}/${log_dir}
hyp_dir=${test_dir}/${hyp_dir}
mkdir -p ${hyp_dir}
mkdir -p ${log_dir}
printf "lm_dmp_dir: %s\n" "${lm_dmp_dir}"
printf "dic_dir: %s\n" "${dic_dir}"
printf "acoustic_dir: %s\n" "${acoustic_dir}"
printf "test_dir: %s\n" "${test_dir}"
printf "test_corpus: %s\n" "${test_corpus}"
printf "wav_dirs: %s\n" "${wav_dir}"
printf "hyp_dir: %s\n" "${hyp_dir}"
printf "log_dir: %s\n" "${log_dir}"
printf "%s\n" "------------------------------"
for lm in ${lm_dmp_dir}/*gt${gt}*
do
printf "lm: %s\n" "${lm}"
lm_name=$(basename $lm)
printf "lm_name: %s\n" "${lm_name}"
#dic_name=$(echo $lm_name | cut -d '.' -f1)
printf "dic_name: %s\n" "${dic_name}"
nohup pocketsphinx_batch \
-adcin yes \
-cepdir ${wav_dir} \
-cepext .wav \
-ctl ${test_dir}/${test_corpus}_test.fileids \
-lm ${lm} \
-dict ${dic_dir}/${dic_name}.dic \
-hmm ${acoustic_dir}/model_parameters/s0192_spk.cd_cont_1000 \
-hyp ${hyp_dir}/${test_corpus}_${lm_name}_${dic_name}.hyp &> ${log_dir}/${test_corpus}_${lm_name}_${dic_name}.out&
done