1. Learn
  2. /
  3. Courses
  4. /
  5. Deep Learning for Text with PyTorch

Connected

Exercise

Preprocessing text

Building a recommendation system, or any model, requires text to be preprocessed first.

A block of text from Sherlock Holmes is loaded here. Preprocess this text using the various techniques presented in the video to prepare it for further analysis.

The text variable is an excerpt from The Hound of the Baskervilles by Arthur Conan Doyle.

The following packages and functions have been loaded for you: nltk, torch, get_tokenizer, PorterStemmer, stopwords.

Instructions 1/3

undefined XP
    1
    2
    3
  • Initialize the tokenizer with "basic_english".
  • Tokenize the text using the tokenizer.