MCPcopy
hub / github.com/GauravBh1010tt/DeepLearn / score_submission

Function score_submission

fake news challenge (FNC-1)/utils/score.py:8–26  ·  view source on GitHub ↗
(gold_labels, test_labels)

Source from the content-addressed store, hash-verified

6RELATED = LABELS[0:3]
7
8def 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
29def print_confusion_matrix(cm):

Callers 5

applyKFoldFunction · 0.90
applyKFoldFunction · 0.90
applyKFoldFunction · 0.90
fnc_kfold.pyFile · 0.90
report_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected