diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-07 18:46:58 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-07 18:46:58 +0400 |
commit | 05fc5ffce36dd1ccf1a00ab247953743544683c0 (patch) | |
tree | 571d4d5dee2bb4fda890cc931edcee761926dfa3 /scripts/ems | |
parent | 0b59bee21ca284c5225149c46f43430fccb4d854 (diff) |
phrase table type deduced in experiment.perl. Passed to train-model.perl
Diffstat (limited to 'scripts/ems')
-rwxr-xr-x | scripts/ems/experiment.perl | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/scripts/ems/experiment.perl b/scripts/ems/experiment.perl index 7774a8010..bd4bcd219 100755 --- a/scripts/ems/experiment.perl +++ b/scripts/ems/experiment.perl @@ -1768,20 +1768,36 @@ sub define_training_build_custom_generation { sub define_training_create_config { my ($step_id) = @_; - my ($config, - $reordering_table,$phrase_translation_table,$generation_table,@LM) - = &get_output_and_input($step_id); + my ($config,$reordering_table,$phrase_translation_table,$generation_table,@LM) + = &get_output_and_input($step_id); my $cmd = &get_training_setting(9); + # get model, and whether suffix array is used. Determines the pt implementation. + my $hierarchical = &get("TRAINING:hierarchical-rule-set"); + my $sa_exec_dir = &get("TRAINING:suffix-array"); + + my $ptImpl; + if ($hierarchical) { + if ($sa_exec_dir) { + $ptImpl = 10; # suffix array + } + else { + $ptImpl = 6; # in-mem SCFG + } + } + else { + $ptImpl = 0; # phrase-based + } + # additional settings for factored models - $cmd .= &get_table_name_settings("translation-factors","phrase-translation-table",$phrase_translation_table); - $cmd .= &get_table_name_settings("reordering-factors","reordering-table",$reordering_table) - if $reordering_table; - $cmd .= &get_table_name_settings("generation-factors","generation-table",$generation_table) - if $generation_table; + $cmd .= &get_table_name_settings("translation-factors","phrase-translation-table","$phrase_translation_table:$ptImpl"); + $cmd .= &get_table_name_settings("reordering-factors","reordering-table",$reordering_table) if $reordering_table; + $cmd .= &get_table_name_settings("generation-factors","generation-table",$generation_table) if $generation_table; $cmd .= "-config $config "; + print STDERR "HIEU: $hierarchical \n $sa_exec_dir \n $cmd \n"; + my $decoding_graph_backoff = &get("TRAINING:decoding-graph-backoff"); if ($decoding_graph_backoff) { $cmd .= "-decoding-graph-backoff \"$decoding_graph_backoff\" "; @@ -2204,7 +2220,7 @@ sub define_tuningevaluation_filter { $cmd .= "-config $config\n"; # filter command - my $sa_exec_dir = &check_and_get("TRAINING:suffix-array"); + my $sa_exec_dir = &get("TRAINING:suffix-array"); if ($sa_exec_dir eq "") { # normal phrase table $cmd .= "$scripts/training/filter-model-given-input.pl"; |