One of the most popular metrics used in search relevance, text mining, and information retrieval is the term frequency-inverse document frequency (TF-IDF) score. In essence, TF-IDF measures how significant a word is to a particular document. The TF-IDF metric therefore only makes sense in the context of a word in a document that's part of a larger corpus of documents.
Imagine you have a corpus of documents, such as blog posts on varying topics, that you want to make searchable. The end user of your application runs a search query for fashion style. How do you then find matching documents and rank them by relevance?
The TF-IDF score is made of two separate but related components. The first is term frequency, or the relative frequency of a specific term in a given document. If a 100-word blog post contains the word fashion four times...