summaryrefslogtreecommitdiff
path: root/per_sentence_bleu
diff options
context:
space:
mode:
Diffstat (limited to 'per_sentence_bleu')
-rwxr-xr-xper_sentence_bleu2
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