August 2018
Intermediate to advanced
522 pages
12h 45m
English
In this example, we want to show how a Multinomial Naive Bayes model can be employed to efficiently classify text data. The dataset is called 20 Newsgroups (http://qwone.com/~jason/20Newsgroups/) and it's already built-in in the scikit-learn (with all preprocessing steps already performed). There are 20,000 posts split into 20 categories, with a training set containing 11,314 posts and a test set with 7,532 posts. In Chapter 13, Introduction to Natural Language Processing, we are going to discuss the most common techniques that are necessary to transform a text into a numerical vector, however, for this example, it's enough to know that the dictionary contains 130,107 words and ...
Read now
Unlock full access