Python for NLP: Parts of Speech Tagging and Named Entity Recognition

python_tutorials

This is the 4th article in my series of articles on Python for NLP. In my previous article, I explained how the spaCy library can be used to perform tasks like vocabulary and phrase matching.

In this article, we will study parts of speech tagging and named entity recognition in detail. We will see how the spaCy library can be used to perform these two tasks.

Parts of Speech (POS) Tagging

Parts of speech tagging simply refers to assigning parts of speech to individual words in a sentence, which means that, unlike phrase matching, which is performed at the sentence or multi-word level, parts of speech tagging is performed at the token level.

Let’s take a very simple example of parts of speech tagging.

import spacy
sp = spacy.load('en_core_web_sm')

As usual, in the script above we import the core spaCy English model. Next, we need to create a spaCy document that we will be using to perform parts of speech tagging.

sen = sp(u"I like to play football. I hated it in my childhood though")

The spaCy document object has several attributes that can be used to perform a

To finish reading, please visit source site