ML Models & Algorithms
Top2Vec
In shortAn embedding-based topic model that finds dense areas of document vectors and uses the nearest words to describe each topic.
Top2Vec is an open-source topic modelling algorithm, introduced by Dimo Angelov in 2020, that discovers topics from embeddings instead of word counts. It finds the number of topics automatically, needs very little text preprocessing and places documents, words and topics in the same vector space, so you can search for documents by topic or keyword. MLforSEO covers it as the closest alternative to BERTopic.
How it works
- Embed: documents and words are turned into vectors in a shared space. The original version trained Doc2Vec on your corpus; it can also use pre-trained models such as the Universal Sentence Encoder or sentence-transformers.
- Reduce: UMAP lowers the number of dimensions.
- Cluster: HDBSCAN finds dense areas of documents.
- Describe: each dense area’s centroid becomes a topic vector, and the word vectors closest to it become the topic’s words.
The key difference from BERTopic is the last step. Top2Vec labels topics with words that sit near the topic in vector space; BERTopic uses c-TF-IDF to pick words frequent in a cluster and rare elsewhere, and offers more modular choices for each step. Top2Vec also supports hierarchical topic reduction to merge topics down to a number you choose.
How it’s used in SEO and marketing
- Discovering themes across a large blog archive or knowledge base.
- Grouping reviews, support tickets or survey answers without predefined categories.
- Semantic search within your own content: find documents closest to a topic or keyword.
- Comparing topic coverage between your site and competitors.
Example
MLforSEO’s BERTopic lesson walks through a published comparison of BERTopic, Top2Vec, NMF and LDA. Both embedding-based models need minimal preprocessing and detect the number of topics automatically, which makes them strong on short texts like reviews and titles. BERTopic stood out for ease of use and coherent, readable topics; Top2Vec’s topics could sometimes overlap or mix concepts, but it remains a good option when you also want built-in semantic search across very large collections.
Limitations and things to watch
- Topic words come from vector proximity and can include odd or very general terms; review them.
- Doc2Vec training needs a reasonably large corpus; use a pre-trained embedding model for small datasets.
- Results vary between runs because of UMAP and HDBSCAN randomness.
- It has fewer modular options and a smaller community than BERTopic.
Learn it on MLforSEO
Where Top2Vec shows up on MLforSEO
Learn it in a course
Try it yourself
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…