Posts Tagged ‘scratch’

Exploring Language Models in Scratch with Machine Learning for Kids

Sunday, March 2nd, 2025

In this post, I want to share the most recent section I’ve added to Machine Learning for Kids: support for generating text and an explanation of some of the ideas behind large language models.


youtu.be/Duw83OYcBik

After launching the feature, I recorded a video using it. It turned into a 45 minute end-to-end walkthrough… longer than I planned! A lot of people won’t have time to watch that, so I’ve typed up what I said to share a version that’s easier to skim. It’s not a transcript – I’ve written a shortened version of what I was trying to say in the demo! I’ll include timestamped links as I go if you want to see the full explanation for any particular bit.

The goal was to be able to use language models (the sort of technology behind tools like ChatGPT) in Scratch.

youtu.be/Duw83OYcBik – jump to 00:19

For example, this means I can ask the Scratch cat:

Who were the Tudor Kings of England?

Or I can ask:

Should white chocolate really be called chocolate?

Although that is fun, I think the more interesting bit is the journey for how you get there.

(more…)

Using books data in Scratch

Sunday, May 19th, 2024

In this post, I want to share a Scratch extension that I’ve been working on today: enabling access to books data from the OpenLibrary API through new Scratch blocks.

Most of the work I do on Machine Learning for Kids involves adding machine learning models into Scratch. To enable students to create interesting projects, it also helps to make it easier to get external data into Scratch that they can use for training and classifying. A few examples of where I’ve done this in the past include creating Scratch blocks to access weather data, data from Spotify, and data from Wikipedia.

New blocks

The new blocks I’ve worked on today use the OpenLibrary API to enable access to information about books.

(more…)

MQTT extension for Scratch

Saturday, August 5th, 2023

screenshot

Extensions in Scratch let you add additional blocks to the palette. I’ve written about how to create extensions before, but in this post I want to share my latest extension which adds MQTT support.

I don’t have a particular Scratch project in mind for this yet, but publishing and subscribing to an MQTT broker from a Scratch project would allow multiple web browsers each running Scratch to communicate with each other. I’m sure there are some fun things this could be used for.

(more…)

Catching the carpool cheats

Monday, July 24th, 2023

I’ve added a new project worksheet to Machine Learning for Kids, based on the idea of a traffic camera in a carpool lane.

Students create training examples by labelling pictures of cars with random passengers in.


recording of creating the training examples at youtu.be/KtDrKcAwECU

(more…)

What children can learn about artificial intelligence

Sunday, May 21st, 2023

One of the conference presentations I gave last year was a talk at Heapcon, sharing some stories of AI/ML lessons I’ve run in schools. The focus of the talk was how I’ve seen children understand and react to machine learning technologies.

I’ve since expanded the ideas in this talk into a mini-book at MachineLearningForKids.co.uk/stories but here is a recording of where some of these stories started.

Using weather data in Scratch

Friday, March 31st, 2023

In this post, I want to share an example of Scratch projects that use live weather data.

At the Raspberry Pi Clubs Conference last week, I talked about the idea of Scratch projects that use live data: projects that do something different every time you run them, based on when or where they are run.

I love this idea. It’s something I’ve talked about many times – like when I tried bringing NASA data into Scratch, or when I built Scratch extensions for different web APIs, such as Wikipedia, Twitter, and Spotify.

I think doing this brings a new perspective to Scratch. Live data can bring projects to life.

So I thought I’d share another example: this time, weather data from Open Meteo.

(more…)

How to make your own Scratch extension

Thursday, March 23rd, 2023

A workshop I prepared for the Raspberry Pi Clubs Conference about how to create your own custom Scratch blocks.

This workshop is a step-by-step guide for how to create a Scratch extension.

I created it for educators and coding group volunteers, who would like to customize Scratch for their students by giving them new and unique blocks to create with. In particular, I wanted to make this accessible to people who perhaps don’t necessarily think of themselves as developers and wouldn’t otherwise know how to clone the Scratch Team repos and start hacking it.

I’ve wrapped all the complicated bits in scripts that set everything up, and prepared an online Scratch extension development environment – so everything can be done in a web browser without having to install or configure anything on your own computer.

I’ve included step-by-step instructions for building different types of Scratch extensions, including Scratch blocks based on web APIs, and Scratch blocks based on JavaScript modules from npm.


workshop video on YouTube

Teaching students that machine learning doesn’t always learn what we intend it to

Tuesday, January 3rd, 2023

This post was written for MachineLearningForKids.co.uk/stories: a series of stories I wrote to describe student experiences of artificial intelligence and machine learning, that I’ve seen from time I spend volunteering in schools and code clubs.

Some of the best lessons I’ve run have been where a machine learning model did the “wrong” thing. Students learn a lot from seeing an example of machine learning not doing what we want.

Perhaps my favourite example of when something went wrong was a lesson that I did on Rock, Paper, Scissors.

Students make a Scratch project to play Rock, Paper, Scissors. They use their webcam to collect example photos of their hands making the shapes of rock (fist), paper (flat hand), and scissors (two fingers) – and use those photos to train a machine learning model to recognise their hand shapes.

It this particular lesson, the project worked really nicely for nearly all the students. There was one student where things went a little bit wrong.

(more…)