From ef0266e7e51f3606e596e9794fa85c6e1b0aad00 Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Mon, 26 Jul 2010 20:23:49 +0000 Subject: Fixed display bug git-svn-id: https://ws10smt.googlecode.com/svn/trunk@426 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/evaluation/confusion_matrix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gi/evaluation') 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): -- cgit v1.2.3