Circle of Learning Logo CIRCLE OF LEARNING Excellence in Education
CBSE Class 10 · Artificial Intelligence Chapter 3 Session 2026-27

Natural Language Processing (NLP): Pipeline & TF-IDF Formulas & Cheat Sheet

Complete chapter-wise reference, step-by-step formula explanations, structured table, and board exam trap warnings.

Core Concepts & Theoretical Foundations

  • NLP Processing Pipeline: (1) Sentence Segmentation -> (2) Tokenization -> (3) Removing Stopwords -> (4) Stemming vs Lemmatization -> (5) Bag of Words (BoW) & TF-IDF Vectorization.
  • Stemming vs Lemmatization: Stemming strips suffixes crudely (heuristic cutting, e.g., 'caring' -> 'car'); Lemmatization uses morphological dictionary analysis to find true root lemma ('caring' -> 'care').
  • Bag of Words (BoW): Represents text as frequency count of unique words in a vocabulary vector, discarding grammatical syntax.
  • TF-IDF (Term Frequency - Inverse Document Frequency): Penalizes frequently occurring words across all documents and rewards words unique to a specific document.

Chapter Formulas & Equations (3 entries)

# Topic / Formula Name Mathematical Form & Equation Conditions, Meaning & Board Tips
1 Term Frequency (TF) Formula
TF(t,d)=ft,d∑t′∈dft′,d\text{TF}(t, d) = \frac{f_{t,d}}{\sum_{t' \in d} f_{t',d}}

Measures the proportional density of a term within a single target document.

2 Inverse Document Frequency (IDF) Formula
IDF(t)=log⁡10(NDF(t))\text{IDF}(t) = \log_{10} \left( \frac{N}{\text{DF}(t)} \right)

If a word appears in every single document, N/DF = 1 and log10(1) = 0, eliminating generic common words.

3 TF-IDF Composite Score
TF-IDF=TF(t,d)⋅IDF(t)\text{TF-IDF} = \text{TF}(t, d) \cdot \text{IDF}(t)

High TF-IDF score indicates a word is highly characteristic and distinguishing for that specific document.

CBSE Board Exam Tips & Frequent Pitfalls

  • CBSE frequently asks 3-mark numerical questions calculating Document Vector using Bag of Words.
  • State clearly that stop words (e.g., 'the', 'is', 'at') add zero contextual distinction and are discarded.

Step-by-Step Worked Board Exam Examples

Example 1: Consider a collection of 100 documents. The word 'quantum' appears in 10 documents. In Document A (50 words total), 'quantum' appears 5 times. Compute its TF-IDF score.

Step 1: Compute TF = 5 / 50 = 0.10.

Step 2: Compute IDF = log10(100 / 10) = log10(10) = 1.0.

Step 3: Multiply TF * IDF = 0.10 * 1.0 = 0.10.

Ans: TF = 5/50 = 0.10; IDF = log10(100/10) = 1.0; TF-IDF = 0.10 * 1.0 = 0.10.

Common Mistakes to Avoid in Exam

  • Thinking Stemming and Lemmatization are identical; stemming can produce invalid dictionary words (e.g., 'studies' -> 'studi').
  • Forgetting to compute unique vocabulary in alphabetical order when constructing a Bag of Words vector.

Target Practice Questions

Q1. What is 'Corpus' in Natural Language Processing?

Correct Answer: A Corpus is a large, structured collection of authentic machine-readable texts used for linguistic analysis and training NLP algorithms.

Frequently Asked Questions

Q. Why is TF-IDF superior to raw word frequency counts in document classification?

Raw word frequency gives disproportionate weight to common non-informative words; TF-IDF dampens pervasive common words and amplifies distinct keywords.

← View All 5 Chapters in Class 10 Artificial Intelligence Formula Book