(gold_labels, test_labels)
| 6 | RELATED = LABELS[0:3] |
| 7 | |
| 8 | def score_submission(gold_labels, test_labels): |
| 9 | score = 0.0 |
| 10 | cm = [[0, 0, 0, 0], |
| 11 | [0, 0, 0, 0], |
| 12 | [0, 0, 0, 0], |
| 13 | [0, 0, 0, 0]] |
| 14 | |
| 15 | for i, (g, t) in enumerate(zip(gold_labels, test_labels)): |
| 16 | g_stance, t_stance = g, t |
| 17 | if g_stance == t_stance: |
| 18 | score += 0.25 |
| 19 | if g_stance != 'unrelated': |
| 20 | score += 0.50 |
| 21 | if g_stance in RELATED and t_stance in RELATED: |
| 22 | score += 0.25 |
| 23 | |
| 24 | cm[LABELS.index(g_stance)][LABELS.index(t_stance)] += 1 |
| 25 | |
| 26 | return score, cm |
| 27 | |
| 28 | |
| 29 | def print_confusion_matrix(cm): |
no outgoing calls
no test coverage detected