Introduction to Natural Language Processing: notebooks and data for the CourseLabs course, runnable in Google Colab. Course material CC BY 4.0.
Jupyter Notebook
0
1 commits
updated Sep 25, 2026
The notebooks of the CourseLabs course Natural Language Processing, ready to
run in Google Colab. Each lab is a folder; the shared data is in data/.
Click a badge to open a notebook in Colab, then run its first code cell. That
cell clones this repository, moves into the lab's folder, links data/,
installs the few packages Colab lacks and downloads the NLTK data, then prints
one line saying it is ready. Models download from Hugging Face as the notebook
first uses them. In a CourseLabs session the same cell does nothing, because
everything is already installed there.
To work on your own computer instead, download a lab's zip (the folder with its
data) or all the data, install the lab's
requirements.txt, and open the notebooks in Jupyter.
The checks in each notebook run anywhere. The one in Lab 11 that scores your fine-tuned model against held-out answers runs only in CourseLabs, and so do the checkpoint and the sign-off.
Folder: lab-nlp-01-why-cant-a-computer-read/. Download: lab-nlp-01-why-cant-a-computer-read.zip (the folder with its data).
01_01_Tokens.ipynb01_02_Normalising_Words.ipynb01_03_Tags_and_Entities.ipynb01_04_On_Your_Own.ipynbCredits: based on Chapter 1 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; HuggingFaceTB/SmolLM2-360M-Instruct; google-bert/bert-base-uncased.
Folder: lab-nlp-02-turning-words-into-numbers/. Download: lab-nlp-02-turning-words-into-numbers.zip (the folder with its data).
02_01_Bag_of_Words.ipynb02_02_TF_IDF.ipynb02_03_Similarity_and_Search.ipynb02_04_On_Your_Own.ipynbCredits: based on Chapter 2 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; SMS Spam Collection, Almeida and Gomez Hidalgo, UCI, CC BY 4.0, https://archive.ics.uci.edu/dataset/228/sms+spam+collection; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-03-teaching-a-machine-what-spam-looks-like/. Download: lab-nlp-03-teaching-a-machine-what-spam-looks-like.zip (the folder with its data).
03_01_Spam_and_the_Baseline.ipynb03_02_Logistic_Regression.ipynb03_03_Support_Vector_Machines.ipynb03_04_On_Your_Own.ipynbCredits: based on Chapter 3 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; SMS Spam Collection, Almeida and Gomez Hidalgo, UCI, CC BY 4.0, https://archive.ics.uci.edu/dataset/228/sms+spam+collection; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-04-which-classifier-and-why/. Download: lab-nlp-04-which-classifier-and-why.zip (the folder with its data).
04_01_Nearest_Neighbours.ipynb04_02_Naive_Bayes.ipynb04_03_Choosing_a_Classifier.ipynb04_04_On_Your_Own.ipynbCredits: based on Chapter 4 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; UCI Sentiment Labelled Sentences, Kotzias et al. (2015), CC BY 4.0, https://archive.ics.uci.edu/dataset/331/sentiment+labelled+sentences; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-05-words-as-points-in-space/. Download: lab-nlp-05-words-as-points-in-space.zip (the folder with its data).
05_01_Pretrained_Word_Vectors.ipynb05_02_Skip_Gram_in_PyTorch.ipynb05_03_Products_as_Words.ipynb05_04_On_Your_Own.ipynbCredits: based on Chapter 5 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; UCI Online Retail, Daqing Chen (2015), CC BY 4.0, https://archive.ics.uci.edu/dataset/352/online+retail; GloVe 6B 50d, Pennington, Socher and Manning (2014), PDDL 1.0, https://nlp.stanford.edu/projects/glove/.
Folder: lab-nlp-06-a-neuron-from-scratch/. Download: lab-nlp-06-a-neuron-from-scratch.zip (the folder with its data).
06_01_One_Neuron.ipynb06_02_XOR_and_Hidden_Layers.ipynb06_03_Activations_and_Loss.ipynb06_04_On_Your_Own.ipynbCredits: based on Chapter 6 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-07-how-a-network-learns/. Download: lab-nlp-07-how-a-network-learns.zip (the folder with its data).
07_01_Backprop_by_Hand.ipynb07_02_Optimisers_Raced.ipynb07_03_A_Recurrent_Network.ipynb07_04_On_Your_Own.ipynbCredits: based on Chapter 7 of Dr. Ernesto Lee's NLP book; Reuters-21578 ApteMod, downloaded by NLTK, CC BY 4.0, https://archive.ics.uci.edu/dataset/137/reuters+21578+text+categorization+collection.
Folder: lab-nlp-08-remembering-across-a-sentence/. Download: lab-nlp-08-remembering-across-a-sentence.zip (the folder with its data).
08_01_Inside_an_LSTM_Cell.ipynb08_02_LSTM_against_the_RNN.ipynb08_03_Reading_Both_Ways.ipynb08_04_On_Your_Own.ipynbCredits: based on Chapter 8 of Dr. Ernesto Lee's NLP book; UCI News Aggregator, Gasparetti (2016), CC BY 4.0, https://archive.ics.uci.edu/dataset/359/news+aggregator.
Folder: lab-nlp-09-from-one-language-to-another/. Download: lab-nlp-09-from-one-language-to-another.zip (the folder with its data).
09_01_Encoder_and_Decoder.ipynb09_02_Greedy_and_Beam.ipynb09_03_The_Bottleneck.ipynb09_04_On_Your_Own.ipynbCredits: based on Chapter 9 of Dr. Ernesto Lee's NLP book; English-Spanish pairs from the Tatoeba Project, CC BY 2.0 FR, https://tatoeba.org, as packaged by https://www.manythings.org/anki/.
Folder: lab-nlp-10-attention-is-the-whole-trick/. Download: lab-nlp-10-attention-is-the-whole-trick.zip (the folder with its data).
10_01_Attention_by_Hand.ipynb10_02_A_Transformer_Block.ipynb10_03_What_BERT_Looks_At.ipynb10_04_On_Your_Own.ipynbCredits: based on Chapter 10 of Dr. Ernesto Lee's NLP book; UCI News Aggregator, Gasparetti (2016), CC BY 4.0, https://archive.ics.uci.edu/dataset/359/news+aggregator; google/bert_uncased_L-4_H-256_A-4.
Folder: lab-nlp-11-bert-and-what-came-after/. Download: lab-nlp-11-bert-and-what-came-after.zip (the folder with its data).
11_01_Masked_Language_Modelling.ipynb11_02_Fine_Tuning_BERT.ipynb11_03_Question_Answering.ipynb11_04_On_Your_Own.ipynbCredits: based on Chapter 11 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; distilbert/distilbert-base-uncased-distilled-squad; google/bert_uncased_L-2_H-128_A-2; google/bert_uncased_L-4_H-256_A-4.
Folder: lab-nlp-12-large-and-small-language-models/. Download: lab-nlp-12-large-and-small-language-models.zip (the folder with its data).
12_01_Next_Token.ipynb12_02_Instructions_and_Prompts.ipynb12_03_Retrieval_and_Grounding.ipynb12_04_On_Your_Own.ipynbCredits: written for CourseLabs; Kittiwake Mobile data, invented for the course; HuggingFaceTB/SmolLM2-360M-Instruct; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-13-models-and-a-database-in-the-browser/. Download: lab-nlp-13-models-and-a-database-in-the-browser.zip (the folder with its data).
README.md to run it from a local static server.Credits: written for CourseLabs.
See LICENSE.md: the course material is CC BY 4.0, and the data keeps its original licences, with a link to each original.
Introduction to Natural Language Processing: notebooks and data for the CourseLabs course, runnable in Google Colab. Course material CC BY 4.0.
Jupyter Notebook
0
1 commits
updated Sep 25, 2026
The notebooks of the CourseLabs course Natural Language Processing, ready to
run in Google Colab. Each lab is a folder; the shared data is in data/.
Click a badge to open a notebook in Colab, then run its first code cell. That
cell clones this repository, moves into the lab's folder, links data/,
installs the few packages Colab lacks and downloads the NLTK data, then prints
one line saying it is ready. Models download from Hugging Face as the notebook
first uses them. In a CourseLabs session the same cell does nothing, because
everything is already installed there.
To work on your own computer instead, download a lab's zip (the folder with its
data) or all the data, install the lab's
requirements.txt, and open the notebooks in Jupyter.
The checks in each notebook run anywhere. The one in Lab 11 that scores your fine-tuned model against held-out answers runs only in CourseLabs, and so do the checkpoint and the sign-off.
Folder: lab-nlp-01-why-cant-a-computer-read/. Download: lab-nlp-01-why-cant-a-computer-read.zip (the folder with its data).
01_01_Tokens.ipynb01_02_Normalising_Words.ipynb01_03_Tags_and_Entities.ipynb01_04_On_Your_Own.ipynbCredits: based on Chapter 1 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; HuggingFaceTB/SmolLM2-360M-Instruct; google-bert/bert-base-uncased.
Folder: lab-nlp-02-turning-words-into-numbers/. Download: lab-nlp-02-turning-words-into-numbers.zip (the folder with its data).
02_01_Bag_of_Words.ipynb02_02_TF_IDF.ipynb02_03_Similarity_and_Search.ipynb02_04_On_Your_Own.ipynbCredits: based on Chapter 2 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; SMS Spam Collection, Almeida and Gomez Hidalgo, UCI, CC BY 4.0, https://archive.ics.uci.edu/dataset/228/sms+spam+collection; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-03-teaching-a-machine-what-spam-looks-like/. Download: lab-nlp-03-teaching-a-machine-what-spam-looks-like.zip (the folder with its data).
03_01_Spam_and_the_Baseline.ipynb03_02_Logistic_Regression.ipynb03_03_Support_Vector_Machines.ipynb03_04_On_Your_Own.ipynbCredits: based on Chapter 3 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; SMS Spam Collection, Almeida and Gomez Hidalgo, UCI, CC BY 4.0, https://archive.ics.uci.edu/dataset/228/sms+spam+collection; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-04-which-classifier-and-why/. Download: lab-nlp-04-which-classifier-and-why.zip (the folder with its data).
04_01_Nearest_Neighbours.ipynb04_02_Naive_Bayes.ipynb04_03_Choosing_a_Classifier.ipynb04_04_On_Your_Own.ipynbCredits: based on Chapter 4 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; UCI Sentiment Labelled Sentences, Kotzias et al. (2015), CC BY 4.0, https://archive.ics.uci.edu/dataset/331/sentiment+labelled+sentences; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-05-words-as-points-in-space/. Download: lab-nlp-05-words-as-points-in-space.zip (the folder with its data).
05_01_Pretrained_Word_Vectors.ipynb05_02_Skip_Gram_in_PyTorch.ipynb05_03_Products_as_Words.ipynb05_04_On_Your_Own.ipynbCredits: based on Chapter 5 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; UCI Online Retail, Daqing Chen (2015), CC BY 4.0, https://archive.ics.uci.edu/dataset/352/online+retail; GloVe 6B 50d, Pennington, Socher and Manning (2014), PDDL 1.0, https://nlp.stanford.edu/projects/glove/.
Folder: lab-nlp-06-a-neuron-from-scratch/. Download: lab-nlp-06-a-neuron-from-scratch.zip (the folder with its data).
06_01_One_Neuron.ipynb06_02_XOR_and_Hidden_Layers.ipynb06_03_Activations_and_Loss.ipynb06_04_On_Your_Own.ipynbCredits: based on Chapter 6 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-07-how-a-network-learns/. Download: lab-nlp-07-how-a-network-learns.zip (the folder with its data).
07_01_Backprop_by_Hand.ipynb07_02_Optimisers_Raced.ipynb07_03_A_Recurrent_Network.ipynb07_04_On_Your_Own.ipynbCredits: based on Chapter 7 of Dr. Ernesto Lee's NLP book; Reuters-21578 ApteMod, downloaded by NLTK, CC BY 4.0, https://archive.ics.uci.edu/dataset/137/reuters+21578+text+categorization+collection.
Folder: lab-nlp-08-remembering-across-a-sentence/. Download: lab-nlp-08-remembering-across-a-sentence.zip (the folder with its data).
08_01_Inside_an_LSTM_Cell.ipynb08_02_LSTM_against_the_RNN.ipynb08_03_Reading_Both_Ways.ipynb08_04_On_Your_Own.ipynbCredits: based on Chapter 8 of Dr. Ernesto Lee's NLP book; UCI News Aggregator, Gasparetti (2016), CC BY 4.0, https://archive.ics.uci.edu/dataset/359/news+aggregator.
Folder: lab-nlp-09-from-one-language-to-another/. Download: lab-nlp-09-from-one-language-to-another.zip (the folder with its data).
09_01_Encoder_and_Decoder.ipynb09_02_Greedy_and_Beam.ipynb09_03_The_Bottleneck.ipynb09_04_On_Your_Own.ipynbCredits: based on Chapter 9 of Dr. Ernesto Lee's NLP book; English-Spanish pairs from the Tatoeba Project, CC BY 2.0 FR, https://tatoeba.org, as packaged by https://www.manythings.org/anki/.
Folder: lab-nlp-10-attention-is-the-whole-trick/. Download: lab-nlp-10-attention-is-the-whole-trick.zip (the folder with its data).
10_01_Attention_by_Hand.ipynb10_02_A_Transformer_Block.ipynb10_03_What_BERT_Looks_At.ipynb10_04_On_Your_Own.ipynbCredits: based on Chapter 10 of Dr. Ernesto Lee's NLP book; UCI News Aggregator, Gasparetti (2016), CC BY 4.0, https://archive.ics.uci.edu/dataset/359/news+aggregator; google/bert_uncased_L-4_H-256_A-4.
Folder: lab-nlp-11-bert-and-what-came-after/. Download: lab-nlp-11-bert-and-what-came-after.zip (the folder with its data).
11_01_Masked_Language_Modelling.ipynb11_02_Fine_Tuning_BERT.ipynb11_03_Question_Answering.ipynb11_04_On_Your_Own.ipynbCredits: based on Chapter 11 of Dr. Ernesto Lee's NLP book; Kittiwake Mobile data, invented for the course; distilbert/distilbert-base-uncased-distilled-squad; google/bert_uncased_L-2_H-128_A-2; google/bert_uncased_L-4_H-256_A-4.
Folder: lab-nlp-12-large-and-small-language-models/. Download: lab-nlp-12-large-and-small-language-models.zip (the folder with its data).
12_01_Next_Token.ipynb12_02_Instructions_and_Prompts.ipynb12_03_Retrieval_and_Grounding.ipynb12_04_On_Your_Own.ipynbCredits: written for CourseLabs; Kittiwake Mobile data, invented for the course; HuggingFaceTB/SmolLM2-360M-Instruct; ibm-granite/granite-embedding-small-english-r2.
Folder: lab-nlp-13-models-and-a-database-in-the-browser/. Download: lab-nlp-13-models-and-a-database-in-the-browser.zip (the folder with its data).
README.md to run it from a local static server.Credits: written for CourseLabs.
See LICENSE.md: the course material is CC BY 4.0, and the data keeps its original licences, with a link to each original.