Spaces:
Sleeping
Sleeping
Update ref-metrics.py
Browse files- ref-metrics.py +25 -3
ref-metrics.py
CHANGED
|
@@ -101,11 +101,33 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
| 101 |
debug: bool = False,
|
| 102 |
):
|
| 103 |
"""
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
Returns:
|
| 107 |
-
dict:
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
"""
|
| 110 |
return self.dummy_values(area_ranges_tuples)
|
| 111 |
|
|
|
|
| 101 |
debug: bool = False,
|
| 102 |
):
|
| 103 |
"""
|
| 104 |
+
Compute the metric from the payload.
|
| 105 |
+
|
| 106 |
+
Args:
|
| 107 |
+
payload (Payload): The payload to compute the metric from.
|
| 108 |
+
**kwargs: Additional keyword arguments.
|
| 109 |
|
| 110 |
Returns:
|
| 111 |
+
dict: The computed metric results with the following format:
|
| 112 |
+
{
|
| 113 |
+
"model_name": {
|
| 114 |
+
"overall": {
|
| 115 |
+
"all": {"tp": ..., "fp": ..., "fn": ..., "f1": ...},
|
| 116 |
+
... # more area ranges
|
| 117 |
+
},
|
| 118 |
+
"per_sequence": {
|
| 119 |
+
"sequence_name": {
|
| 120 |
+
"all": {...},
|
| 121 |
+
... # more area ranges
|
| 122 |
+
},
|
| 123 |
+
... # more sequences
|
| 124 |
+
}
|
| 125 |
+
},
|
| 126 |
+
... # more models
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
Note:
|
| 130 |
+
- If the metric does not support area ranges, the metric should store the results under the `all` key.
|
| 131 |
"""
|
| 132 |
return self.dummy_values(area_ranges_tuples)
|
| 133 |
|