Tools
The course uses Python throughout. Most lectures come with Jupyter notebooks, and the assignments involve practical work on real-world text data, so bring your own computer.
Python setup
Any recent Python (3.11+) works. The simplest route is the Anaconda distribution, which bundles Python, Jupyter, and most of the libraries we use.
If you prefer a leaner setup:
python -m venv .venv
source .venv/bin/activate # Windows: .venvScriptsactivate
pip install pandas numpy scikit-learn nltk torch jupyter matplotlib Libraries we use
| Library | Used for |
|---|---|
pandas / numpy | Data handling and numerics |
nltk | Classic NLP: tokenization, stemming, stop-words |
scikit-learn | Vectorizers, classifiers, topic models |
gensim | Word embeddings and topic modelling |
torch (PyTorch) | Neural language models (lectures 4, 7–9) |
tiktoken | Byte-pair-encoding tokenizers (lecture 7) |
Editor
We recommend VS Code with the Python and Jupyter extensions — it is free and runs notebooks natively. JupyterLab or the classic Jupyter Notebook interface work just as well.
Working with the notebooks
Lecture notebooks are published on each lecture page as the course progresses. Download the notebook and the accompanying data files, put them in the same folder, and run them top to bottom before the lecture if you want a head start.