← Classical AI, NLP & Linguistics
Bag of Words
The bag-of-words model represents a document as an unordered multiset of its tokens, ignoring word order and sentence structure. Each document becomes a vector in vocabulary-sized space where each dimension counts or weights term occurrences. Despite its simplicity, bag-of-words paired with TF-IDF weighting is a strong baseline for text classification, sentiment analysis, and document retrieval. Its main limitation is that it discards all positional and semantic relationships among words.