20 #ifndef KALDI_DECODER_DECODER_WRAPPERS_H_ 21 #define KALDI_DECODER_DECODER_WRAPPERS_H_ 40 AlignConfig(): beam(200.0), retry_beam(0.0), careful(false) { }
43 opts->
Register(
"beam", &beam,
"Decoding beam used in alignment");
44 opts->
Register(
"retry-beam", &retry_beam,
45 "Decoding beam for second try at alignment");
47 "If true, do 'careful' alignment, which is better at detecting " 48 "alignment failure (involves loop to start of decoding graph).");
61 const std::string &utt,
64 fst::VectorFst<fst::StdArc> *
fst,
90 fst::VectorFst<fst::StdArc> *fst);
93 template <
typename FST>
98 const fst::SymbolTable *word_syms,
100 double acoustic_scale,
120 template <
typename FST>
125 const fst::SymbolTable *word_syms,
127 double acoustic_scale,
151 const fst::SymbolTable *word_syms,
152 const std::string &utt,
205 const fst::SymbolTable *word_syms,
207 double acoustic_scale,
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
bool DecodeUtteranceLatticeIncremental(LatticeIncrementalDecoderTpl< FST > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
TODO.
LatticeWriter * lattice_writer_
DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and th...
const TransitionModel * trans_model_
CompactLatticeWriter * compact_lattice_writer_
This is an extention to the "normal" lattice-generating decoder.
void Register(OptionsItf *opts)
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
Int32VectorWriter * alignments_writer_
A templated class for writing objects to an archive or script file; see The Table concept...
bool DecodeUtteranceLatticeFaster(LatticeFasterDecoderTpl< FST > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
This function DecodeUtteranceLatticeFaster is used in several decoders, and we have moved it here...
Int32VectorWriter * words_writer_
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
This class basically does the same job as the function DecodeUtteranceLatticeFaster, but in a way that allows us to build a multi-threaded command line program more easily.
BaseFloat acoustic_scale_
fst::VectorFst< LatticeArc > Lattice
Simplest possible decoder, included largely for didactic purposes and as a means to debug more highly...
bool DecodeUtteranceLatticeSimple(LatticeSimpleDecoder &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
fst::VectorFst< CompactLatticeArc > CompactLattice
void ModifyGraphForCarefulAlignment(fst::VectorFst< fst::StdArc > *fst)
This function modifies the decoding graph for what we call "careful alignment".
This is the "normal" lattice-generating decoder.
const fst::SymbolTable * word_syms_
DecodableInterface * decodable_
void AlignUtteranceWrapper(const AlignConfig &config, const std::string &utt, BaseFloat acoustic_scale, fst::VectorFst< fst::StdArc > *fst, DecodableInterface *decodable, Int32VectorWriter *alignment_writer, BaseFloatWriter *scores_writer, int32 *num_done, int32 *num_error, int32 *num_retried, double *tot_like, int64 *frame_count, BaseFloatVectorWriter *per_frame_acwt_writer)
AlignUtteranceWapper is a wrapper for alignment code used in training, that is called from many diffe...
LatticeFasterDecoder * decoder_