build multiword language models and analyze them with machine learning
an n-gram is a collection of n successive items in a text document that may include words, numbers, symbols, and punctuation. n-gram models are useful in many text analytics applications where sequences of words are relevant, such as in sentiment analysis, text classification, and text generation. n-gram modeling is one of the many techniques used to convert text from an unstructured format to a structured format. an alternative to n-gram is word embedding techniques, such as word2vec.
example
a language model incorporating n-grams can be created by counting the number of times each unique n-gram appears in a document. this is known as a model. in matlab, a bag-of-n-grams model can be created using a “bagofngrams” function.
once the language model is built, it can then be used with machine learning algorithms to build predictive models for text analytics applications. to learn more about n-grams and building models with text data, see text analytics toolbox™, for use with matlab®.
examples and how to
software reference
see also: natural language processing, sentiment analysis, word2vec, text mining with matlab, data science, deep learning, deep learning toolbox™, predictive maintenance toolbox™