Challenge: Tokenization with Regex
Swipe to start coding
You are given a message in message
variable. You have to tokenize it into words using regex. To do this:
- Import necessary class.
- Convert
message
to lowercase and save inmessage_lower
. - Create a Regexp Tokenizer with correct pattern and save it in
word_tokenizer
. - Tokenize
message_lower
into words usingword_tokenizer
.
A word is a sequence of alphanumeric characters and underscores. '#NLPConference_20!'
, for example, contains one word: NLPConference_20
.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Summarize this chapter
Explain the code in file
Explain why file doesn't solve the task
Awesome!
Completion rate improved to 3.45
Challenge: Tokenization with Regex
Swipe to show menu
Swipe to start coding
You are given a message in message
variable. You have to tokenize it into words using regex. To do this:
- Import necessary class.
- Convert
message
to lowercase and save inmessage_lower
. - Create a Regexp Tokenizer with correct pattern and save it in
word_tokenizer
. - Tokenize
message_lower
into words usingword_tokenizer
.
A word is a sequence of alphanumeric characters and underscores. '#NLPConference_20!'
, for example, contains one word: NLPConference_20
.
Solution
Thanks for your feedback!
Awesome!
Completion rate improved to 3.45single