Problem
A clothing store gets 250,000+ direct messages from customers on social networks. The team needed to group them by the request the customer came with (price, size, return, delivery, giveaway). The groups feed further analytics and automation of replies. Clustering raw message text does not do this: clusters form around product names and around the greeting "Good afternoon", not around what people want.
Example from the article: "Hello, how much does this dress cost?" and "Good afternoon, what is the price of such a suit?" must land in one price cluster, while "What sizes do the jeans come in?" must not join a cluster about jeans.
Solution in brief
Mask products, drop manager messages, split dialogues into fragments, and have an LLM extract a 3–4 word intent from each fragment. Then cluster two representations of every fragment together, the raw text and the intent, with multi-view K-means. On 7646 human-labeled fragments it reached ARI 0.33 against 0.12 for plain K-means on the text.
Questions this case answers
- How to cluster hundreds of thousands of short messages by the request they express rather than by surface wording and greetings
- How to combine an LLM-extracted intent summary with the raw text as two views of the same object in one clustering
- How to group hundreds of thousands of customer chat messages by intent
- How to control what a text clustering is built on (topic, intent, tone) instead of getting clusters around product names and greetings
Tools and methods
- Grok-3 — extracts the intent of each fragment from a few-shot prompt, returns JSON.
- multilingual-e5-large-instruct — embeddings for the fragments and for the intents.
- Multi-view K-means with exponent distance (MVKM-ED) — clusters several representations of one object jointly.
- Adjusted Rand Index (ARI), V-measure — cluster quality when clusters and human classes cannot be matched.
Google or a one-time email code. No password.
