Challenge: Stop Words
Tehtävä
Swipe to start coding
You are given some text in text
variable. Your task is to tokenize it and remove the stop words. To do this:
- Import necessary components.
- Convert it to lowercase and save in
text_lower
. - Load the English stop words list from
nltk
, convert it to aset
, and save it instop_words
. - Tokenize the
text_lower
string using theword_tokenize()
function and save the result intokens
. - Filter out the stop words from
tokens
using list comprehension and save the result intokens_clean
.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 8
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Suggested prompts:
Tiivistä tämä luku
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 3.45
Challenge: Stop Words
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
You are given some text in text
variable. Your task is to tokenize it and remove the stop words. To do this:
- Import necessary components.
- Convert it to lowercase and save in
text_lower
. - Load the English stop words list from
nltk
, convert it to aset
, and save it instop_words
. - Tokenize the
text_lower
string using theword_tokenize()
function and save the result intokens
. - Filter out the stop words from
tokens
using list comprehension and save the result intokens_clean
.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Awesome!
Completion rate improved to 3.45Osio 1. Luku 8
single