n-grams

Consecutive word groups

N-grams are contiguous sequences of items from a text or speech sample, where n represents the number of items in each sequence.

In computational linguistics and natural language processing, these items are typically words or characters.

A bigram (2-gram) captures two adjacent words: the cat from "the cat sat." A trigram (3-gram) captures three: the cat sat.

N-grams help computers analyze language patterns, predict text, and power search engines and autocomplete features.

The spam filter uses n-gram analysis to detect suspicious emails.

linguistics

bigrams

Two-letter sequences

collocation · co-occurrence · frequency · concordance · lexical · syntax · morphology · phraseology · stemming · text mining

statistics

frequency

Rate of recurrence

probability · co-occurrence · dispersion · correlation · Bayesian · inference · smoothing · perplexity · counting · ranking

sequence

pattern

Recurring arrangement or template

  • orderMethodical arrangement or request
  • stringSlender fiber or character sequence
  • chainLinked segments forming length

concatenation · contiguous · overlap · adjacency · succession · preceding · following · span · substring

applications

machine translation

Automated cross-lingual text conversion

spell checking · plagiarism detection · search engines · OCR · chatbots

Opposites
textual unit granularity

n-gramsparagraphs

Distinct units of prose

corpus · discourse

Family

monogram, grams, pentagram, hexagram, trigram, bigram, decagram

Familiarity
Top 1,000,000
Profile
Used worldwide · Timeless · Abstract · Rated G