diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-15 07:51:26 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-15 07:51:26 +0400 |
commit | 9b00ae425c4883a75cb852bf301c3aa5355b99d7 (patch) | |
tree | 9a49af15a6ab85913c6a2c1faacaa80fdf7a99ed /regression-testing | |
parent | 195cc1a2c1e483e613b270bd25ab51befc860e80 (diff) |
add regression test binary models with lex reordering. Fix other regression tests - changed to account for new LM prob from IRST or use KenLM
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4367 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'regression-testing')
5 files changed, 110 insertions, 0 deletions
diff --git a/regression-testing/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl b/regression-testing/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl new file mode 100755 index 000000000..2f6e17607 --- /dev/null +++ b/regression-testing/tests/phrase.lexicalized-reordering-bin/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/regression-testing/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl b/regression-testing/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl new file mode 100755 index 000000000..476ddf6e9 --- /dev/null +++ b/regression-testing/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/regression-testing/tests/phrase.lexicalized-reordering-bin/moses.ini b/regression-testing/tests/phrase.lexicalized-reordering-bin/moses.ini new file mode 100644 index 000000000..fb536f9a9 --- /dev/null +++ b/regression-testing/tests/phrase.lexicalized-reordering-bin/moses.ini @@ -0,0 +1,63 @@ +######################### +### MOSES CONFIG FILE ### +######################### + +# input factors +[input-factors] +0 + +# mapping steps +[mapping] +T 0 + +# translation tables: source-factors, target-factors, number of scores, file +[ttable-file] +1 0 0 5 ${MODEL_PATH}/lexicalized-reordering-bin/phrase-table + +# no generation models, no generation-file section + +# language models: type(srilm/irstlm), factors, order, file +[lmodel-file] +0 0 5 ${MODEL_PATH}/lexicalized-reordering/europarl.lm + + +# limit on how many phrase translations e for each phrase f are loaded +# 0 = all elements loaded +[ttable-limit] +20 +0 +# distortion (reordering) files +[distortion-file] +0-0 msd-bidirectional-fe 6 ${MODEL_PATH}/lexicalized-reordering-bin/reordering-table.msd-bidirectional-fe + +# distortion (reordering) weight +[weight-d] +0.5 +0.3 +0.3 +0.3 +0.3 +0.3 +0.3 + +# language model weights +[weight-l] +0.5000 + + +# translation model weights +[weight-t] +0.2 +0.2 +0.2 +0.2 +0.2 + +# no generation models, no weight-generation section + +# word penalty +[weight-w] +-1 + +[distortion-limit] +6 diff --git a/regression-testing/tests/phrase.lexicalized-reordering-bin/to-translate.txt b/regression-testing/tests/phrase.lexicalized-reordering-bin/to-translate.txt new file mode 100644 index 000000000..d336d82f3 --- /dev/null +++ b/regression-testing/tests/phrase.lexicalized-reordering-bin/to-translate.txt @@ -0,0 +1,5 @@ +monsieur le président , ce que nous devrons toutefois également faire à biarritz , c' est regarder un peu plus loin . +les élus que nous sommes avons au moins autant le devoir de l' encourager à progresser , en dépit de l' adversité , que de relayer les messages que nous recevons de l' opinion publique dans chacun de nos pays . +au regard des événements de ces derniers temps , la question du prix de l' essence me semble elle aussi particulièrement remarquable . +à l' heure actuelle , le conseil est en train d' examiner l' inclusion de tels mécanismes dans l' article 7 . +deuxièmement , dans la transparence pour les citoyens , qui connaissent à présent les droits dont ils disposent vis-à-vis de ceux qui appliquent et élaborent le droit européen , et pour ceux qui , justement , appliquent et élaborent ce droit européen . diff --git a/regression-testing/tests/phrase.lexicalized-reordering-bin/truth/results.txt b/regression-testing/tests/phrase.lexicalized-reordering-bin/truth/results.txt new file mode 100644 index 000000000..9c56d1e73 --- /dev/null +++ b/regression-testing/tests/phrase.lexicalized-reordering-bin/truth/results.txt @@ -0,0 +1,13 @@ +TRANSLATION_1=mr president , what we devrons but also to to biarritz , this is regarder a little more loin . +TRANSLATION_2=the élus that we are have the with difference the us of the encourager to progresser , in dépit of the adversité , that of relayer the messages that we recevons of the opinion all in each of our countries . +TRANSLATION_3=the prerequisites for the événements of these derniers time , the issue of the sufficiently of the essence to it also in remarquable . +TRANSLATION_4=in the , the council , it is train of examiner the inclusion of such mécanismes in article 7 . +TRANSLATION_5=secondly , in the transparency for the citizens , which are now the droits which they disposent vis-à-vis of those appliquent and élaborent the european law and , to those , precisely appliquent and élaborent this european law . +LMLOAD_TIME ~ 8.00 +PTLOAD_TIME ~ 9.00 +SCORE_1 = -621.292 +SCORE_2 = -1402.951 +SCORE_3 = -636.300 +SCORE_4 = -631.966 +SCORE_5 = -1110.523 +TOTAL_WALLTIME ~ 16 |