From 31ac766e4654096bed1f33d925936e86051af956 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Wed, 4 Jun 2014 15:22:19 +0200 Subject: fix --- hopefear.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hopefear.rb b/hopefear.rb index 93534b6..c2c4239 100644 --- a/hopefear.rb +++ b/hopefear.rb @@ -18,8 +18,8 @@ def gethopefear_rebol kbest, feedback, gold, max, own_reference=nil if feedback == true # hope hope = kbest[0] - new_reference = hope.s - kbest.each { |k| k.scores[:per_sentence_bleu] = BLEU::per_sentence_bleu k.s, new_reference } + new_reference = hope + kbest.each { |k| k.scores[:per_sentence_bleu] = BLEU::per_sentence_bleu k.s, new_reference.s } # fear kbest.sort_by { |k| -(k.scores[:decoder]-k.scores[:per_sentence_bleu]) }.each_with_index { |k,i| break if i==max @@ -67,7 +67,7 @@ def gethopefear_exec kbest, feedback, gold, max, own_reference=nil type1 = type2 = false if feedback == true hope = kbest[0] - new_reference = hope.s + new_reference = hope type1 = true elsif own_reference hope = own_reference -- cgit v1.2.3