Coding Script or Notebook
Google Colab
Free (Access via Email)

Search Intent Classification from SERP Features in Python: Rule-Based Notebook for SEO

Three connected classification functions in one notebook: SERP-feature-to-intent mapping, percentage breakdowns across four intent categories, and domain-level intent classification using 20+ site type rules
Maps 60+ SERP features (AI Overview, Featured Snippet, Shopping Results, Local Pack, People Also Ask, and more) to Informational, Navigational, Transactional, or Commercial Investigation intent—fully editable to match your own taxonomy
Pure Python with pandas and regex—no API keys, no GPU, no transformer downloads, no recurring costs—just upload your CSV and download the enriched results

Search intent classification often gets stuck at the keyword level, but the real signals live in the SERP itself. This Google Colab notebook by Lazarina Stoy, part of the Semantic ML-enabled Keyword Research Course, gives you a complete rule-based system that classifies search intent directly from SERP features—no API keys, no transformer models, no machine learning training required. Just upload a CSV with your keywords and SERP features (from any rank tracker like Semrush, Ahrefs, or DataForSEO) and let the script do the rest.
The notebook runs three connected functions that build on each other. The first maps over 60 SERP features—from AI Overview and Answer Box to Shopping Results, Local Pack, and Carousel—to one of four intent categories: Informational, Navigational, Transactional, or Commercial Investigation. The second function calculates the percentage breakdown of each intent category per keyword, so instead of a single label you get a full distribution showing how mixed-intent SERPs really are. The third function classifies the top-ranking domains across 20 site type rules (Wiki, News, Reviews, E-commerce, Social Media, Government/Education, Health, Travel, Jobs, Finance, Maps/Navigation, Developer Platforms, and more) and maps them to holistic intent categories, then joins this lookup back to your full SERP results so every URL gets an intent label based on which type of site is ranking.
Use this for:
‧ Classifying search intent at scale without paying for API calls or running ML models
‧ Getting percentage-based intent breakdowns instead of forced single-label classifications, revealing mixed-intent opportunities
‧ Mapping ranking domains to holistic intent categories to understand which types of sites Google rewards for each query
‧ Building a foundational SERP analysis layer you can extend with your own SERP features, domain rules, and intent definitions
‧ Auditing keyword sets quickly to prioritize content investments based on dominant SERP intent signals
This is perfect for SEO professionals, content strategists, and keyword researchers who want a transparent, fully customizable, zero-cost way to add search intent classification to their workflow—no machine learning experience needed.

What’s Included

  • Three connected classification functions in one notebook: SERP-feature-to-intent mapping, percentage breakdowns across four intent categories, and domain-level intent classification using 20+ site type rules
  • Maps 60+ SERP features (AI Overview, Featured Snippet, Shopping Results, Local Pack, People Also Ask, and more) to Informational, Navigational, Transactional, or Commercial Investigation intent—fully editable to match your own taxonomy
  • Pure Python with pandas and regex—no API keys, no GPU, no transformer downloads, no recurring costs—just upload your CSV and download the enriched results

Get Instant Access

Enter your email and we’ll send you the download link immediately.

No spam, ever
Instant delivery