Learn R Programming

flashlighttext (version 0.1.0)

LexiconSeq2SeqDecoder: LexiconSeq2SeqDecoder

Description

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

Arguments

Super class

flashlighttext::Decoder -> LexiconSeq2SeqDecoder

Methods

Inherited methods


Method new()

Usage

LexiconSeq2SeqDecoder$new(
  options,
  trie,
  lm,
  eos,
  emitting_model_update_func,
  max_output_length,
  is_lm_token
)

Arguments

options

a LexiconSeq2SeqDecoderOptions instance.

trie

a Trie instance

lm

a LM instance

eos

an integer. The index representing the EOS.

emitting_model_update_func

an emittingModelUpdateFunc instance

max_output_length

an integer. The maximum output length.

is_lm_token

a is_lm_token

Returns

LexiconSeq2SeqDecoder


Method n_hypothesis()

Usage

LexiconSeq2SeqDecoder$n_hypothesis()

Returns

int


Method clone()

The objects of this class are cloneable with this method.

Usage

LexiconSeq2SeqDecoder$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

AM(W) + lmWeight_ * log(P_lm(W)) + eosScore_ * |W_last == EOS|

where P_lm(W) is the language model score. The transcription W is constrained by a lexicon. The language model may operate at word-level (isLmToken = FALSE) or token-level (isLmToken = TRUE).