Checking term frequency
Term frequency measures the frequency of occurrence of a particular term (word or phrase) in a text. It displays the number of times the term appears in a text relative to the total number of terms in the text. It is very useful to analyze the importance of a term in a text. It is calculated by dividing the number of times the term appears in a text by the total number of terms in that text:
TF = number of times the term appears in a text / total number of terms in the text
The preceding result is a value between 0 and 1 representing the relative frequency of the term in the text.
Term frequency is commonly combined with Inverse Document Frequency (IDF) to produce a better measure of term relevance or importance. Before discussing IDF, we must first talk about two commonly used concepts we will encounter while analyzing text – documents and corpora. In simple terms, a corpus is a collection of documents. On the other hand, a document is a unit...