Refactored test cases and added new metrics
Browse files
tests.py
CHANGED
@@ -1,17 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
test_cases = [
|
2 |
{
|
3 |
-
"predictions": [
|
4 |
-
"references": [
|
5 |
-
"result": {"metric_score": 0}
|
6 |
},
|
7 |
{
|
8 |
"predictions": [1, 1],
|
9 |
"references": [1, 1],
|
10 |
-
"result": {
|
|
|
|
|
|
|
|
|
|
|
11 |
},
|
12 |
-
{
|
13 |
-
|
14 |
-
"references": [1, 1],
|
15 |
-
"result": {"metric_score": 0.5}
|
16 |
-
}
|
17 |
-
]
|
|
|
1 |
+
# test_cases = [
|
2 |
+
# {
|
3 |
+
# "predictions": [0, 0],
|
4 |
+
# "references": [1, 1],
|
5 |
+
# "result": {"metric_score": 0}
|
6 |
+
# },
|
7 |
+
# {
|
8 |
+
# "predictions": [1, 1],
|
9 |
+
# "references": [1, 1],
|
10 |
+
# "result": {"metric_score": 1}
|
11 |
+
# },
|
12 |
+
# {
|
13 |
+
# "predictions": [1, 0],
|
14 |
+
# "references": [1, 1],
|
15 |
+
# "result": {"metric_score": 0.5}
|
16 |
+
# }
|
17 |
+
# ]
|
18 |
+
|
19 |
test_cases = [
|
20 |
{
|
21 |
+
"predictions": ["1111", "1113", "1120", "1211"],
|
22 |
+
"references": ["1111", "1112", "1113", "1114"],
|
23 |
+
"result": {"metric_score": 0},
|
24 |
},
|
25 |
{
|
26 |
"predictions": [1, 1],
|
27 |
"references": [1, 1],
|
28 |
+
"result": {
|
29 |
+
"accuracy": 0.25,
|
30 |
+
"hierarchical_precision": 0.7142857142857143,
|
31 |
+
"hierarchical_recall": 0.5,
|
32 |
+
"hierarchical_fmeasure": 0.588235294117647,
|
33 |
+
},
|
34 |
},
|
35 |
+
# {"predictions": [1, 0], "references": [1, 1], "result": {"metric_score": 0.5}},
|
36 |
+
]
|
|
|
|
|
|
|
|