With the NLTK library, it is often difficult to find your way around, especially with the tags module (pos_tag)!
This module allows you to know the value of each word : adjective, noun, proper name, etc.
In this post, we propose you a summary table of each NLKT tags and their correspondence 😉
|IN||Preposition or subordinating conjunction|
|LS||List item marker|
|NN||Noun, singular or mass|
|NNP||Proper noun, singular Phrase|
|NNPS||Proper noun, plural|
|PRP||Personal pronoun Phrase|
|PRP||Possessive pronoun Phrase|
|S||Simple declarative clause|
|SBAR||Clause introduced by a (possibly empty) subordinating conjunction|
|SBARQ||Direct question introduced by a wh-word or a wh-phrase.|
|SINV||Inverted declarative sentence, i.e. one in which the subject follows the tensed verb or modal.|
|SQ||Inverted yes/no question, or main clause of a wh-question, following the wh-phrase in SBARQ.|
|VB||Verb, base form|
|VBD||Verb, past tense|
|VBG||Verb, gerund or present participle|
|VBN||Verb, past participle|
|VBP||Verb, non-3rd person singular present|
|VBZ||Verb, 3rd person singular present|
Short example of the use of the nltk.tag module :
from nltk import tag tag.pos_tag(['I', 'am', 'a', 'tag', 'from', 'NLTK'])
Output : [(‘I’, ‘PRP’), (‘am’, ‘VBP’), (‘a’, ‘DT’), (‘tag’, ‘NN’), (‘from’, ‘IN’), (‘NLTK’, ‘NNP’)]
The tags from the NLTK library is used a lot for NLP projects but others use more classical libraries.
In this article especially, we use typical Machine Learning libraries for text classification.
A tutorial that we warmly recommend ! 🔥
THE PANE METHOD FOR DEEP LEARNING!
Get your 7 DAYS FREE TRAINING to learn how to create your first ARTIFICIAL INTELLIGENCE!
For the next 7 days I will show you how to use Neural Networks.
You will learn what Deep Learning is with concrete examples that will stick in your head.
BEWARE, this email series is not for everyone. If you are the kind of person who likes theoretical and academic courses, you can skip it.
But if you want to learn the PANE method to do Deep Learning, click here :