illorca commited on
Commit
53ac266
1 Parent(s): a92bada

Avoid dict overrides for entity-level

Browse files
Files changed (1) hide show
  1. 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] = {'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] = {'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']
 
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']