summaryrefslogtreecommitdiff
path: root/gi/evaluation
diff options
context:
space:
mode:
authortrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-26 20:23:49 +0000
committertrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-26 20:23:49 +0000
commitef0266e7e51f3606e596e9794fa85c6e1b0aad00 (patch)
treeb11e162ff44f78807b2f5e86316b4695ad8c5568 /gi/evaluation
parentfcac710ad3fd54275f18c0f8c0488746e81d63ae (diff)
Fixed display bug
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@426 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/evaluation')
-rw-r--r--gi/evaluation/confusion_matrix.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gi/evaluation/confusion_matrix.py b/gi/evaluation/confusion_matrix.py
index 55cad256..2dd7aa47 100644
--- a/gi/evaluation/confusion_matrix.py
+++ b/gi/evaluation/confusion_matrix.py
@@ -92,7 +92,9 @@ if output_fname:
# re-sort preds to get a better diagonal
ptags=[]
- if False:
+ if True:
+ ptags = map(lambda (p,c): p, preds)
+ else:
remaining = set(predict_frequencies.keys())
for y, (gtag, gcount) in enumerate(gtags):
best = (None, 0)
@@ -103,6 +105,9 @@ if output_fname:
ptags.append(ptag)
remaining.remove(ptag)
if not remaining: break
+
+ print 'Predicted tag ordering:', ' '.join(ptags)
+ print 'Gold tag ordering:', ' '.join(map(lambda (t,c): t, gtags))
draw = ImageDraw.Draw(image)
for x, ptag in enumerate(ptags):