-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use an n-gram LM to rescore the lattice from fast_beam_search. #365
Conversation
Hm, interesting. Regarding the n-best stuff, we should try to figure out why your results seem to be different from Liyong's. |
I just added also epsilon self-loops to G and remove epsilon self-loops from the rescored word_fsas after instercting with G. The results are the same, i.e., not improved. |
why does 'fast_beam_search_with_nbest_rescoring' have nbest in it if it is lattice based? |
Anyway the decoding method is cool. I looked briefly at the code and did not see any obvious problems. |
I am using nbest rescoring, i.e., extracting n paths from the lattice, unique them, and then intersect them with the given G. That is why the decoding name contains nbest. I am not intersecting the generated lattice with the G directly since the generated lattice is an acceptor containing token IDs, while G contains word IDs. I think we can intersect the genreated lattice with an LG graph, instead of a G. |
Nice implementation. I will study this. |
One possibility: Liyong might simply be using a larger LM, since KenLM is a compact format? |
After checking the config, I was using a larger LM, with 23G(mine) vs. 4.1G(downlowned from https://www.openslr.org/11/) . |
that is probably converted from the 4-gram.arpa.gz downloaded from here https://www.openslr.org/11/ |
I have tried the 4-gram and 3-gram that are used by the conformer_ctc setup. icefall/egs/librispeech/ASR/local/download_lm.py Lines 60 to 61 in f6ce135
|
Here is the Larger arpa I am using trained by myself. |
@csukuangfj I am testing this branch on my machine and I am not seeing the same results. Could you tell me which models are you using (epoch and average) ? Thank you ! |
@ezerhouni I just uploaded two new checkpoints to the |
@csukuangfj I am not seeing them Last commit is from 21 days ago (the yesterday commit is only about modifying the readme) |
Sorry. Please check again. |
@csukuangfj Thanks ! I just test it. I got the same result as yours for the test-clean (i.e ngram_lm_scale_0) is the best, for test-other I am getting slightly better :
I will try to work on it a bit in the coming days (if I can find some spare time) and I will let you know if we can improve the results |
Thanks! |
I think this PR can be closed |
The PR adds another two decoding methods
fast_beam_search_nbest
, similar to fast_beam_search, but it uses k2.random_paths() to samplen
paths from the lattice instead of usingk2.shortest_path()
fast_beam_search_with_nbest_rescoring
: It uses an n-gram LM to rescore the lattice obtained from fast_beam_search. However, it does not seem to be helpful.