AI engineering glossary · NLP embeddings
What is n-gram?
N-gram (also called Ngram): A contiguous run of n items, usually words or characters, taken from a text. Counting n-grams captures local word order and common phrases, and they serve as features for classifiers and as the building blocks of simple language models.
N-gram: an example
The word 3-grams of "I like hot chai" are "I like hot" and "like hot chai".
Related terms
More NLP embeddings terms
- N-gram language model
- Named entity
- Named entity recognition
- Natural language processing
- Natural language understanding
- Negative sampling
- NLTK
- One-hot word vector
Where you learn it
N-gram is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.