Intents, Utterances, and Entities
Define Intents, Utterances,
and Entities
When a user interacts
with an application that utilizes your language model, they may enter
utterances. An intent, or more simply the meaning of an utterance, is a task or
activity that the user want to carry out. By defining intents and linking them
to one or more utterances, you can build a model.
For example, consider the
following list of intents and associated utterances:
- GetTime:
"What time is
it?"
"What is the
time?"
"Tell me the
time"
- GetWeather:
"What is the weather
forecast?"
"Do I need an
umbrella?"
"Will it snow?"
- TurnOnDevice
"Turn the light
on."
"Switch on the
light."
"Turn on the
fan"
- None:
"Hello"
"Goodbye"
Spend some time thinking
about the domain your model must cover and the kinds of activities or
information that users might request. This will help you establish the
intentions that you want your model to comprehend. Every model has a None
intent in addition to the intents you define, which you should use to
specifically identify utterances that a user might submit but for which no
particular action is necessary (like conversational greetings like
"hello") or that are outside the model's domain.
Once you've determined
which intents your model needs to serve, it's critical to record a variety of
distinct example utterances for each purpose. Gather statements that you
anticipate users will make, including statements that have the same meaning but
are worded differently. Keep these guidelines in mind:
- Capture multiple different examples, or alternative ways of saying the same thing
- Vary the length of the utterances from short, to medium, to long
- Vary the location of the noun or subject of the utterance. Place it at the beginning, the end, or somewhere in between
- Use correct grammar and incorrect grammar in different utterances to offer good training data examples
- The precision, consistency and completeness of your labeled data are key factors to determining model performance.
- Label precisely: Label each entity to its right type always. Only include what you want extracted, avoid unnecessary data in your labels.
- Label consistently: The same entity should have the same label across all the utterances.
- Label completely: Label all the instances of the entity in all your utterances
Entities are used to add
specific context to intents. For example, you might define a TurnOnDevice
intent that can be applied to multiple devices, and use entities to define the
different devices.
You can split entities
into a few different component types:
- Learned entities are the most flexible kind of entity, and should be used in most cases. You define a learned component with a suitable name, and then associate words or phrases with it in training utterances. When you train your model, it learns to match the appropriate elements in the utterances with the entity.
- List entities are useful when you need an entity with a specific set of possible values - for example, days of the week. You can include synonyms in a list entity definition, so you could define a DayOfWeek entity that includes the values "Sunday", "Monday", "Tuesday", and so on; each with synonyms like "Sun", "Mon", "Tue", and so on.
- Prebuilt entities are useful for common types such as numbers, datetimes, and names. For example, when prebuilt components are added, you will automatically detect values such as "6" or organizations such as "Microsoft". You can see this article for a list of supported prebuilt entities.
Conclusion
We have successfully
learnt about basics of defining intents, utterances, and entities.
Comments
Post a Comment