From ebf2ed7357beb36e5351aab7703a0a5af7c876ca Mon Sep 17 00:00:00 2001 From: "robin.perrotin" <robin.perrotin@lif.univ-mrs.fr> Date: Mon, 13 Nov 2017 05:11:31 +0100 Subject: [PATCH] . --- maca_trans_parser/src/simple_decoder_parser_arc_eager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/maca_trans_parser/src/simple_decoder_parser_arc_eager.c b/maca_trans_parser/src/simple_decoder_parser_arc_eager.c index 8671b38..1458686 100644 --- a/maca_trans_parser/src/simple_decoder_parser_arc_eager.c +++ b/maca_trans_parser/src/simple_decoder_parser_arc_eager.c @@ -151,7 +151,7 @@ void simple_decoder_parser_arc_eager(context *ctx) int index; float score; - double sumExp = 0.; + double sumExp = -1.; double currentSumExp = 0.; double ScoreTranslation = -150.; @@ -194,8 +194,9 @@ void simple_decoder_parser_arc_eager(context *ctx) int b3 = respect_buffer_constraint(ctx->partial_mode, c, movement_parser_type(vcode_array[i].class_code), movement_parser_label(vcode_array[i].class_code)); if(b1 && b2 && b3){ - if(sumExp == 0.){ + if(sumExp < 0.){ ScoreTranslation += vcode_array[i].score; + sumExp = 0. } if(vcode_array[i].score - ScoreTranslation >= 0){ sumExp += exp(vcode_array[i].score - ScoreTranslation); -- GitLab