From a5c21b10d25375a09cf49b33252d41acbc263942 Mon Sep 17 00:00:00 2001 From: "robin.perrotin" <robin.perrotin@lif.univ-mrs.fr> Date: Mon, 13 Nov 2017 05:24:40 +0100 Subject: [PATCH] . --- maca_trans_parser/src/simple_decoder_parser_arc_eager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 6c04ef9..9fe73aa 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 = -1.; + double sumExp = -1; double currentSumExp = 0.; double ScoreTranslation = -10.; @@ -194,13 +194,13 @@ 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.5){ + if(sumExp + 0.5 < 0){ printf(" %f %f %d ",ScoreTranslation,vcode_array[i].score, i); ScoreTranslation += vcode_array[i].score; printf(" %f " ,ScoreTranslation); sumExp = 0.; } - if(vcode_array[i].score - ScoreTranslation >= 0){ + if(vcode_array[i].score - ScoreTranslation > 0){ sumExp += exp(vcode_array[i].score - ScoreTranslation); } } @@ -216,7 +216,7 @@ void simple_decoder_parser_arc_eager(context *ctx) int b2 = respect_stack_constraint(ctx->partial_mode, c, movement_parser_type(vcode_array[i].class_code), movement_parser_label(vcode_array[i].class_code)); 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(vcode_array[i].score - ScoreTranslation >= 0){ + if(vcode_array[i].score - ScoreTranslation > 0){ printf(" %f %f %f",sumExp, currentSumExp,ScoreTranslation); printf(" [%f-",currentSumExp/sumExp); currentSumExp += exp(vcode_array[i].score - ScoreTranslation); -- GitLab