Define n-grams

746    Asked by KaylaShinn in Data Science , Asked on Nov 9, 2019
Answered by Kayla Shinn

N-grams are used in text preprocessing tasks and they are a combination of words occur in a given window. They can consist of two combinations of words known as bi-grams,3 combinations of words known as tri-grams and so on. In a sentence X, if n is the number of words, then the number of n-grams will be

(N-grams)X=n-(g-1)

Where g=2 if bigrams, g=3 if trigrams and so on.


This is how n-gram work.



Your Answer

Interviews

Parent Categories