Skip to main content
NLP Basics Tutorial
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. 1. "I want to *book* a flight." (Verb - an action)
  1. 2. "I want to read a *book*." (Noun - an object)
If you are building an AI travel assistant, it must know that "book" in the first sentence is an action command. By applying POS tagging, the AI instantly knows the context.

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
12345678910111213141516
import nltk
from nltk.tokenize import word_tokenize

# nltk.download('averaged_perceptron_tagger')

text = "The quick brown fox jumps over the lazy dog."

# 1. Tokenize the text
tokens = word_tokenize(text)

# 2. Apply POS Tagging
pos_tags = nltk.pos_tag(tokens)

print(pos_tags)
# Output: [('The', 'DT'), ('quick', 'JJ'), ('brown', 'JJ'), ('fox', 'NN'), ('jumps', 'VBZ') ...]
# Translation: (quick, Adjective), (brown, Adjective), (fox, Noun), (jumps, Verb).

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. 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
123456789101112
review = "The phone is beautiful but the battery is terrible."
tokens = tokenize(review)
tagged_words = POS_Tagger(tokens)

adjectives_found = []

For (word, tag) in tagged_words:
    If tag == "JJ":  // "JJ" is the standard tag for Adjective
        Add word to adjectives_found
        
Print adjectives_found
// Output: ["beautiful", "terrible"]

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.

16. FAQs

Q: Do I need to memorize all the tags like NN, VBD, and JJ? A: No. When building applications, developers just keep a cheat sheet handy from the Penn Treebank tagset. You only need to memorize the general concepts.

17. Summary

In Chapter 9, we explored how AI understands grammar. Parts of Speech (POS) Tagging acts as a virtual English teacher, reading sentences and labeling words as Nouns, Verbs, or Adjectives based on their context. This is a critical step in the NLP pipeline, as it resolves ambiguity and allows the computer to extract meaningful phrases rather than just isolated words.

18. Next Chapter Recommendation

Now that the computer knows what a Noun is, can it figure out if that Noun is a Person, a City, or a Corporation? Proceed to Chapter 10: Named Entity Recognition (NER) to find out.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·