Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Wealthfront Engineering 14 min read How-to mediumAdept

Unsupervised Topic Discovery with Text Embeddings

Wealthfront derives a hierarchical taxonomy of support-call topics from free-form representative notes by embedding each note with OpenAI's text-embedding-3-small, reducing dimensions with UMAP (to 25), and clustering with HDBSCAN into 89 top-level clusters, then re-running UMAP+HDBSCAN within each cluster to get sub-topics. An LLM names clusters from notes sampled near sub-cluster centroids, which avoids the bias of naming a cluster after a skewed sample (e.g. January 1099 calls). Because HDBSCAN cannot label new data, the resulting labelled dataset, after manual label cleanup and merging, is used to train a KNN classifier for incoming notes. This approach is presented as cheaper and more consistent than asking an LLM to label every note.

Related posts

  • Finding relationships in your data with embeddings

    incident.io mediumAdept

    incident.io built a related-incidents feature by embedding a plain-text representation of each incident with OpenAI's text-embedding-ada-002 and ranking matches by cosine similarity. Prompt construction mattered most. Leaving out noisy fields such as timestamps and IDs, sorting values consistently, flattening rich text, labelling fields and replacing newlines all improved consistency, and k-means clustering was used to gauge prompt quality. In production the embeddings live in Postgres via pgvector with an HNSW index, keyed by model and prompt version so backfills can run without gaps in suggestions. In-progress incidents are re-embedded periodically once they hold enough content to give useful matches.

  • Introducing the Data Measurements Tool: an Interactive Tool for Looking at Datasets

    Hugging Face easyNovice

    Hugging Face's Data Measurements Tool is an open-source Python library and no-code Streamlit interface for measuring, exploring and comparing NLP datasets on the Hub. It reports dataset basics (missing values), descriptive statistics (vocabulary, label balance, instance lengths, duplicates), and fit to Zipf's law. As a rule of thumb, an alpha above 2 or a minimum rank above 10 suggests unnatural text such as leftover HTML. It also shows hierarchical clusters built from Sentence-Transformer embeddings and nPMI between identity terms to surface stereotypes. The alpha version covers a handful of English datasets like SQuAD, IMDb and C4, with support for user datasets and custom nPMI terms planned.

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

    Shopify Engineering mediumAdept

    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.

  • How we think about text classification in the LLM era

    Medium Engineering mediumAdept

    Medium replaced its aging NSFW story classifier with a prompt-based LLM classifier that runs inside Snowflake Cortex SQL queries. It needs only a human-labelled evaluation set, oversampled to a 50/50 split, plus curator-written guidelines. Mixtral 8x7b matched or beat the legacy model on precision and recall for about $250/month, scoring only distribution-eligible stories. The team judged LLMs a poor fit for its topic and spam models. Topic labels come free from writer tags and let that model adapt to trends, while spam is an adversarial, full-volume workload where a static model and fixed prompt fall behind and costs rise.

  • Getting Started With Embeddings

    Hugging Face mediumAdept

    Embeddings turn text or images into fixed-length vectors that capture meaning, so semantic similarity becomes a distance calculation. A walkthrough builds a small FAQ matcher: it embeds 13 Medicare FAQs into 384-dimensional vectors with sentence-transformers/all-MiniLM-L6-v2 through the Hugging Face Inference API, hosts the vectors as a CSV dataset on the Hub, then embeds a user query and ranks the top 5 FAQs by cosine similarity with util.semantic_search. Practical notes include retrying the first API call while the model loads, and using FAISS via add_faiss_index as an alternative search path.

The quest for software engineering knowledge.

Look:
Layout: