Challenge: Tokenization with Regex
Task
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
messageto lowercase and save inmessage_lower. - Create a Regexp Tokenizer with correct pattern and save it in
word_tokenizer. - Tokenize
message_lowerinto words usingword_tokenizer.
A word is a sequence of alphanumeric characters and underscores. '#NLPConference_20!', for example, contains one word: NLPConference_20.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 3.45
Challenge: Tokenization with Regex
Swipe to show menu
Task
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
messageto lowercase and save inmessage_lower. - Create a Regexp Tokenizer with correct pattern and save it in
word_tokenizer. - Tokenize
message_lowerinto words usingword_tokenizer.
A word is a sequence of alphanumeric characters and underscores. '#NLPConference_20!', for example, contains one word: NLPConference_20.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6
single