added a new regression test for --continue option of mert-moses-new.pl

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2569 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
nicolabertoldi 2009-10-07 16:37:25 +00:00
parent 124f88e55a
commit 98387244c1
30 changed files with 248 additions and 0 deletions

View File

@ -9,6 +9,7 @@ my @tests = qw (
mert-moses-new
mert-moses-new-nocase
mert-moses-new-aggregate
mert-moses-new-continue
);
###########################################################

View File

@ -0,0 +1,62 @@
#! /bin/sh
moses_scripts_dir=$1; shift
mert_dir=$1; shift
decoder=$1; shift
data_dir=$1; shift
testdir=$1; shift
cwd=$moses_scripts_dir/regression-testing/
pushd $testdir 2> /dev/null > /dev/null
rm actual_index 2> /dev/null > /dev/null
local_moses_ini=`perl $cwd/create_localized_moses_ini.pl $data_dir ./moses.ini 2> /dev/null`
nbest=200
#if you want distinct nbest change this:
nbestdistinct=""
#nbestdistinct="--nbest-distinct"
devset="input"
reference="reference"
reference="reference."
config=$local_moses_ini
#1-LM, 1-TM, 1-lex-RM
lambdas="d:0.4,0-2;0.15,0-2;0.15,0-2;0.15,0-2;0.15,0-2;0.15,0-2;0.15,0-2 lm:0.5,0-2 tm:0.2,0-2;0.2,0-2;0.2,0-2;0.2,0-2;0.2,-1-1 w:-1,-1-1"
rm -r working_dir 2> /dev/null > /dev/null
mkdir working_dir 2> /dev/null
cp $0 working_dir/ 2> /dev/null
cp ./data/archive.list working_dir/ 2> /dev/null
cp ./data/run* working_dir/ 2> /dev/null
cp ./data/finished_step.txt working_dir/ 2> /dev/null
cp ./data/finished_step.txt working_dir/actual.index 2> /dev/null
gzip -d working_dir/run*.NBEST.out.gz 2> /dev/null
parameters="--nonorm --closest --no-filter-phrase-table --efficient_scorenbest_flag --predictable-seeds --continue"
/Users/nicolabertoldi/workspace/mosesdecoder/trunk/scripts/regression-testing/tests/mert-moses-new-continue/mert-moses-new.pl $devset $reference $decoder $config --mertdir $mert_dir --mertargs "--binary" --working-dir working_dir --nbest $nbest $nbestdistinct --lambdas "$lambdas" $parameters > working_dir/MERT.out 2> working_dir/MERT.err
#$moses_scripts_dir/training/mert-moses-new.pl $devset $reference $decoder $config --mertdir $mert_dir --mertargs "--binary" --working-dir working_dir --nbest $nbest $nbestdistinct --lambdas "$lambdas" $parameters > working_dir/MERT.out 2> working_dir/MERT.err
# checking for weights.opt files
cat working_dir/run[0-9].weights.txt | awk '{a++; print "weights_"a": "$0}' > tmpout$$
# checking for bleu scores
cat working_dir/run[0-9].mert.log | grep -i ^Best | cut -d'>' -f2 | awk '{a++; print "best_"a": "$0}' >> tmpout$$
# checking for translations
cat working_dir/run[0-9].out | awk '{a++; print "translation_"a": "$0}' >> tmpout$$
cat tmpout$$ > /dev/stdout
rm $config 2> /dev/null > /dev/null
rm tmpout$$ tmperr$$ 2> /dev/null > /dev/null
#rm -r working_dir 2> /dev/null > /dev/null
popd 2> /dev/null > /dev/null
exit

View File

@ -0,0 +1,8 @@
run1.TRANS.out run1.NBEST.out
run2.TRANS.out run2.NBEST.out
run3.TRANS.out run3.NBEST.out
run4.TRANS.out run4.NBEST.out
run5.TRANS.out run5.NBEST.out
run6.TRANS.out run6.NBEST.out
run7.TRANS.out run7.NBEST.out
run8.TRANS.out run8.NBEST.out

View File

@ -0,0 +1,50 @@
Seeding random numbers with 5000
Scorer config string: reflen:closest,case:true
name: reflen value: closest
name: case value: true
Using scorer regularisation strategy: none
Using scorer regularisation window: 0
Using case preservation: 1
Using reference length strategy: closest
Data::score_type BLEU
Data::Scorer type from Scorer: BLEU
BleuScorer: 9
ScoreData: number_of_scores: 9
Loading Data from: run1.scores.dat and run1.features.dat
loading feature data from run1.features.dat
loading score data from run1.scores.dat
Loading Data from: run2.scores.dat and run2.features.dat
loading feature data from run2.features.dat
loading score data from run2.scores.dat
Loading Data from: run3.scores.dat and run3.features.dat
loading feature data from run3.features.dat
loading score data from run3.scores.dat
Loading Data from: run4.scores.dat and run4.features.dat
loading feature data from run4.features.dat
loading score data from run4.scores.dat
Loading Data from: run5.scores.dat and run5.features.dat
loading feature data from run5.features.dat
loading score data from run5.scores.dat
Data loaded : [0] seconds
Try number 1 : [0] seconds
Try number 2 : [0] seconds
Try number 3 : [0] seconds
Try number 4 : [1] seconds
Try number 5 : [1] seconds
Try number 6 : [1] seconds
Try number 7 : [1] seconds
Try number 8 : [1] seconds
Try number 9 : [2] seconds
Try number 10 : [2] seconds
Try number 11 : [2] seconds
Try number 12 : [2] seconds
Try number 13 : [2] seconds
Try number 14 : [3] seconds
Try number 15 : [3] seconds
Try number 16 : [3] seconds
Try number 17 : [3] seconds
Try number 18 : [3] seconds
Try number 19 : [4] seconds
Try number 20 : [4] seconds
Best point: 0.0836727 0.135627 0.0602366 0.0263658 0.043897 0.0146552 0.0770568 0.112996 0.0437857 0.0206718 0.133082 0.0821608 -0.101029 -0.0647629 => 0.408975
Stopping... : [4] seconds

View File

@ -0,0 +1 @@
0.0836727 0.135627 0.0602366 0.0263658 0.043897 0.0146552 0.0770568 0.112996 0.0437857 0.0206718 0.133082 0.0821608 -0.101029 -0.0647629

View File

@ -0,0 +1,5 @@
till Tuesday Almeno stable and mostly sunny weather with rising temperatures , especially in maxima values .
A possible worsening is expected in the second half of the week .
A moist and temporary flow will affect the Alps in the next days determining mostly changeable cloudiness , and scattered southern sectors , with light precipitation towards the half of next week .
Con today evening , Thursday , a disturbance is expected , bringing widespread rains into clearing on Friday and snowfalls to 600 of m 2000 m .
For the weekend clear or clear sky cloudy with temperature lowering minimum temperatures .

View File

@ -0,0 +1,5 @@
till Tuesday Almeno stable and mostly sunny weather with rising temperatures , especially in maxima values .
A possible worsening is expected in the second half of the week .
A moist and temporary flow will affect the Alpine area for the next days will determine changeable cloudiness , will probably southern sectors , and with light precipitation is expected for the half of the week .
Con evening today , Thursday , a disturbance is expected , bringing widespread rains into clearing on Friday and snowfalls to 600 of m 2000 m .
For the weekend clear or clear sky cloudy with dropping of minimum temperatures .

View File

@ -0,0 +1,9 @@
#!/usr/bin/perl
$x=0;
while (<>) {
chomp;
$x++;
print "STDERR_$x=$_\n";
}

View File

@ -0,0 +1,8 @@
#!/usr/bin/perl
$x=0;
while (<>) {
chomp;
$x++;
print "STDOUT_$x=$_\n";
}

View File

@ -0,0 +1,5 @@
Almeno fino a martedì tempo stabile e in prevalenza soleggiato con temperature in ripresa , specie nei valori massimi .
Un possibile peggioramento è atteso nella seconda parte della settimana .
Aria umida e a tratti fredda interesserà l' arco alpino nei prossimi giorni determinando condizioni di nuvolosità variabile , più fitta sui settori meridionali , e con possibili deboli precipitazioni verso metà settimana .
Con la serata di oggi , giovedì , è atteso il transito di una perturbazione , che porterà piogge diffuse in esaurimento nella serata di venerdì e neve a quote di circa 2000 m .
Per il fine settimana cielo sereno o poco nuvoloso con brusco calo delle temperature minime .

View File

@ -0,0 +1,60 @@
# moses.ini for regression test
[ttable-file]
0 0 5 ${TM_PATH}/phrase-table.0-0.gz
# language model
[lmodel-file]
1 0 3 ${LM_PATH}/train.en.w5.msb.nops.blm
# limit on how many phrase translations e for each phrase f are loaded
[ttable-limit]
#ttable element load limit 0 = all elements loaded
20
0
# distortion (reordering) files
[distortion-file]
0-0 msd-bidirectional-fe 6 ${RM_PATH}/reordering-table.msd-bidirectional-fe.0.5.0-0.gz
# distortion (reordering) weight
[weight-d]
0.4
0.15
0.15
0.15
0.15
0.15
0.15
# language model weight
[weight-l]
0.5
# translation model weight (phrase translation, lexical weighting)
[weight-t]
0.2
0.2
0.2
0.2
0.2
# word penalty
[weight-w]
-1.0
[distortion-limit]
4
[beam-threshold]
0.03
[input-factors]
0
[mapping]
T 0
[verbose]
0

View File

@ -0,0 +1,5 @@
Stable weather and mostly sunny with increasing temperatures , especially maximum temperatures , at least till Tuesday .
A possible worsening is expected in the second part of the week .
Humid air , cold at times , will affect the Alpine area for the next days fostering changeable cloudiness , thicker over southern areas , with possible precipitation towards the middle of the week .
Today , Thursday , in the evening the passage of a disturbance is expected which will bring widespread rainfall dying out on Friday evening and snowfall around 2000 m .
Over the weekend clear or lightly cloudy with a sudden fall of minimum temperatures .

View File

@ -0,0 +1,5 @@
Stable weather and mostly sunny with increasing temperatures , especially maximum temperatures , at least until Tuesday .
A worsening is possible in the second half of the week .
Humid air and cold at times will affect the Alpine area for the next days fostering unstable cloudiness , thicker over southern areas , with possible precipitation towards the middle of the week .
Today Thursday in the evening the passage of a disturbance is expected which will bring widespread rainfall dying out on Friday evening and snowfall around 2000 metres .
During the weekend clear or lightly cloudy with a sudden fall of minimum temperatures .

View File

@ -0,0 +1,5 @@
Stable and mostly sunny weather with increasing temperatures , especially maximum temperatures , at least until Tuesday .
A possible worsening is expected in the second part of the week .
Humid and cold air will affect the Alps in the next days fostering changeable cloudiness , thicker in the Southern areas , with possible precipitation towards the middle of the week .
Today , Thursday , in the evening the passage of a disturbance is expected which will bring widespread rainfall dying out on Friday evening and snowfall around 2000 m .
Over the weekend clear or lightly cloudy with a sudden fall of minimum temperatures .

View File

@ -0,0 +1,17 @@
STDOUT_1=weights_1: 0.0836727 0.135627 0.0602366 0.0263658 0.043897 0.0146552 0.0770568 0.112996 0.0437857 0.0206718 0.133082 0.0821608 -0.101029 -0.0647629
STDOUT_2=weights_2: 0.0662178 0.138211 0.0613841 0.0268681 0.0447332 0.0149344 0.0785247 0.115149 0.0446198 0.0210656 0.135617 0.0837259 -0.102954 -0.0659966
STDOUT_3=weights_3: 0.0662177 0.138211 0.061384 0.0268681 0.0447331 0.0149344 0.0785246 0.115149 0.0446197 0.0210656 0.135617 0.0837258 -0.102954 -0.0659965
STDOUT_4=best_1: 0.408975
STDOUT_5=best_2: 0.410349
STDOUT_6=best_3: 0.410349
STDOUT_7=translation_1: till Tuesday Almeno stable and mostly sunny weather with rising temperatures , especially in maxima values .
STDOUT_8=translation_2: A possible worsening is expected in the second half of the week .
STDOUT_9=translation_3: A moist and temporary flow will affect the Alps in the next days determining mostly changeable cloudiness , and scattered southern sectors , with light precipitation towards the half of next week .
STDOUT_10=translation_4: Con today evening , Thursday , a disturbance is expected , bringing widespread rains into clearing on Friday and snowfalls to 600 of m 2000 m .
STDOUT_11=translation_5: For the weekend clear or clear sky cloudy with temperature lowering minimum temperatures .
STDOUT_12=translation_6: till Tuesday Almeno stable and mostly sunny weather with rising temperatures , especially in maxima values .
STDOUT_13=translation_7: A possible worsening is expected in the second half of the week .
STDOUT_14=translation_8: A moist and temporary flow will affect the Alpine area for the next days will determine changeable cloudiness , will probably southern sectors , and with light precipitation is expected for the half of the week .
STDOUT_15=translation_9: Con evening today , Thursday , a disturbance is expected , bringing widespread rains into clearing on Friday and snowfalls to 600 of m 2000 m .
STDOUT_16=translation_10: For the weekend clear or clear sky cloudy with dropping of minimum temperatures .
TOTAL_WALLTIME ~ 10