Repeated intent in a story

Hi everyone! I am currently facing a new feature for a chatbot. The feature is that sometimes, the user can ask for the same information of another location, example:

User: How many habitants are in Madrid?
Bot: Madrid has XXXXX habitants
User: And Barcelona?
Bot: Barcelona has ....
User: And Zaragoza?
Bot: Zara...
...

And continuing in that way. How can I approach this. I thought about deactivating last executed action so in my story I am always expecting the intent another_city until I got another one but I don’t think its the best option. Any recommendations??

My story will look like:

*population_city
     - action_population
*another_city
     - action_population

Thanks in advance

Cheers

Hi @AlvaroMonteagudo. For this situation I would suggest having an intent for these follow-up questions (the way you did with another_city works well). This intent will simply update the entity and slot value and the action_population should extract the data for a correct city. Do you have any other situations where the users would ask similar questions about something else other than population?

Yes, for example, asking for the surface of a city, the major, the address, email, fax of the town hall. My fear is that whenever a user asks for another city, the story ends so if the user asks for another city, the Core of my agent would not know what story to start because there is no one declared with another_city at the beginning. I only think about the deactivate function within an action, I did not try yet to do this because I am setting up other stuff but wanted to know your thoughts on this solution I came up with

You stories should reflect those follow-up requests for other cities. For example, let’s say you want you bot to lear from the following conversation:

U: How many habitants are in Madrid?
B: Madrid has XXX habitants
U: And Barcelona?
B: Barcelona has…
U: What is the fax of the town hall?
B: The fax is xxxx
U: Thanks

Then the corresponding story should look like the following:

*population_city{"city":"Madrid"}
  - action_population
*another_city{"city":"Barcelona"}
  - action_population
* fax
  - action_fax 
* thanks  

If you would like to let your assistant learn from the stories that have more other city requests, they should have to be included in the stories too, for example:

*population_city{"city":"Madrid"}
  - action_population
*another_city{"city":"Barcelona"}
  - action_population
*another_city{"city":"London"}
  - action_population
*another_city{"city":"Italy"}
  - action_population
* fax
  - action_fax 
* thanks  
1 Like

Thank you Juste, I will try it.

The thing is that I don’t know how many times a user is going to request info for another city, it can be 3 as your example, but it could be 5, 15 or even 100, and there is my problem, how stories can handle that variability in the number of times that a user would repeat an intent.

Hi @AlvaroMonteagudo,

may I ask what was you solution to this problem? I want to do something very similar. I’m not sure ahead how many consequent questions will be asked from the users. I’m guessing after enough training data, you don’t have to hardcode the number of another_locations. Is this true? If so, but how much is enough?

Thanks in advance!