This tutorial introduces Entities, Disqualifying Entities, Required Entities and their usage within Conversation Learner.
This tutorial requires that the general tutorial Bot is running
npm run tutorial-general
Entities capture the pieces of information that the Bot needs to perform its task, either through extraction from user utterances or assignment by custom code. Entities themselves can also constrain Action availability by being explicitly be classified as "Required" or "Disqualifying."
- Required Entities must be present in the Model's memory in order for the Action to be available
- Disqualifying Entities must not be present in the Model's memory in order for the action to be available
This tutorial focuses on Custom Entities. Pre-Trained, Multi-Value, Negatable Entities and Programmatic Entities are introduced in other tutorials.
- In the Web UI, click "New Model."
- In the "Name" field, type "IntroToEntities" and hit enter.
- Click the "Create" button.
- On the left panel, click "Entities", then the "New Entity" button.
- Select "Custom Trained" for the "Entity Type."
- Type "city" for the "Entity Name."
- Click the "Create" button.
Note
The 'Custom Trained' entity type means this entity can be trained, unlike other types of Entities.
- On the left panel, click "Actions", then the "New Action" button.
- In the "Bot's response..." field, type "I don't know what city you want."
- In the "Disqualifying Entities" field, type "city."
- Click the "Create" button.
Note
Adding the "city" Entity to "Disqualifying Entities" would disqualify this Action from the Bot's consideration when the "city" Entity is defined in the Bot's memory.
Now, create a second Action.
- On the left panel, click "Actions", then the "New Action" button.
- In the "Bot's response..." field, type "The weather in the $city is probably sunny."
- Click the "Create" button.
Note
The "city" Entity has been added automatically in the Required Entities list by reference in the response.
- On the left panel, click "Train Dialogs", then the "New Train Dialog" button.
- In the chat panel, where it says "Type your message...", type in "hello."
- This simulates the user's side of the conversation.
- Click the "Score Actions" button.
- Select the response, "I don't know what city you want."
- As the user, respond with, "Seattle".
- Click the "Score Actions" button.
- Select the response, "Weather in $city is probably sunny."
- Click the "Save" button.
[!div class="nextstepaction"] Expected entity