chapter seven
7 Convolutional Neural Networks
This chapter covers
- Solving text classification by detecting patterns
- Using convolutional layers to detect patterns and produce scores
- Using pooling layers to aggregate the scores produced by convolution
- Building a convolutional neural network (CNN) by combining convolution and pooling
- Building a CNN-based text classifier using AllenNLP
In previous chapters, we covered linear layers and RNNs, two main neural network architectures commonly used in NLP. In this chapter, we introduce another important class of neural networks called convolutional neural networks (CNNs). CNNs have very different characteristics from RNNs that make them suitable for NLP tasks where detecting linguistic patterns is important, such as text classification.
7.1 Introduction to convolutional neural networks
This section introduces convolutional neural networks (CNNs), another type of neural network architecture that operates in a very different way than how RNNs work. CNNs are particularly good at pattern matching tasks and increasingly popular in the NLP community.