Problem
Shopify Inbox is a chat app that gathers a merchant's buyer conversations in one place. The team wanted to know what buyers write about: product questions, shipping, order status or just greetings. That would let merchants answer the messages most likely to convert and tell the product team what to build next. With millions of unique messages a month, reading them was impossible, and the first classifier built from embedding clusters reached only about 70% accuracy and labeled 35% of messages with high confidence.
Example from the article: one prototype topic held both questions about shipping to a destination (before purchase) and questions about order status (after purchase).
Solution in brief
The team kept the model fixed (a pre-trained DistilBERT) and spent the effort on the data. Domain experts wrote a new taxonomy of 40+ topics, annotators were trained on it until they agreed, and the trained model was used to find more examples of rare topics. Accuracy rose to about 90% and high-confidence coverage to about 80%.
Questions this case answers
- How to turn a large stream of unlabeled free-text messages into a consistently labeled training set when the first clustering-based labels are too coarse and unbalanced
- How to raise the accuracy and high-confidence coverage of a text classifier by improving the labels rather than the model architecture
- How to find out what buyers write to a store in chat, when millions of free-text messages arrive every month?
- How to build a topic taxonomy that annotators apply consistently?
Tools and methods
- Universal Sentence Encoder — sentence embeddings for the prototype.
- UMAP and HDBSCAN — dimensionality reduction and clustering to find message groups.
- DistilBERT — pre-trained transformer fine-tuned for version 2.0.
- Inter-annotator agreement — checks that two annotator groups label the same way.
- Presidio and Faker — find and replace personal information in messages.
Google or a one-time email code. No password.