30 const fst::Fst<fst::StdArc> &
fst,
33 feature_pipeline_(feature_pipeline),
35 decodable_(model, tmodel, config.decodable_opts, feature_pipeline),
36 decoder_(fst, config.decoder_opts) {
55 KALDI_ERR <<
"You cannot get a lattice if you decoded no frames.";
60 KALDI_ERR <<
"--determinize-lattice=false option is not supported at the moment";
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void FinalizeDecoding()
Finalizes the decoding.
bool GetRawLattice(Lattice *ofst, bool use_final_probs=true) const
Outputs an FST corresponding to the raw, state-level tracebacks.
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
OnlineFeatureInterface * feature_pipeline_
void FinalizeDecoding()
This function may be optionally called after AdvanceDecoding(), when you do not plan to decode any fu...
bool EndpointDetected(const OnlineEndpointConfig &config, int32 num_frames_decoded, int32 trailing_silence_frames, BaseFloat frame_shift_in_seconds, BaseFloat final_relative_cost)
This function returns true if this set of endpointing rules thinks we should terminate decoding...
int32 NumFramesDecoded() const
void AdvanceDecoding()
advance the decoding as far as we can.
void InitDecoding()
InitDecoding initializes the decoding, and should only be used if you intend to call AdvanceDecoding(...
void GetBestPath(bool end_of_utterance, Lattice *best_path) const
Outputs an FST corresponding to the single best path through the current lattice. ...
int32 NumFramesDecoded() const
void GetLattice(bool end_of_utterance, CompactLattice *clat) const
Gets the lattice.
OnlineNnet2DecodingConfig config_
fst::VectorFst< LatticeArc > Lattice
virtual BaseFloat FrameShiftInSeconds() const =0
fst::VectorFst< CompactLatticeArc > CompactLattice
fst::DeterminizeLatticePhonePrunedOptions det_opts
void AdvanceDecoding(DecodableInterface *decodable, int32 max_num_frames=-1)
This will decode until there are no more frames ready in the decodable object.
LatticeFasterDecoderConfig decoder_opts
OnlineFeatureInterface is an interface for online feature processing (it is also usable in the offlin...
const TransitionModel & tmodel_
SingleUtteranceNnet2Decoder(const OnlineNnet2DecodingConfig &config, const TransitionModel &tmodel, const nnet2::AmNnet &model, const fst::Fst< fst::StdArc > &fst, OnlineFeatureInterface *feature_pipeline)
bool GetBestPath(Lattice *ofst, bool use_final_probs=true) const
Outputs an FST corresponding to the single best path through the lattice.
nnet2::DecodableNnet2Online decodable_
LatticeFasterOnlineDecoder decoder_
bool EndpointDetected(const OnlineEndpointConfig &config)
This function calls EndpointDetected from online-endpoint.h, with the required arguments.
bool DeterminizeLatticePhonePrunedWrapper(const kaldi::TransitionModel &trans_model, MutableFst< kaldi::LatticeArc > *ifst, double beam, MutableFst< kaldi::CompactLatticeArc > *ofst, DeterminizeLatticePhonePrunedOptions opts)
This function is a wrapper of DeterminizeLatticePhonePruned() that works for Lattice type FSTs...