You can start by installing NLTK (Natural Language Toolkit) as any other Python package in DSS, by creating a code environment and adding "nltk" to your package requirements. To do so, follow thisdocumentation.
However, some functionalities of NLTK such as text corpora and language-specific models rely on resources which are not bundled in the library itself. The full list of available resources is available here.
To use these models, you need an additional download step. Typically, this can create issues on shared DSS nodes where users do not have write access to shared locations on the server (see User Isolation Framework).
1. Download NLTK Data for all users (recommended)
WARNING: this procedure needs command-line access and administrative privileges on the machine hosting DSS. You may need to speak to your DSS admin and/or Linux admin. Assuming you are on a Linux machine and have administrative privileges, run:
sudo python -m nltk.downloader -d /usr/share/nltk_data all
For macOS, the path is slightly different: /usr/local/share/nltk_data.
To test that it worked correctly, run the following code in a notebook using your code environment with nltk.
from nltk.corpus import brown