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.

Level: beginnerTopic: NLP embeddings

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.