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

github.com/moses-smt/moses-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant Mathur <pramathur@ebay.com>2016-05-17 18:09:57 +0300
committerPrashant Mathur <pramathur@ebay.com>2016-05-17 18:09:57 +0300
commit87ebf67a7b8c460f420a6d76e8866f79884b91ed (patch)
treeafce72e8ff18de71767bda3906497a5217714a02
parent0f892797ae03b37f7bf4470b172de83736bce953 (diff)
Regression tests for cache based model.
-rwxr-xr-xtests/phrase.cache-multi-factor/filter-stderr.pl22
-rwxr-xr-xtests/phrase.cache-multi-factor/filter-stdout.pl7
-rw-r--r--tests/phrase.cache-multi-factor/moses.ini49
-rw-r--r--tests/phrase.cache-multi-factor/to-translate.txt4
-rw-r--r--tests/phrase.cache-multi-factor/truth/results.txt9
5 files changed, 91 insertions, 0 deletions
diff --git a/tests/phrase.cache-multi-factor/filter-stderr.pl b/tests/phrase.cache-multi-factor/filter-stderr.pl
new file mode 100755
index 0000000..fb31704
--- /dev/null
+++ b/tests/phrase.cache-multi-factor/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.cache-multi-factor/filter-stdout.pl b/tests/phrase.cache-multi-factor/filter-stdout.pl
new file mode 100755
index 0000000..0715c2d
--- /dev/null
+++ b/tests/phrase.cache-multi-factor/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.cache-multi-factor/moses.ini b/tests/phrase.cache-multi-factor/moses.ini
new file mode 100644
index 0000000..3da47d7
--- /dev/null
+++ b/tests/phrase.cache-multi-factor/moses.ini
@@ -0,0 +1,49 @@
+#########################
+### MOSES CONFIG FILE ###
+#########################
+
+# input factors
+[input-factors]
+0
+1
+
+# indicates that factors are separated by '++' in the input
+[factor-delimiter]
+++
+
+[decoding-graph-backoff]
+0
+0
+
+# mapping steps
+[mapping]
+0 T 0
+1 T 1
+1 G 0
+1 T 2
+
+[xml-input]
+inclusive
+
+[verbose]
+2
+
+[feature]
+KENLM factor=0 order=3 num-features=1 lazyken=0 path=${LM_PATH}/europarl.en.srilm.gz
+Generation input-factor=0 output-factor=1 num-features=2 path=${MODEL_PATH}/multi-factor/generation.0-1.gz
+Distortion
+WordPenalty
+UnknownWordPenalty
+PhraseDictionaryCache name=CBPT0 input-factor=0,1 output-factor=0,1 num-features=4
+PhraseDictionaryMemory input-factor=0 output-factor=0 path=${MODEL_PATH}/multi-factor/phrase-table.0-0.gz num-features=5 table-limit=20
+PhraseDictionaryBinary input-factor=1 output-factor=1 path=${MODEL_PATH}/multi-factor/phrase-table.1-1.gz num-features=5 table-limit=0
+
+[weight]
+WordPenalty0= -1
+KENLM0= 0.5
+Generation0= 0.3 0
+Distortion0= 0.6
+CBPT0= 0.2 0.2 0.2 0.2
+PhraseDictionaryMemory0= 0.2 0.2 0.2 0.2 0.2
+PhraseDictionaryBinary0= 0.2 0.2 0.2 0.2 0.2
+
diff --git a/tests/phrase.cache-multi-factor/to-translate.txt b/tests/phrase.cache-multi-factor/to-translate.txt
new file mode 100644
index 0000000..998cb23
--- /dev/null
+++ b/tests/phrase.cache-multi-factor/to-translate.txt
@@ -0,0 +1,4 @@
+es++PPER gibt++VVFIN verschiedene++ADJ andere++ADJ meinungen++NN .++PE
+<dlt type="cache" cbtm="es++PPER gibt++VVFIN verschiedene++ADJ andere++ADJ meinungen++NN .++PE ||| there++EX are++VBP plenty++JJ different++JJ opinions++NNS .++PE ||| 0.4 0.5 0.2 0.7"/>es++PPER gibt++VVFIN verschiedene++ADJ andere++ADJ meinungen++NN .++PE
+<dlt type="cache" cbtm="es++PPER gibt++VVFIN verschiedene++ADJ ||| there++EX are++VBP awful++JJ ||| 1 0.4 0.7 0.1"/>es++PPER gibt++VVFIN verschiedene++ADJ andere++ADJ meinungen++NN .++PE
+es++PPER gibt++VVFIN verschiedene++ADJ andere++ADJ meinungen++NN .++PE
diff --git a/tests/phrase.cache-multi-factor/truth/results.txt b/tests/phrase.cache-multi-factor/truth/results.txt
new file mode 100644
index 0000000..9c09c03
--- /dev/null
+++ b/tests/phrase.cache-multi-factor/truth/results.txt
@@ -0,0 +1,9 @@
+TRANSLATION_1=there are various different opinions .
+TRANSLATION_2=there are plenty different opinions .
+TRANSLATION_3=there are awful different opinions .
+TRANSLATION_4=there are various different opinions .
+SCORE_1 = -113.734
+SCORE_2 = -2.282
+SCORE_3 = -111.154
+SCORE_4 = -113.734
+TOTAL_WALLTIME ~ 4