Lesson 3: Sentence embeddings: one vector per message
56 min read·14 Oct 2026
Module 6 · Lesson 3 · About 50 minutes · Needs: basic Python; Module 4 Lessons 2 and 4 (TF-IDF, cosine, logistic regression) help; Lessons 1 and 2 of this module help but are not required
The situation
It is Wednesday 14 October 2026, project week 6. Ines keeps meeting messages that use none of the words she expects. Rosa asks: if a model compared whole messages by meaning, would it route better than TF-IDF, and could it group the inbox without labels?
One message runs through the lesson: HT28 from the hand-written test set (simulated). It reads "brakes squealing like a banshee lol. book me in?" Ines labels it repair_booking. Its nearest training message by TF-IDF is a price question that matched on "me in".