June 2018
Beginner to intermediate
306 pages
7h 42m
English
POS-tagging with spaCy is like any other basic linguistic function with spaCy – it is one of its core features loaded into its pipeline. If you load up your spaCy module of choice and run the text through the pipeline, you will have that text POS-tagged – as well as tokenized, NER-tagged, and ready to be dependency parsed. We've already seen spaCy's power in this regard in our chapter on our introduction to spaCy's language models.
Setting up our model involves the same steps we saw before.
import spacy
nlp = spacy.load('en')
Let's now decide some sentence we would like to POS-tag.
sent_0 = nlp(u'Mathieu and I went to the park.') sent_1 = nlp(u'If Clement was asked to take out the garbage, he would refuse.') sent_2 ...
Read now
Unlock full access