Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Tokenization | Text Preprocessing Fundamentals
Introduction to NLP

Swipe to show menu

book
Challenge: Tokenization

Task

Swipe to start coding

Your are given an excerpt from 'The Adventures of the Musgrave Ritual' in text variable. You need to tokenize the last sentence. To do this:

  1. Import necessary functions.
  2. Tokenize text into sentences and save the result in sentences.
  3. Take the last sentence, convert it to lowercase, and save in last_sentence.
  4. Tokenize the last_sentence into words and save the result in tokens.

Use the nltk functions for this purpose.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 3.45

book
Challenge: Tokenization

Task

Swipe to start coding

Your are given an excerpt from 'The Adventures of the Musgrave Ritual' in text variable. You need to tokenize the last sentence. To do this:

  1. Import necessary functions.
  2. Tokenize text into sentences and save the result in sentences.
  3. Take the last sentence, convert it to lowercase, and save in last_sentence.
  4. Tokenize the last_sentence into words and save the result in tokens.

Use the nltk functions for this purpose.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 3.45

Swipe to show menu

some-alt