#include <kws-scoring.h>
Public Member Functions | |
void | AddRef (const KwsTerm &ref) |
void | AddHyp (const KwsTerm &hyp) |
int | nof_hyps () const |
int | nof_refs () const |
KwsTermsAligner (const KwsTermsAlignerOptions &opts) | |
KwsAlignment | AlignTerms () |
virtual float | AlignerScore (const KwsTerm &ref, const KwsTerm &hyp) |
Private Types | |
typedef std::vector< KwsTerm > | TermArray |
typedef std::vector< KwsTerm >::iterator | TermIterator |
typedef unordered_map< int, bool > | TermUseMap |
Private Member Functions | |
int | FindBestRefIndex (const KwsTerm &term) |
TermIterator | FindNextRef (const KwsTerm &hyp, const TermIterator &prev, const TermIterator &last) |
bool | RefExistsMaybe (const KwsTerm &term) |
void | FillUnmatchedRefs (KwsAlignment *ali) |
Private Attributes | |
unordered_map< int, unordered_map< std::string, TermArray > > | refs_ |
unordered_map< int, unordered_map< std::string, TermUseMap > > | used_ref_terms_ |
std::list< KwsTerm > | hyps_ |
KwsTermsAlignerOptions | opts_ |
int | nof_refs_ |
int | nof_hyps_ |
Definition at line 136 of file kws-scoring.h.
Definition at line 160 of file kws-scoring.h.
|
private |
Definition at line 161 of file kws-scoring.h.
|
private |
Definition at line 162 of file kws-scoring.h.
|
explicit |
Definition at line 119 of file kws-scoring.cc.
|
inline |
|
inline |
Definition at line 138 of file kws-scoring.h.
References KwsTerm::kw_id(), and KwsTerm::utt_id().
Referenced by main().
Definition at line 236 of file kws-scoring.cc.
References KwsTerm::end_time(), and KwsTerm::start_time().
Referenced by KwsTermsAligner::AlignTerms(), and KwsTermsAligner::FindBestRefIndex().
KwsAlignment AlignTerms | ( | ) |
Definition at line 125 of file kws-scoring.cc.
References KwsAlignment::Add(), AlignedTermsPair::aligner_score, KwsTermsAligner::AlignerScore(), KwsTermsAligner::FillUnmatchedRefs(), KwsTermsAligner::FindBestRefIndex(), AlignedTermsPair::hyp, KwsTermsAligner::hyps_, KALDI_LOG, AlignedTermsPair::ref, KwsTermsAligner::refs_, KwsAlignment::size(), and KwsTermsAligner::used_ref_terms_.
Referenced by main().
|
private |
Definition at line 156 of file kws-scoring.cc.
References KwsAlignment::Add(), AlignedTermsPair::aligner_score, AlignedTermsPair::ref, KwsTermsAligner::refs_, and KwsTermsAligner::used_ref_terms_.
Referenced by KwsTermsAligner::AlignTerms().
|
private |
Definition at line 182 of file kws-scoring.cc.
References KwsTermsAligner::AlignerScore(), KwsTermsAligner::FindNextRef(), KwsTerm::kw_id(), KwsTermsAligner::RefExistsMaybe(), KwsTermsAligner::refs_, KwsTermsAligner::used_ref_terms_, and KwsTerm::utt_id().
Referenced by KwsTermsAligner::AlignTerms().
|
private |
Definition at line 228 of file kws-scoring.cc.
References KwsTermsAlignerOptions::max_distance, and KwsTermsAligner::opts_.
Referenced by KwsTermsAligner::FindBestRefIndex().
|
inline |
|
inline |
Definition at line 215 of file kws-scoring.cc.
References count, KwsTerm::kw_id(), KwsTermsAligner::refs_, and KwsTerm::utt_id().
Referenced by KwsTermsAligner::FindBestRefIndex().
|
private |
Definition at line 165 of file kws-scoring.h.
Referenced by KwsTermsAligner::AlignTerms().
|
private |
Definition at line 168 of file kws-scoring.h.
|
private |
Definition at line 167 of file kws-scoring.h.
|
private |
Definition at line 166 of file kws-scoring.h.
Referenced by KwsTermsAligner::FindNextRef().
|
private |
Definition at line 163 of file kws-scoring.h.
Referenced by KwsTermsAligner::AlignTerms(), KwsTermsAligner::FillUnmatchedRefs(), KwsTermsAligner::FindBestRefIndex(), and KwsTermsAligner::RefExistsMaybe().
|
private |
Definition at line 164 of file kws-scoring.h.
Referenced by KwsTermsAligner::AlignTerms(), KwsTermsAligner::FillUnmatchedRefs(), and KwsTermsAligner::FindBestRefIndex().