Skip to content
Snippets Groups Projects
Commit aa5addef authored by Alexis Nasr's avatar Alexis Nasr
Browse files

prevent the parser to produce an EOS at one point when segmentation is given...

prevent the parser to produce an EOS at one point when segmentation is given in input and there is no segmentation at this point
parent 36ddf619
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.7)
project(macaon2)
find_package(FLEX)
find_package(BLAS)
add_definitions("-Wall" )
SET(CMAKE_C_COMPILER g++)
......
if you want to use a debugger
cmake -DCMAKE_BUILD_TYPE=Debug ..
if you want the binaries to be installed in a special directory
cmake -DCMAKE_INSTALL_PREFIX:PATH=absolute_path_to_directory_where_binaries_will_be_copied ..
\ No newline at end of file
......@@ -13,7 +13,7 @@ extern int defait_amalgames;
BEGIN(state_defait_amalgames);
}
[0-9]+,[0-9]* printf("%s", yytext);
[0-9]+,[0-9]+ printf("%s", yytext);
[ \t]+ printf("\n");
[ ]*\. printf("\n.");
[ ]*\? printf("\n?");
......
......@@ -4,7 +4,7 @@ set(SOURCES src/context.c
src/movement_tagparser_arc_eager.c
src/movement_tagger.c
src/feat_fct.c
src/global_feat_vec.c
# src/global_feat_vec.c
# src/oracle_parser.c
src/oracle_parser_arc_eager.c
src/oracle_tagparser_arc_eager.c
......@@ -32,11 +32,11 @@ add_library(transparse STATIC ${SOURCES})
target_link_libraries(transparse perceptron)
#compiling, linking and installing executables
add_executable(maca_trans_parser_nn ./src/maca_trans_parser_nn.cc)
target_link_libraries(maca_trans_parser_nn perceptron)
target_link_libraries(maca_trans_parser_nn transparse)
target_link_libraries(maca_trans_parser_nn maca_common)
install (TARGETS maca_trans_parser_nn DESTINATION bin)
#add_executable(maca_trans_parser_nn ./src/maca_trans_parser_nn.cc)
#target_link_libraries(maca_trans_parser_nn perceptron)
#target_link_libraries(maca_trans_parser_nn transparse)
#target_link_libraries(maca_trans_parser_nn maca_common)
#install (TARGETS maca_trans_parser_nn DESTINATION bin)
add_executable(maca_trans_tagger_mcf2cff ./src/maca_trans_tagger_mcf2cff.c)
target_link_libraries(maca_trans_tagger_mcf2cff perceptron)
......
......@@ -187,6 +187,16 @@ void simple_decoder_parser_arc_eager(context *ctx)
mvt_type = movement_parser_type(mvt_code);
mvt_label = movement_parser_label(mvt_code);
if((mvt_type == MVT_PARSER_EOS) && (word_get_sent_seg(stack_top(config_get_stack(c))) == 0)){
if(ctx->verbose)
fprintf(stderr, "the classifier did predict EOS but this is not the case\n");
feature_table_argmax_1_2(fv, ft, &argmax1, &max1, &argmax2, &max2);
mvt_code = argmax2;
mvt_type = movement_parser_type(mvt_code);
mvt_label = movement_parser_label(mvt_code);
}
result = 0;
switch(mvt_type){
case MVT_PARSER_LEFT :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment