Shakespeare: from http://www.gutenberg.org/ebooks/100 Classifying author by naive Bayes over 2-gram bag of words. The example is just notional. In practice you would want more features (NLP, word2vec), feature pruning (remove proper names) and more sophisticated statistics (author-topic modeling, latent Dirichlet allocation).