AI Basics · Lesson 2
How machines learn from examples
Learning from examples has three ingredients: examples (training data), a model with lots of adjustable numbers, and a training process that nudges those numbers until the model's guesses match the examples.
Below is a real mini-AI. You give it a few example messages for each label. It turns every sentence into numbers that capture its meaning, then learns which numbers point to which label.
Try it Yourself: Train a message sorter (Train your own AI)
Tip: Notice that it can label sentences it has never seen. That is the whole point of learning: generalising from examples to new cases.
Exercises
- The model thinks "Where is my parcel? It is 5 days late." is a Question, because it starts like one. Add better Complaint examples (for example about late deliveries), press Train again, and get it classified as a Complaint with at least 60% confidence.
- Put the steps of machine learning in order.