Naïve Bayes
This algorithm is used in AI for classification task. Initially this technique was used for email filtering. It compare two documents to identify spam emails. This technique finds which group of words are repeating in type of document. The group of words is referred to as bag-of-words.
Term Frequency – Inverse Document Frequency (TF-IDF)
Term Frequency – Inverse Document Frequency (TF-IDF) technique has similar approach, but compare frequency of words in one document with frequency of words in a whole corpus of documents. Based on context of word being used in documents, it can be classified. TF-IDF is used for information retrieval, to help in understanding which word is used for search.