diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2013-02-18 15:11:20 +0400 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2013-02-18 15:11:20 +0400 |
commit | 9ca364fb22d7efbfb1880744c8ea3b74e9b8787b (patch) | |
tree | 66d805658f4dbff1f4eee296768b23cc299676f6 /mert/BleuScorerTest.cpp | |
parent | 2e6b5e7a23f41835d55f405213ffcc665ad3e539 (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.cpp | 6 |
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); } |