Problem installing and using NLTK library - Python
I have installed the NLTK library to process some text. So I want to get the number of tokens/words of a list of texts.
To do that, I first imported word_tokenize using:
from nltk.tokenize import word_tokenize
Then I ran the following lines of code:
content = list(sms['message'])
At this point, I'm getting the following error which I don't know how to solve :(.
I am new using repl.it so I would really appreciate your help.
The error says: Resource punkt not found.
Please use the NLTK Downloader to obtain the resource:
how do I do that from the console in repl.it?
Solved! I typed import nltk in the console and then I typed nltk.download('punkt') as it was suggested in the error message. It worked fine when I ran the code again. Thanks