← Back to course
AI and You 9-12 / Week 03 / Wednesday
3/6
Week 03 Β· How Models Learn

Wednesday

Explorer Lab: Train Tiny Text
// The crew trains Tiny Text by hand to see how training data becomes predictions
⏱ about 20 min

Wednesday: Explorer Lab: Train Tiny Text

Comet has copied all six sentences onto bright index cards and lined them up in a row. "Training day!" she says. "How hard can counting be?"

Wren clicks his watch. "Before we count, we predict. What word will follow 'the' most often in all six cards?"

Comet answers at once. "Library. It's everywhere."

"Maybe," Wren says. "What does the evidence say? Write the guess down, then let the tally decide."

Nova projects a big empty tally table on the wall. "Would you like a hint?" she asks. "Check your totals at the end. Every card gives four pairs."

Comet hands you the first card. "Reviewer, you count. I will check."

Your mission

Computers can learn from data, and machine learning finds patterns in data.

Today you train Tiny Text on all six cards. Training means counting every next-word pair into the tally table.

Then you check your totals, so you know no pair was missed.

  • Six index cards or six slips of paper
  • A pencil
  • A sheet of paper for the tally table
  1. Copy cards T1 to T6 from the table below, one sentence per card.
  2. Predict which word will follow "the" most often. Write your prediction at the top of your paper.
  3. On paper, copy the empty tally table below.
  4. Take card T1. Find its first pair, "the library," and make one tally mark for "library" in the "the" row.
  5. Slide over one word and tally the next pair. Keep going to the end of the card.
  6. Do the same for cards T2 to T6.
  7. Count the marks in each row and write each row total.
  8. Add the row totals. Six cards with four pairs each should give 24.
CardTraining sentence
T1the library opens at eight
T2the library has quiet rooms
T3the lab opens at nine
T4the lab has new desks
T5the library opens at eight
T6the gym opens at seven
After this wordNext words (your tally marks)Row total
the
library
lab
gym
opens
at
has
quiet
new
CHECK YOUR TRAINED MODEL
  • Read the question.
  • Tap your answer.
How many times does "library" follow "the" in all six cards?
What is the row total for "the"?
What is the row total for "at"?
Which word follows "at" most often?
All your row totals added together should make how many?

Here is the crew's trained model, so you can check every row.

After this wordNext words (tally)Row total
thelibrary 3, lab 2, gym 16
libraryopens 2, has 13
labopens 1, has 12
gymopens 11
opensat 44
ateight 2, nine 1, seven 14
hasquiet 1, new 12
quietrooms 11
newdesks 11
What the lab showsTrue or false?
Comet's prediction, "library," matches the tally.?
After "library," the word "opens" is more likely than "has."?
Tiny Text's tallies came from its training cards and nothing else.?
If the grand total is not 24, a pair was missed or counted twice.?
WHY THIS EXERCISEA model is only as good as the counts it was trained on, so checking totals matters.
On paper, draw your finished tally table neatly. Put your prediction at the top and the grand total of 24 at the bottom.

Excellent training, reviewer. Tomorrow the library changes its hours, and Tiny Text does not know.

← Tuesday