summaryrefslogtreecommitdiff
path: root/mteval/ns.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-12-20 18:34:14 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-12-20 18:34:14 -0500
commite4c5e87db2139aa0f8655b063da7d8b5199cb46d (patch)
treebfbb13d1c9131ed865ed3c0b42744d5d9e474b22 /mteval/ns.cc
parent2eb3bb96c6f780c477585b33273fc0c0d56c80e4 (diff)
migrate fast_score to the new API
Diffstat (limited to 'mteval/ns.cc')
-rw-r--r--mteval/ns.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/mteval/ns.cc b/mteval/ns.cc
index 6139757d..1018319d 100644
--- a/mteval/ns.cc
+++ b/mteval/ns.cc
@@ -173,7 +173,7 @@ struct BleuSegmentEvaluator : public SegmentEvaluator {
template <unsigned int N = 4u, BleuType BrevityType = IBM>
struct BleuMetric : public EvaluationMetric {
- BleuMetric() : EvaluationMetric("IBM_BLEU") {}
+ BleuMetric() : EvaluationMetric(BrevityType == IBM ? "IBM_BLEU" : (BrevityType == Koehn ? "KOEHN_BLEU" : "NIST_BLEU")) {}
unsigned SufficientStatisticsVectorSize() const { return N*2 + 2; }
shared_ptr<SegmentEvaluator> CreateSegmentEvaluator(const vector<vector<WordID> >& refs) const {
return shared_ptr<SegmentEvaluator>(new BleuSegmentEvaluator<N,BrevityType>(refs, this));
@@ -208,7 +208,8 @@ struct BleuMetric : public EvaluationMetric {
vector<float> precs(N);
float bp;
float bleu = ComputeBreakdown(stats, &bp, &precs);
- sprintf(buf, "BLEU = %.2f, %.1f|%.1f|%.1f|%.1f (brev=%.3f)",
+ sprintf(buf, "%s = %.2f, %.1f|%.1f|%.1f|%.1f (brev=%.3f)",
+ MetricId().c_str(),
bleu*100.0,
precs[0]*100.0,
precs[1]*100.0,