Description
Clustering sentence embeddings of feedback or transcript passages into topics, which handles short texts and semantic similarity better than word-count topic models.
BERTopic encodes each document with a sentence transformer, reduces dimensionality with UMAP, clusters with HDBSCAN and describes each cluster with class-based TF-IDF keywords. Because embeddings capture meaning, it groups semantically similar texts that share few words, which suits short app reviews, survey comments and chat messages. HDBSCAN also labels outliers rather than forcing every document into a topic. Rigour comes from fixing seeds (UMAP is stochastic), tuning min_cluster_size, checking how many documents are outliers, evaluating topics by reading representative documents, checking stability across runs, and avoiding over-interpretation of small clusters.
Attributes
- Discipline
- Computational & Machine Learning
- Loss type
- Siloed
- Goal
- Synthesise data
- Stage
- Discovery, Post-launch
- Data
- Qualitative
- Effort
- Days
Steps
- Prepare documents as passages or responses, removing moderator speech and boilerplate.
- Encode with a pinned sentence-transformer (e.g. all-MiniLM-L6-v2 for speed or a larger model for quality).
- Configure UMAP (n_neighbors about 15, n_components about 5, fixed seed) and HDBSCAN (min_cluster_size scaled to corpus size, e.g. 10-50).
- Fit BERTopic and inspect topic sizes and the proportion of outliers (investigate if above about 30%).
- Read representative documents for each topic, merge redundant topics and label them.
- Re-run with 3 or more seeds and keep topics that recur; report prevalence by segment and over time.
Sources
- gensim (LDA)
- BERTopic
- sentence-transformers
- pyLDAvis (visualisation)
- hdbscan
- Grootendorst, M. (2022) BERTopic: Neural topic modeling with a class-based TF-IDF procedure. arXiv:2203.05794
- McInnes, L., Healy, J. & Astels, S. (2017) hdbscan: Hierarchical density based clustering. JOSS
- Reimers, N. & Gurevych, I. (2019) Sentence-BERT. EMNLP
- The Inquiry Series, C11 — Topic Modelling at Scale — LDA, BERTopic & Semantic Clustering
Also known as
- Embedding-based topic modelling
- Neural topic modelling
Categories
- Analytics & Behaviour
- Computational & Machine Learning