Skip to content

NLP (Concepts & Pipeline)

Syntax analysis (parsing)

In shortThe NLP step that analyses a sentence's grammatical structure: parts of speech, word roots and how words depend on each other.

Updated 24 Oct 2026· 2 min read

Syntax analysis, or parsing, is the stage of natural language processing that works out the grammatical structure of text: which words are nouns or verbs, what their root forms are, and how the words in a sentence depend on each other. MLforSEO describes the NLP pipeline as modelled on compiler design, where syntax analysis comes after lexical analysis and before semantic analysis checks meaning and logic.

How it works

A parser splits text into sentences and tokens, then annotates each token. The Google Cloud Natural Language API syntax method, for example, returns:

  • Part of speech for each token (noun, verb, adjective and so on), with details such as tense, number and person.
  • Lemma: the root form, so “writing”, “wrote” and “written” all map to “write”.
  • Dependency tree: for each token, the word it depends on (its head) and the relationship label, such as subject, direct object or modifier.
  • Libraries such as spaCy provide the same kind of output locally, without an API.

How it’s used in SEO and marketing

  • Query analysis: separate the head noun (what is wanted) from modifiers (which kind), a useful feature for search intent classification alongside entity extraction and embeddings.
  • Spotting question patterns and verbs in queries and titles (“how to fix”, “compare”) at scale.
  • Anchor text and title analysis: check whether anchors are descriptive noun phrases or generic phrases.
  • Content quality checks: sentence length, passive voice or overly complex structure in large content sets.

Example

Using MLforSEO’s Google Sheets template, you run the query “cheap running shoes for flat feet” through the API. The dependency tree shows “shoes” as the root noun, “running” and “cheap” as modifiers of it, and “feet” (modified by “flat”) attached through the preposition “for”. That tells you the entity is shoes, the attribute values are price and use case, and the page needs to answer all three.

Limitations and things to watch

  • Short, ungrammatical queries are harder to parse accurately than full sentences.
  • Syntax shows structure, not meaning; combine it with entity and semantic analysis.
  • The syntax method is in v1 of the Google Cloud Natural Language API but not in v2, so check the version you call.
  • Output is verbose; plan what you will aggregate before running thousands of rows.

Learn it on MLforSEO

Where Syntax analysis (parsing) shows up on MLforSEO

Sources and further reading

Other terms from NLP (Concepts & Pipeline)

See all 17 NLP (Concepts & Pipeline) terms →