---
title: "Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model"
description: "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."
url: "https://swe.quest/articles/data-centric-machine-learning-building-shopify-inbox-s-message-classification-89547c88c3590e73"
canonical: "https://shopify.engineering/shopify-inbox-message-classification-model"
source: "Shopify Engineering"
published: "2022-07-21"
difficulty: "medium"
kind: "Case study"
reading_minutes: 12
tags: ["machine-learning","model-training","privacy","communications"]
---

# Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-07-21, 12 min read, Case study. Original: [https://shopify.engineering/shopify-inbox-message-classification-model](https://shopify.engineering/shopify-inbox-message-classification-model)

## Summary

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. The v1 prototype used Universal Sentence Encoder embeddings with UMAP/HDBSCAN clustering and semi-supervised labeling on 40,000 examples. For v2, the team fine-tuned DistilBERT on 20,000 human-labeled messages. Those labels came from a 45-topic taxonomy built with support advisors and domain experts, refined through inter-annotator agreement exercises, and scrubbed of personal information with Presidio and Faker. Model predictions were then used to surface underrepresented topics for further annotation.

Written by swe.quest, not by the author.

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

## Topics

- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Privacy](https://swe.quest/tags/privacy.md) (Security)
- [Communications](https://swe.quest/tags/communications.md) (Domains)

## Prerequisites

- text classification basics
- sentence embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- fine-tuning pre-trained models ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))

## Keywords

Shopify Inbox, DistilBERT, Universal Sentence Encoder, UMAP, HDBSCAN, Presidio, Faker, TensorFlow Hub

## Related posts

- [Using Rich Image and Text Data to Categorize Products at Scale](https://swe.quest/articles/using-rich-image-and-text-data-to-categorize-products-at-scale-d20fb07ad5fcc987.md): Shopify Engineering · 2021-09-08 · Medium · 12 min read · Machine learning, Model training, E-commerce, Computer vision
  Shopify rebuilt its product categorization model as a multi-task, multi-class neural network that predicts all seven levels of the hierarchical Google Product Taxonomy.
- [Supercharged Customer Service with Machine Learning](https://swe.quest/articles/supercharged-customer-service-with-machine-learning-40f2ea8336a86ea0.md): Hugging Face · 2022-04-25 · Medium · 22 min read · Model training, Machine learning, Python
  A walkthrough of building a classifier that flags very unsatisfied customer messages by framing the problem as 5-class sentiment text classification.
- [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.
- [Evolution of Product Classification at Shopify: From Categories to Comprehensive Product Understanding](https://swe.quest/articles/evolution-of-product-classification-at-shopify-from-categories-to-comprehensive-f7af0d3e764e6a0d.md): Shopify Engineering · 2025-05-08 · Medium · 8 min read · Inference & serving, Machine learning, E-commerce, LLMs, ML platforms
  Shopify's product classification evolved from a 2018 TF-IDF logistic regression model through a 2020 multi-modal classifier to a Vision Language Model system built on the Shopify Product Taxonomy, which covers over 10,000 categories and 1,000+ attributes.
- [How we think about text classification in the LLM era](https://swe.quest/articles/how-we-think-about-text-classification-in-the-llm-era-a6b9a6bf775ffc1a.md): Medium Engineering · 2026-08-19 · Medium · 13 min read · LLMs, Machine learning, Evaluation, Cost optimization
  Medium replaced its aging NSFW story classifier with a prompt-based LLM classifier that runs inside Snowflake Cortex SQL queries.

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)
