summaryrefslogtreecommitdiff
path: root/mteval/ns_wer.h
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-09-04 13:24:26 -0400
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-09-04 13:24:26 -0400
commit5dfecf3ac4a0755255bb806f7d556f1f8e7dbc38 (patch)
tree592547d91748125b892e6ecd86de5ff2334a26aa /mteval/ns_wer.h
parent969b00197fc41087f9eb808a7ebba293966f90de (diff)
word error rate metric
Diffstat (limited to 'mteval/ns_wer.h')
-rw-r--r--mteval/ns_wer.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/mteval/ns_wer.h b/mteval/ns_wer.h
new file mode 100644
index 00000000..24c85d83
--- /dev/null
+++ b/mteval/ns_wer.h
@@ -0,0 +1,20 @@
+#ifndef _NS_WER_H_
+#define _NS_WER_H_
+
+#include "ns.h"
+
+class WERMetric : public EvaluationMetric {
+ friend class EvaluationMetric;
+ protected:
+ WERMetric() : EvaluationMetric("WER") {}
+
+ 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