diff options
author | Hieu Hoang <s0565741@crom.inf.ed.ac.uk> | 2013-03-16 19:05:14 +0400 |
---|---|---|
committer | Hieu Hoang <s0565741@crom.inf.ed.ac.uk> | 2013-03-16 19:05:14 +0400 |
commit | 1f1a0297dbfc8e16a089e5a8eb75ac89809dc7f1 (patch) | |
tree | 25afc3711e1cfcb722666e7b95516aee8c502fb7 /scripts/ems | |
parent | cedb41be2ac95d982841ebdec78150caa371e9d3 (diff) |
runtime error in creating ini file
Diffstat (limited to 'scripts/ems')
-rwxr-xr-x | scripts/ems/experiment.perl | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/ems/experiment.perl b/scripts/ems/experiment.perl index 4b7a88972..e49ceba83 100755 --- a/scripts/ems/experiment.perl +++ b/scripts/ems/experiment.perl @@ -2085,13 +2085,27 @@ sub define_training_create_config { my $moses_src_dir = &check_and_get("GENERAL:moses-src-dir"); my $cmd = "$moses_src_dir/bin/create-ini "; - my %IN = &get_factor_id("input"); - my %OUT = &get_factor_id("output"); + my %IN; + my %OUT; + if (&backoff_and_get("TRAINING:input-factors")) { + %IN = &get_factor_id("input"); + } + else { + $IN{"word"} = 0; + } + + if (&backoff_and_get("TRAINING:output-factors")) { + %OUT = &get_factor_id("output"); + } + else { + $OUT{"word"} = 0; + } $cmd .= "-input-factor-max ".((scalar keys %IN)-1)." "; - $cmd .= "-translation-factors ". - &encode_factor_definition("translation-factors",\%IN,\%OUT)." "; + $cmd .= "-translation-factors ". + &encode_factor_definition("translation-factors",\%IN,\%OUT)." " + if &get("TRAINING:translation-factors"); $cmd .= "-reordering-factors ". &encode_factor_definition("reordering-factors",\%IN,\%OUT)." " if &get("TRAINING:reordering-factors"); |