30 int main(
int argc,
char *argv[]) {
32 using namespace kaldi;
34 using fst::SymbolTable;
39 "Compute log-likelihoods from GMM-based model\n" 40 "(outputs matrices of log-likelihoods indexed by (frame, pdf)\n" 41 "Usage: gmm-compute-likes [options] model-in features-rspecifier likes-wspecifier\n";
51 std::string model_in_filename = po.
GetArg(1),
52 feature_rspecifier = po.
GetArg(2),
53 loglikes_wspecifier = po.
GetArg(3);
59 Input ki(model_in_filename, &binary);
68 for (; !feature_reader.
Done(); feature_reader.
Next()) {
69 std::string key = feature_reader.
Key();
72 for (int32
i = 0;
i < features.NumRows();
i++) {
78 loglikes_writer.
Write(key, loglikes);
82 KALDI_LOG <<
"gmm-compute-likes: computed likelihoods for " << num_done
85 }
catch(
const std::exception &e) {
86 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
A templated class for writing objects to an archive or script file; see The Table concept...
void Write(const std::string &key, const T &value) const
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
BaseFloat LogLikelihood(const int32 pdf_index, const VectorBase< BaseFloat > &data) const
void Read(std::istream &is, bool binary)
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
int main(int argc, char *argv[])
void Read(std::istream &in_stream, bool binary)
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...