NLU Basics

NLU or natural language understanding is a process of teaching computers to comperehend and understand human languages. It extracts meaning out of written texts and transforms it into structured form.

Learn more

This page covers the basics of a NLU model. For instructions on how to do this in the Speechly Dashboard, see this article.

Intents and entities

Voice user interfaces require two distinct parts: first, the actual speech recognition (ASR) that transcribes speech input into text and second, the intent extraction that extracts intent and entities from the transcript.

If the user says “Kitchen lights, please” or “Switch on the kitchen lamp”, the intent is the same – to turn on some of the lights - but the way it’s said differs quite a lot. This is why you have to provide several sample utterances and annotate them accordingly to make the model understand different ways of interacting with the model.

In our previous example, we could say that the intent for both utterances is something like “TURN_KITCHEN_LIGHTS_ON”. To train the SLU model to understand all the different ways users can present this intent, you must give the models NLU examples. This is done in the Speechly Admin Dashboard by providing the annotated sample utterances. We should also create another intent for switching the lights off.

But our application shouldn’t be limited to switching on and off all the lights at the same time. We could create intents for all the rooms the users might have, but there’s a simpler way. We can identify certain parts of the utterance as entities and make our intent more general. If we change our intent to “TURN_LIGHTS_ON”, we can have a more general intention and then identify entities, properties for our intention. Entities are modifiers for the intent and always have a value.

In our TURN_LIGHTS_ON example, the different entities could be the rooms where the lights can be controlled. Now we have two intents (TURN_LIGHTS_ON and TURN_LIGHTS_OFF), and an entity called location, which can modify both of our intents.

We could also have an intent called CHANGE_COLOR that controls the color of the lights. This intent has two entities, the location entity we just defined, and another that modifies the color. Let’s call this entity color. This entity is only used for this intent, but the location entity is common for all the three intents.


Intent Entity (location) Entity (color) Sample utterance 
LIGHTS_ON kitchen NA “Turn on the light in kitchen”
LIGHTS_ON bedroom NA “Switch on the bedroom lamp”
LIGHTS_OFF bathroom NA “Bathroom lights off”
CHANGE_COLOR bedroom blue “Change bedroom light to blue”

Profile image for ottomatias

Last updated by ottomatias on March 25, 2020 at 16:46 +0200

Found an error on our documentation? Please file an issue or make a pull request