CHAPTER 09
Beginner
Parts of Speech Tagging (POS)
Updated: May 14, 2026
20 min read
# CHAPTER 9
Parts of Speech Tagging (POS)
1. Introduction
To truly understand the meaning of a sentence, knowing the dictionary definition of the words is not enough. The AI must understand the *grammatical role* each word plays. Is a word acting as an action (Verb) or a thing (Noun)? This process is called Parts of Speech (POS) Tagging. In this chapter, we will explore how NLP models automatically assign grammatical labels to text.2. Learning Objectives
By the end of this chapter, you will be able to:- Define Parts of Speech (POS) Tagging.
- Identify the standard grammatical tags used in NLP (Nouns, Verbs, Adjectives).
- Understand why POS tagging resolves lexical ambiguity.
- See how POS tagging is implemented using Python.
3. Beginner-Friendly Explanation
Imagine you are trying to understand a recipe written in a foreign language. You know the word "Mix" and you know the word "Flour". But you don't know the grammar. Does the recipe say "The mix of flour is dry" (Noun) or "Mix the flour" (Verb/Command)? Without knowing the grammatical part of speech, you don't know what action to take. POS Tagging is the process where an AI acts like an English teacher, reading a sentence and labeling every single word: "This is a Noun, this is an Adjective, this is a Verb."4. Common POS Tags
When you run a POS Tagger, it doesn't output the full word "Noun". It uses standard abbreviation tags (usually from the Penn Treebank dataset).- NN: Noun, singular (e.g., dog, book)
- NNS: Noun, plural (e.g., dogs, books)
- VB: Verb, base form (e.g., run, eat)
- VBD: Verb, past tense (e.g., ran, ate)
- JJ: Adjective (e.g., happy, large)
- RB: Adverb (e.g., quickly, very)
5. Why is POS Tagging Important?
POS Tagging is the primary weapon against Lexical Ambiguity (words that look the same but have different meanings). Consider the word "Book":- 1. "I want to *book* a flight." (Verb - an action)
- 2. "I want to read a *book*." (Noun - an object)
6. How do POS Taggers Work?
Early taggers used basic dictionaries. If a word was "quickly", it tagged it as an Adverb. Modern POS Taggers use Machine Learning (specifically Hidden Markov Models or Neural Networks). They look at the *sequence* of words. They learn mathematical rules, such as: "If the word 'The' appears, there is a 90% chance the next word is an Adjective or a Noun, and a 0% chance the next word is a Verb."7. Applications of POS Tagging
- Lemmatization: As learned in the last chapter, the Lemmatizer needs to know if "leaves" is a Noun (leaf) or a Verb (leave). The POS Tagger provides this info.
- Text-to-Speech: To pronounce the word "Read", a voice assistant needs to know if it's "I will read" (present tense) or "I have read" (past tense). POS tagging tells the speech synthesizer which pronunciation to use.
8. Python Examples
Using NLTK, extracting POS tags takes only a few lines of code.
python
9. Mini Project
Act as the Tagger: Look at the following sentence: "She is a fast runner, so she runs fast." Assign a basic tag (Noun, Verb, Adjective, or Adverb) to both instances of the word "fast". *(Answer: The first "fast" describes the runner, so it is an Adjective. The second "fast" describes how she runs, so it is an Adverb).*10. Best Practices
- Context is everything: A POS tagger requires full, grammatically correct sentences to work well. If you feed it a messy, unpunctuated array of random words, it cannot use context and will guess the tags incorrectly.
11. Common Mistakes
- Assuming 100% accuracy: Even state-of-the-art POS taggers make mistakes on complex sentences with poor grammar. If a user tweets "I totally heart this song," the AI might struggle to tag "heart" as a Verb.
12. Exercises
- 1. Explain how POS tagging helps an AI voice assistant pronounce the word "Object" correctly depending on the sentence. (Think about the difference between "An unidentified flying object" vs "I object to this!").
13. Coding Challenges
Challenge 1: Write pseudocode for an NLP application that extracts ONLY the Adjectives from a user's product review to understand what they liked or disliked.
text
14. MCQs with Answers
Question 1
What is the primary purpose of Parts of Speech (POS) Tagging in NLP?
Question 2
How does a modern POS Tagger determine if the word "Watch" is a Noun (a timepiece) or a Verb (to look)?
15. Interview Questions
- Q: What is POS Tagging, and how does it help resolve Lexical Ambiguity in Natural Language Processing?
- Q: Explain how POS Tagging is used as a foundational step for higher-level NLP tasks like Lemmatization or Information Extraction.