Evaluate predictions
Last updated
Last updated
Metrics is deprecated in 🌍 Datasets. To learn more about how to use metrics, take a look at the library 🌍 ! In addition to metrics, you can find more tools for evaluating models and datasets.
🌍 Datasets provides various common and NLP-specific for you to measure your models performance. In this section of the tutorials, you will load a metric and use it to evaluate your models predictions.
You can see what metrics are available with :
Copied
It is very easy to load a metric with 🌍 Datasets. In fact, you will notice that it is very similar to loading a dataset! Load a metric from the Hub with :
Copied
This will load the metric associated with the MRPC dataset from the GLUE benchmark.
If you are using a benchmark dataset, you need to select a metric that is associated with the configuration you are using. Select a metric configuration by providing the configuration name:
Copied
Copied
Copied
Before you begin using a object, you should get to know it a little better. As with a dataset, you can return some basic information about a metric. For example, access the inputs_description
parameter in to get more information about a metrics expected input format and some usage examples:
Notice for the MRPC configuration, the metric expects the input format to be zero or one. For a complete list of attributes you can return with your metric, take a look at .
Once you have loaded a metric, you are ready to use it to evaluate a models predictions. Provide the model predictions and references to :