Module 11 · Lesson 6 of 13Pro
Text features: from word counts to embeddings
- Level
- Intermediate
- Reading time
- 17 min
When you finish this page you can
- Turn review text into a sparse TF-IDF matrix with scikit-learn, with the vocabulary learned from training rows only.
- Work out a TF-IDF weight by hand and explain why rare words count for more than common ones.
- Add pretrained sentence embeddings as features and name what they cost at training and at scoring time.
- Choose between TF-IDF and embeddings by testing both on validation, knowing when varied wording and few labels favour embeddings.