From 49158e721bfaf6423dca9fc633873218f691c83a Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 20 Dec 2013 21:53:42 +0100 Subject: fixed BLEU+1 as in Nakov et al --- per_sentence_bleu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3