I am using below code to use stopwords through jupyter hub, I have hosted jupyter hub on AWS DLAMI Linux server.
$python3 -m nltk.downloader stopwords
$python3 -m nltk.downloader words
$python3 -m nltk.downloader punkt
python3
from nltk.corpus import stopwords
stop_words = set(stopwords.words("english"))
print(stop_words)
This works fine while running in python terminal.
But when I try below in Jupyternotebook its failing with error. Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:
When i try to download in python3 terminal I see its already upto date.
>>> import nltk
>>> nltk.download('stopwords') [nltk_data] Downloading package stopwords to /root/nltk_data... [nltk_data] Package stopwords is already up-to-date! ](url)
But when tried through jupyter hub download is timing out. Ideally download is not required if its up to date. So is there a configuration in jupyter hub to handle this.