Hands-On Natural Language Processing with PyTorch 1.x by Thomas Dop

Hands-On Natural Language Processing with PyTorch 1.x by Thomas Dop

Author:Thomas Dop
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2020-07-09T00:00:00+00:00


Let's get started!

Technical requirements

All the code for this chapter can be found at https://github.com/PacktPublishing/Hands-On-Natural-Language-Processing-with-PyTorch-1.x.

Exploring CNNs

The basis for CNNs comes from the field of computer vision but can conceptually be extended to work on NLP as well. The way the human brain processes and understands images is not on a pixel-by-pixel basis, but as a holistic map of an image and how each part of the image relates to the other parts.

A good analogy of CNNs would be how the human mind processes a picture versus how it processes a sentence. Consider the sentence, This is a sentence about a cat. When you read that sentence you read the first word, followed by the second word and so forth. Now, consider a picture of a cat. It would be foolish to assimilate the information within the picture by looking at the first pixel, followed by the second pixel. Instead, when we look at something, we perceive the whole image at once, rather than as a sequence.

For example, if we take a black and white representation of an image (in this case, the digit 1), we can see that we can transform this into a vector representation, where the color of each pixel is denoted by a 0 or a 1:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.