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-23 20:19:22 +0400
committerphikoehn <pkoehn@inf.ed.ac.uk>2013-06-23 20:19:22 +0400
commit164b06cd7e3de60196a675d44663245c1bfe5b92 (patch)
treeb7c397acc99f029fdce699031a1e42f9ffaba55a /scripts/training
parent0d9020fefe0b0e7d5d4a20485793205d402109c0 (diff)
debugging
Diffstat (limited to 'scripts/training')
-rwxr-xr-xscripts/training/convert-moses-ini-to-v2.perl11
-rwxr-xr-xscripts/training/filter-model-given-input.pl1
2 files changed, 7 insertions, 5 deletions
diff --git a/scripts/training/convert-moses-ini-to-v2.perl b/scripts/training/convert-moses-ini-to-v2.perl
index 01e1c818b..69924ae10 100755
--- a/scripts/training/convert-moses-ini-to-v2.perl
+++ b/scripts/training/convert-moses-ini-to-v2.perl
@@ -46,7 +46,9 @@ for(; $i<scalar(@INI); $i++) {
elsif ($section =~ /weight-(.+)/ && $section ne "weight-file") {
$WEIGHT{$1} = &get_data();
}
- elsif ($section eq "report-sparse-features") {}
+ elsif ($section eq "report-sparse-features") {
+ &get_data(); # ignore
+ }
else {
print STDERR "include section [$section] verbatim.\n";
print $header.$line;
@@ -101,9 +103,9 @@ foreach my $section (keys %FEATURE) {
$feature .= " path=$file" if defined($file);
$feature .= "\n";
}
- elsif ($section eq "source-word-insertion-feature") {
+ elsif ($section eq "source-word-deletion-feature") {
my ($factor,$file) = split(/ /,$FEATURE{$section}[0]);
- $feature .= "SourceWordDeletionFeature name=swd factor=$file";
+ $feature .= "SourceWordDeletionFeature name=swd factor=$factor";
$feature .= " path=$file" if defined($file);
$feature .= "\n";
}
@@ -126,7 +128,7 @@ foreach my $section (keys %FEATURE) {
$implementation = "UNKNOWN";
}
$feature .= "$implementation name=TranslationModel$i num-features=$weight_count path=$file input-factor=$input_factor output-factor=$output_factor";
- $feature .= " ttable-limit=".$TTABLE_LIMIT[$i] if $#TTABLE_LIMIT >= $i;
+ $feature .= " table-limit=".$TTABLE_LIMIT[$i] if $#TTABLE_LIMIT >= $i;
$feature .= "\n";
$weight .= "TranslationModel$i=".&get_weights(\@W,$weight_count)."\n";
$i++;
@@ -194,7 +196,6 @@ sub get_weights {
my $list = "";
for(my $w=0;$w<$count;$w++) {
my $value = shift @{$W};
- chop($value);
$list .= " $value";
}
return $list;
diff --git a/scripts/training/filter-model-given-input.pl b/scripts/training/filter-model-given-input.pl
index ccc4d318c..f72336a45 100755
--- a/scripts/training/filter-model-given-input.pl
+++ b/scripts/training/filter-model-given-input.pl
@@ -209,6 +209,7 @@ while(my $line = <INI>) {
} # for (my $i = 1; $i < scalar(@toks); ++$i) {
push @TABLE, $file;
+ push @TABLE_WEIGHTS,$w;
$file =~ s/^.*\/+([^\/]+)/$1/g;
my $new_name = "$dir/$file";