🔤N-gram
Also known as Bigram, Trigram, N-gram Model
A run of n words in a row, like 'green tea' for n = 2.
Think of it like
Think of it like you look at a line of words through a small hole. Then you slide it along.
Example
From 'I love green tea', the bigrams are 'I love', 'love green' and 'green tea'. A trigram model would see 'love green' and guess 'tea'.
Why it matters
N-grams are the simplest way to see how a computer can guess words from counts alone.
Definition
Common mistake
Key takeaways
- 1n words in a row. Two is a bigram, three a trigram.
- 2Counted in a corpus. How often each run appears.
- 3Short memory. Only the last few words count.