alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.68k stars 1.08k forks source link

Relabeled HCL does not work with test_words.py #907

Open lucgeo opened 2 years ago

lucgeo commented 2 years ago

Hi,

I create HCLr.fst with the following procedure:

./utils/mkgraph_lookahead.sh --self-loop-scale 1.0 --remove-oov --compose-graph <lang_test_dir> exp/chain/tdnn1g_sp_bi exp-train/chain/tdnn1g_sp_bi/graph_lookahead

I use this HCLr with test_words.py, but it does not work because the dinamically created Gr.fst is not relabeled and not fstarcsort. If I manually create a Gr.fst including the relabeing (command below) process and use it with the HCLr.fst, then everything works fine. My question is: how do I create a HCLr.fst that can work with test_word.py?

Thank you!

farcompilestrings --fst_type=compact --symbols=<lang_test_dir>/words.txt --keep_symbols text.txt | ngramcount | ngrammake | fstrelabel --relabel_ipairs=exp-train/chain/tdnn1g_sp_bi/graph_lookahead/relabel | fstarcsort --sort_type=ilabel | fstconvert --fst_type=const > Gr.fst

nshmyrev commented 2 years ago

It is not about HCLr.fst probably. Most likely the symbols you have in the model (either in words.txt or Gr.fst) are not relabelled.