November 2018
Beginner to intermediate
182 pages
4h 48m
English
In order to try some of our classifiers, let's get the basic imports out of the way, as shown in the following code. Here, we will be importing the rest of the classifiers as we need them. This ability to import things later is important for ensuring we don't import too many unnecessary components into memory:
from sklearn.pipeline import Pipelinefrom sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
Since this section is simply for illustration purposes, we will use the simplest feature extraction steps, which are as follows:
We encourage you to try the code examples with better text vectorization (for example, using direct GloVe or word2vec lookups).
Read now
Unlock full access