Decoder implements a beam seach decoder that finds the word transcription W maximizing:
flashlighttext::Decoder -> LexiconDecoder
new()LexiconDecoder$new(
options,
trie,
lm,
sil_token_idx,
blank_token_idx,
unk_token_idx,
transitions,
is_lm_token
)optionsa LexiconDecoderOptions instance
triea Trie instance. Lexicon trie to restrict beam-search decoder
lma LM instance (e.g. KenLM or ZeroLM)
sil_token_idxa character. The silence token index
blank_token_idxa character. The blank token index (for CTC)
unk_token_idxa character. The unkown token index
transitionsa tensor. Matrix of transitions (for ASG criterion)
is_lm_tokena is_lm_token
LexiconDecoder
n_hypothesis()LexiconDecoder$n_hypothesis()an integer
clone()The objects of this class are cloneable with this method.
LexiconDecoder$clone(deep = FALSE)deepWhether to make a deep clone.
AM(W) + lmWeight_ * log(P_lm(W)) + wordScore_ * |W_known| + unkScore_ * |W_unknown| + silScore_ * |i| pi_i = <sil>|
where P_lm(W) is the language model score, pi_i is the value for the i-th frame in the path leading to W and AM(W) is the (unnormalized) emitting model score of the transcription W. Note that the lexicon is used to limit the search space and all candidate words are generated from it if unkScore is -inf, otherwise <UNK> will be generated for OOVs.