juniorNLP

What is bag-of-words model?

Updated May 17, 2026

Short answer

Bag-of-words represents text as word frequency vectors ignoring grammar and order.

Deep explanation

BoW converts text into a sparse vector where each dimension corresponds to a word in the vocabulary. It captures frequency but loses syntax and context.

Real-world example

Used in simple spam classification systems.

Common mistakes

  • Ignoring word order limitations.

Follow-up questions

  • How is TF-IDF different from BoW?
  • Why is BoW inefficient?

More NLP interview questions

View all →