Skip to main content

Keyword Clustering Tool (Python)

Open-source Python keyword clustering with embeddings — group keywords by semantic similarity for content planning

Marketing / SEOFree

An open-source Python tool for clustering keywords using text embeddings and cosine similarity. Feed it a list of keywords (from Ahrefs, Semrush, or any source), and it groups them by semantic similarity using sentence transformers — revealing which keywords share the same topic and should target the same content. Free to run locally with no API costs; requires Python and basic technical setup.

This tool appears to be discontinued. The GitHub repository has been removed (checked 2026-11-12).

What we know

PricingFreefrom our original listing, not yet re-checked
GitHub stars0from our original listing, not yet re-checked

Why it matters

  • Zero cost for large keyword lists — clustering 100,000 keywords with a SaaS tool costs hundreds of dollars in credits; this runs locally for free.
  • Full control over clustering parameters — adjust similarity thresholds, choose different embedding models, post-process clusters with custom logic.
  • Privacy and data security — no keywords sent to external APIs; useful for industries where keyword research reveals sensitive business strategy.
  • Educational value — examine exactly how semantic similarity clustering works as a foundation for understanding NLP-based keyword grouping.

Key capabilities

  • Embedding generation: Convert keywords to semantic vectors using sentence-transformers.
  • Cosine similarity: Measure keyword similarity in embedding space.
  • K-means or hierarchical clustering: Group keywords into configurable number of clusters.
  • CSV input/output: Feed in standard keyword CSV exports from any SEO tool.
  • Customizable models: Swap in different sentence-transformer models (larger/smaller, multilingual).
  • Threshold tuning: Adjust similarity thresholds to control cluster granularity.
  • Local execution: Runs entirely on your machine without external API calls.

Technical notes

  • Language: Python
  • Key dependencies: sentence-transformers, scikit-learn, pandas
  • Install: pip install sentence-transformers scikit-learn pandas
  • Embedding model: all-MiniLM-L6-v2 (default); swappable
  • Input: CSV with keyword column
  • Output: CSV with cluster labels added
  • License: Open source (check repository)
  • GitHub: github.com/AndreiMikhalevich/KeywordClustering

Getting started

git clone https://github.com/AndreiMikhalevich/KeywordClustering
pip install -r requirements.txt
# Add keywords.csv with a 'keyword' column
python cluster_keywords.py --input keywords.csv --output clustered.csv

Ideal for

  • Developers and data scientists who want embedding-based keyword clustering with full code control.
  • SEO practitioners with large keyword lists who want to avoid per-keyword SaaS costs.
  • Teams exploring how embedding-based clustering works before deciding on a commercial tool.

Not ideal for

  • Non-technical users — requires Python setup; commercial tools like KeywordInsights or WriterZen are easier.
  • High-accuracy clustering for production SEO — SERP-based clustering (KeywordInsights) is more accurate for actual search intent.
  • Teams needing features like SERP data, content briefs, or search volume integration alongside clustering.

See also

  • KeywordInsights — Commercial keyword clustering with SERP-based accuracy; more reliable for production SEO.
  • WriterZen — Keyword research + clustering + briefs in one platform; no coding required.
  • LowFruits — Finds weak-competition keywords within clusters; complements clustering for opportunity analysis.

FAQ

What is the Keyword Clustering Python Tool?

This is an open-source Python script for clustering SEO keywords by semantic similarity. You provide a list of keywords as input, and it uses sentence-transformers to create vector embeddings for each keyword, then groups keywords with high cosine similarity into clusters. Each cluster represents a set of keywords that likely share the same search intent and can be targeted by the same page — helping prevent keyword cannibalization.

Is this keyword clustering tool free?

Completely free and open source. There are no API costs because it uses local sentence-transformer models (like `all-MiniLM-L6-v2`) that run entirely on your machine. You need Python, a few pip packages (`sentence-transformers`, `scikit-learn`, `pandas`), and a CSV of keywords. No external services, no subscriptions, no per-keyword credits.

How does embedding-based clustering differ from SERP-based clustering?

Embedding-based clustering (like this tool) groups keywords by text similarity — keywords that look or read similarly get grouped together. SERP-based clustering (like KeywordInsights) groups keywords by whether Google shows the same top results for them. SERP-based is more accurate for SEO because it reflects Google's own view of keyword intent. Embedding-based is faster, cheaper, and works without making search engine requests — good for initial rough clustering before SERP validation.

Who should use this Python keyword clustering tool?

This tool is best for: developers and data scientists who want full control over clustering parameters and can write Python; teams that need to cluster large keyword lists without per-keyword costs; organizations with strict data privacy requirements where sending keywords to external APIs isn't acceptable; and SEOs who want to understand the underlying NLP approach to keyword grouping.

Alternatives

Is your tool an alternative to Keyword Clustering Tool (Python)? Sponsor this spot for 30 days, marked Sponsored.

Integrations

None listed.

Built on

None listed.

Good for these tasks

Listed 2026-02-22 · updated 2026-11-12