Lably
Skip to content

Tf–idf

Estimate of the importance of a word in a document

  • 8 min read
  • 9 chapters

Learn it on Lably

It was often used as a weighting factor in searches of information retrieval, text mining, and user modeling. A survey conducted in 2015 showed that 83% of text-based recommender systems in digital libraries used tf–idf. Variations of the tf–idf weighting scheme were often used by search engines as a central tool in scoring and ranking a document's relevance given a user query.

One of the simplest ranking functions is computed by summing the tf–idf for each query term; many more sophisticated ranking functions are variants of this simple model.

Motivations

Karen Spärck Jones (1972) conceived a statistical interpretation of term-specificity called Inverse Document Frequency (idf), which became a cornerstone of term weighting:

The specificity of a term can be quantified as an inverse function of the number of documents in which it occurs.

For example, the df (document frequency) and idf for some words in Shakespeare's 37 plays might be represented as follows:

In the example above, "Romeo", "Falstaff", and "salad" appears in very few plays; since only a handful of plays contain them, their appearance would significantly narrow down the possible list of plays. In contrast, "good" and "sweet" appear in every play and are completely uninformative as to which play it is.

Sign in to keep reading

8 more chapters are free with a Lably account.

More in Artificial Intelligence