← Natural Language Processing learning path
Natural Language Processing · Module 3 of 10

Representing text as numbers

Turn words into vectors models can use.

📖 Key ideas

  1. Bag of Words counts word occurrences.
  2. TF-IDF weights words important to a document but rare overall.
  3. Word embeddings (Word2Vec, GloVe) capture meaning in dense vectors.
  4. Similar words have nearby vectors.
  5. Contextual embeddings (BERT) change by sentence context.
💡 Real-life example: Embeddings put words on a map: "king" and "queen" live close, "banana" lives far away.
Bag of WordsWord count representation
TF-IDFTerm frequency-inverse document frequency
Word embeddingDense vector of word meaning
Contextual embeddingVector depending on sentence