зеркало из https://github.com/mozilla/kaldi.git
Use outupt file arg of arpa2fst instead of redirection
This commit is contained in:
Родитель
64ca6aed76
Коммит
2cc2c1edd3
|
@ -17,7 +17,7 @@ cp -r data/lang data/lang_test
|
|||
|
||||
gunzip -c "$arpa_lm" | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=data/lang_test/words.txt - >data/lang_test/G.fst
|
||||
--read-symbol-table=data/lang_test/words.txt - data/lang_test/G.fst
|
||||
|
||||
echo "Checking how stochastic G is (the first of these numbers should be small):"
|
||||
fstisstochastic data/lang_test/G.fst
|
||||
|
|
|
@ -30,7 +30,7 @@ for lm_suffix in tgpr; do
|
|||
done
|
||||
gunzip -c $lm_dir/lm_${lm_suffix}.arpa.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$test/words.txt - > $test/G.fst
|
||||
--read-symbol-table=$test/words.txt - $test/G.fst
|
||||
|
||||
utils/validate_lang.pl $test || exit 1;
|
||||
done
|
||||
|
|
|
@ -51,7 +51,7 @@ for lm_suffix in tgsmall tgmed; do
|
|||
cp -r ${src_dir}/* $test
|
||||
gunzip -c $lm_dir/lm_${lm_suffix}.arpa.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$test/words.txt - > $test/G.fst
|
||||
--read-symbol-table=$test/words.txt - $test/G.fst
|
||||
utils/validate_lang.pl --skip-determinization-check $test || exit 1;
|
||||
done
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ for lm_suffix in bg tgpr tg bg_5k tgpr_5k tg_5k; do
|
|||
|
||||
gunzip -c $lmdir/lm_${lm_suffix}.arpa.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$test/words.txt - > $test/G.fst
|
||||
--read-symbol-table=$test/words.txt - $test/G.fst
|
||||
|
||||
utils/validate_lang.pl --skip-determinization-check $test || exit 1;
|
||||
done
|
||||
|
|
|
@ -46,12 +46,12 @@ fi
|
|||
# not work for LMs generated from all toolkits.
|
||||
gunzip -c $lm_srcdir_3g/lm_pr6.0.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$lang/words.txt - > data/lang${lang_suffix}_test_bd_tgpr/G.fst || exit 1;
|
||||
--read-symbol-table=$lang/words.txt - data/lang${lang_suffix}_test_bd_tgpr/G.fst || exit 1;
|
||||
fstisstochastic data/lang${lang_suffix}_test_bd_tgpr/G.fst
|
||||
|
||||
gunzip -c $lm_srcdir_3g/lm_unpruned.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$lang/words.txt - > data/lang${lang_suffix}_test_bd_tg/G.fst || exit 1;
|
||||
--read-symbol-table=$lang/words.txt - data/lang${lang_suffix}_test_bd_tg/G.fst || exit 1;
|
||||
fstisstochastic data/lang${lang_suffix}_test_bd_tg/G.fst
|
||||
|
||||
# Build ConstArpaLm for the unpruned language model.
|
||||
|
@ -62,7 +62,7 @@ gunzip -c $lm_srcdir_3g/lm_unpruned.gz | \
|
|||
|
||||
gunzip -c $lm_srcdir_4g/lm_unpruned.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$lang/words.txt - > data/lang${lang_suffix}_test_bd_fg/G.fst || exit 1;
|
||||
--read-symbol-table=$lang/words.txt - data/lang${lang_suffix}_test_bd_fg/G.fst || exit 1;
|
||||
fstisstochastic data/lang${lang_suffix}_test_bd_fg/G.fst
|
||||
|
||||
# Build ConstArpaLm for the unpruned language model.
|
||||
|
@ -73,7 +73,7 @@ gunzip -c $lm_srcdir_4g/lm_unpruned.gz | \
|
|||
|
||||
gunzip -c $lm_srcdir_4g/lm_pr7.0.gz | \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$lang/words.txt - > data/lang${lang_suffix}_test_bd_fgpr/G.fst || exit 1;
|
||||
--read-symbol-table=$lang/words.txt - data/lang${lang_suffix}_test_bd_fgpr/G.fst || exit 1;
|
||||
fstisstochastic data/lang${lang_suffix}_test_bd_fgpr/G.fst
|
||||
|
||||
exit 0;
|
||||
|
|
|
@ -112,7 +112,7 @@ while read line; do
|
|||
printf("\n"); }' > $wdir/text
|
||||
ngram-count -text $wdir/text -order $ngram_order "$srilm_options" -lm - |\
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$lang/words.txt - > $wdir/G.fst || exit 1;
|
||||
--read-symbol-table=$lang/words.txt - $wdir/G.fst || exit 1;
|
||||
fi
|
||||
fstisstochastic $wdir/G.fst || echo "$0: $uttid/G.fst not stochastic."
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ done
|
|||
lm_base=$(basename $lm '.gz')
|
||||
gunzip -c $lm \
|
||||
arpa2fst --disambig-symbol=#0 \
|
||||
--read-symbol-table=$out_dir/words.txt - > $out_dir/G.fst
|
||||
--read-symbol-table=$out_dir/words.txt - $out_dir/G.fst
|
||||
set +e
|
||||
fstisstochastic $out_dir/G.fst
|
||||
set -e
|
||||
|
|
Загрузка…
Ссылка в новой задаче