From: Daniel P. <dp...@gm...> - 2012-09-02 15:44:31
|
I think it's just a bug in the code. You are doing int32 tid = split[i][0]; which means you get the first HMM-state in the alignment of each phone, which will always be zero. Instead you want to iterate over split[i] and get tid = split[i][j]. Dan and I want to convert the transition ids to the hmm states to be writte to > disk. I need the triphone states as target values for a neural network. > > For this purpose I have copied the file ali-to-phones.cc and adapted it to > write out what I think should be the hmm states. > Excerpt: > "... > for (; !reader.Done(); reader.Next()) { > std::string key = reader.Key(); > const std::vector<int32> &alignment = reader.Value(); > > std::vector<std::vector<int32> > split; > SplitToPhones(trans_model, alignment, &split); > > if (!write_lengths) { > std::vector<int32> states; > for (size_t i = 0; i < split.size(); i++) { > KALDI_ASSERT(split[i].size() > 0); > int32 tid = split[i][0]; > int32 hmmstate = trans_model.TransitionIdToHmmState(tid); <-- !! > int32 num_repeats = split[i].size(); > KALDI_ASSERT(num_repeats!=0); > if (per_frame) > for(int32 j = 0; j < num_repeats; j++) > states.push_back(hmmstate); > else > states.push_back(hmmstate); > } > states_writer.Write(key, states); > } else { > ... // omitted, as not needed > } > ... > " > > The outcome, however, is always a vector of zeros for all utterances! This > is true also if instead I try to convert to PdfClass. > > What am I missing here? > > Thanks in advance! > > Ray > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Kaldi-developers mailing list > Kal...@li... > https://lists.sourceforge.net/lists/listinfo/kaldi-developers > > |