Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Haddow <barry.haddow@gmail.com>2013-02-18 15:11:20 +0400
committerBarry Haddow <barry.haddow@gmail.com>2013-02-18 15:11:20 +0400
commit9ca364fb22d7efbfb1880744c8ea3b74e9b8787b (patch)
tree66d805658f4dbff1f4eee296768b23cc299676f6 /mert/BleuScorerTest.cpp
parent2e6b5e7a23f41835d55f405213ffcc665ad3e539 (diff)
Implement brevity penalty smoothing for PRO
As in Nakov et al (Coling 2012)
Diffstat (limited to 'mert/BleuScorerTest.cpp')
-rw-r--r--mert/BleuScorerTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/mert/BleuScorerTest.cpp b/mert/BleuScorerTest.cpp
index 0d721422c..136f134eb 100644
--- a/mert/BleuScorerTest.cpp
+++ b/mert/BleuScorerTest.cpp
@@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE(calculate_actual_score) {
// reference-length
stats[8] = 7;
- BOOST_CHECK(IsAlmostEqual(0.5115f, scorer.calculateScore(stats)));
+ BOOST_CHECK_CLOSE(0.5115f, scorer.calculateScore(stats), 0.01);
}
BOOST_AUTO_TEST_CASE(sentence_level_bleu) {
@@ -270,5 +270,7 @@ BOOST_AUTO_TEST_CASE(sentence_level_bleu) {
// reference-length
stats[8] = 7.0;
- BOOST_CHECK(IsAlmostEqual(0.5985f, sentenceLevelBleuPlusOne(stats)));
+ BOOST_CHECK_CLOSE(0.5985f, smoothedSentenceBleu(stats), 0.01);
+ BOOST_CHECK_CLOSE(0.5624f, smoothedSentenceBleu(stats, 0.5), 0.01 );
+ BOOST_CHECK_CLOSE(0.5067f, smoothedSentenceBleu(stats, 1.0, true), 0.01);
}