Multi-Dimension Query Classifier: Rule-Based Colab Notebook and Google Sheets Template
Most keyword tools give each query one search intent label and stop there. A single query says much more than that: whether the searcher is a beginner, whether they want a video or a template, whether location matters, whether they are trying to fix something. This free rule-based classifier reads every keyword in your export and adds a column for each of those dimensions, using regex rules you can open and change.
What it labels
- Query length in words
- Main intent: informational, commercial, transactional, navigational (more than one if several match)
- Query type: Do, Know or Go
- Geo relevance, device relevance and an explicit content format (video, infographic, template, document, webinar, podcast, eBook)
- Knowledge level (beginner, intermediate, expert) and user persona (student, professional, casual user, budget-conscious, affluent and more)
- Implicit problem (“how to fix”, “won’t work”) and context such as urgency or mood
Who it’s for
SEOs and content strategists who want richer intent labels on a keyword set without paying for another tool, and without needing to write Python. If you can upload a CSV, you can run it.
How to use it
- Open the notebook in Google Colab and save a copy to your own Drive.
- Export your keywords from Semrush, Ahrefs or Search Console as a CSV with a
Keywordcolumn. - Run the first code cell. It asks you to upload the CSV, then applies each labelling function to the Keyword column and shows the first rows.
- Run the last cell to download
updated_file.csvwith all the new columns. - Edit the regex lists for your industry (your brand names, your product words) and run it again.
Prefer spreadsheets? The Google Sheets version does the same with formulas. Make a copy: it has a demo tab of about 3,950 “first time dog owner” keywords, a tab that shows each formula, and the notebook’s output for comparison.
For intent alone, there is also a refreshed rule-based classifier on GitHub that matches whole words, keeps every matching intent (multi-label), flags easy keywords (difficulty under 65) and money keywords (CPC of $0.01 or more), and prints the same rules as a Google Sheets IFS(REGEXMATCH()) formula and a Data Studio calculated field.
What you get
Your keyword export back as a CSV with ten extra columns you can pivot, filter and chart, plus rules you can audit line by line.
Limits
- Rules only see the words in the query. A keyword like “chatbot benefits” says nothing explicit about intent, so it stays unclassified.
- Navigational intent depends on brand names, so add yours and your competitors’.
- The lists are English-only and some Sheet formulas match parts of words; the GitHub version fixes this with word boundaries.
Read the full method comparison in Search-Intent Classification with Machine Learning, and go deeper in the Semantic ML-enabled Keyword Research course.
What’s included
- Adds ten label columns to any keyword export: query length, main intent, Do/Know/Go, geo, content format, knowledge level, persona, device, problem and context
- Every rule is a plain regex pattern you can read and edit for your niche
- Google Sheets version with the same logic as formulas, plus a demo tab of about 3,950 keywords
- Refreshed GitHub classifier adds whole-word matching, easy/money keyword flags and prints a ready-to-paste Sheets formula and Data Studio calculated field
- No API keys, no cost, runs in the browser
Where this resource is used on MLforSEO
Used in the course
Walkthroughs on the blog
Concepts behind it
More search intent resources
- Coding Script or NotebookSearch Intent Classification from SERP Features in Python: Rule-Based Notebook for SEO
- Coding Script or NotebookSemantic Search Intent Classification with Google Cloud NLP & spaCy in Python (Colab Notebook)
- Coding Script or NotebookTransformer-Based Search Intent Classification with BART Zero-Shot & SERP Signals (Colab Notebook)
- Coding Script or NotebookSynthetic vs User Query Classification Notebook with Rule-Based and Machine Learning Detection
- Coding Script or NotebookIdentifying Desired Content Formats & Platforms from SERP Data (Lab Notebook)
- No-Code TemplateKeyword Mapping Template with Intent and Cannibalisation Flags (Google Sheets)
See all 11 search intent resources →See all 22 keyword research resources →See all 42 coding script or notebook resources →
