19 #ifndef KALDI_KWS_KWS_SCORING_H_ 20 #define KALDI_KWS_KWS_SCORING_H_ 45 KwsTerm(
const std::string &
kw_id,
const std::vector<double> &vec) {
102 void WriteCsv(std::iostream &os,
const float frames_per_sec);
106 inline AlignedTerms::const_iterator
begin()
const {
return alignment_.begin();}
107 inline AlignedTerms::const_iterator
end()
const {
return alignment_.end();}
108 inline int size()
const {
return alignment_.size(); }
122 alignment_.push_back(next);
144 hyps_.push_back(hyp);
157 virtual float AlignerScore(
const KwsTerm &ref,
const KwsTerm &hyp);
163 unordered_map<int, unordered_map<std::string, TermArray > >
refs_;
173 int FindBestRefIndex(
const KwsTerm &term);
176 TermIterator FindNextRef(
const KwsTerm &hyp,
177 const TermIterator &prev,
178 const TermIterator &last);
182 bool RefExistsMaybe(
const KwsTerm &term);
213 return (cost_fa/value_corr) * (1.0/prior_probability - 1);
242 void GetOracleMeasures(
float *final_mtwv,
243 float *final_mtwv_threshold,
255 void AddEvent(
const KwsTerm &ref,
const KwsTerm &hyp,
float ali_score);
256 void RefAndHypSeen(
const std::string &
kw_id,
float score);
257 void OnlyRefSeen(
const std::string &
kw_id,
float score);
258 void OnlyHypSeen(
const std::string &
kw_id,
float score);
262 #endif // KALDI_KWS_KWS_SCORING_H_
void AddRef(const KwsTerm &ref)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
unordered_map< int, bool > TermUseMap
KwsTerm(const std::string &kw_id, const std::vector< double > &vec)
void AddHyp(const KwsTerm &hyp)
unordered_map< int, unordered_map< std::string, TermUseMap > > used_ref_terms_
void Add(const AlignedTermsPair &next)
#define KALDI_DISALLOW_COPY_AND_ASSIGN(type)
std::vector< AlignedTermsPair > AlignedTerms
std::string kw_id() const
AlignedTerms::const_iterator begin() const
void set_start_time(int start_time)
std::list< KwsTerm > hyps_
void set_end_time(int end_time)
void set_score(float score)
void set_utt_id(int utt_id)
void set_kw_id(const std::string &kw_id)
std::vector< KwsTerm >::iterator TermIterator
unordered_map< int, unordered_map< std::string, TermArray > > refs_
KwsTermsAlignerOptions opts_
#define KALDI_ASSERT(cond)
float atwv_decision_threshold_
AlignedTerms::const_iterator end() const
std::vector< KwsTerm > TermArray