Home · Academy · Robotics & Coding · Introduction to Data and AI · Introduction to Speech and Text Systems

Introduction to Speech and Text Systems

Learn how speech assistants and text systems work, and how to use them responsibly.

LESSON COMPASS

What will you use this page for?

Core idea

Voice assistants and text systems (chatbots, translation) are not magic; they are tools that turn speech into writing and writing into a likely reply by using patterns learned from many examples.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

Both speech and text systems get things wrong for the same basic reason: they are all guesses learned from data. If a topic appeared rarely in the data it learned from, it guesses weakly on that topic. If the data is biased (for example, it mostly heard one accent), it misreads other accents. If it learned from data…

Next connection

Artificial Intelligence Ethics

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteIntroduction to Image Recognition
ContentStandard lesson · 1,616 words
Last updated

One-sentence summary

Voice assistants and text systems (chatbots, translation) are not magic; they are tools that turn speech into writing and writing into a likely reply by using patterns learned from many examples.

Why does it matter?

You ask your phone, "What's the weather?" and a voice answers. You type a sentence into a translation app and it appears in another language. You ask a chatbot about your homework and within seconds it writes a long paragraph. These tools have become part of everyday life.

But if you do not know how they work, you can make two mistakes: either you believe everything they say without question, or you assume "they think and they know" and trust them far too much. This lesson is here to help you understand honestly what these systems do and what they do not do. In the previous lesson we saw how a computer recognises patterns in an image; now we look at the same idea in speech and text.

How do speech systems work?

A voice assistant is not really a single "brain"; it is a few steps that run one after another.

From speech to text

When you speak, the microphone turns your voice into a wave made of vibrations. The system breaks this wave into small pieces and compares them with patterns it learned from thousands of recorded human voices. It guesses the words by saying, in effect, "this sound piece is most likely an 'm', this one is an 'e'." This is called speech-to-text.

An important point: the system does not understand the *meaning* of your voice. It only guesses which words were most likely said. That is why it often gets things wrong in a noisy room, with an unfamiliar accent, or with an unusual name.

From text to speech

When the assistant replies, it does the opposite: it turns a written sentence back into a sound wave. This is called text-to-speech. The voice you hear is not a real person; it is a result built from recorded voice samples.

Example: When you say, "Set an alarm for seven in the morning," the system first turns your voice into text, then works out the command "07:00 alarm," then turns the sentence "Okay, I set an alarm for seven" into speech and reads it back to you.

How do text systems work?

Chatbots and translation tools also work with patterns, but with words directly rather than with sound.

Guessing the next word from a pattern

A chatbot has read a huge amount of writing and learned the pattern of "which word usually comes after which word." When you type a question, the bot builds an answer by guessing the most likely next words, one after another.

So the bot does not really "understand" your sentence or "think" the way you do. It is a very good guessing machine. Most of the time this guess is useful and looks correct, but sometimes it writes completely wrong information in a very confident tone. We call this making things up (sometimes called a "hallucination").

Translation is a guess too

Translation tools also learn patterns from millions of translated sentences. They say, "the match for this phrase in this language is usually this in the other language." They work well most of the time, but can slip on idioms, jokes and words with two meanings.

Example: A translation tool may sometimes translate the idiom "It's raining cats and dogs" word for word, as if animals were falling from the sky. But it really means "it is raining very heavily." The tool applies the pattern it sees, not the meaning.

Why do these systems make mistakes?

Both speech and text systems get things wrong for the same basic reason: they are all guesses learned from data.

That is why, when you get an important piece of information (a date, health advice, homework, news) from a bot, you need to check it against a reliable source. A bot "sounding sure" does not mean the information is correct.

Mini practice

We will not train a real AI model. Instead, we will see how a very simple rule-based system works: a small program that guesses whether a short message is rude or polite by looking at the words inside it. This shows that real systems also look at patterns, only on a much larger scale.

You can run this program on a computer, change the word lists, and watch how the result changes.

# A simple rule-based text classifier.
# This is not real AI; it just counts words.

polite_words = ["please", "thanks", "welcome", "hello"]
rude_words = ["stupid", "shutup", "nonsense"]

message = "Hello please can you help me"
words = message.lower().split()

polite = sum(1 for w in words if w in polite_words)
rude = sum(1 for w in words if w in rude_words)

if polite > rude:
    print("Guess: polite message")
elif rude > polite:
    print("Guess: rude message")
else:
    print("Guess: not sure")

Notice: This program cannot spot a rude word that is not in its list, and it could misclassify a sentence like "a stupidly good idea." Real systems are limited in exactly the same way; they have just learned patterns from far more examples. This experiment is here so you can see with your own eyes why a guessing machine can be wrong.

Common mistakes

Thinking the bot "thinks"

A chatbot does not feel, does not know and has no consciousness. It is a tool that guesses very well. Asking it "how do you feel?" and treating the reply as a real emotion is a mistake.

Accepting made-up information as true

When a bot writes a source, a date or a name, that information may be invented. Writing it in a confident tone does not make it correct. Always check important information.

Trusting translation blindly

Translation is usually good for short messages, but it can slip in a formal text, an idiom or a joke. For important texts, ask an adult or a second source to check.

Assuming the system understands every accent and voice equally

Voice assistants understand best the way of speaking they heard most. If it misunderstands you, that is not your fault; it is a limit of the system's data.

Safety note

Speech and text tools are useful, but some of them send what you type to their servers. So:

Lesson summary

Check questions

  1. What does speech-to-text do?
  2. How does a chatbot build an answer?
  3. What does "making things up" (hallucination) mean, and why is it dangerous?
  4. Why can a translation tool get idioms wrong?
  5. Why should you not type your personal information into an AI tool?

Answers

  1. It turns your spoken voice into a sound wave and, using learned patterns, guesses which words that sound was most likely, then writes them down. It guesses likely words, not meaning.
  2. By using the pattern of "which word comes after which word," learned from a huge amount of text, to guess the most likely next words one after another. It does not really think.
  3. It is when the bot writes wrong information as if it were true, in a confident tone. It is dangerous because people believe it easily since it sounds sure, and mistake wrong information for correct information.
  4. Idioms work by figurative meaning, not by the plain meaning of the words. The tool does not know the meaning; it applies the pattern it sees, so it can translate an idiom word for word and get it wrong.
  5. Because some tools send what you type to their servers, and that information could reach other people. Personal information should stay private and not be given to online tools.

Source and verification note

For “Introduction to Speech and Text Systems”, verification focuses on whether the relationship between How do speech systems work? and From text to speech remains consistent across examples. Datasets in this module are small and educational; real personal data should not be used. An AI result should be evaluated not only for accuracy but also for data balance, error distribution and explainability.

Next lesson

Artificial Intelligence Ethics

Start QuizBack to Introduction to Data and AI
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.