Challenge: Tokenization
Завдання
Swipe to start coding
Your are given an excerpt from 'The Adventures of the Musgrave Ritual' in text
variable. You need to tokenize the last sentence. To do this:
- Import necessary functions.
- Tokenize
text
into sentences and save the result insentences
. - Take the last sentence, convert it to lowercase, and save in
last_sentence
. - Tokenize the
last_sentence
into words and save the result intokens
.
Use the nltk
functions for this purpose.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!