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 different characteristics than RNNs that make them suitable for NLP tasks where detecting linguistic patterns is important, such as text classification.