Home › Glossary › NLP › Bag-of-words model

Beginner · NLP

Bag-of-words model

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A text representation that counts word occurrences, ignoring grammar and word order, to capture content.

Technical Definition

A text representation that counts word occurrences, ignoring grammar and word order, to capture content.

How it works

The bag-of-words (BoW) model is a common technique in natural language processing and information retrieval. It represents text as a collection of its words, where the frequency of each word is counted, but the order in which words appear is disregarded. This simplifies text into a feature vector suitable for machine learning tasks like classification.

Related Concepts

  • Feature Extraction — Deriving informative numerical signals from raw data for use as model inputs.
  • Natural language processing (NLP) — A field of AI enabling computers to understand, interpret, and generate human language.
  • Text Classification — The task of categorizing text documents into predefined classes or labels.

Further Reading

  • Wikipedia — Glossary of AI