From bf1203a3da4337e9158da477d158b8e7911686d7 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 30 Jul 2013 13:04:14 +0100 Subject: add test for Ken's incremental search algorithm --- .../filter-stderr.pl | 22 +++++++++++ .../filter-stdout.pl | 7 ++++ tests/chart.hierarchical.incremental/moses.ini | 44 ++++++++++++++++++++++ .../to-translate.txt | 6 +++ .../truth/results.txt | 13 +++++++ 5 files changed, 92 insertions(+) create mode 100755 tests/chart.hierarchical.incremental/filter-stderr.pl create mode 100755 tests/chart.hierarchical.incremental/filter-stdout.pl create mode 100644 tests/chart.hierarchical.incremental/moses.ini create mode 100644 tests/chart.hierarchical.incremental/to-translate.txt create mode 100644 tests/chart.hierarchical.incremental/truth/results.txt (limited to 'tests') diff --git a/tests/chart.hierarchical.incremental/filter-stderr.pl b/tests/chart.hierarchical.incremental/filter-stderr.pl new file mode 100755 index 0000000..2f6e176 --- /dev/null +++ b/tests/chart.hierarchical.incremental/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/chart.hierarchical.incremental/filter-stdout.pl b/tests/chart.hierarchical.incremental/filter-stdout.pl new file mode 100755 index 0000000..476ddf6 --- /dev/null +++ b/tests/chart.hierarchical.incremental/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/tests/chart.hierarchical.incremental/moses.ini b/tests/chart.hierarchical.incremental/moses.ini new file mode 100644 index 0000000..194f2b7 --- /dev/null +++ b/tests/chart.hierarchical.incremental/moses.ini @@ -0,0 +1,44 @@ +######################### +### MOSES CONFIG FILE ### +######################### + +# input factors +[input-factors] +0 + +# mapping steps +[mapping] +0 T 0 +1 T 1 + +[cube-pruning-pop-limit] +1000 + +[non-terminals] +X + +[search-algorithm] +5 + +[inputtype] +3 + +[max-chart-span] +20 +1000 + + +[feature] +KENLM factor=0 order=5 num-features=1 path=${LM_PATH}/news.de.arpalm.gz +WordPenalty +UnknownWordPenalty +PhraseDictionaryMemory input-factor=0 output-factor=0 path=${MODEL_PATH}/hierarchical/phrase-table.0-0.1 num-features=5 table-limit=20 +PhraseDictionaryMemory input-factor=0 output-factor=0 path=${MODEL_PATH}/hierarchical/phrase-table.0-0.2 num-features=1 table-limit=20 + +[weight] +WordPenalty0= -0.148974 +KENLM0= 0.118861 +PhraseDictionaryMemory0= 0.077197 0.014533 0.059406 0.001891 -0.098314 +PhraseDictionaryMemory1= 0.131945 + + diff --git a/tests/chart.hierarchical.incremental/to-translate.txt b/tests/chart.hierarchical.incremental/to-translate.txt new file mode 100644 index 0000000..c6d433d --- /dev/null +++ b/tests/chart.hierarchical.incremental/to-translate.txt @@ -0,0 +1,6 @@ +Prague Stock Market falls to minus by the end of the trading day + +after a sharp drop in the morning , the Prague Stock Market corrected its losses . +transactions with stocks from the Czech Energy Enterprise ( ČEZ ) reached nearly half of the regular daily trading . +the Prague Stock Market immediately continued its fall from Monday at the beginning of Tuesday 's trading , when it dropped by nearly six percent . +this time the fall in stocks on Wall Street is responsible for the drop . diff --git a/tests/chart.hierarchical.incremental/truth/results.txt b/tests/chart.hierarchical.incremental/truth/results.txt new file mode 100644 index 0000000..7256ca0 --- /dev/null +++ b/tests/chart.hierarchical.incremental/truth/results.txt @@ -0,0 +1,13 @@ +TRANSLATION_1=Prag Stock Markt fällt , ohne am Ende des Handel Tag +TRANSLATION_2= +TRANSLATION_3=nach einem steilen Rückgang am Morgen , der Prager Stock Markt korrigiert ihre Verluste . +TRANSLATION_4=Transaktionen mit Aktien von der Tschechischen Energy Enterprise ( ČEZ ) erreicht beinahe die Hälfte der regelmäßigen täglich Handel . +TRANSLATION_5=der Prager Stock Markt sofort ihren fallen von Montag Anfang Tuesday der Handel , als es um beinahe sechs Prozent . +TRANSLATION_6=diesmal dem Fall in Aktien an der Wall Street verantwortlich ist für die fallen . +SCORE_1 = -12.143 +SCORE_2 = -0.590 +SCORE_3 = -13.177 +SCORE_4 = -117.664 +SCORE_5 = -123.038 +SCORE_6 = -8.702 +TOTAL_WALLTIME ~ 12 -- cgit v1.2.3