Introduction: Sentence Classification with CNNs

Get an overview of convolutional neural networks and their application is sentence classification.

Why use CNNs?

Now, we’ll discuss a type of neural network known as convolutional neural networks (CNNs). CNNs are quite different from fully connected neural networks and have achieved state-of-the-art performance in numerous tasks. These tasks include image classification, object detection, speech recognition, and of course, sentence classification. One of the main advantages of CNNs is that, compared to a fully connected layer, a convolution layer in a CNN has a much smaller number of parameters. This allows us to build deeper models without worrying about memory overflow. Also, deeper models usually lead to better performance.

What are CNNs?

We’ll introduce what a CNN is in detail by discussing different components found in a CNN and what makes CNNs different from their fully connected counterparts. Then, we’ll discuss the various operations used in CNNs, such as the convolution and pooling operations, and certain hyperparameters related to these operations, such as filter size, padding, and stride. We’ll also look at some of the mathematics behind the actual operations. After establishing a good understanding of CNNs, we’ll look at the practical side of implementing a CNN with TensorFlow. First, we’ll implement a CNN to classify images and then use a CNN for sentence classification.

Get hands-on with 1200+ tech skills courses.