In the previous post, we saw the flowchart for the florist bot.
The process for identifying entities, in my view, is to start looking for the nouns in your flowchart. In the case of the florist bot, we see the following: red roses, and nouns for events (wedding, anniversary etc.). For this particular case, only the red roses (in general, flowers) are defined as entities since the event-based nouns are only used for static responses in the flowchart.
Now let us look at the different intents we need to define.
In the flowchart, all the yellow boxes where the user says something is an intent. There are 11 such yellow boxes.
I have mapped out the Yellow boxes in the flowchart to the list of intents in the florist zip file.
You should note a couple of things:
- There are two numbers mapped to the top Intent. This is because you can combine multiple possible phrases into a single intent. (User says “Yes” or User says “I want to buy a bouquet” which both have the same intention)
- A single number can also become two intents. E.g. Box number 6 is defined using two different intents. Why is this the case? It is because this is the place in the flowchart where you have a loop. And a loop is usually constructed with an intent for the case where the loop has not yet been entered, and another one for the case where the loop has already been entered. If you remember our discussion about contexts, you might remember that they are usually used to distinguish states in these scenarios.
There are also other things you can analyze which will help you decide on the intents.
Does your flowchart have a merge? For example, yellow boxes 2 and 3 merge into a single green Response. This is the reason why they have been declared as a single intent. If you don’t yet have any contexts set, you can combine the two merging yellow boxes into a single intent.
Does your flowchart have splits? For example, the previous green box for 4 and 5 is splitting based on the two possible responses (Yes or No). In those cases, you will usually have 1 intent per splitting branch.
Does your flowchart have loops? For example, there is a loop after box 6. You might notice that it is also like a split – except that one of the splitting branches loops back. As a result, you have two intents to represent the loop (the last 2 intents in the list).
In the next post, we will talk about contexts in the “context” of the florist bot. 🙂