22 #ifndef KALDI_LAT_DETERMINIZE_LATTICE_PRUNED_H_ 23 #define KALDI_LAT_DETERMINIZE_LATTICE_PRUNED_H_ 24 #include <fst/fstlib.h> 25 #include <fst/fst-decl.h> 126 retry_cutoff(0.5) { }
128 opts->
Register(
"delta", &delta,
"Tolerance used in determinization");
129 opts->
Register(
"max-mem", &max_mem,
"Maximum approximate memory usage in " 130 "determinization (real usage might be many times this)");
131 opts->
Register(
"max-arcs", &max_arcs,
"Maximum number of arcs in " 132 "output FST (total, not per state");
133 opts->
Register(
"max-states", &max_states,
"Maximum number of arcs in output " 134 "FST (total, not per state");
135 opts->
Register(
"max-loop", &max_loop,
"Option used to detect a particular " 136 "type of determinization failure, typically due to invalid input " 137 "(e.g., negative-cost loops)");
138 opts->
Register(
"retry-cutoff", &retry_cutoff,
"Controls pruning un-determinized " 139 "lattice and retrying determinization: if effective-beam < " 140 "retry-cutoff * beam, we prune the raw lattice and retry. Avoids " 141 "ever getting empty output for long segments.");
160 phone_determinize(true),
161 word_determinize(true),
164 opts->
Register(
"delta", &delta,
"Tolerance used in determinization");
165 opts->
Register(
"max-mem", &max_mem,
"Maximum approximate memory usage in " 166 "determinization (real usage might be many times this).");
167 opts->
Register(
"phone-determinize", &phone_determinize,
"If true, do an " 168 "initial pass of determinization on both phones and words (see" 169 " also --word-determinize)");
170 opts->
Register(
"word-determinize", &word_determinize,
"If true, do a second " 171 "pass of determinization on words only (see also " 172 "--phone-determinize)");
173 opts->
Register(
"minimize", &minimize,
"If true, push and minimize after " 189 template<
class Weight>
191 const ExpandedFst<ArcTpl<Weight> > &ifst,
193 MutableFst<ArcTpl<Weight> > *ofst,
208 template<
class Weight,
class IntType>
210 const ExpandedFst<ArcTpl<Weight> >&ifst,
223 template<
class Weight>
226 MutableFst<ArcTpl<Weight> > *
fst);
234 template<
class Weight>
237 MutableFst<ArcTpl<Weight> > *
fst);
254 template<
class Weight,
class IntType>
257 const ExpandedFst<ArcTpl<Weight> > &ifst,
266 template<
class Weight,
class IntType>
269 MutableFst<ArcTpl<Weight> > *ifst,
286 MutableFst<kaldi::LatticeArc> *ifst,
288 MutableFst<kaldi::CompactLatticeArc> *ofst,
void Register(kaldi::OptionsItf *opts)
bool DeterminizeLatticePruned(const ExpandedFst< ArcTpl< Weight > > &ifst, double beam, MutableFst< ArcTpl< CompactLatticeWeightTpl< Weight, IntType > > > *ofst, DeterminizeLatticePrunedOptions opts)
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
bool DeterminizeLatticePhonePruned(const kaldi::TransitionModel &trans_model, MutableFst< ArcTpl< Weight > > *ifst, double beam, MutableFst< ArcTpl< CompactLatticeWeightTpl< Weight, IntType > > > *ofst, DeterminizeLatticePhonePrunedOptions opts)
"Destructive" version of DeterminizeLatticePhonePruned() where the input lattice might be changed...
DeterminizeLatticePhonePrunedOptions()
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
DeterminizeLatticePrunedOptions()
void Register(kaldi::OptionsItf *opts)
ArcTpl< Weight >::Label DeterminizeLatticeInsertPhones(const kaldi::TransitionModel &trans_model, MutableFst< ArcTpl< Weight > > *fst)
This function takes in lattices and inserts phones at phone boundaries.
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...
void DeterminizeLatticeDeletePhones(typename ArcTpl< Weight >::Label first_phone_label, MutableFst< ArcTpl< Weight > > *fst)
This function takes in lattices and deletes "phones" from them.