Skip to content
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

Add "length_penalty" config option #7

Open
FredSRichardson opened this issue Dec 11, 2023 · 0 comments
Open

Add "length_penalty" config option #7

FredSRichardson opened this issue Dec 11, 2023 · 0 comments

Comments

@FredSRichardson
Copy link

FredSRichardson commented Dec 11, 2023

This is a very small change that helps quite a lot I've found. The WeNet decoder has an option "length_penalty" which really helps control deletion rates which by default tend to be really high.

A good reference for the code change is in the WeNet code base. The relevant lines are linked below. Basically you add "length_penalty" (a float param with a negative value like -3.0 - so a bonus...) the following two places in ProcessEmitting() in kaldi-decoder/csrc/faster-decoder.cc and of course add the corresponding config option to kaldi-decoder/csrc/faster-decoder.h and kaldi-decoder/python/csrc/faster-decoder.cc:

runtime/core/kaldi/decoder/lattice-faster-decoder.cc#L781-L783

runtime/core/kaldi/decoder/lattice-faster-decoder.cc#L811-L813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant