mosesdecoder/mert/example
Tetsuo Kiso faab4b214d Put global variables in mert/util.cpp in anonymous space.
We do not allow clients to access the following variables.
Instead, use the APIs which we provide for that.

Also, remove the unused function, and fix smoke tests.
2012-02-20 08:02:23 +09:00
..
gzipped_test.sh Put global variables in mert/util.cpp in anonymous space. 2012-02-20 08:02:23 +09:00
init.opt merged in TER Scorer from mert-other_metrics (at r4140) 2011-08-16 16:21:31 +00:00
memcheck_extractor.sh Add error checking for file existence. 2011-11-15 10:17:00 +09:00
memcheck_mert.sh Fix typo. 2011-11-15 10:15:09 +09:00
NBEST main command for managing feature and error statistics is ready; small example fortesting is available in directory example 2008-05-15 08:35:56 +00:00
normal_test.sh Delete mert/sample/README; Add smoke tests. 2012-02-17 03:53:52 +09:00
README.oldmert - made output more compliant with old version 2008-05-27 16:50:52 +00:00
REF main command for managing feature and error statistics is ready; small example fortesting is available in directory example 2008-05-15 08:35:56 +00:00
REF.0 main command for managing feature and error statistics is ready; small example fortesting is available in directory example 2008-05-15 08:35:56 +00:00
REF.1 main command for managing feature and error statistics is ready; small example fortesting is available in directory example 2008-05-15 08:35:56 +00:00
REF.2 main command for managing feature and error statistics is ready; small example fortesting is available in directory example 2008-05-15 08:35:56 +00:00
smoke_test.sh Delete mert/sample/README; Add smoke tests. 2012-02-17 03:53:52 +09:00

scorecmd=/Users/nicolabertoldi/workspace/mosesdecoder/trunk/scripts/training/cmert-0.5/score-nbest.py 
mertcmd=/Users/nicolabertoldi/workspace/mosesdecoder/trunk/scripts/training/cmert-0.5/mert 
size=15

#cat NBEST | $scorecmd ${casetype} ${normtype} ${reflentype} REF.0 REF.1 REF.2 ./$basename.
$mertcmd -d $size 

exit

lines=10
for casetype in '' '-c' ; do
for normtype in '' '-n' ; do
for reflentype in '' '-a' '-s' '-e' ; do

basename=OLDMERT${casetype}${normtype}${reflentype}
cat NBEST | $scorecmd ${casetype} ${normtype} ${reflentype} REF.0 REF.1 REF.2 ./$basename.
#cat NBEST NBEST | sort -mnk 1,1 | $scorecmd ${casetype} ${normtype} ${reflentype} REF.0 REF.1 REF.2 ./$basename.
cat ./$basename.feats.opt | cut -d' ' -f 16- > ./$basename.SCORESTAT.out
cat ./$basename.feats.opt | cut -d' ' -f 1-15 > ./$basename.FEATSTAT.out

echo comparing SCORESTAT.out and $basename.SCORESTAT.out
cat SCORESTAT.out | perl -pe 's/[ ]+$//' | sort | grep -v "^SCORE"> AAA$$
cat $basename.SCORESTAT.out | sort >BBB$$
wc AAA$$ BBB$$
cmp AAA$$ BBB$$

echo comparing FEATSTAT.out and $basename.FEATSTAT.out
cat FEATSTAT.out | perl -pe 's/\-/\@\-\@/g; s/(\s)([0-9])/$1\-$2/g; s/\@\-\@//g; s/\-?0\b/0/g; s/[ ]+$//' | sort | grep -v "^FEAT" > AAA$$
cat $basename.FEATSTAT.out | perl -pe 's/\-?0\.0\b/0/g; s/\.0\b//g' | sort > BBB$$ 
wc AAA$$ BBB$$
cmp AAA$$ BBB$$
#rm AAA$$ BBB$$

echo

done
done
done