diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-03-06 15:28:10 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-03-06 15:28:10 +0300 |
commit | d00ada072503392a877cb9419f8156c9da0c8d1d (patch) | |
tree | 2607abe45dd50822c3c601fb48604b5bd7fad212 | |
parent | 98a119ae926927cc023baf21ce1559eb59ce7007 (diff) |
test for models with 2 generation tables
-rw-r--r-- | tests/phrase.2fac/data/pos.cls.gz | bin | 0 -> 420256 bytes | |||
-rw-r--r-- | tests/phrase.2fac/data/pos.kenlm | bin | 0 -> 210897 bytes | |||
-rw-r--r-- | tests/phrase.2fac/data/txt.kenlm | bin | 0 -> 6309141 bytes | |||
-rw-r--r-- | tests/phrase.2fac/data/wc.cls.gz | bin | 0 -> 98057 bytes | |||
-rw-r--r-- | tests/phrase.2fac/data/wc.kenlm | bin | 0 -> 1384199 bytes | |||
-rwxr-xr-x | tests/phrase.2fac/filter-stderr.pl | 22 | ||||
-rwxr-xr-x | tests/phrase.2fac/filter-stdout.pl | 7 | ||||
-rw-r--r-- | tests/phrase.2fac/moses.ini | 45 | ||||
-rw-r--r-- | tests/phrase.2fac/phrase-table.0-0.1.1.gz | bin | 0 -> 604110 bytes | |||
-rw-r--r-- | tests/phrase.2fac/to-translate.txt | 2 | ||||
-rw-r--r-- | tests/phrase.2fac/truth/results.txt | 5 |
11 files changed, 81 insertions, 0 deletions
diff --git a/tests/phrase.2fac/data/pos.cls.gz b/tests/phrase.2fac/data/pos.cls.gz Binary files differnew file mode 100644 index 0000000..061ac30 --- /dev/null +++ b/tests/phrase.2fac/data/pos.cls.gz diff --git a/tests/phrase.2fac/data/pos.kenlm b/tests/phrase.2fac/data/pos.kenlm Binary files differnew file mode 100644 index 0000000..6ae9501 --- /dev/null +++ b/tests/phrase.2fac/data/pos.kenlm diff --git a/tests/phrase.2fac/data/txt.kenlm b/tests/phrase.2fac/data/txt.kenlm Binary files differnew file mode 100644 index 0000000..4d22040 --- /dev/null +++ b/tests/phrase.2fac/data/txt.kenlm diff --git a/tests/phrase.2fac/data/wc.cls.gz b/tests/phrase.2fac/data/wc.cls.gz Binary files differnew file mode 100644 index 0000000..0d23013 --- /dev/null +++ b/tests/phrase.2fac/data/wc.cls.gz diff --git a/tests/phrase.2fac/data/wc.kenlm b/tests/phrase.2fac/data/wc.kenlm Binary files differnew file mode 100644 index 0000000..e7a1f38 --- /dev/null +++ b/tests/phrase.2fac/data/wc.kenlm diff --git a/tests/phrase.2fac/filter-stderr.pl b/tests/phrase.2fac/filter-stderr.pl new file mode 100755 index 0000000..fb31704 --- /dev/null +++ b/tests/phrase.2fac/filter-stderr.pl @@ -0,0 +1,22 @@ +#!/usr/bin/env 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.2fac/filter-stdout.pl b/tests/phrase.2fac/filter-stdout.pl new file mode 100755 index 0000000..0715c2d --- /dev/null +++ b/tests/phrase.2fac/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/env perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/tests/phrase.2fac/moses.ini b/tests/phrase.2fac/moses.ini new file mode 100644 index 0000000..bae343e --- /dev/null +++ b/tests/phrase.2fac/moses.ini @@ -0,0 +1,45 @@ +######################### +### MOSES CONFIG FILE ### +######################### + +# input factors +[input-factors] +0 + +# mapping steps +[mapping] +0 T 0 +0 G 0 +0 G 1 + +[distortion-limit] +1 + +# feature functions +[feature] +Generation name=Generation0 num-features=0 input-factor=0 output-factor=1 path=${TEST_PATH}/data/wc.cls.gz +Generation name=Generation1 num-features=0 input-factor=0 output-factor=2 path=${TEST_PATH}/data/pos.cls.gz +UnknownWordPenalty +WordPenalty +PhrasePenalty +PhraseDictionaryMemory name=TranslationModel0 num-features=4 path=${TEST_PATH}/phrase-table.0-0.1.1.gz input-factor=0 output-factor=0 +KENLM name=LM0 factor=0 path=${TEST_PATH}/data/txt.kenlm order=3 +KENLM name=LM2 factor=1 path=${TEST_PATH}/data/wc.kenlm order=3 +KENLM name=LM3 factor=2 path=${TEST_PATH}/data/pos.kenlm order=3 + +# dense weights for feature functions +[weight] +UnknownWordPenalty0= 0 +WordPenalty0= -1 +PhrasePenalty0= 0.2 +TranslationModel0= 0.2 0.2 0.2 0.2 +LM0= 0.5 +LM2= 0.5 +LM3= 0.5 + +[search-algorithm] +1 + +[report-all-factors] +1 + diff --git a/tests/phrase.2fac/phrase-table.0-0.1.1.gz b/tests/phrase.2fac/phrase-table.0-0.1.1.gz Binary files differnew file mode 100644 index 0000000..7e9bfba --- /dev/null +++ b/tests/phrase.2fac/phrase-table.0-0.1.1.gz diff --git a/tests/phrase.2fac/to-translate.txt b/tests/phrase.2fac/to-translate.txt new file mode 100644 index 0000000..1aa64ef --- /dev/null +++ b/tests/phrase.2fac/to-translate.txt @@ -0,0 +1,2 @@ +this is test . +these are test . diff --git a/tests/phrase.2fac/truth/results.txt b/tests/phrase.2fac/truth/results.txt new file mode 100644 index 0000000..de984c1 --- /dev/null +++ b/tests/phrase.2fac/truth/results.txt @@ -0,0 +1,5 @@ +TRANSLATION_1=this|43|DT|UNK is|1|VBZ|UNK .|47|.|UNK +TRANSLATION_2=these|77|DT|UNK are|82|NN|UNK .|47|.|UNK +SCORE_1 = -17.386 +SCORE_2 = -16.141 +TOTAL_WALLTIME ~ 0 |