---
title: "Supercharged Customer Service with Machine Learning"
description: "A walkthrough of building a classifier that flags very unsatisfied customer messages by framing the problem as 5-class sentiment text classification."
url: "https://swe.quest/articles/supercharged-customer-service-with-machine-learning-40f2ea8336a86ea0"
canonical: "https://huggingface.co/blog/supercharge-customer-service-with-machine-learning"
source: "Hugging Face"
published: "2022-04-25"
difficulty: "medium"
kind: "How-to"
reading_minutes: 22
tags: ["model-training","machine-learning","python"]
---

# Supercharged Customer Service with Machine Learning

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2022-04-25, 22 min read, How-to. Original: [https://huggingface.co/blog/supercharge-customer-service-with-machine-learning](https://huggingface.co/blog/supercharge-customer-service-with-machine-learning)

## Summary

A walkthrough of building a classifier that flags very unsatisfied customer messages by framing the problem as 5-class sentiment text classification. Covers choosing a dataset on the Hugging Face Hub, settling on English Amazon Reviews Multi (1-5 star labels, 200k training examples) over GLUE, Amazon polarity, Tweet eval and Yelp, and choosing a pretrained model by checking GLUE/SuperGLUE leaderboards, landing on microsoft/deberta-v3-base. It then shows code to load and tokenize the data with Datasets and Transformers and fine-tune the model, pushing checkpoints to the Hub.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Python basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- text classification concepts
- pretrained transformer models

## Keywords

Hugging Face Transformers, Hugging Face Datasets, DeBERTa-v3, Amazon Reviews Multi, Hugging Face Hub, GLUE

## Related posts

- [Opinion Classification with Kili and HuggingFace AutoTrain](https://swe.quest/articles/opinion-classification-with-kili-and-huggingface-autotrain-97ebbffd8c146463.md): Hugging Face · 2022-04-28 · Medium · 18 min read · Machine learning, Model training, Python
  Kili's annotation platform and Hugging Face AutoTrain combine into an active-learning pipeline that classifies about 40,000 Google Play reviews of the Medium app into Subscription, Content, Interface and User Experience, then applies sentiment analysis to the classified reviews.
- [Train and Fine-Tune Sentence Transformers Models](https://swe.quest/articles/train-and-fine-tune-sentence-transformers-models-49bc0c36b2cdc22e.md): Hugging Face · 2022-08-10 · Medium · 11 min read · Model training, Machine learning, Python, Search
  Sentence Transformers models map text to fixed-size embeddings by running a pre-trained Transformer and pooling its token embeddings, and training them depends on matching the dataset format to the right loss.
- [Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model](https://swe.quest/articles/data-centric-machine-learning-building-shopify-inbox-s-message-classification-89547c88c3590e73.md): Shopify Engineering · 2022-07-21 · Medium · 12 min read · Machine learning, Model training, Privacy, Communications
  Shopify Inbox's message classifier improved from ~70% to ~90% accuracy, and from ~35% to ~80% high-confidence coverage, by investing in better training data rather than model tweaks.
- [Training and Finetuning Embedding Models with Sentence Transformers](https://swe.quest/articles/training-and-finetuning-embedding-models-with-sentence-transformers-d6dcb3eebe384143.md): Hugging Face · 2024-05-28 · Medium · 14 min read · Model training, Python, Machine learning, Search, Evaluation
  Sentence Transformers v3 trains and finetunes embedding models through a SentenceTransformerTrainer that combines Hugging Face datasets, a loss function, optional training arguments and evaluators.
- [The Partnership: Amazon SageMaker and Hugging Face](https://swe.quest/articles/the-partnership-amazon-sagemaker-and-hugging-face-bdc6f1a55662e5fc.md): Hugging Face · 2021-03-23 · Medium · 14 min read · Model training, ML platforms, Cloud platforms, Python
  Hugging Face and AWS partner, making AWS Hugging Face's preferred cloud and introducing Hugging Face Deep Learning Containers plus a HuggingFace Estimator in the SageMaker Python SDK for training Transformers models.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
