diff options
author | Patrick Simianer <p@simianer.de> | 2013-12-20 21:53:42 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2013-12-20 21:53:42 +0100 |
commit | 49158e721bfaf6423dca9fc633873218f691c83a (patch) | |
tree | 5d90c4498d3a21da1b9e7c95b28aed3549e16b37 | |
parent | d22d5914775c19cce81447cc95badaf64e9d3d6c (diff) |
fixed BLEU+1 as in Nakov et al
-rwxr-xr-x | per_sentence_bleu | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/per_sentence_bleu b/per_sentence_bleu index f024e74..c7c0b0e 100755 --- a/per_sentence_bleu +++ b/per_sentence_bleu @@ -16,7 +16,7 @@ end def brevity_penalty hypothesis, reference a = hypothesis.split; b = reference.split return 1.0 if a.size>b.size - return Math.exp(1.0 - b.size.to_f/a.size); + return Math.exp(1.0 - ((b.size.to_f+1)/a.size)); end def per_sentence_bleu hypothesis, reference, n=4 |