-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_oov.sh
42 lines (35 loc) · 1.21 KB
/
get_oov.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
#!/usr/bin/env bash
# this script get OOV words for a transciption with respect the hyp
################## generic code #################################
function get_oov_words {
test_dir=${1}
transcription=${2}
printf "processing \n%s\n%s\n------------\n" ${test_dir} ${transcription}
mkdir -p ${test_dir}/oov
oov_dir=${test_dir}/oov
for hyp in ${test_dir}/hyp/*gt*00*
do
printf "%s\n" ${hyp}
hyp_name=$(basename ${hyp})
python ~/asr_dev/sphinx-eval/get_oov.py \
--ref ${test_dir}/${transcription} --hyp ${hyp} --oov ${oov_dir}/${hyp_name}.oov
done
}
################## end of generic code ###########################
# change arguments according to your system
# word align kacst
test_corpus="asr-test/kacst"
trs=kacst500_test.transcription
get_oov_words ${test_corpus} ${trs}
# word align N7_020723_RMC_AR
test_corpus="asr-test/N7_020723_RMC"
trs=N7_020723_RMC_AR_test.transcription
get_oov_words ${test_corpus} ${trs}
# word align N7_040810_MED_AR
test_corpus="asr-test/N7_040810_MED"
trs=N7_040810_MED_AR_test.transcription
get_oov_words ${test_corpus} ${trs}
# word align jsc
test_corpus="asr-test/jsc"
trs=jsc_test.transcription
get_oov_words ${test_corpus} ${trs}