Skip to Main Content
Hands-On Natural Language Processing with PyTorch 1.x
book

Hands-On Natural Language Processing with PyTorch 1.x

by Thomas Dop
July 2020
Beginner to intermediate content levelBeginner to intermediate
276 pages
6h 5m
English
Packt Publishing
Content preview from Hands-On Natural Language Processing with PyTorch 1.x

Chapter 6: Convolutional Neural Networks for Text Classification

In the previous chapter, we showed how RNNs can be used to provide sentiment classifications for text. However, RNNs are not the only neural network architecture that can be used for NLP classification tasks. Convolutional neural networks (CNNs) are another such architecture.

RNNs rely on sequential modeling, maintain a hidden state, and then step sequentially through the text word by word, updating the state at each iteration. CNNs do not rely on the sequential element of language, but instead try and learn from the text by perceiving each word in the sentence individually and learning its relationship to the words surrounding it within the sentence.

While CNNs are more commonly ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Natural Language Processing with Python

Hands-On Natural Language Processing with Python

Rajesh Arumugam, Rajalingappaa Shanmugamani

Publisher Resources

ISBN: 9781789802740Supplemental Content