Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Stemming | Stemming and Lemmatization
Introduction to NLP

Stryg for at vise menuen

book
Challenge: Stemming

Opgave

Swipe to start coding

You are given some text in text variable. Your task is to tokenize this text, remove the stop words, and apply stemming on tokens. To do this:

  1. Import Porter Stemmer.
  2. Convert text to lowercase and save it in text_lower.
  3. Tokenize the text_lower string and save the result in tokens.
  4. Load English stop words, convert them to set, and save in stop_words.
  5. Filter out the stop words using list comprehension and save the result in filtered_tokens.
  6. Create a Porter Stemmer and save it in stemmer.
  7. Stem the tokens using list comprehension and save the result in stemmed_tokens.

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 2. Kapitel 2
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: Stemming

Opgave

Swipe to start coding

You are given some text in text variable. Your task is to tokenize this text, remove the stop words, and apply stemming on tokens. To do this:

  1. Import Porter Stemmer.
  2. Convert text to lowercase and save it in text_lower.
  3. Tokenize the text_lower string and save the result in tokens.
  4. Load English stop words, convert them to set, and save in stop_words.
  5. Filter out the stop words using list comprehension and save the result in filtered_tokens.
  6. Create a Porter Stemmer and save it in stemmer.
  7. Stem the tokens using list comprehension and save the result in stemmed_tokens.

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