From c8802a38e7767dea01f2731f243be7f7555f4c28 Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Mon, 14 Oct 2019 11:48:44 +0200 Subject: [PATCH] Don't add special tokens to vocabulary --- native_client/ctcdecode/scorer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native_client/ctcdecode/scorer.cpp b/native_client/ctcdecode/scorer.cpp index 49a6d794..c265b430 100644 --- a/native_client/ctcdecode/scorer.cpp +++ b/native_client/ctcdecode/scorer.cpp @@ -296,7 +296,9 @@ void Scorer::fill_dictionary(const std::vector& vocabulary, bool ad fst::StdVectorFst dictionary; // For each unigram convert to ints and put in trie for (const auto& word : vocabulary) { - add_word_to_dictionary(word, char_map_, add_space, SPACE_ID_ + 1, &dictionary); + if (word != START_TOKEN && word != UNK_TOKEN && word != END_TOKEN) { + add_word_to_dictionary(word, char_map_, add_space, SPACE_ID_ + 1, &dictionary); + } } /* Simplify FST