summaryrefslogtreecommitdiff
path: root/mteval/scorer.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-06-08 22:35:06 -0400
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:57 +0200
commitcad818e83f1bdfeb1930b071b116442a27a38303 (patch)
tree55f09ac77badfb3ef976e88829bcfcb11dea6e8a /mteval/scorer.cc
parent0d2b0f252370260042a456f215b2b79c456796df (diff)
rudimentary support for meteor via an external process. still needs configuration of path, but it should work
Diffstat (limited to 'mteval/scorer.cc')
-rw-r--r--mteval/scorer.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/mteval/scorer.cc b/mteval/scorer.cc
index 64ce63af..2daa0daa 100644
--- a/mteval/scorer.cc
+++ b/mteval/scorer.cc
@@ -17,11 +17,12 @@
#include "comb_scorer.h"
#include "tdict.h"
#include "stringlib.h"
+#include "external_scorer.h"
using boost::shared_ptr;
using namespace std;
-void Score::TimesEquals(float scale) {
+void Score::TimesEquals(float /*scale*/) {
cerr<<"UNIMPLEMENTED except for BLEU (for MIRA): Score::TimesEquals"<<endl;abort();
}
@@ -43,12 +44,14 @@ ScoreType ScoreTypeFromString(const string& st) {
return Koehn_BLEU;
if (sl == "combi")
return BLEU_minus_TER_over_2;
+ if (sl == "meteor")
+ return METEOR;
cerr << "Don't understand score type '" << st << "', defaulting to ibm_bleu.\n";
return IBM_BLEU;
}
static char const* score_names[]={
- "IBM_BLEU", "NIST_BLEU", "Koehn_BLEU", "TER", "BLEU_minus_TER_over_2", "SER", "AER", "IBM_BLEU_3"
+ "IBM_BLEU", "NIST_BLEU", "Koehn_BLEU", "TER", "BLEU_minus_TER_over_2", "SER", "AER", "IBM_BLEU_3", "METEOR"
};
std::string StringFromScoreType(ScoreType st) {
@@ -356,6 +359,7 @@ ScorerP SentenceScorer::CreateSentenceScorer(const ScoreType type,
case TER: r = new TERScorer(refs);break;
case SER: r = new SERScorer(refs);break;
case BLEU_minus_TER_over_2: r = new BLEUTERCombinationScorer(refs);break;
+ case METEOR: r = new ExternalSentenceScorer(ScoreServerManager::Instance("meteor"), refs); break;
default:
assert(!"Not implemented!");
}
@@ -398,6 +402,8 @@ ScoreP SentenceScorer::CreateScoreFromString(const ScoreType type, const string&
return SERScorer::ScoreFromString(in);
case BLEU_minus_TER_over_2:
return BLEUTERCombinationScorer::ScoreFromString(in);
+ case METEOR:
+ return ExternalSentenceScorer::ScoreFromString(ScoreServerManager::Instance("meteor"), in);
default:
assert(!"Not implemented!");
}