Natural Language Processing · BSc AI

Natural
Language
Processing

An Interactive Course Guide

An 8-week, 10-lecture hands-on course spanning the full NLP stack — from statistical language models and word embeddings through CNNs, LSTMs, Transformers, fine-tuning, and RAG. Built around a continuous project with baselines, ablations, and rigorous evaluation at every stage.

8 Weeks · 10 Lectures Python · PyTorch · HuggingFace BSc AI · UGroningen WBAI059-05 · 5 ECTS · Ocasys ↗ Project-Based
8
Weeks
10
Lectures
6
Core Objectives
NLP
Primary Domain

Skills &
Prior Knowledge

This course is designed for students with a foundational background in programming and mathematics. The skill bars below indicate the recommended proficiency level entering the course. No prior NLP experience is required — only curiosity and rigour.

Python Programming Advanced
Linear Algebra & Statistics Intermediate
Machine Learning Fundamentals Intermediate
Deep Learning (PyTorch) Beginner
Probability Theory Intermediate
Command Line & Git Basic
Recommended entry level versus expected exit level (0 to 100): Python 88 to 95; Linear Algebra 70 to 82; Statistics 65 to 80; ML Fundamentals 65 to 88; Deep Learning 42 to 80; Git / CLI 45 to 72.

Core Learning
Outcomes

Master Text Preprocessing
Gain proficiency in tokenization, stemming, lemmatization, and text normalisation techniques for robust NLP pipelines.
Understand Language Models
Comprehend the principles behind n-gram models, neural language models, and the probability theory underpinning text generation.
Implement Core NLP Tasks
Build systems for text classification, sentiment analysis, POS tagging, and Named Entity Recognition from scratch.
Apply Deep Learning to NLP
Implement RNNs, LSTMs, and the Transformer self-attention mechanism for advanced sequence modelling problems.
Develop Practical Applications
Gain hands-on experience building machine translation, information extraction, and RAG-based question answering systems.
Analyse Ethical Implications
Critically assess and address bias, fairness, privacy, and responsible deployment in NLP systems and their societal impact.

8-Week
Course Plan

Click any week to expand ↓
Overview & Outcomes
  • NLP task landscape & why language is hard
  • Ambiguity, context, and linguistic structure
  • The standard NLP pipeline
  • Baselines, data splits, metrics, error analysis
  • Reproducible experiment setup
Lab / Deliverable
  • Create project repo: data/ src/ notebooks/ reports/
  • Implement dataset loading + train/dev/test split
  • Implement evaluation metrics (accuracy + F1)
  • Push code + short README explaining how to run
Required Reading
Jurafsky & Martin, Speech and Language Processing — Intro / Overview sections.
Overview & Outcomes
  • N-gram probabilities and perplexity
  • Sparsity: why smoothing & backoff are necessary
  • Laplace, Kneser-Ney smoothing
  • TF-IDF representation for classification
  • Logistic regression + F1 + confusion matrix
Lab / Deliverable
  • Implement trigram LM
  • Compute perplexity on dev set
  • Train TF-IDF + logistic regression baseline
  • Basic error analysis table (≥ 20 mistakes)
Required Reading
Jurafsky & Martin — Ch. 3: N-gram Language Models

Jurafsky & Martin — Ch. 4: Logistic Regression and Text Classification
Overview & Outcomes
  • Similarity vs. relatedness
  • Sparse (TF-IDF) vs. dense (word2vec) representations
  • Intrinsic evaluation: nearest neighbours
  • Extrinsic evaluation: downstream task performance
  • Bias in word embeddings
Lab / Deliverable
  • Train or load word embeddings
  • Inspect nearest neighbours + discuss limitations
  • Replace TF-IDF with embeddings in classifier
  • Baseline vs. embedding comparison + updated error analysis
Required Reading
Mikolov et al. (2013), Efficient Estimation of Word Representations in Vector Space

Jurafsky & Martin — Ch. 5: Embeddings
Overview & Outcomes
  • "Encoder → classifier" architecture for neural NLP
  • CNNs for sentence/document modelling
  • Hyperparameter tuning: kernel size, pooling, dropout
  • Fair comparison vs. classical baselines
Lab / Deliverable
  • Implement CNN-based text classifier
  • Add early stopping + dropout regularisation
  • Run one ablation: kernel size OR pooling OR dropout
  • Error analysis: 5–10 new errors + interpretation
Required Reading
Jurafsky & Martin — Ch. 6: Neural Networks

Kim (2014), Convolutional Neural Networks for Sentence Classification
Overview & Outcomes
  • BPTT and vanishing/exploding gradients
  • LSTM gating mechanism — forget, input, output
  • GRU: simplified gating
  • Bidirectional RNNs for contextual encoding
  • CNN vs. LSTM: tradeoffs in runtime & generalisation
