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

LibraryUsed for
pandas / numpyData handling and numerics
nltkClassic NLP: tokenization, stemming, stop-words
scikit-learnVectorizers, classifiers, topic models
gensimWord embeddings and topic modelling
torch (PyTorch)Neural language models (lectures 4, 7–9)
tiktokenByte-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.

GRA 4164 Text as Data · Fall 2026 · BI Norwegian Business School