Skip to Content
Deep Learning with PyTorch
book

Deep Learning with PyTorch

by Vishnu Subramanian
February 2018
Intermediate to advanced
262 pages
6h 59m
English
Packt Publishing
Content preview from Deep Learning with PyTorch

Training word embedding by building a sentiment classifier

In the last section, we briefly learned about word embedding without implementing it. In this section, we will download a dataset called IMDB, which contains reviews, and build a sentiment classifier which calculates whether a review's sentiment is positive, negative, or unknown. In the process of building, we will also train word embedding for the words present in the IMDB dataset. We will use a library called torchtext that makes a lot of processes such as downloading, text vectorization, and batching much easier. Training a sentiment classifier will involve the following steps:

  1. Downloading IMDB data and performing text tokenization
  2. Building a vocabulary
  3. Generating batches of ...
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

Deep Learning with PyTorch

Deep Learning with PyTorch

Eli Stevens, Thomas Viehmann, Luca Pietro Giovanni Antiga
Grokking Deep Learning

Grokking Deep Learning

Andrew W. Trask

Publisher Resources

ISBN: 9781788624336Supplemental Content