Lab / Deliverable
  • Train LSTM classifier (same task as W04)
  • Add gradient clipping
  • CNN vs. LSTM comparison (same split, same metrics)
  • Model comparison write-up (≤ 1 page): failure modes, generalisation, complexity
Required Reading
Jurafsky & Martin — Ch. 13: RNNs and LSTMs

Hochreiter & Schmidhuber (1997), Long Short-Term Memory (skim)

Goldberg (2017), RNN/LSTM chapters (recommended)
Overview & Outcomes
  • Encoder–decoder modelling of P(y|x)
  • Bahdanau attention as soft alignment
  • Greedy vs. beam search decoding
  • BLEU: computation and critical interpretation
  • Qualitative analysis: reordering, adequacy, hallucination
Lab / Deliverable
  • Run greedy vs. beam decoding on MT model (toy or pretrained)
  • Compute BLEU scores
  • Qualitative analysis table: 10 examples (reordering / adequacy / hallucination)
  • Submit: best model so far + results summary
Required Reading
Jurafsky & Martin — Ch. 12: Machine Translation

Bahdanau et al. (2015), Neural Machine Translation by Jointly Learning to Align and Translate

Papineni et al. (2002), BLEU (skim)
Overview & Outcomes
  • Self-attention, masking, and positional encoding
  • Encoder-only vs. decoder-only vs. encoder–decoder
  • BERT: masked LM pretraining
  • GPT: autoregressive pretraining
  • Fine-tuning strategy & rigorous evaluation
Lab / Deliverable
  • Fine-tune a pretrained Transformer on your project task
  • Compare to Week 4/5 best model (same split, same metrics)
  • Run one robustness/slice test (length, domain slice, negation, etc.)
Required Reading
Jurafsky & Martin — Ch. 8: Transformers & Ch. 10: Masked Language Models

Vaswani et al. (2017), Attention Is All You Need

Devlin et al. (2019), BERT (recommended)
Overview & Outcomes
  • Sequence labelling: NER, POS tagging
  • Why structured decoding helps (CRF)
  • Extractive vs. generative QA
  • Closed-book vs. open-book (retrieval-augmented)
  • RAG pipeline: retriever + generator + faithfulness
Lab / Deliverable
  • Implement a simple NER model; evaluate span-F1
  • Build a minimal retrieval + generation pipeline
  • Evaluate correctness + faithfulness on held-out examples
Required Reading
Lafferty et al. (2001), Conditional Random Fields (skim)

Lewis et al. (2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (skim)

Real-World
NLP Applications

Machine Translation
Automatically translating text or speech across languages, breaking down communication barriers. Powered by neural sequence-to-sequence models and multilingual transformers.
Sentiment Analysis
Determining the emotional tone of text at scale — used for customer feedback analysis, brand monitoring, and social media intelligence across languages and domains.
Chatbots & Assistants
Conversational AI systems that understand and respond to natural language queries — from customer service automation to AI tutoring agents and RAG-powered knowledge systems.
Information Extraction
Automatically identifying structured information — entities, relations, events — from unstructured text. Core to search engines, biomedical NLP, and financial intelligence.
Spam & Content Filtering
Identifying and filtering malicious or harmful text content at scale — from email spam detection to hate speech moderation and content safety classification.
Writing Assistance
Grammar and style checking, text completion, essay evaluation — NLP tools that augment human writing. Includes automated assessment systems for educational settings.

Responsible NLP &
Societal Impact

As NLP technologies become more powerful and widely deployed, it is essential to engage critically with their societal effects. This course treats ethics not as a peripheral concern but as a core technical and intellectual discipline — woven throughout all eight weeks.

Algorithmic Bias in Text Data
NLP models trained on biased corpora can perpetuate and amplify societal stereotypes — in hiring tools, translation systems, and emotion classifiers. We study detection methods, debiasing techniques, and structural causes of representation harm.
Privacy & Data Security
Processing sensitive personal information in NLP applications raises fundamental privacy concerns. This includes differential privacy, anonymisation, GDPR compliance, and the particular challenges of training data memorisation in large language models.
Misinformation & Synthetic Text
Advanced text generation can create convincing misinformation and synthetic media. We examine detection methods, the arms race between generation and detection, and the societal responsibilities of NLP researchers and practitioners.
Environmental Sustainability
Training large language models carries significant computational and carbon costs. We discuss efficient model design, knowledge distillation, and the imperative for sustainable AI research practices and reporting.
Responsible AI Framework
Fairness
Equitable performance across demographic groups and languages
Transparency
Interpretable decisions, model cards, and datasheets
Privacy
Data minimisation, anonymisation, and GDPR compliance
Accountability
Clear responsibility chains for AI system outcomes
Societal Benefit
Designing NLP systems that advance human welfare equitably