diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2016-09-26 01:03:07 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2016-09-26 01:03:07 +0300 |
commit | 2d7ca8a352ac6eabc940b8808473a7b2f9e22dda (patch) | |
tree | 6bb72f767c11a65493ddc066bd3cad8593edf62d | |
parent | a507516aecc5175757b9c803496ac4be1976a824 (diff) |
add moses2.hierarchical-withkenlm
5 files changed, 83 insertions, 0 deletions
diff --git a/tests/moses2.hierarchical-withkenlm/filter-stderr.pl b/tests/moses2.hierarchical-withkenlm/filter-stderr.pl new file mode 100755 index 0000000..4c279a1 --- /dev/null +++ b/tests/moses2.hierarchical-withkenlm/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/moses2.hierarchical-withkenlm/filter-stdout.pl b/tests/moses2.hierarchical-withkenlm/filter-stdout.pl new file mode 100755 index 0000000..0715c2d --- /dev/null +++ b/tests/moses2.hierarchical-withkenlm/filter-stdout.pl @@ -0,0 +1,7 @@ +#!/usr/bin/env perl +$x=0; +while (<>) { + chomp; + $x++; + print "TRANSLATION_$x=$_\n"; +} diff --git a/tests/moses2.hierarchical-withkenlm/moses.ini b/tests/moses2.hierarchical-withkenlm/moses.ini new file mode 100644 index 0000000..2289320 --- /dev/null +++ b/tests/moses2.hierarchical-withkenlm/moses.ini @@ -0,0 +1,43 @@ +######################### +### 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] +3 + +[inputtype] +3 + +[max-chart-span] +20 +1000 + +[feature] +KENLM factor=0 order=3 num-features=1 lazyken=0 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/moses2.hierarchical-withkenlm/to-translate.txt b/tests/moses2.hierarchical-withkenlm/to-translate.txt new file mode 100644 index 0000000..142ac43 --- /dev/null +++ b/tests/moses2.hierarchical-withkenlm/to-translate.txt @@ -0,0 +1,5 @@ +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/moses2.hierarchical-withkenlm/truth/results.txt b/tests/moses2.hierarchical-withkenlm/truth/results.txt new file mode 100644 index 0000000..8912c0c --- /dev/null +++ b/tests/moses2.hierarchical-withkenlm/truth/results.txt @@ -0,0 +1,6 @@ +TRANSLATION_1=Prag Stock Markt fällt , durch das Ende der Handel Tag +TRANSLATION_2=nach einem steilen Rückgang der Morgen , dem Prager Stock Markt korrigiert ihre Verluste . +TRANSLATION_3=Transaktionen mit Aktien von der tschechischen Energy Enterprise ( ČEZ ) erreicht beinahe die Hälfte der regelmäßigen täglich Handel . +TRANSLATION_4=der Prager Stock Markt sofort ihren Sturz von Montag zu Beginn der Handel Tuesday , wenn es um beinahe sechs Prozent . +TRANSLATION_5=dieses Mal den Rückgang der Aktien an der Wall Street verantwortlich ist für die fallen . +TOTAL_WALLTIME ~ 55 |