Skip to main content

From "Hello" to "Bonjour" 2: Bringing AI to Life

From "Hello" to "Bonjour": Bringing AI to Life 


I recently revisited one of my favourite projects based around using Machine Learning for Kids and Scratch 3, and the result was surprisingly elegant. For STEM educators and makers, this is more than just a coding trick; it’s a gateway to AI literacy and global communication.  

It started with a simple question: Could I make a computer not just hear me, but understand my intent across languages? I’m always looking for that "Aha!" moment—the point where the complexity of high-level tech melts away into a simple, working project - and is cool. The end goal has changed since the original project from getting it to just saying a prescribed phrase to translating typed-in phrases when it hears "French" - it is even cooler than before.



The Journey: Making the Connection

I sat down with the goal of creating a "Polyglot Sprite." The setup through the Machine Learning for Kids Scratch template was remarkably straightforward. I didn’t need to be a data scientist; I just needed a clear logic flow.

The magic happens when you combine three specific extensions:

  1. Speech to Text: To let the computer "listen."

  2. Translate: To bridge the language gap.

  3. Machine Learning Blocks: To handle the triggers.

The logic was simple: if I said "Hello," the sprite responded in English. If I say "French," the system toggles a state, and the next "Hello" triggers a "Bonjour." Seeing it work for the first time—realising that I had built a functional translator with just a few blocks—was incredibly satisfying. It’s that specific moment of success I want every student to feel.


How to Build It: A Step-by-Step Guide

This project doesn’t require you to train a new model from scratch. We’re going to use the pre-trained models available in the special ML4K version of Scratch 3.

1. Launch the Environment

Open the Machine Learning for Kids Scratch editor. Note: You must use this specific URL rather than the standard Scratch site to access the specific AI extensions required for this project.

2. Add Your "Superpowers" (Extensions)

Click the Blue Extension Button (bottom-left corner) and add these three tools:

Image shows what the speech to text block looks like.
Figure 1: Extension for Speech to Text


  • Speech to Text: This allows the computer to use your microphone.

  • Translate: This gives your sprite its "inner dictionary."

  • Text to Speech: So your sprite can talk back!

Show two extension blocks need one Text to Speech the other the translate
Figure 2: Remaining extensions needed.




3. Coding the "English" Logic

First, let's make the sprite respond to a basic "Hello."

  • Drag a when green flag clicked block (from the standard Events menu).

  • Add a listen and wait block (from the Speech to Text menu).

  • Using a 

  • Inside the block, use the speak block to say "Hello!" back.

Shows the Stratch 3 code for getting the system to listen and respond with hello when it hears hello.
Figure 3: The code for Coding the "English" Logic


What to Expect: When the Green Flag is clicked, it will start listening (once your microphone is set up), and when hello is said, it will say hello back.


4. Hello to Bonjour itself
  • Drag a translate block into the speak block. Change the language to French
Show the samll change of adding the translate block to turn hello into bonjour
Figure 4: Hello to bonjour

What to Expect: When the Green Flag is clicked, it will start listening (once your microphone is set up), and when hello is said, it will translate it inot French.


5. The "Switch" (Adding French)

Now, we create the logic to switch languages.

  • So it will wait until it hears the word "French" - Using the When I hear block anf this time instead of hello, French.

  • Have an input/ask block that waits for the a message to be typed in.

  • Using a speak block say the message in English (stored as answer)

  • Wait 1 second and then using a combination of the speak block and translation block turn the message (answer) into the French equivalent.


Scratch blocks showing the swirching to Frenach and then translating a typed message in English to spoken French.
Figure 5: Translating English to French

What to Expect: When the Green Flag is clicked, it will start listening ,  when Fench is said , the message block came up, type the message in and get the message read out in English and then (hopefully) in French.


How Does It Actually "Hear"? (The CS Bit)

