diff --git a/maca_common/include/word_emb.h b/maca_common/include/word_emb.h index 198e755cf38e9519f897442e7108e0b633f1d2f4..eba9f4acf5213193814b4a600ccb3ad5e2567f61 100644 --- a/maca_common/include/word_emb.h +++ b/maca_common/include/word_emb.h @@ -2,7 +2,6 @@ #define __WORD_EMB__ #include"hash.h" -/* #include"fann.h"*/ #include"dico.h" typedef struct @@ -14,21 +13,20 @@ typedef struct } word_emb; word_emb *word_emb_new(int dim, int nbelem); -void word_emb_free(word_emb *we); +void word_emb_free(word_emb *we); word_emb *word_emb_load(char *filename); -float *word_emb_get_vector(word_emb *we, char *word); -int word_emb_get_code(word_emb *we, char *word); -/* int word_emb_fill_input_array_dnn(fann_type *input_array, word_emb *we, int code, int first_index); */ -int word_emb_fill_input_array_dnn(float *input_array, word_emb *we, int code, int first_index); -void word_emb_print(FILE *f, word_emb *we, int code); +float *word_emb_get_vector(word_emb *we, char *word); +int word_emb_get_code(word_emb *we, char *word); +int word_emb_fill_input_array_dnn(float *input_array, word_emb *we, int code, int first_index); +void word_emb_print(FILE *f, word_emb *we, int code); -int word_emb_number_of_lines_in_file(char *filename); -int word_emb_number_of_columns_in_file(char *filename); +int word_emb_number_of_lines_in_file(char *filename); +int word_emb_number_of_columns_in_file(char *filename); word_emb *word_emb_load_w2v_file(char *filename); word_emb *word_emb_load_w2v_file_filtered(char *file_name, dico *d); -void word_emb_print_to_file(word_emb *we, char *filename); +void word_emb_print_to_file(word_emb *we, char *filename); #endif diff --git a/maca_trans_parser/src/cff2fann.c b/maca_trans_parser/src/cff2fann.c index a36490f2ff86abb5de95859af18138f775a6af87..1aaffd1c3bffbc98bb52198234c9eac0eaf1642d 100644 --- a/maca_trans_parser/src/cff2fann.c +++ b/maca_trans_parser/src/cff2fann.c @@ -158,7 +158,9 @@ void cff2fann(context *ctx) /* printf("representation = %d\n", m->representation[mcd_col]); */ if(m->representation[mcd_col] == MCD_REPRESENTATION_EMB){ - /* printf("it is an embedding val = %d, file = %s\n", val, m->filename[mcd_col]); */ + fprintf(stderr, "it is an embedding val = %d, file = %s\n", feature_valindex, m->filename[mcd_col]); + + //int word_emb_get_code(word_emb *we, char *word) /* word_emb_print(stdout, m->word_emb_array[mcd_col], feature_valindex); */ /* printf("\n"); */ printf("\t%d", feature_valindex); diff --git a/perceptron/exec/cff_cutoff.c b/perceptron/exec/cff_cutoff.c index 64ad7e05231568704e16ee14fdb9602843217c8a..4fa8e757bfb0c10d9832c4e1d2097d2deebb3b2e 100644 --- a/perceptron/exec/cff_cutoff.c +++ b/perceptron/exec/cff_cutoff.c @@ -27,6 +27,7 @@ cff_cutoff_context *cff_cutoff_context_new(void) { cff_cutoff_context *ctx = (cff_cutoff_context *)memalloc(sizeof(cff_cutoff_context)); + ctx->help = 0; ctx->verbose = 0; ctx->program_name = NULL; ctx->vocabs_filename = NULL; diff --git a/perceptron/lib/src/perceptron_context.c b/perceptron/lib/src/perceptron_context.c index 2013181d9db01d57d0f5db6d1f078804ae31be8f..34d0f7bb759855b914439e65b833fd6d354e1c86 100644 --- a/perceptron/lib/src/perceptron_context.c +++ b/perceptron/lib/src/perceptron_context.c @@ -19,6 +19,7 @@ perceptron_context *perceptron_context_new(void) { perceptron_context *ctx = (perceptron_context *)memalloc(sizeof(perceptron_context)); + ctx->help = 0; ctx->verbose = 0; ctx->program_name = NULL; ctx->perc_model_filename = NULL;