Sentence Classification with HuggingFace BERT and Hyperparameter Optimization with W&B

Ayush Chaurasia, Contributor
15
Apr
2020

You can visualize your Hugging Face model's performance quickly with a seamless Weights & Biases integration. This helps you quickly compare hyperparameters, output metrics, and system stats like GPU utilization across your models. Let's briefly look at the integration and then at some examples, including sentence classification with BERT.

Why use W&B

Think of W&B like GitHub for machine learning models— save machine learning experiments to your private, hosted dashboard. Experiment quickly with the confidence that all the versions of your models are saved for you, no matter where you're running your scripts.

W&B lightweight integrations works with any Python script, and all you need to do is sign up for a free W&B account to start tracking and visualizing your models.

In the Hugging Face Transformers repo, we've instrumented the Trainer to automatically log training and evaluation metrics to W&B at each logging step.

Examples

We've created a few examples for you to see how the integration works:

Visualize Results

Explore your results dynamically in the W&B Dashboard. It's easy to look across dozens of experiments, zoom in on interesting findings, and visualize highly dimensional data.

Here's an example comparing BERT vs DistilBERT — it's easy to see how different architectures effect the evaluation accuracy throughout training with automatic line plot visualizations.

Join our mailing list to get the latest machine learning updates.