This is as FasterDecoder, but does online composition between HCLG and the "difference language model", which is a deterministic FST that represents the difference between the language model you want and the language model you compiled HCLG with. More...
#include <biglm-faster-decoder.h>
Classes | |
class | Token |
Public Types | |
typedef fst::StdArc | Arc |
typedef Arc::Label | Label |
typedef Arc::StateId | StateId |
typedef uint64 | PairId |
typedef Arc::Weight | Weight |
Public Member Functions | |
BiglmFasterDecoder (const fst::Fst< fst::StdArc > &fst, const BiglmFasterDecoderOptions &opts, fst::DeterministicOnDemandFst< fst::StdArc > *lm_diff_fst) | |
void | SetOptions (const BiglmFasterDecoderOptions &opts) |
~BiglmFasterDecoder () | |
void | Decode (DecodableInterface *decodable) |
bool | ReachedFinal () |
bool | GetBestPath (fst::MutableFst< LatticeArc > *fst_out, bool use_final_probs=true) |
Private Types | |
typedef HashList< PairId, Token * >::Elem | Elem |
Private Member Functions | |
PairId | ConstructPair (StateId fst_state, StateId lm_state) |
BaseFloat | GetCutoff (Elem *list_head, size_t *tok_count, BaseFloat *adaptive_beam, Elem **best_elem) |
Gets the weight cutoff. Also counts the active tokens. More... | |
void | PossiblyResizeHash (size_t num_toks) |
StateId | PropagateLm (StateId lm_state, Arc *arc) |
BaseFloat | ProcessEmitting (DecodableInterface *decodable, int frame) |
void | ProcessNonemitting (BaseFloat cutoff) |
void | ClearToks (Elem *list) |
KALDI_DISALLOW_COPY_AND_ASSIGN (BiglmFasterDecoder) | |
Static Private Member Functions | |
static StateId | PairToState (PairId state_pair) |
static StateId | PairToLmState (PairId state_pair) |
Private Attributes | |
HashList< PairId, Token * > | toks_ |
const fst::Fst< fst::StdArc > & | fst_ |
fst::DeterministicOnDemandFst< fst::StdArc > * | lm_diff_fst_ |
BiglmFasterDecoderOptions | opts_ |
bool | warned_noarc_ |
std::vector< const Elem *> | queue_ |
std::vector< BaseFloat > | tmp_array_ |
This is as FasterDecoder, but does online composition between HCLG and the "difference language model", which is a deterministic FST that represents the difference between the language model you want and the language model you compiled HCLG with.
The class DeterministicOnDemandFst follows through the epsilons in G for you (assuming G is a standard backoff language model) and makes it look like a determinized FST. Actually, in practice, DeterministicOnDemandFst operates in a mode where it composes two G's together; one has negated likelihoods and works by removing the LM probabilities that you made HCLG with, and one is the language model you want to use.
Definition at line 51 of file biglm-faster-decoder.h.
typedef fst::StdArc Arc |
Definition at line 53 of file biglm-faster-decoder.h.
Definition at line 239 of file biglm-faster-decoder.h.
typedef Arc::Label Label |
Definition at line 54 of file biglm-faster-decoder.h.
typedef uint64 PairId |
Definition at line 57 of file biglm-faster-decoder.h.
typedef Arc::StateId StateId |
Definition at line 55 of file biglm-faster-decoder.h.
typedef Arc::Weight Weight |
Definition at line 58 of file biglm-faster-decoder.h.
|
inline |
Definition at line 70 of file biglm-faster-decoder.h.
References KALDI_ASSERT, and DeterministicOnDemandFst< Arc >::Start().
|
inline |
Definition at line 83 of file biglm-faster-decoder.h.
|
inlineprivate |
Definition at line 488 of file biglm-faster-decoder.h.
References HashList< I, T >::Delete(), and KALDI_DISALLOW_COPY_AND_ASSIGN.
Definition at line 184 of file biglm-faster-decoder.h.
|
inline |
Definition at line 87 of file biglm-faster-decoder.h.
References DecodableInterface::IsLastFrame().
Referenced by main().
|
inline |
Definition at line 115 of file biglm-faster-decoder.h.
References rnnlm::i, KALDI_ASSERT, LatticeWeightTpl< BaseFloat >::One(), BiglmFasterDecoder::Token::prev_, fst::RemoveEpsLocal(), HashList< I, T >::Elem::tail, and fst::Times().
Referenced by main().
|
inlineprivate |
Gets the weight cutoff. Also counts the active tokens.
Definition at line 243 of file biglm-faster-decoder.h.
References count, and HashList< I, T >::Elem::tail.
|
private |
Definition at line 191 of file biglm-faster-decoder.h.
Definition at line 188 of file biglm-faster-decoder.h.
|
inlineprivate |
Definition at line 308 of file biglm-faster-decoder.h.
|
inlineprivate |
Definition at line 341 of file biglm-faster-decoder.h.
References BiglmFasterDecoder::Token::arc_, KALDI_ASSERT, HashList< I, T >::Elem::key, DecodableInterface::LogLikelihood(), HashList< I, T >::Elem::val, and BiglmFasterDecoder::Token::weight_.
|
inlineprivate |
Definition at line 423 of file biglm-faster-decoder.h.
References KALDI_ASSERT, HashList< I, T >::Elem::key, HashList< I, T >::Elem::val, and BiglmFasterDecoder::Token::weight_.
Definition at line 316 of file biglm-faster-decoder.h.
References KALDI_WARN, and fst::Times().
|
inline |
Definition at line 101 of file biglm-faster-decoder.h.
References HashList< I, T >::Elem::tail, and fst::Times().
Referenced by main().
|
inline |
Definition at line 81 of file biglm-faster-decoder.h.
|
private |
Definition at line 474 of file biglm-faster-decoder.h.
|
private |
Definition at line 475 of file biglm-faster-decoder.h.
|
private |
Definition at line 476 of file biglm-faster-decoder.h.
|
private |
Definition at line 478 of file biglm-faster-decoder.h.
|
private |
Definition at line 479 of file biglm-faster-decoder.h.
Definition at line 473 of file biglm-faster-decoder.h.
|
private |
Definition at line 477 of file biglm-faster-decoder.h.