From 11b3c09e45348d3e69db57837b61097862544fec Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Wed, 25 Jul 2012 23:57:05 -0400 Subject: Character error rate metric - [python] cdec.score.CER - Cleanup .gitignore --- mteval/ns_cer.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 mteval/ns_cer.h (limited to 'mteval/ns_cer.h') 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& hyp, + const std::vector >& refs, + SufficientStats* out) const; + virtual float ComputeScore(const SufficientStats& stats) const; +}; + +#endif -- cgit v1.2.3