diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2015-09-04 12:07:50 +0300 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2015-09-04 12:07:50 +0300 |
commit | 90f15cc619d7bb451c09c7bd42f23bb7f9c48633 (patch) | |
tree | b0c24485515c6512d209f3fc0c1d95194aafcbc0 /scripts | |
parent | 4746970bf8082719c73b5ab8ca67c0e45480dd62 (diff) |
extra nplm settings
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ems/experiment.perl | 2 | ||||
-rwxr-xr-x | scripts/training/bilingual-lm/train_nplm.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/scripts/ems/experiment.perl b/scripts/ems/experiment.perl index cb56704d8..d2dd281e8 100755 --- a/scripts/ems/experiment.perl +++ b/scripts/ems/experiment.perl @@ -1801,7 +1801,7 @@ sub define_lm_train_bilingual_lm { $cmd .= " -e $epochs" if defined($epochs); my $nplm_settings = backoff_and_get("LM:$set:nplm-settings"); - $cmd .= " $nplm_settings" if defined($nplm_settings); + $cmd .= " --extra-settings \"$nplm_settings\"" if defined($nplm_settings); # Create the ini file $cmd .= "\n"; diff --git a/scripts/training/bilingual-lm/train_nplm.py b/scripts/training/bilingual-lm/train_nplm.py index 572076006..3280d506e 100755 --- a/scripts/training/bilingual-lm/train_nplm.py +++ b/scripts/training/bilingual-lm/train_nplm.py @@ -41,6 +41,8 @@ parser.add_argument("--input_vocab_size", dest="input_vocab_size", type=int) parser.add_argument("--output_vocab_size", dest="output_vocab_size", type=int) parser.add_argument("--mmap", dest="mmap", action="store_true", help="Use memory-mapped file (for lower memory consumption).") +parser.add_argument("--extra-settings", dest="extra_settings", + help="Extra settings to be passed to NPLM") parser.set_defaults( working_dir="working", @@ -136,6 +138,7 @@ def main(options): "--activation_function", options.activation_fn, "--ngram_size", str(options.ngram_size), ] + validations_command + vocab_command + mmap_command + if options.extra_settings: train_args += options.extra_settings.split() print("Train model command: ") print(', '.join(train_args)) |