When we talk to a computer, it doesn't "hear" words the way humans do. To keep it simple for students:

  • The Sound Library: Imagine the computer has a massive library of sound patterns (waveforms).

  • The Match Game: When you speak, the computer turns your voice into a digital pattern and quickly compares those sound waves to its library patterns.

  • The Verdict: If the pattern of your "Hello" matches the pattern in its library closely enough, it triggers the code.

A Note on Ethics: This is a great time to talk to students about Privacy. If a computer is waiting for a "trigger word," is it always listening? It’s a vital conversation for the modern digital citizen.


Taking it Off-Screen: The Maker Challenge

To turn this from a screen activity into a "Physical Computing" project, we need to build a home for our AI using "low-tech" recycled materials.

  • The Translation Booth: Use a cardboard box to create a mini-kiosk for the laptop or tablet. Decorate it with flags from around the world. It transforms the experience from "using a computer" to "interacting with a station."

  • The Robot Head: Cut a slot in a sturdy box for the screen (the "face"). When the sprite speaks "Bonjour," the "Robot" is talking to you!

The Educator’s Challenge: Once the basic "Hello" project (all the steps up to and including step 4) works, challenge your students: Can you make the sprite change its costume? If it detects 'French,' can it switch to a costume of a croissant or the Eiffel Tower?


Why This Matters

We are moving beyond teaching kids how to code; we are teaching them how to build systems that interact with the real world. By using a "one-word trigger" project, we remove the frustration of complex syntax and focus on the logic of AI and the joy of creation.

I’d love to hear how you might use this in your classroom or makerspace. What "Aha!" moments have your students had with AI? Let’s chat in the comments below!

All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Comments

Popular posts from this blog

Robot Software

In the previous blog posts for this 'series' "It is a good time...."  Post 1  looked at the hardware unpinning some of this positive rise in robots; Post 2  looked at social robots; Post 3  looked at a collection of small robots; Post 4 looked at further examples of small robots Robots, such as the forthcoming Buddy and JIBO, will be based some established open sourceand other technologies. Jibo will be based around various technologies including Electron and JavaScript (for more details see:  http://blog.jibo.com/2015/07/29/jibo-making-development-readily-accessible-to-all-developers/ ). Buddy is expected to be developed around tools for Unity3d, Arduino and OpenCV, and support Python, C++, C#, Java and JavaScript (for more details see http://www.roboticstrends.com/article/customize_your_buddy_companion_robot_with_this_software_development_kit ).  This post contin ues with some of the software being used with the smaller robots.  A number ...

Speech Recognition in Scratch 3 - turning Hello into Bonjour!

The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids , that is a brilliant use of Scratch 3 - Speech Recognition to control a sprite in an alien language. Do the activity, and it is very much worth doing, and it will make sense! I  would also recommend going to the  machinelearningforkids.co.uk   site anyway it is full of exciting things to do (for example loads of activities  https://machinelearningforkids.co.uk/#!/worksheets  ) . Scratch 3 has lots of extensions that are accessible through the Extension button in the Scratch 3 editor (see below) which add new fun new blocks to play with. The critical thing for this post is  Machine Learning for Kids  have created a Scratch 3 template with their own extensions for Scratch 3 within it  https://machinelearningforkids.co.uk/scratch3/ . One of which is a Speech to Text extension (see below). You must use this one ...

Scratch and web-cams in Scratch 3

Scratch 3 was launched on 2nd January 2019, so I wanted to know would Webcams still work with Scratch 3 as it did with Scratch 2. For example, in a previous post  Scratch, webcams, cats and explosions  the cat (Scratch) moved across the screen and a button burst when the object moved in the camera onto it.  Can the same thing be done in Scratch 3? The short answer is yes, but it is done slightly differently. The first change the video capture is not there in the blocks automatically; but is an extension that needs to be added. First, you need to add the extension blocks for video sensing. Go to the little icon at the bottom left of the screen (as shown below) this takes you to the extensions menu. Next, find the Video Sensing option and selected. The webcam, if enabled, with start automatically. A video sensing set of blocks is now in the list of block options.  The rest is very similar to doing this in Scratch 2. Moving ...