In the previous post, we learnt a little about the WimbledonFinalsBot (henceforth WFBot) we will be building.
You will start by creating a new agent just like for the FAQ bot. Once you have created an agent, the next step will be to declare the Intents. If you remember from the previous posts, the intents should be the different phrases you expect your user to ask.
In our case, we have only 4 intents.
- Who won the men’s tournament in year X?
- Who won the women’s tournament in year X?
- Who was the women’s runnerup in year X?
- Who was the men’s runnerup in year X?
However, before we can declare our Intents, we should first declare our entities. I mention the Intents first because I am establishing the motivation as to what kind of questions the user will ask the bot, so we can better understand how to declare and populate our entities.
Click on the + sign next to the Entities in the left pane.
I am going to populate the values for the men’s winners in the first step. Take a look at what happens when I type mens winners into the entity name.
API.AI complains that there should be no spaces in the name. As you will see later, this will be an important constraint which will help us when we use this entity later.
So I will call this entity mens-winners (no spaces).
The next step is to fill out the values.
There is the slow way – you can type out the values one by one. But you can also import these values if you can get the data in CSV or JSON format.
To do this, click on the three vertical dots next to the save button, click on “Switch to raw mode”, and fill out the values in the format of your choice. I have uploaded the input in the CSV format below.
Next, we will see how to declare the intents so we can query this data.