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

modified decode_forrest.c and simple_decoder_forrest.c so that it does not load a model

parent 7e34c822
Branches
No related tags found
No related merge requests found
......@@ -99,7 +99,7 @@ void context_model_help_message(context *ctx){
fprintf(stderr, "\t-m --model <file> : model file name\n");
}
void context_input_help_message(context *ctx){
fprintf(stderr, "\t-i --input <file> : input file name\n");
fprintf(stderr, "\t-i --input <file> : input file name (default is stdin)\n");
}
void context_iterations_help_message(context *ctx){
fprintf(stderr, "\t-n --iter <int> : number of iterations (default is 4)\n");
......
......@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
ctx = context_read_options(argc, argv);
decode_check_options(ctx);
set_linguistic_resources_filenames_parser(ctx);
/* set_linguistic_resources_filenames_parser(ctx); */
ctx->features_model = feat_model_read(ctx->features_model_filename, ctx->verbose);
ctx->vocabs = dico_vec_read(ctx->vocabs_filename, ctx->hash_ratio);
mcd_link_to_dico(ctx->mcd_struct, ctx->vocabs, ctx->verbose);
......@@ -112,11 +112,9 @@ int main(int argc, char *argv[])
/* load models */
ctx->d_perceptron_features = dico_vec_get_dico(ctx->vocabs, (char *)"d_perceptron_features");
/* ctx->d_perceptron_features = dico_vec_get_dico(ctx->vocabs, (char *)"d_perceptron_features"); */
if(ctx->beam_width == 1){
simple_decoder_forrest(ctx);
}
context_free(ctx);
return 0;
......
......@@ -26,6 +26,7 @@ void transform_treebank_help_message(context *ctx)
context_conll_help_message(ctx);
context_mcd_help_message(ctx);
context_features_model_help_message(ctx);
context_input_help_message(ctx);
fprintf(stderr, "IN TEST MODE\n");
context_vocabs_help_message(ctx);
......@@ -39,10 +40,10 @@ void transform_treebank_help_message(context *ctx)
void transform_treebank_check_options(context *ctx)
{
if(!ctx->input_filename
|| ctx->help
if( ctx->help
|| !ctx->input_filename
/* || !ctx->mcd_filename */
|| !(ctx->cff_filename || ctx->fann_filename)
/* || !(ctx->cff_filename || ctx->fann_filename) */
){
transform_treebank_help_message(ctx);
exit(1);
......
......@@ -62,7 +62,8 @@ void simple_decoder_buffer_forrest(context *ctx, FILE *f, feature_table *ft, int
void simple_decoder_forrest(context *ctx)
{
FILE *f = (ctx->input_filename)? myfopen(ctx->input_filename, "r") : stdin;
feature_table *ft = feature_table_load(ctx->perc_model_filename, ctx->verbose);
/* feature_table *ft = feature_table_load(ctx->perc_model_filename, ctx->verbose); */
feature_table *ft = NULL;
int root_label;
root_label = dico_string2int(ctx->dico_labels, ctx->root_label);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment