22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11

Down the Yellow Brick Rabbit Hole

Spoilers

In this chapter, we will:

• learn about many useful packages for natural language processing (NLP):

NLTK, Gensim, flair, and HuggingFace

• build our own dataset from scratch using HuggingFace’s Dataset

• use different tokenizers on our dataset

• learn and load word embeddings using Word2Vec and GloVe

• train many models using embeddings in different ways

• use ELMo and BERT to retrieve contextual word embeddings

• use HuggingFace’s Trainer to fine-tune BERT

• fine-tune GPT-2 and use it in a pipeline to generate text

Jupyter Notebook

The Jupyter notebook corresponding to Chapter 11 [156] is part of the official Deep

Learning with PyTorch Step-by-Step repository on GitHub. You can also run it

directly in Google Colab [157] .

If you’re using a local installation, open your terminal or Anaconda prompt and

navigate to the PyTorchStepByStep folder you cloned from GitHub. Then, activate

the pytorchbook environment and run jupyter notebook:

$ conda activate pytorchbook

(pytorchbook)$ jupyter notebook

If you’re using Jupyter’s default settings, this link should open Chapter 11’s

notebook. If not, just click on Chapter11.ipynb in your Jupyter’s home page.

880 | Chapter 11: Down the Yellow Brick Rabbit Hole

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!