What is Bag of Words & TF-IDF
Short answer
Bag of words is a simple way to represent text as a count of words it contains, while TF-IDF improves on this by weighing words based on how important they are across a set of documents.
Advertisement
AModel answer
Bag of words is a simple way to represent text as a count of words it contains, while TF-IDF improves on this by weighing words based on how important they are across a set of documents.
Real-world example
A search engine can use TF-IDF to rank which documents are most relevant to a search query based on important keywords.
Likely follow-ups
- What is Natural Language Processing, How is Bag of Words & TF-IDF evaluated in practice, What tools are commonly used for Bag of Words & TF-IDF
Related topics