20 #ifndef KALDI_TREE_CONTEXT_DEP_H_ 21 #define KALDI_TREE_CONTEXT_DEP_H_ 68 virtual bool Compute(
const std::vector<int32> &phoneseq,
76 if (max_result < 0 )
return 0;
77 else return (
int32) max_result+1;
84 void Read (std::istream &is,
bool binary);
94 void Write (std::ostream &os,
bool binary)
const;
107 const std::vector<int32> &phones,
108 const std::vector<int32> &num_pdf_classes,
109 std::vector<std::vector<std::pair<int32, int32> > > *pdf_info)
132 const std::vector<int32> &phones,
133 const std::vector<std::vector<std::pair<int32, int32> > > &pdf_class_pairs,
134 std::vector<std::vector<std::vector<std::pair<int32, int32> > > > *pdf_info)
150 const std::vector<int32> &phones,
151 int32 self_loop_pdf_class,
int32 forward_pdf_class,
152 const std::vector<int32> &context,
168 bool ensure_all_covered,
169 std::vector<int32> *num_pdf_classes);
175 bool ensure_all_covered,
176 std::vector<int32> *num_pdf_classes);
186 const std::vector<int32> &phone2num_pdf_classes);
193 const std::vector<int32> &phone2num_pdf_classes);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
virtual int32 ContextWidth() const
ContextWidth() returns the value N (e.g.
virtual void GetPdfInfo(const std::vector< int32 > &phones, const std::vector< int32 > &num_pdf_classes, std::vector< std::vector< std::pair< int32, int32 > > > *pdf_info) const
GetPdfInfo returns a vector indexed by pdf-id, saying for each pdf which pairs of (phone...
const EventMap & ToPdfMap() const
virtual ContextDependencyInterface * Copy() const
Returns pointer to new object which is copy of current one.
ContextDependency * GenRandContextDependencyLarge(const std::vector< int32 > &phone_ids, int N, int P, bool ensure_all_covered, std::vector< int32 > *hmm_lengths)
GenRandContextDependencyLarge is like GenRandContextDependency but generates a larger tree with speci...
virtual EventAnswerType MaxResult() const
virtual bool Compute(const std::vector< int32 > &phoneseq, int32 pdf_class, int32 *pdf_id) const
returns success or failure; outputs pdf to pdf_id For positions that were outside the sequence (due t...
ContextDependency * MonophoneContextDependency(const std::vector< int32 > &phones, const std::vector< int32 > &phone2num_pdf_classes)
ContextDependency * MonophoneContextDependencyShared(const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes)
void EnumeratePairs(const std::vector< int32 > &phones, int32 self_loop_pdf_class, int32 forward_pdf_class, const std::vector< int32 > &context, unordered_set< std::pair< int32, int32 >, PairHasher< int32 > > *pairs) const
static const EventKeyType kPdfClass
virtual int32 NumPdfs() const
NumPdfs() returns the number of acoustic pdfs (they are numbered 0.. NumPdfs()-1).
void Write(std::ostream &os, bool binary) const
int32 EventKeyType
Things of type EventKeyType can take any value.
virtual int32 CentralPosition() const
Central position P of the phone context, in 0-based numbering, e.g.
virtual EventMap * Copy(const std::vector< EventMap *> &new_leaves) const =0
KALDI_DISALLOW_COPY_AND_ASSIGN(ContextDependency)
context-dep-itf.h provides a link between the tree-building code in ../tree/, and the FST code in ...
A class that is capable of representing a generic mapping from EventType (which is a vector of (key...
void Read(std::istream &is, bool binary)
Read context-dependency object from disk; throws on error.
ContextDependency * GenRandContextDependency(const std::vector< int32 > &phone_ids, bool ensure_all_covered, std::vector< int32 > *hmm_lengths)
GenRandContextDependency is mainly of use for debugging.
int32 EventAnswerType
As far as the event-map code itself is concerned, things of type EventAnswerType may take any value e...
ContextDependency(int32 N, int32 P, EventMap *to_pdf)
A hashing function-object for pairs of ints.