TF-IDF is a weighted model that's used to convert the text documents into vector models on the basis of the occurrence of words in the documents without considering the exact ordering of text in the document.
Let's consider a set of N text documents and any one document to be D. Then, we define the following.