summaryrefslogtreecommitdiff
path: root/mteval/ns_cer.h
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
commit3f8e33cfe481a09c121a410e66a6074b5d05683e (patch)
treea41ecaf0bbb69fa91a581623abe89d41219c04f8 /mteval/ns_cer.h
parentc139ce495861bb341e1b86a85ad4559f9ad53c14 (diff)
parent9fe0219562e5db25171cce8776381600ff9a5649 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mteval/ns_cer.h')
-rw-r--r--mteval/ns_cer.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/mteval/ns_cer.h b/mteval/ns_cer.h
new file mode 100644
index 00000000..9d211181
--- /dev/null
+++ b/mteval/ns_cer.h
@@ -0,0 +1,23 @@
+#ifndef _NS_CER_H_
+#define _NS_CER_H_
+
+#include "ns.h"
+
+class CERMetric : public EvaluationMetric {
+ friend class EvaluationMetric;
+ private:
+ unsigned EditDistance(const std::string& hyp,
+ const std::string& ref) const;
+ protected:
+ CERMetric() : EvaluationMetric("CER") {}
+
+ public:
+ virtual bool IsErrorMetric() const;
+ virtual unsigned SufficientStatisticsVectorSize() const;
+ virtual void ComputeSufficientStatistics(const std::vector<WordID>& hyp,
+ const std::vector<std::vector<WordID> >& refs,
+ SufficientStats* out) const;
+ virtual float ComputeScore(const SufficientStats& stats) const;
+};
+
+#endif