NLTK
POS tagging
natural language processing
computational linguistics
part-of-speech tags

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 TagPart of SpeechExample
CCCoordinating conjunctionand, but, or
CDCardinal numberone, two, 3, 50
DTDeterminerthe, a, an
EXExistential therethere (in "there is")
FWForeign worddoppelgänger
INPreposition/Subordinating conjunctionin, of, like
JJAdjectivebig, blue, fast
JJRAdjective, comparativebigger, better
JJSAdjective, superlativebiggest, best
LSList item marker1., A., etc.
MDModalcan, will, could
NNNoun, singular or masscat, tree
NNSNoun, pluralcats, trees
NNPProper noun, singularJohn, Britain
NNPSProper noun, pluralClintons, Americans
PDTPredeterminerall, both
POSPossessive ending's, '
PRPPronoun, personalhe, you, her
---------
RBAdverbvery, quickly
RBRAdverb, comparativefaster, harder
RBSAdverb, superlativefastest, best
RPParticleup, off
SYMSymbol
TOtoto (as in to fly)
UHInterjectionoh, wow, hey
VBVerb, base formrun, eat, fly
VBDVerb, past tenseran, ate, flew
VBGVerb, gerund/present participlerunning, eating
VBNVerb, past participlerun, eaten
VBPVerb, non-3rd person singular presentrun, eat
VBZVerb, 3rd person singular presentruns, eats
WDTWh-determinerwhich, that
WPWh-pronounwho, what
---------
WRBWh-adverbhow, 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.

Course illustration
Course illustration

All Rights Reserved.