← Natural Language Processing learning pathNatural Language Processing · Module 3 of 10
Representing text as numbers
Turn words into vectors models can use.
📖 Key ideas
- Bag of Words counts word occurrences.
- TF-IDF weights words important to a document but rare overall.
- Word embeddings (Word2Vec, GloVe) capture meaning in dense vectors.
- Similar words have nearby vectors.
- 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