AI Rookies

Bag-of-Words

Fact

A classic way to turn text into a vector of word counts.

In Plain Words

Bag-of-Words treats an essay like a Halloween candy bag. It counts each candy type, not the order you grabbed them.

People use it to sort texts and search them. It starts fast, but misses word order and context.

Related Concepts

Token
Bag-of-Words splits text into tokens, then counts how often they appear.

BM25
BM25 keeps the word-count idea and improves it for search.

Word2Vec
Word2Vec helps fix Bag-of-Words because it can catch similar meanings.

Embedding
Embeddings pack meaning better than simple word counts.