-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 blank scale for wfst decoding #1646
Conversation
thx, any numbers? |
|
runtime/core/decoder/asr_decoder.cc
Outdated
@@ -107,6 +107,10 @@ DecodeState AsrDecoder::AdvanceDecoding(bool block) { | |||
std::vector<std::vector<float>> ctc_log_probs; | |||
model_->ForwardEncoder(chunk_feats, &ctc_log_probs); | |||
int forward_time = timer.Elapsed(); | |||
for (int i = 0; i < ctc_log_probs.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (opts_.ctc_wfst_search_opts.blank_scale != 1.0) {
for (int i = 0; i < ctc_log_probs.size(); i++) {
ctc_log_probs[i][0] = ctc_log_probs[i][0]
+ std::log(opts_.ctc_wfst_search_opts.blank_scale);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonwang517 please fix the logic as above to avoid useless computation when blank_scale is 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robin1001 have updated code to avoid useless computation
blank scale can smooth wfst decoding score