๐ฏ In this lesson, you will:
- Understand what natural language processing (NLP) is and how machines understand text
- Explore real-world tools that use NLP, like translators, chatbots, and emotion detectors
- Experiment with neural networks and tweak parameters like layers and learning rate
๐ Resources
๐ Week 2 Slides (update link)
๐ Week 2 Worksheet (Make a Copy) (update link)
๐น Starter Activity: Make a 5-Word Sentence
Tool: Word Synth
- Type a short sentence (e.g. โMy cat plays the pianoโ).
- Listen to how the machine โspeaksโ.
- It helps machines read, write, speak, and make sense of our words.
- Itโs used in tools like Google Translate, autocorrect, chatbots, and voice assistants.
๐ง Word Synth uses NLP and speech synthesis to turn your sentence into sound โ trained on real speech to sound realistic.
Dr. Dolittle talks to animals if you havenโt seen the film!
๐ Theory: What is NLP?
Natural Language Processing (NLP) is how computers understand, interpret, and generate human language.
It allows machines to read, write, and respond in ways that sound (mostly) natural.
๐ Real-world examples of NLP tools:
- Emotion Detector โ Try it: How does it โknowโ what you're feeling?
- Named Entity Recognition โ Try it: See how machines find names, places, and dates in text
- Text Completion โ Try it: Just like the tech behind ChatGPT and autocorrect
๐งฉ These tools all use neural networks to spot patterns in huge amounts of language data.
โจTask: Magic Text Transformations
- Use Google Translate
- Start with a simple sentence in English.
- Translate it through multiple languages (e.g., English โ French โ Japanese โ Spanish โ English).
- Read the final result โ is it the same? What changed?
๐ฌ Discussion prompts:
- What changed?
- What stayed the same?
- Why do you think the meaning sometimes shifts?
๐ง This activity shows how machines sometimes โmisunderstandโ - a key challenge in NLP.
๐ค Theory: What is a Neural Network?
A neural network is a kind of algorithm inspired by the human brain.
It spots patterns in data (like words or sounds) and makes predictions based on what itโs learned.
๐ In NLP, neural networks help with:
- Predicting the next word in a sentence
- Translating between languages
- Analysing tone or mood
- Answering questions (like ChatGPT!)
๐บ๏ธTask: Neural Network Playground
Tool: TensorFlow Playground
๐ฏ Try adjusting the following:
- Number of layers
- Number of neurons
- Learning rate
๐ Think about:
- How does performance change?
- Does the model learn faster or slower?
- Can it separate the two classes correctly?
This task connects to the idea of training models on language data โ and lets you tweak the kind of networks that power real NLP systems.
extension - make a multi instrument loop on word synth
โ Just a Minute!
NLP lets machines speak, listen, and understand us (but it's far from perfect!). What did you notice today that surprised you?
Discuss in pairs/small groups.