diff options
author | vladimir.eidelman <vladimir.eidelman@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-14 23:00:08 +0000 |
---|---|---|
committer | vladimir.eidelman <vladimir.eidelman@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-14 23:00:08 +0000 |
commit | 2775fc13d1e8d3ad45c8ddf94226397403e0e373 (patch) | |
tree | 487fe0f9e717e6d444a448142d7b91e75e6873a1 /vest/aer_scorer.cc | |
parent | 8f97e6b03114761870f0c72f18f0928fac28d0f9 (diff) |
Added oracle forest rescoring
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@254 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'vest/aer_scorer.cc')
-rw-r--r-- | vest/aer_scorer.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/vest/aer_scorer.cc b/vest/aer_scorer.cc index 9c8a783a..d3f28804 100644 --- a/vest/aer_scorer.cc +++ b/vest/aer_scorer.cc @@ -15,15 +15,27 @@ class AERScore : public Score { AERScore() : num_matches(), num_predicted(), num_in_ref() {} AERScore(int m, int p, int r) : num_matches(m), num_predicted(p), num_in_ref(r) {} - virtual void PlusEquals(const Score& delta) { + virtual void PlusPartialEquals(const Score& rhs, int oracle_e_cover, int oracle_f_cover, int src_len){} + virtual void PlusEquals(const Score& delta, const float scale) { const AERScore& other = static_cast<const AERScore&>(delta); num_matches += other.num_matches; num_predicted += other.num_predicted; num_in_ref += other.num_in_ref; } + virtual void PlusEquals(const Score& delta) { + const AERScore& other = static_cast<const AERScore&>(delta); + num_matches += other.num_matches; + num_predicted += other.num_predicted; + num_in_ref += other.num_in_ref; + } + + virtual Score* GetZero() const { return new AERScore; } + virtual Score* GetOne() const { + return new AERScore; + } virtual void Subtract(const Score& rhs, Score* out) const { AERScore* res = static_cast<AERScore*>(out); const AERScore& other = static_cast<const AERScore&>(rhs); @@ -37,6 +49,7 @@ class AERScore : public Score { float Recall() const { return static_cast<float>(num_matches) / num_in_ref; } + float ComputePartialScore() const { return 0.0;} virtual float ComputeScore() const { const float prec = Precision(); const float rec = Recall(); @@ -82,6 +95,11 @@ static inline bool Safe(const Array2D<bool>& a, int i, int j) { return false; } +Score* AERScorer::ScoreCCandidate(const vector<WordID>& shyp) const { + Score* a = NULL; + return a; +} + Score* AERScorer::ScoreCandidate(const vector<WordID>& shyp) const { boost::shared_ptr<Array2D<bool> > hyp = AlignerTools::ReadPharaohAlignmentGrid(TD::GetString(shyp)); |