0PricingLogin
Learn AI with Python · Lesson

N-Gram Models

Analyzing text patterns.

1

N-Gram Models

N-Gram models are a fundamental concept in NLP. They analyze sequences of words or characters to identify patterns and relationships within text.

An N-Gram is a contiguous sequence of N items (words or characters) from a given text.

N-Gram Models — illustration 1

2

What Are N-Grams?

N-Grams are defined by the value of N:

  • Unigram (N=1): Single words (e.g., "I", "like", "NLP").
  • Bigram (N=2): Pairs of words (e.g., "I like", "like NLP").
  • Trigram (N=3): Triplets of words (e.g., "I like NLP").

All lessons in this course

  1. Working with Text Data
  2. Tokenization and Normalization
  3. N-Gram Models
  4. Sentiment Analysis Concepts
  5. Transformer-Based Models
← Back to Learn AI with Python