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.
Two-letter sequences
- trigramsThree-symbol sequences
- tokenizationConverting input into discrete units
- corpusAssembled written works
- collocationConventional phrase pattern
co-occurrence · frequency · concordance · lexical · syntax · morphology · phraseology · stemming
Rate of recurrence
- distributionAllocation across recipients
- mutual informationQuantified shared uncertainty reduction
- chi-squareStatistic for categorical data
- probabilityQuantified chance of occurrence
co-occurrence · dispersion · correlation · Bayesian · inference · smoothing · perplexity · counting
Recurring arrangement or template
- orderMethodical arrangement or request
- stringSlender fiber or character sequence
- chainLinked segments forming length
- concatenationJoining items end-to-end
contiguous · overlap · adjacency · succession · preceding · following · span · substring
Automated cross-lingual text conversion
- speech recognitionMachines understanding human talk
- autocompleteSoftware-suggested text completion
- predictive textAlgorithm suggesting likely words
- spell checkingVerifying correct orthography
bigrams
Two-letter sequences
- trigramsThree-symbol sequences
- tokenizationConverting input into discrete units
- corpusAssembled written works
collocation · co-occurrence · frequency · concordance · lexical · syntax · morphology · phraseology · stemming · text mining
frequency
Rate of recurrence
- distributionAllocation across recipients
- mutual informationQuantified shared uncertainty reduction
- chi-squareStatistic for categorical data
probability · co-occurrence · dispersion · correlation · Bayesian · inference · smoothing · perplexity · counting · ranking
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
machine translation
Automated cross-lingual text conversion
- speech recognitionMachines understanding human talk
- autocompleteSoftware-suggested text completion
- predictive textAlgorithm suggesting likely words
spell checking · plagiarism detection · search engines · OCR · chatbots