TF-IDF and term rarity
medium 4 minTerm frequency describes a word inside one document.
Video lesson · Chapter 1 of 5
A rare mark in the rail archive
Why does a rare word outweigh a common one?
1:13Reel
Theory
Read or listen first. About 1 min.
What it is
A word in almost every document offers little help in choosing the right one. Inverse document frequency measures how much a term narrows the field across a corpus.
How much does a term distinguish a document?
Why it exists
Two documents can repeat a query word equally often. Weighting the rarer query term more heavily can bring the more specific match toward the top.
Words to know
- Document frequency
- The number of documents containing a term, counting each document at most once.
How it works
Step through the idea, or press Play.
Count documents. One word appears in 10 of 1,000 documents.
Understand it
Worked example
TF-IDF and term rarity in practice
In 1,000 documents a word found in ten has unsmoothed IDF ln(100), about 4.61. A word in 500 has ln(2), about 0.69. At equal frequency the rarer word contributes more in this variant.
Related case
Why did this document rank first?
An internal engineering search returns a long glossary above a precise two-paragraph runbook. Another user cannot find a document they just published.
Check refresh, terms and access filters.