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
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
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Can you explain this in more detail?
What are the main benefits or drawbacks?
Can you give an example?
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
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
Thanks for your feedback!
single