#include <training-graph-compiler.h>
Public Member Functions | |
TrainingGraphCompiler (const TransitionModel &trans_model, const ContextDependency &ctx_dep, fst::VectorFst< fst::StdArc > *lex_fst, const std::vector< int32 > &disambig_syms, const TrainingGraphCompilerOptions &opts) | |
bool | CompileGraph (const fst::VectorFst< fst::StdArc > &word_grammar, fst::VectorFst< fst::StdArc > *out_fst) |
bool | CompileGraphs (const std::vector< const fst::VectorFst< fst::StdArc > *> &word_fsts, std::vector< fst::VectorFst< fst::StdArc > *> *out_fsts) |
bool | CompileGraphFromText (const std::vector< int32 > &transcript, fst::VectorFst< fst::StdArc > *out_fst) |
bool | CompileGraphsFromText (const std::vector< std::vector< int32 > > &word_grammar, std::vector< fst::VectorFst< fst::StdArc > *> *out_fsts) |
~TrainingGraphCompiler () | |
Private Attributes | |
const TransitionModel & | trans_model_ |
const ContextDependency & | ctx_dep_ |
fst::VectorFst< fst::StdArc > * | lex_fst_ |
std::vector< int32 > | disambig_syms_ |
int32 | subsequential_symbol_ |
fst::TableComposeCache< fst::Fst< fst::StdArc > > | lex_cache_ |
TrainingGraphCompilerOptions | opts_ |
Definition at line 59 of file training-graph-compiler.h.
TrainingGraphCompiler | ( | const TransitionModel & | trans_model, |
const ContextDependency & | ctx_dep, | ||
fst::VectorFst< fst::StdArc > * | lex_fst, | ||
const std::vector< int32 > & | disambig_syms, | ||
const TrainingGraphCompilerOptions & | opts | ||
) |
Definition at line 26 of file training-graph-compiler.cc.
References fst::AddSubsequentialLoop(), ContextDependency::CentralPosition(), ContextDependency::ContextWidth(), TrainingGraphCompiler::disambig_syms_, TransitionModel::GetPhones(), rnnlm::i, kaldi::IsSortedAndUniq(), KALDI_ASSERT, KALDI_ERR, TrainingGraphCompiler::lex_fst_, kaldi::SortAndUniq(), TrainingGraphCompiler::subsequential_symbol_, and TrainingGraphCompiler::trans_model_.
|
inline |
Definition at line 94 of file training-graph-compiler.h.
bool CompileGraph | ( | const fst::VectorFst< fst::StdArc > & | word_grammar, |
fst::VectorFst< fst::StdArc > * | out_fst | ||
) |
Definition at line 73 of file training-graph-compiler.cc.
References kaldi::AddSelfLoops(), ContextDependency::CentralPosition(), fst::ComposeDeterministicOnDemandInverse(), ContextDependency::ContextWidth(), TrainingGraphCompiler::ctx_dep_, fst::DeterminizeStarInLog(), TrainingGraphCompiler::disambig_syms_, kaldi::GetHTransducer(), TransitionModel::GetPhones(), KALDI_ASSERT, TrainingGraphCompiler::lex_cache_, TrainingGraphCompiler::lex_fst_, fst::MinimizeEncoded(), TrainingGraphCompiler::opts_, fst::RemoveEpsLocal(), fst::RemoveSomeInputSymbols(), TrainingGraphCompilerOptions::reorder, TrainingGraphCompilerOptions::rm_eps, TrainingGraphCompilerOptions::self_loop_scale, TrainingGraphCompiler::subsequential_symbol_, fst::TableCompose(), TrainingGraphCompiler::trans_model_, TrainingGraphCompilerOptions::transition_scale, and HTransducerConfig::transition_scale.
Referenced by TrainingGraphCompiler::CompileGraphFromText(), and main().
bool CompileGraphFromText | ( | const std::vector< int32 > & | transcript, |
fst::VectorFst< fst::StdArc > * | out_fst | ||
) |
Definition at line 64 of file training-graph-compiler.cc.
References TrainingGraphCompiler::CompileGraph(), and fst::MakeLinearAcceptor().
Referenced by main().
bool CompileGraphs | ( | const std::vector< const fst::VectorFst< fst::StdArc > *> & | word_fsts, |
std::vector< fst::VectorFst< fst::StdArc > *> * | out_fsts | ||
) |
Definition at line 161 of file training-graph-compiler.cc.
References kaldi::AddSelfLoops(), ContextDependency::CentralPosition(), fst::ComposeDeterministicOnDemandInverse(), ContextDependency::ContextWidth(), TrainingGraphCompiler::ctx_dep_, fst::DeterminizeStarInLog(), TrainingGraphCompiler::disambig_syms_, kaldi::GetHTransducer(), TransitionModel::GetPhones(), rnnlm::i, KALDI_ASSERT, TrainingGraphCompiler::lex_cache_, TrainingGraphCompiler::lex_fst_, fst::MinimizeEncoded(), TrainingGraphCompiler::opts_, fst::RemoveEpsLocal(), fst::RemoveSomeInputSymbols(), TrainingGraphCompilerOptions::reorder, TrainingGraphCompilerOptions::rm_eps, TrainingGraphCompilerOptions::self_loop_scale, TrainingGraphCompiler::subsequential_symbol_, fst::TableCompose(), TrainingGraphCompiler::trans_model_, TrainingGraphCompilerOptions::transition_scale, and HTransducerConfig::transition_scale.
Referenced by TrainingGraphCompiler::CompileGraphsFromText(), and main().
bool CompileGraphsFromText | ( | const std::vector< std::vector< int32 > > & | word_grammar, |
std::vector< fst::VectorFst< fst::StdArc > *> * | out_fsts | ||
) |
Definition at line 145 of file training-graph-compiler.cc.
References TrainingGraphCompiler::CompileGraphs(), rnnlm::i, and fst::MakeLinearAcceptor().
Referenced by main().
|
private |
Definition at line 97 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), and TrainingGraphCompiler::CompileGraphs().
|
private |
Definition at line 100 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), TrainingGraphCompiler::CompileGraphs(), and TrainingGraphCompiler::TrainingGraphCompiler().
|
private |
Definition at line 103 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), and TrainingGraphCompiler::CompileGraphs().
|
private |
Definition at line 98 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), TrainingGraphCompiler::CompileGraphs(), and TrainingGraphCompiler::TrainingGraphCompiler().
|
private |
Definition at line 106 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), and TrainingGraphCompiler::CompileGraphs().
|
private |
Definition at line 101 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), TrainingGraphCompiler::CompileGraphs(), and TrainingGraphCompiler::TrainingGraphCompiler().
|
private |
Definition at line 96 of file training-graph-compiler.h.
Referenced by TrainingGraphCompiler::CompileGraph(), TrainingGraphCompiler::CompileGraphs(), and TrainingGraphCompiler::TrainingGraphCompiler().