Text features, explained simply
A model works with numbers, not meanings. To learn from text, words first have to be turned into numbers. Those numbers become the model’s features.
One simple method is counting: how many times does each word appear in a message? A review containing "brilliant" and "fun" several times is probably positive. A model can learn which words go with which labels.
Counting words is a good start, but it throws away word order. Modern language models use far richer number patterns that capture how words relate to one another.
Example: Counting words in reviews
- "Fun game, really fun!" → fun: 2, game: 1, really: 1
- "Boring and slow" → boring: 1, slow: 1
- After many labelled reviews, the model learns that "fun" leans positive and "boring" leans negative.
Try this
- Pick a short story paragraph and tally the five most common words. What do they tell you?
- Write two messages with exactly the same words in a different order but a different meaning.
- Guess whether a film review is happy or grumpy from just three of its words.
