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/scorer.h | |
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/scorer.h')
-rw-r--r-- | vest/scorer.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vest/scorer.h b/vest/scorer.h index 83d4db4c..7ce688c4 100644 --- a/vest/scorer.h +++ b/vest/scorer.h @@ -10,17 +10,21 @@ class ViterbiEnvelope; class ErrorSurface; class Hypergraph; // needed for alignment -enum ScoreType { IBM_BLEU, NIST_BLEU, Koehn_BLEU, TER, BLEU_minus_TER_over_2, SER, AER }; +enum ScoreType { IBM_BLEU, NIST_BLEU, Koehn_BLEU, TER, BLEU_minus_TER_over_2, SER, AER, IBM_BLEU_3 }; ScoreType ScoreTypeFromString(const std::string& st); class Score { public: virtual ~Score(); virtual float ComputeScore() const = 0; + virtual float ComputePartialScore() const =0; virtual void ScoreDetails(std::string* details) const = 0; + virtual void PlusEquals(const Score& rhs, const float scale) = 0; virtual void PlusEquals(const Score& rhs) = 0; + virtual void PlusPartialEquals(const Score& rhs, int oracle_e_cover, int oracle_f_cover, int src_len) = 0; virtual void Subtract(const Score& rhs, Score* res) const = 0; virtual Score* GetZero() const = 0; + virtual Score* GetOne() const = 0; virtual bool IsAdditiveIdentity() const = 0; // returns true if adding this delta // to another score results in no score change // under any circumstances @@ -32,6 +36,7 @@ class SentenceScorer { virtual ~SentenceScorer(); void ComputeErrorSurface(const ViterbiEnvelope& ve, ErrorSurface* es, const ScoreType type, const Hypergraph& hg) const; virtual Score* ScoreCandidate(const std::vector<WordID>& hyp) const = 0; + virtual Score* ScoreCCandidate(const std::vector<WordID>& hyp) const =0; virtual const std::string* GetSource() const; static Score* CreateScoreFromString(const ScoreType type, const std::string& in); static SentenceScorer* CreateSentenceScorer(const ScoreType type, |