Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphikoehn <pkoehn@inf.ed.ac.uk>2013-06-08 16:39:15 +0400
committerphikoehn <pkoehn@inf.ed.ac.uk>2013-06-08 16:39:15 +0400
commit730da7edec8b0af66fec857fcf6420db4290eea2 (patch)
tree0349677d935ea61129f8b33b31a334ee8ff998ca /scripts/ems
parenta974bbafacbaddde3aee32b9949cac78dc14636f (diff)
sparse feature specification bug fix
Diffstat (limited to 'scripts/ems')
-rw-r--r--scripts/ems/experiment.meta2
-rwxr-xr-xscripts/ems/support/build-sparse-features.perl12
2 files changed, 7 insertions, 7 deletions
diff --git a/scripts/ems/experiment.meta b/scripts/ems/experiment.meta
index 7ac3e8240..875296d41 100644
--- a/scripts/ems/experiment.meta
+++ b/scripts/ems/experiment.meta
@@ -576,7 +576,7 @@ build-sparse
out: sparse
ignore-unless: sparse-features
rerun-on-change: sparse-features
- default-name: model/most-frequent-words
+ default-name: model/sparse-features
template: $moses-script-dir/ems/support/build-sparse-features.perl IN $input-extension $output-extension OUT "$sparse-features"
create-config
in: sigtest-filter-reordering-table sigtest-filter-phrase-translation-table generation-table sparse corpus-mml-prefilter=OR=corpus-mml-postfilter=OR=domains INTERPOLATED-LM:binlm LM:binlm
diff --git a/scripts/ems/support/build-sparse-features.perl b/scripts/ems/support/build-sparse-features.perl
index 2bda46722..9e4b35a77 100755
--- a/scripts/ems/support/build-sparse-features.perl
+++ b/scripts/ems/support/build-sparse-features.perl
@@ -46,20 +46,20 @@ foreach my $feature_spec (split(/,\s*/,$specification)) {
$ini .= "\n";
}
elsif ($SPEC[0] eq 'word-translation') {
- $ini .= "WordTranslationFeature input-factor=0 output-factor=0 simple=1 source-context=0 target-context=0";
-
+ my $extra_ini = "";
if ($SPEC[1] eq 'top' && $SPEC[2] =~ /^\d+$/ && $SPEC[3] =~ /^\d+$/) {
my $file_in = &create_top_words($input_extension, $SPEC[2]);
my $file_out = &create_top_words($output_extension, $SPEC[3]);
- $ini .= " source-path=$file_in target-path=$file_out"
+ $extra_ini .= " source-path=$file_in target-path=$file_out"
}
elsif ($SPEC[1] eq 'all') {
-
+ # nothing to specify
}
else {
- die("ERROR: Unknown parameter specification in '$feature_spec'\n");
+ die("ERROR: Unknown parameter specification in '$SPEC[1]'\n");
}
- $ini .= "\n";
+ my ($input_factor,$output_factor) = split(/\-/,$factor);
+ $ini .= "WordTranslationFeature input-factor=$input_factor output-factor=$output_factor simple=1 source-context=0 target-context=0$extra_ini\n";
}
elsif ($SPEC[0] eq 'phrase-length') {
$ini .= "PhraseLengthFeature\n";