The normal decoder, lattice-faster-decoder.h, sometimes has an issue when doing real-time applications with long utterances, that each time you get the lattice the lattice determinization can take a considerable amount of time; this introduces latency. More...
#include <lattice-incremental-decoder.h>
Public Member Functions | |
LatticeIncrementalDecoderConfig () | |
void | Register (OptionsItf *opts) |
void | Check () const |
The normal decoder, lattice-faster-decoder.h, sometimes has an issue when doing real-time applications with long utterances, that each time you get the lattice the lattice determinization can take a considerable amount of time; this introduces latency.
This version of the decoder spreads the work of lattice determinization out throughout the decoding process.
NOTE:
Please see https://www.danielpovey.com/files/ *TBD* .pdf for a technical explanation of what is going on here.
GLOSSARY OF TERMS: chunk: We do the determinization on chunks of frames; these may coincide with the chunks on which the user calls AdvanceDecoding(). The basic idea is to extract chunks of the raw lattice and determinize them individually, but it gets much more complicated than that. The chunks should normally be at least as long as a word (let's say, at least 20 frames), or the overhead of this algorithm might become excessive and affect RTF.
raw lattice chunk: A chunk of raw (i.e. undeterminized) lattice that we will determinize. In the paper this corresponds to the FST B that is described in Section 5.2.
token_label, state_label / token-label, state-label:
In the paper these are both referred to as `state labels` (these are special, large integer id's that refer to states in the undeterminized lattice and in the the determinized lattice); but we use two separate terms here, for more clarity, when referring to the undeterminized vs. determinized lattice.
token_label conceptually refers to states in the raw lattice, but we don't materialize the entire raw lattice as a physical FST and and these tokens are actually tokens (template type Token) held by the decoder
state_label when used in this code refers specifically to labels that identify states in the determinized lattice (i.e. state indexes in lat_).
token-final state A state in a raw lattice or in a determinized chunk that has an arc entering it that has a `token-label` on it (as defined above). These states will have nonzero final-probs.
redeterminized-non-splice-state, aka ns_redet: A redeterminized state which is not also a splice state; refer to the paper for explanation. In the already-determinized part this means a redeterminized state which is not final.
canonical appended lattice: This is the appended compact lattice that we conceptually have (i.e. what we described in the paper). The difference from the "actual appended lattice" stored in LatticeIncrementalDeterminizer::clat_ is that the actual appended lattice has all its final-arcs replaced with final-probs, and we keep the real final-arcs "on the side" in a separate data structure. The final-probs in clat_ aren't necessarily related to the costs on the final-arcs; instead they can have arbitrary values passed in by the user (e.g. if we want to include final-probs). This means that the clat_ can be returned without modification to the user who wants a partially determinized result.
final-arc: An arc in the canonical appended CompactLattice which goes to a final-state. These arcs will have `state-labels` as their labels.
Definition at line 106 of file lattice-incremental-decoder.h.
|
inline |
Definition at line 133 of file lattice-incremental-decoder.h.
References DeterminizeLatticePhonePrunedOptions::minimize.
|
inline |
Definition at line 173 of file lattice-incremental-decoder.h.
References KALDI_ERR, DeterminizeLatticePhonePrunedOptions::minimize, and DeterminizeLatticePhonePrunedOptions::word_determinize.
Referenced by LatticeIncrementalDecoderTpl< FST, decoder::BackpointerToken >::LatticeIncrementalDecoderTpl().
|
inline |
Definition at line 146 of file lattice-incremental-decoder.h.
References OptionsItf::Register(), and DeterminizeLatticePhonePrunedOptions::Register().
Referenced by main().
BaseFloat beam |
Definition at line 109 of file lattice-incremental-decoder.h.
BaseFloat beam_delta |
Definition at line 114 of file lattice-incremental-decoder.h.
Definition at line 122 of file lattice-incremental-decoder.h.
int32 determinize_max_delay |
Definition at line 129 of file lattice-incremental-decoder.h.
int32 determinize_min_chunk_size |
Definition at line 130 of file lattice-incremental-decoder.h.
BaseFloat hash_ratio |
Definition at line 115 of file lattice-incremental-decoder.h.
BaseFloat lattice_beam |
Definition at line 112 of file lattice-incremental-decoder.h.
int32 max_active |
Definition at line 110 of file lattice-incremental-decoder.h.
int32 min_active |
Definition at line 111 of file lattice-incremental-decoder.h.
int32 prune_interval |
Definition at line 113 of file lattice-incremental-decoder.h.
BaseFloat prune_scale |
Definition at line 116 of file lattice-incremental-decoder.h.