Advanced
Build your own chatbot
Try two ways a chatbot can answer the same message. Rules looks for keywords, assigns a label (like “help” or “hello”), then returns a prepared reply. Next-word builds a reply one word at a time: after each word, it shows the most likely next words and their chances, then picks one and continues. Compare runs both on one prompt so you can see the difference.
Rules mode
The bot scans your message for keywords, picks a category (intent), then returns a reply that was written in advance for that category. If nothing matches, it says it is unsure instead of inventing a long answer.
Next-word mode
The bot was “trained” on a fixed block of practice text on this page. It counts how often word B follows word A (and pairs of words). To write a reply, it keeps choosing a likely next word and adding it. Big chat apps use the same loop (add one piece, repeat), but with much larger training and different scoring.
Token and probability
Here a token is a word. Example: build a bot → build · a · bot.
Probability of a next word = how often that continuation showed up after the same previous word(s) in the practice text, divided by all continuations seen there. That is a teaching demo, not a guarantee the sentence is true or wise.
Try it
Type one message, choose a mode, then press Run. Nothing runs until you press the button.
Privacy tip: Don’t paste passwords, API keys, or private personal data. This lab runs in your browser. Next-word replies follow patterns in the practice text—they are not advice or verified facts. Privacy
Mode: Rules — keyword category, then a prepared reply.
Rules result
What the rules bot measured on your message. Tap a card if you want the term explained.
Next-word result
Chance of a next word = how often it followed the same previous word(s) in the practice text, divided by all options seen there. If those exact previous words never appeared together, the bot uses a shorter history (one previous word, then “any word”).
Compare
Prepared reply
Built one word at a time
Left: one category match, then a fixed reply for that category. Right: a chain of next-word choices from the practice text.
Ask Scout
Questions about words on this page, or a quick chat that uses the Rules bot. For the probability steps, use Next-word or Compare.
Mark this lab complete
When you’ve run at least one message and opened the step outputs, mark the lab complete. Progress is saved in this browser.
Lab complete
You tried a rules bot (category + prepared reply) and/or a next-word bot (pick each word from chances in the practice text). Compare puts both on the same message.
Trail Builders