Evaluate is a Huggingface software library for evaluating machine learning models. It has integration with Transformers and Huggingface Optimum.
Label Encoding
The evaluate library expects labels to be integers so we have to encode all text labels into ints (see related issue in SetFit library here and proposed solution).
Using multi-label F1 with evaluator
class
F1 requires us to set an averaging approach (e.g. micro or macro) when we calculate for multi-class.
Using an Evaluator object, we can pass the average in via evaluator.METRIC_KWARGS
property: