Type a word into a search box and something has to decide which of the million matching documents to show first. For decades, that something was TF-IDF — a formula invented by Gerard Salton and colleagues in the 1970s that is still woven into every modern search system.
The idea starts with a puzzle. The word "the" appears in every English document. If you search for "the", every document matches equally — that is useless. Conversely, the word "eigenvalue" appears in very few documents. If your document uses it a lot, that is a strong signal it is about eigenvalues.
TF-IDF captures this trade-off in two multiplied pieces:
- TF (term frequency): how often the word appears in this document, normalized by document length.
- IDF (inverse document frequency): , where is the total number of documents and is how many contain the word. Rare words get a high IDF; universal words get near zero.
Multiply them together and you have a score that rises when a word appears often here and rarely elsewhere — exactly the words that characterize a document.
Comments
Loading comments...