Introduction to Machine Learning for SEO
- Practical: Clustering of page content with BERTopic
- Marketing and SEO implementations of ML Clustering
- Practical: Query Entity Extraction with Google NLP and Entity ML-enabled data analysis
ML Models & Algorithms
In shortA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-based TF-IDF to produce readable topics.
BERTopic is a topic modelling technique, introduced by Maarten Grootendorst in 2022, that groups documents by meaning and describes each group with its most distinctive words. It combines transformer embeddings with clustering, which makes it far better than older bag-of-words models at handling synonyms and context. It is the approach MLforSEO reaches for first when clustering keywords, reviews, titles and page content.
BERTopic is a pipeline of swappable steps, which MLforSEO describes as building with Lego:
Each step is optional and replaceable, so you can change the embedding model for another language, fix the number of topics, or add an LLM to write topic labels.
In the MLforSEO demo, BERTopic runs on about 100 BBC news articles, the same dataset used for LDA, and returns six coherent topics, including the Ukraine-Russia war, climate change and a US election topic, plus a small outlier group. Raising HDBSCAN’s min_cluster_size on the demo data split one muddled topic into cleaner ones, which shows how much the clustering settings drive the result.
random_state in UMAP.approximate_distribution if a page genuinely covers several.