From 70cc367c67f5b092b7abed53d0003d60da380621 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Mon, 11 Nov 2013 17:25:47 +0000 Subject: regresssion test for TargetNGramFeature --- tests/phrase.TargetNGramFeature/filter-stderr.pl | 22 ++++++++++++++++++++++ tests/phrase.TargetNGramFeature/filter-stdout.pl | 7 +++++++ tests/phrase.TargetNGramFeature/moses.ini | 8 ++++---- tests/phrase.TargetNGramFeature/truth/results.txt | 22 ++++++++++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100755 tests/phrase.TargetNGramFeature/filter-stderr.pl create mode 100755 tests/phrase.TargetNGramFeature/filter-stdout.pl create mode 100644 tests/phrase.TargetNGramFeature/truth/results.txt (limited to 'tests') diff --git a/tests/phrase.TargetNGramFeature/filter-stderr.pl b/tests/phrase.TargetNGramFeature/filter-stderr.pl new file mode 100755 index 0000000..2f6e176 --- /dev/null +++ b/tests/phrase.TargetNGramFeature/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.TargetNGramFeature/filter-stdout.pl b/tests/phrase.TargetNGramFeature/filter-stdout.pl new file mode 100755 index 0000000..476ddf6 --- /dev/null +++ b/tests/phrase.TargetNGramFeature/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/tests/phrase.TargetNGramFeature/moses.ini b/tests/phrase.TargetNGramFeature/moses.ini index eb35320..77b9b04 100644 --- a/tests/phrase.TargetNGramFeature/moses.ini +++ b/tests/phrase.TargetNGramFeature/moses.ini @@ -17,10 +17,10 @@ [feature] UnknownWordPenalty WordPenalty -PhraseDictionaryBinary name=TranslationModel0 num-features=12 path=phrase-table.0-0.1.1 input-factor=0 output-factor=0 table-limit=20 -LexicalReordering name=LexicalReordering0 num-features=6 type=wbe-msd-bidirectional-fe-allff input-factor=0 output-factor=0 path=reordering-table.81.wbe-msd-bidirectional-fe +PhraseDictionaryBinary name=TranslationModel0 num-features=12 path=${TEST_PATH}/phrase-table.0-0.1.1 input-factor=0 output-factor=0 table-limit=20 +LexicalReordering name=LexicalReordering0 num-features=6 type=wbe-msd-bidirectional-fe-allff input-factor=0 output-factor=0 path=${TEST_PATH}/reordering-table.81.wbe-msd-bidirectional-fe Distortion -KENLM lazyken=0 name=LM0 factor=0 path=toy.binlm.41 order=5 +KENLM lazyken=0 name=LM0 factor=0 path=${TEST_PATH}/toy.binlm.41 order=5 # dense weights for feature functions [feature] @@ -31,7 +31,7 @@ PhraseLengthFeature TargetNgramFeature name=TNGF n=2 lower-ngrams=1 factor=0 [weight-file] -moses.tuned.ini.81.target-n-gram.sparse-weights +${TEST_PATH}/moses.tuned.ini.81.target-n-gram.sparse-weights [cube-pruning-pop-limit] 1000 diff --git a/tests/phrase.TargetNGramFeature/truth/results.txt b/tests/phrase.TargetNGramFeature/truth/results.txt new file mode 100644 index 0000000..4835acd --- /dev/null +++ b/tests/phrase.TargetNGramFeature/truth/results.txt @@ -0,0 +1,22 @@ +TRANSLATION_1=Illhaeusern ... finally +TRANSLATION_2=Illhaeusern has finally found the way of the victory on the ground after a long period of disette . +TRANSLATION_3=without make a great match , the Jaunes and black have created the largest number of disabled and have succeeded in into a for the gain the match . +TRANSLATION_4=the pace was not very supported during this meeting where attaquants have been of ill @-@ speaking out . +TRANSLATION_5=after a first attempt capitaine visiteur Kauffmann that frôlait the lucarne on a tir far Illhaeusern take runs the ascendant and turn to turn Fonderflick far , then with Hirn above Romain overcome the or even Diebold venaient chatouiller the defense of . Dannemarie working , the packaging , the +TRANSLATION_6=in the face , you fa bloc in the mid @-@ ground and one left just the remuant Riahi to the high of the attack . +TRANSLATION_7=the start of 's mid @-@ time packaging watershed with first two disabled signées Riahi and Temporale for Dannemarie , and aussitôt after the openness score for the Illhousiens by Marais , though positionné for a repoussée on a first attempt to Diebold ( 53e ) . " armor to be +TRANSLATION_8=but the buteur Illhousiens will not savourer his bonheur long and will be forced to regain the vestiaires a douzaine of minutes later and let so its coéquipiers in infériorité numérique . +TRANSLATION_9=but Dannemarie do not in feast and do not of breadwinner in a onze illhousien that has just a few for " compacter " defense , hormis in the past secondes of hands where , after a typically cafouillage , the armor passait very of the . transversale almost all reculé problems posera saura +TRANSLATION_10=Sarkozy to the meeting of pêcheurs in anger +SCORE_1 = -103.331 +SCORE_2 = -211.032 +SCORE_3 = -417.448 +SCORE_4 = -112.459 +SCORE_5 = -1543.514 +SCORE_6 = -316.177 +SCORE_7 = -1240.537 +SCORE_8 = -1020.454 +SCORE_9 = -1241.007 +SCORE_10 = -205.845 +TOTAL_WALLTIME ~ 358 + -- cgit v1.2.3