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