Our second example of feature learning will move away from images and towards text and natural language processing. When machines learn to read/write, they face a very large problem, context. In previous chapters, we have been able to vectorize documents by counting the number of words that appeared in each document and we fed those vectors into machine learning pipelines. By constructing new count-based features, we were able to use text in our supervised machine learning pipelines. This is very effective, up until a point. We are limited to only being to understand text as if they were only a Bag of Words (BOW). This means that we regard documents as being nothing more than a collection of words out of order.
What's more is that each word on its own has no meaning. It is only in a collection of other words that a document can have meaning when using modules such as CountVectorizer
and TfidfVectorizer
. It is for this reason that we will turn our...