CRF showed us structured entity extraction. DIET showed us joint intent–entity learning. Now it’s time to move from theory to practice.
Understanding models is important. But models are useless without data, and this is where real NLU development begins.
So far, we’ve discussed how DIET works internally.
Now we answer the practical question: How do we actually train it?
Rasa training consists of three core steps:
- Create structured training data
- Configure the NLU pipeline
- Train the model
Let’s walk through each.
Generating Training Data
Rasa models learn entirely from annotated examples. Unlike rule-based systems, you don’t write logic, but you provide examples.
The NLU File
Rasa training data lives inside a YAML file, typically:
data/nlu.yml
version: "3.1"
nlu:
- intent: book_flight
examples: |
- Book a flight to [Paris](location)
- I want to fly to [Berlin](location)
- Get me a ticket to [London](location)
- intent: greet
examples: |
- Hello
- Hi
- Hey there
Notice:
- Intents are labels
- Entities are annotated inline
- No separate entity file
- No feature engineering DIET learns both tasks from this single dataset.
How Much Data Do You Need?
- There’s no magic number, but for general guidance:
- 10–15 examples per intent → minimum prototype
- 50–100 examples per intent → production baseline
- Diverse phrasing is nearly always better than repetitive patterns.
Bad example:
- Book a flight to Paris
- Book a flight to Berlin
- Book a flight to London
Good example:
- I need to travel to Paris
- Can you find flights to Berlin?
- Get me a ticket heading to London
- Fly me to Rome tomorrow
Variation teaches generalisation.
We've already covered the configuration of the pipeline, so those curious can read the intermediate blogs from the playlist to understand how the configuration works.
Training the Model
Once data and configuration are ready, training is simple:
rasa train
Behind the scenes, Rasa reads NLU data using it to build vocabulary. This is followed by initialises DIET model and running multiple training epochs
This is followed by optimising loss for intent + entity prediction, and those parameters are then saved as a trained model file.
models/20260215-123456.tar.gz
This folder contains:
- NLU model
- Dialogue model
- Metadata Now your assistant is runnable.
What Happens During Training?
Internally:
- Text is tokenised.
- Tokens are vectorised.
- Transformer layers process context.
- Intent and entity losses are computed jointly.
- Gradients update shared weights.
You don’t manually tune features.
Where the dev has to tune:
- epochs
- learning rate (advanced use)
- embedding dimensions
- batch size
Testing the Model
After training:
rasa shell nlu
Which activates a test server where you can truly experience the model yourself, asking prompts, testing limitations and forming improvements as you communicate.
For any input you will obtain the outputs as follows:
Say you type:
Book a flight to Madrid tomorrow
You can safely assume to obtain:
{
"intent": {
"name": "book_flight",
"confidence": 0.94
},
"entities": [
{
"entity": "location",
"value": "Madrid"
}
]
}
This is DIET in action, trained on your data.
Common Beginner Mistakes
Now to address a few common yet harmful beginner errors:
Improving data quality almost always improves performance more than tweaking architecture.
So you should focus on:
- Diverse phrasing
- Balanced intents
- Clear entity boundaries
- Avoiding overlapping intent meanings
Good data reduces ambiguity.
And try avoiding:
- Too few examples
- Overlapping intents
- Copy-paste variations
- Mixing business logic into NLU
- Ignoring real user phrasing
Always remember:
NLU predicts meaning, and it does not enforce workflow.
And that the training works by following:
Train → Test → Improve → Retrain.
Where We Go Next
Now that we know:
- How to generate training data
- How to configure DIET
- How to train a Rasa model
Next, we’ll connect NLU to dialogue training:
- Domain files
- Stories
- Rules
- Slot filling
- End-to-end training Because predicting intent is only step one. Building behaviour is step two. Now we begin building real assistants.
Until next time.
Top comments (0)