28 template <
typename FST>
35 decoder_opts_(decoder_opts),
36 input_feature_frame_shift_in_seconds_(features->FrameShiftInSeconds()),
37 trans_model_(trans_model),
38 decodable_(trans_model_, info,
39 features->InputFeature(), features->IvectorFeature()),
40 decoder_(fst, decoder_opts_) {
44 template <
typename FST>
50 template <
typename FST>
55 template <
typename FST>
60 template <
typename FST>
65 template <
typename FST>
69 KALDI_ERR <<
"You cannot get a lattice if you decoded no frames.";
71 decoder_.GetRawLattice(&raw_lat, end_of_utterance);
74 KALDI_ERR <<
"--determinize-lattice=false option is not supported at the moment";
81 template <
typename FST>
84 decoder_.GetBestPath(best_path, end_of_utterance);
87 template <
typename FST>
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 FrameSubsamplingFactor() const
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
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...
SingleUtteranceNnet3DecoderTpl(const LatticeFasterDecoderConfig &decoder_opts, const TransitionModel &trans_model, const nnet3::DecodableNnetSimpleLoopedInfo &info, const FST &fst, OnlineNnet2FeaturePipeline *features)
void InitDecoding(int32 frame_offset=0)
Initializes the decoding and sets the frame offset of the underlying decodable object.
const LatticeFasterDecoderConfig & decoder_opts_
void GetLattice(bool end_of_utterance, CompactLattice *clat) const
Gets the lattice.
int32 NumFramesDecoded() const
bool EndpointDetected(const OnlineEndpointConfig &config)
This function calls EndpointDetected from online-endpoint.h, with the required arguments.
You will instantiate this class when you want to decode a single utterance using the online-decoding ...
fst::VectorFst< LatticeArc > Lattice
BaseFloat input_feature_frame_shift_in_seconds_
fst::VectorFst< CompactLatticeArc > CompactLattice
void GetBestPath(bool end_of_utterance, Lattice *best_path) const
Outputs an FST corresponding to the single best path through the current lattice. ...
nnet3::DecodableAmNnetLoopedOnline decodable_
fst::DeterminizeLatticePhonePrunedOptions det_opts
LatticeFasterOnlineDecoderTpl< FST > decoder_
OnlineNnet2FeaturePipeline is a class that's responsible for putting together the various parts of th...
void AdvanceDecoding()
Advances the decoding as far as we can.
When you instantiate class DecodableNnetSimpleLooped, you should give it a const reference to this cl...
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...
const TransitionModel & trans_model_
void SetFrameOffset(int32 frame_offset)
Sets the frame offset value.
void FinalizeDecoding()
Finalizes the decoding.