Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 23 of file lattice-add-penalty.cc.
References kaldi::AddWordInsPenToCompactLattice(), SequentialTableReader< Holder >::Done(), ParseOptions::GetArg(), KALDI_LOG, SequentialTableReader< Holder >::Key(), SequentialTableReader< Holder >::Next(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), ParseOptions::Register(), SequentialTableReader< Holder >::Value(), and TableWriter< Holder >::Write().
24 using namespace kaldi;
25 typedef kaldi::int64 int64;
28 "Add word insertion penalty to the lattice.\n" 29 "Note: penalties are negative log-probs, base e, and are added to the\n" 30 "'language model' part of the cost.\n" 32 "Usage: lattice-add-penalty [options] <lattice-rspecifier> <lattice-wspecifier>\n" 33 " e.g.: lattice-add-penalty --word-ins-penalty=1.0 ark:- ark:-\n";
39 po.Register(
"word-ins-penalty", &word_ins_penalty,
"Word insertion penalty");
43 if (po.NumArgs() != 2) {
48 std::string lats_rspecifier = po.GetArg(1),
49 lats_wspecifier = po.GetArg(2);
56 for (; !clat_reader.Done(); clat_reader.Next()) {
59 clat_writer.Write(clat_reader.Key(), clat);
62 KALDI_LOG <<
"Done adding word insertion penalty to " << n_done <<
" lattices.";
63 return (n_done != 0 ? 0 : 1);
64 }
catch(
const std::exception &e) {
65 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
A templated class for writing objects to an archive or script file; see The Table concept...
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...
void AddWordInsPenToCompactLattice(BaseFloat word_ins_penalty, CompactLattice *clat)
This function add the word insertion penalty to graph score of each word in the compact lattice...
fst::VectorFst< CompactLatticeArc > CompactLattice