Digital Humanities, University of Bern Digital Humanities, University of Bern DH Lab
  • Lab
  • Programme
  • Assignment
  • Toolbox
  • Student Workflows
  • About
  • Intro to DH ↗
  1. Programme
  2. Session 9
  • Lab
  • Programme
    • Session 1
    • Session 2
    • Session 3
    • Session 4
    • Session 5
    • Session 6
    • Session 7
    • Session 8
    • Session 9
    • Session 10
    • Session 11
    • Session 12
    • Session 13
    • Session 14
  • Assignment
  • Toolbox
  • Student Workflows
    • How to add your workflow here
  • About

  • Introduction to DH (companion course)

On this page

  • In this session
  • Notebooks
  • Enough Python
  • NLP: from text to numbers
  • Topic modelling
  • Exercise
  • Edit this page
  • Report an issue
  1. Programme
  2. Session 9

Session 9

Introduction to Colab / Noto

Author
Affiliation

Tobias Hodel

Walter Benjamin Kolleg / Digital Humanities, University of Bern

Published

10 November 2026

Modified

2 September 2026

Hodel Taught by Tobias Hodel.

In this session

  • Notebooks: Google Colab and Noto (the Swiss academic JupyterHub)
  • Enough Python to run and adapt someone else’s analysis
  • Topic modelling as a worked NLP example
NoteYou are not expected to program

The aim is not to write code from scratch. It is to read a notebook, understand what each cell does, change the parts that concern your data, and know when the output is nonsense.

Notebooks

  • Cells, kernels, execution order — and why out-of-order execution ruins reproducibility
  • Markdown cells: a notebook is a document, not just a script
  • Colab versus Noto: convenience against data protection. Do not put sensitive or licensed material in Colab.
  • Installing packages, uploading data, saving results
  • Getting a notebook into Git, and why .ipynb diffs are unreadable

Enough Python

  • Variables, lists, dictionaries
  • Loops and conditions
  • Reading a file, writing a file
  • pandas for tabular data: load a CSV, filter it, group it, count it
  • Reading an error message — the single most useful skill in this session

NLP: from text to numbers

  • Tokenisation, and why it is language-specific
  • Stopwords, stemming, lemmatisation — what each throws away
  • Bag-of-words, TF-IDF
  • Where embeddings differ, briefly

Topic modelling

  • LDA: the intuition, without the mathematics
  • Choosing the number of topics — a decision, not a discovery
  • Preparing a corpus (the one from the Intro’s Voyant session)
  • Reading the output: are these topics, or artefacts?
  • Visualising with pyLDAvis
  • The critical question: a topic model always returns topics. How do you tell a finding from a pattern you imposed?

Exercise

Run the provided notebook on your own corpus. Change the number of topics three times. Write two sentences about what changed and whether any of it was informative.

TipIn parallel in the Intro

Data analysis: text corpora with Voyant Tools

Back to top
Session 8
Session 10
  • Edit this page
  • Report an issue