diff --git a/mert/Scorer.h b/mert/Scorer.h index a08fc436d..a02d02c59 100644 --- a/mert/Scorer.h +++ b/mert/Scorer.h @@ -47,11 +47,16 @@ public: virtual float calculateScore(const std::vector& totals) const = 0; float calculateSentenceLevelBackgroundScore(const std::vector& totals, const std::vector& bg) { - std::vector stats(totals.size()); - for(size_t i=0; i stats(totals.size()); + for(size_t i=0; i ScorerFactory::getTypes() types.push_back(string("PER")); types.push_back(string("TER")); types.push_back(string("CDER")); + types.push_back(string("CHRF")); types.push_back(string("WER")); types.push_back(string("MERGE")); types.push_back(string("SEMPOS")); @@ -62,6 +64,8 @@ Scorer* ScorerFactory::getScorer(const string& type, const string& config) return (PermutationScorer*) new PermutationScorer(type, config); } else if (type == "METEOR") { return new MeteorScorer(config); + } else if (type == "CHRF") { + return new CHRFScorer(config); } else if (type == "HWCM") { return new HwcmScorer(config); } else { diff --git a/mert/kbmira.cpp b/mert/kbmira.cpp index 025602041..d060d2679 100644 --- a/mert/kbmira.cpp +++ b/mert/kbmira.cpp @@ -43,6 +43,7 @@ de recherches du Canada #include "util/random.hh" #include "BleuScorer.h" +#include "CHRFScorer.h" #include "HopeFearDecoder.h" #include "MiraFeatureVector.h" #include "MiraWeightVector.h"