What are all possible POS tags of NLTK?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
The Natural Language Toolkit (NLTK) is a powerful library in Python used for working with human language data (i.e., text data). One of its many tools is the part-of-speech (POS) tagging functionality, which assigns parts of speech to each word in a given sentence. This article details the possible POS tags used by NLTK, featuring technical explanations, examples, and additional resources to enhance your understanding.
Understanding POS Tagging in NLTK
Before diving into the list of NLTK's POS tags, it's important to understand what POS tagging accomplishes. POS tagging involves labeling each word in a text with the appropriate part of speech: noun, verb, adjective, etc. This information is crucial for various NLP tasks such as parsing, scene descriptions, and syntactic analysis, providing deeper insights into the text structure.
NLTK's POS Tagging with the Penn Treebank
NLTK utilizes the Penn Treebank for its corpus of tagged texts. The Penn Treebank is a project that has annotated a large number of sentences with POS tags based on their syntactic roles. Here's an overview of the process:
- Tokenization: Before tagging, sentences are split into tokens (words).
- Tagging: Each token is assigned a POS tag that indicates its grammatical role.
The List of NLTK POS Tags
Below is a list of common POS tags used in NLTK, based on the Penn Treebank. The table includes the tag, the part of speech it represents, and examples.
| POS Tag | Part of Speech | Example |
| CC | Coordinating conjunction | and, but, or |
| CD | Cardinal number | one, two, 3, 50 |
| DT | Determiner | the, a, an |
| EX | Existential there | there (in "there is") |
| FW | Foreign word | doppelgänger |
| IN | Preposition/Subordinating conjunction | in, of, like |
| JJ | Adjective | big, blue, fast |
| JJR | Adjective, comparative | bigger, better |
| JJS | Adjective, superlative | biggest, best |
| LS | List item marker | 1., A., etc. |
| MD | Modal | can, will, could |
| NN | Noun, singular or mass | cat, tree |
| NNS | Noun, plural | cats, trees |
| NNP | Proper noun, singular | John, Britain |
| NNPS | Proper noun, plural | Clintons, Americans |
| PDT | Predeterminer | all, both |
| POS | Possessive ending | 's, ' |
| PRP | Pronoun, personal | he, you, her |
| --- | --- | --- |
| RB | Adverb | very, quickly |
| RBR | Adverb, comparative | faster, harder |
| RBS | Adverb, superlative | fastest, best |
| RP | Particle | up, off |
| SYM | Symbol | |
| TO | to | to (as in to fly) |
| UH | Interjection | oh, wow, hey |
| VB | Verb, base form | run, eat, fly |
| VBD | Verb, past tense | ran, ate, flew |
| VBG | Verb, gerund/present participle | running, eating |
| VBN | Verb, past participle | run, eaten |
| VBP | Verb, non-3rd person singular present | run, eat |
| VBZ | Verb, 3rd person singular present | runs, eats |
| WDT | Wh-determiner | which, that |
| WP | Wh-pronoun | who, what |
| --- | --- | --- |
| WRB | Wh-adverb | how, where, when |
Examples and Technical Explanations
To illustrate NLTK's POS tagging, consider the following Python code snippet:
- LS (List item marker): Used for enumerating items in a list or sequence.
- FW (Foreign word): Marks words that belong to a foreign language within a text.
- SYM (Symbol): Represents symbols such as mathematical symbols or currency signs.
- Syntactic Parsing: Understanding sentence structure and dependencies.
- Named Entity Recognition (NER): Identifying proper nouns and classifying them into categories such as persons, organizations, or locations.
- Sentiment Analysis: Determining the sentiment expressed in a text by examining the mood of specific parts of speech.

