Building language model using CNN + word2vec

Now that we have learned core computational linguistics concepts and trained relations from the provided dataset, we can use this learning to implement a language model which can perform a task. 

In this section, we will build a text classification model to perform sentiment analysis. For classification, we will be using a combination of CNN and a pre-trained word2vec model which we learned in the previous section of this chapter. 

This task is the simulation of our hypothetical business use case of taking text responses from restaurant patrons and classifying what they text back into meaningful classes for the restaurant.

We are inspired by Denny Britz's (https://twitter.com/dennybritz) work on Implementing a CNN for Text Classification in TensorFlow (http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/) in our own CNN and text classification build.  We invite you to review the blog he created to gain a more complete understanding of the internal mechanisms that make CNN's useful for text classification.

As an overview, this architecture starts with an input embedding step, then a 2D convolution utilizing max pooling with multiple filters and softmax activation layer producing the output.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset