diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-04-19 17:26:26 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-04-19 17:26:26 +0400 |
commit | 02d8c37e923d2996f2954e10052439ab4a711a84 (patch) | |
tree | b2ff964e4d44ccaa9073f85923635560d9a6f0c6 | |
parent | ab3c917f9d3196ba86220d1fcde949f4fceb338d (diff) | |
parent | 56049f66ff76f09dc5d2bab69114a0e8d17d9ea0 (diff) |
Merge branch 'master' of github.com:moses-smt/moses-regression-tests into weight-new
17 files changed, 113 insertions, 0 deletions
diff --git a/models/ptable-interpolated/phrase-table.1.binphr.idx b/models/ptable-interpolated/phrase-table.1.binphr.idx Binary files differnew file mode 100644 index 0000000..bebc4b2 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.1.binphr.idx diff --git a/models/ptable-interpolated/phrase-table.1.binphr.srctree b/models/ptable-interpolated/phrase-table.1.binphr.srctree Binary files differnew file mode 100644 index 0000000..8a4fa98 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.1.binphr.srctree diff --git a/models/ptable-interpolated/phrase-table.1.binphr.srcvoc b/models/ptable-interpolated/phrase-table.1.binphr.srcvoc new file mode 100644 index 0000000..33268d9 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.1.binphr.srcvoc @@ -0,0 +1,4 @@ +3 d +2 c +1 b +0 a diff --git a/models/ptable-interpolated/phrase-table.1.binphr.tgtdata b/models/ptable-interpolated/phrase-table.1.binphr.tgtdata Binary files differnew file mode 100644 index 0000000..8bb8ec5 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.1.binphr.tgtdata diff --git a/models/ptable-interpolated/phrase-table.1.binphr.tgtvoc b/models/ptable-interpolated/phrase-table.1.binphr.tgtvoc new file mode 100644 index 0000000..69bd615 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.1.binphr.tgtvoc @@ -0,0 +1,4 @@ +3 a +2 and +1 in +0 the diff --git a/models/ptable-interpolated/phrase-table.2.binphr.idx b/models/ptable-interpolated/phrase-table.2.binphr.idx Binary files differnew file mode 100644 index 0000000..bebc4b2 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.2.binphr.idx diff --git a/models/ptable-interpolated/phrase-table.2.binphr.srctree b/models/ptable-interpolated/phrase-table.2.binphr.srctree Binary files differnew file mode 100644 index 0000000..84a5892 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.2.binphr.srctree diff --git a/models/ptable-interpolated/phrase-table.2.binphr.srcvoc b/models/ptable-interpolated/phrase-table.2.binphr.srcvoc new file mode 100644 index 0000000..1f94767 --- /dev/null +++ b/models/ptable-interpolated/phrase-table.2.binphr.srcvoc @@ -0,0 +1,4 @@ +3 e +2 c +1 b +0 a diff --git a/models/ptable-interpolated/phrase-table.2.binphr.tgtdata b/models/ptable-interpolated/phrase-table.2.binphr.tgtdata Binary files differnew file mode 100644 index 0000000..f4f325e --- /dev/null +++ b/models/ptable-interpolated/phrase-table.2.binphr.tgtdata diff --git a/models/ptable-interpolated/phrase-table.2.binphr.tgtvoc b/models/ptable-interpolated/phrase-table.2.binphr.tgtvoc new file mode 100644 index 0000000..3e6feda --- /dev/null +++ b/models/ptable-interpolated/phrase-table.2.binphr.tgtvoc @@ -0,0 +1,3 @@ +2 an +1 and +0 the diff --git a/models/ptable-interpolated/table1 b/models/ptable-interpolated/table1 new file mode 100644 index 0000000..f5c5c13 --- /dev/null +++ b/models/ptable-interpolated/table1 @@ -0,0 +1,4 @@ +a ||| the ||| 0.1 0.2 0.3 0.1 2.718 +a ||| in ||| 0.7 0.4 0.6 0.5 2.718 +b c ||| and ||| 0.4 0.2 0.1 0.6 2.718 +d ||| a ||| 0.5 0.1 0.2 0.3 2.718 diff --git a/models/ptable-interpolated/table2 b/models/ptable-interpolated/table2 new file mode 100644 index 0000000..7ba4b3f --- /dev/null +++ b/models/ptable-interpolated/table2 @@ -0,0 +1,3 @@ +a ||| the ||| 0.3 0.1 0.9 0.2 2.718 +b c ||| and ||| 0.2 0.9 0.8 0.2 2.718 +e ||| an ||| 0.1 0.5 0.7 0.3 2.718 diff --git a/tests/phrase.interpolated/filter-stderr.pl b/tests/phrase.interpolated/filter-stderr.pl new file mode 100755 index 0000000..2f6e176 --- /dev/null +++ b/tests/phrase.interpolated/filter-stderr.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; } +use RegTestUtils; + +$x=0; +while (<>) { + chomp; + + if (/^Finished loading LanguageModels/) { + my $time = RegTestUtils::readTime($_); + print "LMLOAD_TIME ~ $time\n"; + } + if (/^Finished loading phrase tables/) { + my $time = RegTestUtils::readTime($_); + print "PTLOAD_TIME ~ $time\n"; + } + next unless /^BEST TRANSLATION:/; + my $pscore = RegTestUtils::readHypoScore($_); + $x++; + print "SCORE_$x = $pscore\n"; +} diff --git a/tests/phrase.interpolated/filter-stdout.pl b/tests/phrase.interpolated/filter-stdout.pl new file mode 100755 index 0000000..476ddf6 --- /dev/null +++ b/tests/phrase.interpolated/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/tests/phrase.interpolated/moses.ini b/tests/phrase.interpolated/moses.ini new file mode 100644 index 0000000..d9ebd45 --- /dev/null +++ b/tests/phrase.interpolated/moses.ini @@ -0,0 +1,56 @@ +# Moses configuration file +# automatic exodus from pharaoh.ini Wed Jul 12 18:24:14 EDT 2006 + +########################### +### PHARAOH CONFIG FILE ### +########################### + +# phrase table f, n, p(n|f) +[ttable-file] +13 0 0 5 naive ${MODEL_PATH}/ptable-interpolated/phrase-table.1 ${MODEL_PATH}/ptable-interpolated/phrase-table.2 0.4,0.6;0.2,0.8;0.1,0.9;0.8,0.2 + +# language model +[lmodel-file] +8 0 3 ${LM_PATH}/europarl.en.srilm.gz + +# limit on how many phrase translations e for each phrase f are loaded +[ttable-limit] +#ttable element load limit 0 = all elements loaded +20 + +# distortion (reordering) weight +[weight-d] +0.2 + +# language model weight +[weight-l] +0.2 + +# translation model weight (phrase translation, lexical weighting) +[weight-t] +0.2 +0.2 +0.2 +0.2 +0.2 + +# word penalty +[weight-w] +-0.1 + +[distortion-limit] +4 + +[beam-threshold] +0.03 + +[input-factors] +0 + +[mapping] +T 0 + + +[verbose] +2 + diff --git a/tests/phrase.interpolated/to-translate.txt b/tests/phrase.interpolated/to-translate.txt new file mode 100644 index 0000000..1b4b9f3 --- /dev/null +++ b/tests/phrase.interpolated/to-translate.txt @@ -0,0 +1 @@ +a b c d e diff --git a/tests/phrase.interpolated/truth/results.txt b/tests/phrase.interpolated/truth/results.txt new file mode 100644 index 0000000..a14fe87 --- /dev/null +++ b/tests/phrase.interpolated/truth/results.txt @@ -0,0 +1,5 @@ +TRANSLATION_1=the and a an +LMLOAD_TIME ~ 3.240 +PTLOAD_TIME ~ 3.240 +SCORE_1 = -11.370 +TOTAL_WALLTIME ~ 3 |