An N-Gram

An N-gram is a contiguous sequence of ‘n’ items from a given sample of text or speech.

An N-Gram

Areas of application

  • {‘name’: ‘Text analysis’, ‘description’: ‘N-grams are used in text analysis to study the frequency and co-occurrence of words, phrases, or characters in a given text. For example, analyzing the N-grams in a news article can help identify the topics being discussed, the language style, and the level of complexity.’}
  • {‘name’: ‘Speech recognition’, ‘description’: ‘N-grams are used in speech recognition to model the patterns of sounds or words in spoken language. By analyzing the N-grams in a speech signal, the system can learn to recognize and transcribe the language more accurately.’}
  • {‘name’: ‘Machine learning’, ‘description’: ‘N-grams are used in machine learning to build models that can predict future observations based on past patterns. For example, in natural language processing, an N-gram model can be trained to predict the next word in a sentence based on the previous N-1 words.’}

Example

In the sentence ‘The quick brown fox jumps over the lazy dog’, there are three N-grams: ‘quick brown’, ‘brown dog’, and ‘dog lazy’.