Overview - N-grams
What is it?
N-grams are groups of consecutive words or characters taken from a text. For example, a 2-gram (bigram) is a pair of words that appear next to each other. They help computers understand language by looking at small chunks instead of whole sentences. This makes it easier to find patterns and predict what comes next.
Why it matters
N-grams let machines capture simple language patterns without needing deep understanding. Without them, computers would struggle to guess the next word or find common phrases, making tasks like spell checking, search, and translation less accurate. They are a basic building block for many language tools we use every day.
Where it fits
Before learning N-grams, you should know what text data is and how words form sentences. After N-grams, learners often explore more advanced language models like neural networks or transformers that build on these ideas.