Learn R Programming

flashlighttext (version 0.1.0)

LexiconDecoder: LexiconDecoder

Description

Decoder implements a beam seach decoder that finds the word transcription W maximizing:

Arguments

Super class

flashlighttext::Decoder -> LexiconDecoder

Methods

Inherited methods


Method new()

Usage

LexiconDecoder$new(
  options,
  trie,
  lm,
  sil_token_idx,
  blank_token_idx,
  unk_token_idx,
  transitions,
  is_lm_token
)

Arguments

options

a LexiconDecoderOptions instance

trie

a Trie instance. Lexicon trie to restrict beam-search decoder

lm

a LM instance (e.g. KenLM or ZeroLM)

sil_token_idx

a character. The silence token index

blank_token_idx

a character. The blank token index (for CTC)

unk_token_idx

a character. The unkown token index

transitions

a tensor. Matrix of transitions (for ASG criterion)

is_lm_token

a is_lm_token

Returns

LexiconDecoder


Method n_hypothesis()

Usage

LexiconDecoder$n_hypothesis()

Returns

an integer


Method clone()

The objects of this class are cloneable with this method.

Usage

LexiconDecoder$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

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.