From f44d2ddeb93f759b7c14a2e9bca48e2a1e76e002 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Tue, 17 Dec 2019 09:39:14 +0100 Subject: [PATCH] Don't OOV_SCORE on empty prefix Fixes #2579 --- native_client/ctcdecode/ctc_beam_search_decoder.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/native_client/ctcdecode/ctc_beam_search_decoder.cpp b/native_client/ctcdecode/ctc_beam_search_decoder.cpp index 5a2c834e..7ec00f2f 100644 --- a/native_client/ctcdecode/ctc_beam_search_decoder.cpp +++ b/native_client/ctcdecode/ctc_beam_search_decoder.cpp @@ -169,9 +169,7 @@ DecoderState::decode() const if (ext_scorer_ != nullptr) { for (size_t i = 0; i < beam_size_ && i < prefixes_copy.size(); ++i) { auto prefix = prefixes_copy[i]; - if (prefix->is_empty()) { - scores[prefix] = OOV_SCORE; - } else if (!ext_scorer_->is_scoring_boundary(prefix->parent, prefix->character)) { + if (!ext_scorer_->is_scoring_boundary(prefix->parent, prefix->character)) { float score = 0.0; std::vector ngram = ext_scorer_->make_ngram(prefix); bool bos = ngram.size() < ext_scorer_->get_max_order();