Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
| Converts alignments (containing transition-ids) to pdf-ids, zero-based. More...
|
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Converts alignments (containing transition-ids) to pdf-ids, zero-based.
Definition at line 29 of file ali-to-pdf.cc.
References SequentialTableReader< Holder >::Done(), ParseOptions::GetArg(), rnnlm::i, KALDI_LOG, SequentialTableReader< Holder >::Key(), SequentialTableReader< Holder >::Next(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), kaldi::ReadKaldiObject(), TransitionModel::TransitionIdToPdf(), SequentialTableReader< Holder >::Value(), and TableWriter< Holder >::Write().
30 using namespace kaldi;
34 "Converts alignments (containing transition-ids) to pdf-ids, zero-based.\n" 35 "Usage: ali-to-pdf [options] <model> <alignments-rspecifier> <pdfs-wspecifier>\n" 37 " ali-to-pdf 1.mdl ark:1.ali ark,t:-\n";
42 if (po.NumArgs() != 3) {
47 std::string model_filename = po.GetArg(1),
48 alignments_rspecifier = po.GetArg(2),
49 pdfs_wspecifier = po.GetArg(3);
58 for (; !reader.Done(); reader.Next()) {
59 std::string key = reader.Key();
60 std::vector<int32> alignment = reader.Value();
62 for (
size_t i = 0;
i < alignment.size();
i++)
65 writer.Write(key, alignment);
68 KALDI_LOG <<
"Converted " << num_done <<
" alignments to pdf sequences.";
69 }
catch(
const std::exception &e) {
70 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...
int32 TransitionIdToPdf(int32 trans_id) const
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...