7 Finding kernels of knowledge in text with CNNs
This chapter covers
- Understanding neural networks for NLP
- Finding patterns in sequences
- Building a convolutional neural network with PyTorch
- Training a convolutional neural network
- Training embeddings
- Classifying text
In this chapter, you will unlock the misunderstood superpowers of convolution for natural language processing (NLP). This will help your machine understand words by detecting patterns in sequences of words and how they are related to their neighbors.
Convolutional neural networks (CNNs) are all the rage for computer vision (image processing), but few businesses appreciate the power of CNNs for NLP. This creates an opportunity for you in your NLP learning and for entrepreneurs that understand what CNNs can do. For example, in 2022, Cole Howard and Hannes Hapke (coauthors of the first edition of this book) used their NLP CNN expertise to help their startup automate business and accounting decisions.1 And deep learning deep thinkers in academia, like Christopher Manning and Geoffrey Hinton, use CNNs to crush the competition in NLP. You can too.