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

Stryg for at vise menuen

book
Challenge: Tokenization

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

Awesome!

Completion rate improved to 3.45

book
Challenge: Tokenization

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

close

Awesome!

Completion rate improved to 3.45

Stryg for at vise menuen

some-alt