Commit 20b358b7 authored by Arne Koehn's avatar Arne Koehn

fixed output of hunpos-incremental

parent d3f2cc2b
......@@ -6,7 +6,7 @@ abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
WORKDIR=$(dirname $abspath)
cd $WORKDIR
cat $2 | ../hunpos/tagger.native -c incremental $WORKDIR/../hunpos-standard/models/$1 2>tmp-out-$1 | sed 's/\t/ /g'| sed 's/ */ /g' >$3
cat $2 | ../hunpos/tagger.native -c incremental $WORKDIR/../hunpos-standard/models/$1 2>tmp-out-$1 |sed 's/\([^\t ]*[\t ]*[^\t ]*\).*/\1/'| sed 's/\t/ /g'| sed 's/ */ /g' >$3
TAGTIME=$(grep "Tagging: " tmp-out-$1)
SETUPTIME=$(grep "Setup: " tmp-out-$1)
echo SETUPTIME=$(echo $SETUPTIME | sed "s/.* \([0-9:\.]*\).*/\1/")
......
......@@ -35,17 +35,8 @@ def get_errors(goldfile, testfile):
if __name__ == "__main__":
import os,sys
from operator import itemgetter
try:
goldfile = open(os.path.abspath(sys.argv[1]))
testfile = open(os.path.abspath(sys.argv[2]))
except:
print "usage: get-errortypes.py [goldfile] [testfile]"
sys.exit(1)
goldfile = open(os.path.abspath(sys.argv[1]))
testfile = open(os.path.abspath(sys.argv[2]))
(g,t,e) = get_errors(goldfile, testfile)
num_errors = 0
for error in e.iteritems():
num_errors += error[1]
print num_errors, " errors"
print "===== ERRORS: ====="
for error in sorted(e.iteritems(), key=itemgetter(1), reverse=True):
print error[0], ":", error[1], " (",(error[1]*1.0/num_errors)*100, " )"
print error
......@@ -20,7 +20,7 @@ foreach my $tagger (@files) {
while (<$fh>) {
$_ =~ s/\d+ ([^ ]+) .*/$1/;
chomp;
print " & ", sprintf("%.3f",$_);
print " & ", $_;
}
print " \\\\ \n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment