diff options
author | Rico Sennrich <rico.sennrich@gmx.ch> | 2014-09-17 17:14:11 +0400 |
---|---|---|
committer | Rico Sennrich <rico.sennrich@gmx.ch> | 2014-09-22 13:49:20 +0400 |
commit | 3d00e5dc8ceb19d619e2ed2d0aa3f1b2a160944a (patch) | |
tree | 9d6a6fc32490d47aa0291c52285f53bf8d5abfac /mert/BleuScorer.cpp | |
parent | 6810b225ccd673c7684ab9b62e0daa0a7af054f3 (diff) |
basic support for more metrics with kbmira
metrics need getReferenceLength (for background smoothing) to work with kbmira
Diffstat (limited to 'mert/BleuScorer.cpp')
-rw-r--r-- | mert/BleuScorer.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp index 381abeabf..04f4d75c9 100644 --- a/mert/BleuScorer.cpp +++ b/mert/BleuScorer.cpp @@ -289,23 +289,6 @@ float sentenceLevelBackgroundBleu(const std::vector<float>& sent, const std::vec return exp(logbleu) * stats[kBleuNgramOrder*2]; } -float unsmoothedBleu(const std::vector<float>& stats) -{ - UTIL_THROW_IF(stats.size() != kBleuNgramOrder * 2 + 1, util::Exception, "Error"); - - float logbleu = 0.0; - for (int j = 0; j < kBleuNgramOrder; j++) { - logbleu += log(stats[2 * j]) - log(stats[2 * j + 1]); - } - logbleu /= kBleuNgramOrder; - const float brevity = 1.0 - stats[(kBleuNgramOrder * 2)] / stats[1]; - - if (brevity < 0.0) { - logbleu += brevity; - } - return exp(logbleu); -} - vector<float> BleuScorer::ScoreNbestList(const string& scoreFile, const string& featureFile) { vector<string> scoreFiles; |