summaryrefslogtreecommitdiff
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
commitba5267bddf74b6bc31b605810cbfe6597ab65cbf (patch)
tree24e27f7039ce4fd01340c75ce39fbf614dd7a242
parent0b3f354adbe8703fe2540247dc3d1bcdda7ea709 (diff)
Fixed display bug
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@426 ec762483-ff6d-05da-a07a-a48fb63a330f
-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):