91 using namespace kaldi;
95 "Determinize lattices, keeping only the best path (sequence of\n" 96 "acoustic states) for each input-symbol sequence. This is a version\n" 97 "of lattice-determinize-phone-pruned that accepts the --num-threads\n" 98 "option. The program does phone insertion when doing a first pass\n" 99 "determinization, it then removes the inserted symbols and does a\n" 100 "second pass determinization. It also does pruning as part of the\n" 101 "determinization algorithm, which is more efficient and prevents\n" 104 "Usage: lattice-determinize-phone-pruned-parallel [options] \\\n" 105 " <model> <lattice-rspecifier> <lattice-wspecifier>\n" 106 " e.g.: lattice-determinize-phone-pruned-parallel \\\n" 107 " --acoustic-scale=0.1 final.mdl ark:in.lats ark:det.lats\n";
115 determinize_opts.
max_mem = 50000000;
117 po.Register(
"acoustic-scale", &acoustic_scale,
"Scaling factor for acoustic" 119 po.Register(
"beam", &beam,
"Pruning beam [applied after acoustic scaling].");
124 if (po.NumArgs() != 3) {
129 std::string model_rxfilename = po.GetArg(1),
130 lats_rspecifier = po.GetArg(2),
131 lats_wspecifier = po.GetArg(3);
145 int32 n_done = 0, n_warn = 0;
147 if (acoustic_scale == 0.0)
148 KALDI_ERR <<
"Do not use a zero acoustic scale (cannot be inverted)";
150 for (; !lat_reader.Done(); lat_reader.Next()) {
151 std::string key = lat_reader.Key();
154 Lattice *lat = lat_reader.Value().Copy();
156 KALDI_VLOG(2) <<
"Processing lattice " << key;
159 trans_model, determinize_opts, key, acoustic_scale, beam,
160 lat, &compact_lat_writer, &n_warn);
166 KALDI_LOG <<
"Done " << n_done <<
" lattices, determinization finished " 167 <<
"earlier than specified by the beam on " << n_warn <<
" of " 169 return (n_done != 0 ? 0 : 1);
170 }
catch(
const std::exception &e) {
171 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Register(kaldi::OptionsItf *opts)
A templated class for writing objects to an archive or script file; see The Table concept...
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
fst::VectorFst< LatticeArc > Lattice
void Register(OptionsItf *opts)