diff --git a/native_client/ctcdecode/ctc_beam_search_decoder.cpp b/native_client/ctcdecode/ctc_beam_search_decoder.cpp index a5f9cb27..856ca4a2 100644 --- a/native_client/ctcdecode/ctc_beam_search_decoder.cpp +++ b/native_client/ctcdecode/ctc_beam_search_decoder.cpp @@ -170,7 +170,8 @@ DecoderState::decode() const if (!prefix->is_empty() && prefix->character != space_id_) { float score = 0.0; std::vector ngram = ext_scorer_->make_ngram(prefix); - score = ext_scorer_->get_log_cond_prob(ngram) * ext_scorer_->alpha; + bool bos = ngram.size() < ext_scorer_->get_max_order(); + score = ext_scorer_->get_log_cond_prob(ngram, bos) * ext_scorer_->alpha; score += ext_scorer_->beta; scores[prefix] += score; }