begin to add LM rescoring.

This commit is contained in:
Fangjun Kuang 2021-07-24 18:24:04 +08:00
parent a9095925ba
commit 00f8371f37
2 changed files with 12 additions and 2 deletions

View File

@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15]
python-version: [3.7, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
torch: ["1.8.1"]
k2-version: ["1.2.dev20210723"]
fail-fast: false

View File

@ -93,13 +93,23 @@ if [ $stage -le 6 ] && [ $stop_stage -ge 6 ]; then
# We assume you have install kaldilm, if not, please install
# it using: pip install kaldilm
if [ ! -e data/lm/G_3_gram.fst.txt ]; then
if [ ! -f data/lm/G_3_gram.fst.txt ]; then
# It is used in building HLG
python3 -m kaldilm \
--read-symbol-table="data/lang/words.txt" \
--disambig-symbol='#0' \
--max-order=3 \
data/lm/3-gram.pruned.1e-7.arpa > data/lm/G_3_gram.fst.txt
fi
if [ ! -f data/lm/G_4_gram.fst.txt ]; then
# It is used for LM rescoring
python3 -m kaldilm \
--read-symbol-table="data/lang/words.txt" \
--disambig-symbol='#0' \
--max-order=4 \
data/lm/4-gram.arpa > data/lm/G_4_gram.fst.txt
fi
fi
if [ $stage -le 7 ] && [ $stop_stage -ge 7 ]; then