Introduction to dependency parsing
With spaCy’s dependency parser, we can represent the syntactic structure of sentences. In the previous section, we focused on POS tags, which categorize words syntactically. While POS tags offer insights into the tags of neighboring words, they don’t reveal the relationships between words that are not directly adjacent in a sentence.
As the name suggests, dependency parsing involves analyzing sentence structures via dependencies between the tokens. The dependency parser tags syntactic relations between tokens of the sentence and connects tokens that are syntactically related. A dependency or a dependency relation is a directed link between two tokens.
We can visualize the dependency parsing as a tree, as illustrated in Figure 3.1.
Figure 3.1 – The result of running dependency parsing on a sentence
Let’s learn more about these dependency relations in the next section.