Avoid dict overrides for entity-level
Browse files- FairEval.py +2 -2
FairEval.py
CHANGED
@@ -213,10 +213,10 @@ class FairEval(evaluate.Metric):
|
|
213 |
# append entity-level scores (depending on mode)
|
214 |
if mode == 'traditional':
|
215 |
for k, v in results['per_label'][mode].items():
|
216 |
-
output[k]
|
217 |
elif mode == 'fair' or mode == 'weighted':
|
218 |
for k, v in results['per_label'][mode].items():
|
219 |
-
output[k]
|
220 |
|
221 |
# append overall scores (depending on mode)
|
222 |
output['overall_precision'] = results['overall'][mode]['Prec']
|
|
|
213 |
# append entity-level scores (depending on mode)
|
214 |
if mode == 'traditional':
|
215 |
for k, v in results['per_label'][mode].items():
|
216 |
+
output[k].update({'precision': v['Prec'], 'recall': v['Rec'], 'f1': v['F1'],})
|
217 |
elif mode == 'fair' or mode == 'weighted':
|
218 |
for k, v in results['per_label'][mode].items():
|
219 |
+
output[k].update({'precision': v['Prec'], 'recall': v['Rec'], 'f1': v['F1'],})
|
220 |
|
221 |
# append overall scores (depending on mode)
|
222 |
output['overall_precision'] = results['overall'][mode]['Prec']
|