July 2017
Intermediate to advanced
382 pages
9h 13m
English
One thing to do is to use n-gram counts instead of plain word counts. So far, we have relied on what is known as a bag of words: We simply threw every word of an email into a bag and counted the number of its occurrences. However, in real emails, the order in which words appear can carry a great deal of information!
This is exactly what n-gram counts are trying to convey. You can think of an n-gram as a phrase that is n words long. For example, the phrase Statistics has its moments contains the following 1-grams: Statistics, has, its, and moments. It also has the following 2-grams: Statistics has, has its, and its moments. It also has two 3-grams (Statistics has its and has its moments), and only a single ...
Read now
Unlock full access