You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets. More...
#include <online-nnet3-incremental-decoding.h>
Public Member Functions | |
SingleUtteranceNnet3IncrementalDecoderTpl (const LatticeIncrementalDecoderConfig &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. More... | |
void | AdvanceDecoding () |
Advances the decoding as far as we can. More... | |
void | FinalizeDecoding () |
Finalizes the decoding. More... | |
int32 | NumFramesDecoded () const |
int32 | NumFramesInLattice () const |
const CompactLattice & | GetLattice (int32 num_frames_to_include, bool use_final_probs=false) |
void | GetBestPath (bool end_of_utterance, Lattice *best_path) const |
Outputs an FST corresponding to the single best path through the current lattice. More... | |
bool | EndpointDetected (const OnlineEndpointConfig &config) |
This function calls EndpointDetected from online-endpoint.h, with the required arguments. More... | |
const LatticeIncrementalOnlineDecoderTpl< FST > & | Decoder () const |
~SingleUtteranceNnet3IncrementalDecoderTpl () | |
Private Attributes | |
const LatticeIncrementalDecoderConfig & | decoder_opts_ |
BaseFloat | input_feature_frame_shift_in_seconds_ |
const TransitionModel & | trans_model_ |
nnet3::DecodableAmNnetLoopedOnline | decodable_ |
LatticeIncrementalOnlineDecoderTpl< FST > | decoder_ |
You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets.
The template will be instantiated only for FST = fst::Fst<fst::StdArc> and FST = fst::GrammarFst.
Definition at line 51 of file online-nnet3-incremental-decoding.h.
SingleUtteranceNnet3IncrementalDecoderTpl | ( | const LatticeIncrementalDecoderConfig & | decoder_opts, |
const TransitionModel & | trans_model, | ||
const nnet3::DecodableNnetSimpleLoopedInfo & | info, | ||
const FST & | fst, | ||
OnlineNnet2FeaturePipeline * | features | ||
) |
Definition at line 28 of file online-nnet3-incremental-decoding.cc.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
|
inline |
Definition at line 120 of file online-nnet3-incremental-decoding.h.
void AdvanceDecoding | ( | ) |
Advances the decoding as far as we can.
Definition at line 50 of file online-nnet3-incremental-decoding.cc.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decodable_, and SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
Referenced by main().
|
inline |
Definition at line 118 of file online-nnet3-incremental-decoding.h.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
Referenced by main().
bool EndpointDetected | ( | const OnlineEndpointConfig & | config | ) |
This function calls EndpointDetected from online-endpoint.h, with the required arguments.
Definition at line 61 of file online-nnet3-incremental-decoding.cc.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decodable_, SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_, kaldi::EndpointDetected(), DecodableNnetLoopedOnlineBase::FrameSubsamplingFactor(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::input_feature_frame_shift_in_seconds_, and SingleUtteranceNnet3IncrementalDecoderTpl< FST >::trans_model_.
Referenced by SingleUtteranceNnet3IncrementalDecoderTpl< FST >::GetLattice(), and main().
|
inline |
Finalizes the decoding.
Cleans up and prunes remaining tokens, so the GetLattice() call will return faster. You must not call this before calling (TerminateDecoding() or InputIsFinished()) and then Wait().
Definition at line 74 of file online-nnet3-incremental-decoding.h.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
Referenced by main().
Outputs an FST corresponding to the single best path through the current lattice.
If "use_final_probs" is true AND we reached the final-state of the graph then it will include those as final-probs, else it will treat all final-probs as one.
Definition at line 55 of file online-nnet3-incremental-decoding.cc.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
Referenced by SingleUtteranceNnet3IncrementalDecoderTpl< FST >::GetLattice().
|
inline |
Definition at line 97 of file online-nnet3-incremental-decoding.h.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_, SingleUtteranceNnet3IncrementalDecoderTpl< FST >::EndpointDetected(), and SingleUtteranceNnet3IncrementalDecoderTpl< FST >::GetBestPath().
Referenced by main().
void InitDecoding | ( | int32 | frame_offset = 0 | ) |
Initializes the decoding and sets the frame offset of the underlying decodable object.
This method is called by the constructor. You can also call this method when you want to reset the decoder state, but want to keep using the same decodable object, e.g. in case of an endpoint.
Definition at line 44 of file online-nnet3-incremental-decoding.cc.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decodable_, SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_, and DecodableNnetLoopedOnlineBase::SetFrameOffset().
|
inline |
Definition at line 76 of file online-nnet3-incremental-decoding.h.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
Referenced by main().
|
inline |
Definition at line 78 of file online-nnet3-incremental-decoding.h.
References SingleUtteranceNnet3IncrementalDecoderTpl< FST >::decoder_.
|
private |
|
private |
Definition at line 135 of file online-nnet3-incremental-decoding.h.
Referenced by SingleUtteranceNnet3IncrementalDecoderTpl< FST >::AdvanceDecoding(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::Decoder(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::EndpointDetected(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::FinalizeDecoding(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::GetBestPath(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::GetLattice(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::InitDecoding(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::NumFramesDecoded(), SingleUtteranceNnet3IncrementalDecoderTpl< FST >::NumFramesInLattice(), and SingleUtteranceNnet3IncrementalDecoderTpl< FST >::SingleUtteranceNnet3IncrementalDecoderTpl().
|
private |
Definition at line 123 of file online-nnet3-incremental-decoding.h.
|
private |
Definition at line 127 of file online-nnet3-incremental-decoding.h.
Referenced by SingleUtteranceNnet3IncrementalDecoderTpl< FST >::EndpointDetected().
|
private |
Definition at line 131 of file online-nnet3-incremental-decoding.h.
Referenced by SingleUtteranceNnet3IncrementalDecoderTpl< FST >::EndpointDetected().