summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-04 15:22:19 +0200
committerPatrick Simianer <p@simianer.de>2014-06-04 15:22:19 +0200
commit31ac766e4654096bed1f33d925936e86051af956 (patch)
tree692eb6276f21c9e46b05b85d8f47a90583661cdf
parent5bfb3b1a0d6d964ee4b1a2c522587699a6c6be2f (diff)
fix
-rw-r--r--hopefear.rb6
1 files 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