I am implementing a covid bot. Currently, my model picks “covid” and the “location” as entities and it correctly returns the statistics.
For example
user: how many covid cases are there in Nigeria
bot: there are xxxx covid cases in Nigeria.
user: what about Ghana?
When I ask this follow-up question, the bot doesn’t understand because there’s no “covid” entity in the question.
So my question is how can the bot keep track of earlier states of the conversation and understands what I am talking about?
In the above example, how can I design/implement my bot to reply with:
should your covid cases being an entity or an intent?
ask_about_covid_numbers is an intent where you could add the various examples of utterances that users might have asked.
your most likely entity here is the country. I also understand covid is a proper noun too thus using it as an entity is also valid but in your context, it is rather an intent to know about covid cases over covid as an entity itself.
Hey @laboratory I think you should use slots also in your project. That way your bot will have information from past.
I am beginner, but heres a thought : I would have a location entity just like you & I will also have an intent for information which will capture the location and fill the slot. Then I would put a custom action and check location in that & query from API… then use dispatcher to utter new message.
- intent: information
examples: |
- how many covid cases in [Nigeria](location)
- how about [Ghana](location)
- can you tell me covid cases in [India](location)
- I want to know [active](state) covid cases in [New Zealand](location)
- what about [Australia](location)
- please tell me [recovered](state) cases in [Dubai](location)
Thank you. I get your point and I think it makes much sense.
So how does this help me achieve my initial question? including how about [Ghana](location) in my training examples so the model learns that and if I just say to my bot “how about ghana?” without any initial conversation, it gives me the statistics for Ghana. However, this doesn’t make much sense to me.
Asking the bot (initially) how about Ghana doesn’t make much sense until there is an initial conversation like previously asking for a particular location (like the example in my initial post).
Thank you. I currently have mine like these. The problem (I think) with your example is your re including: how about [Ghana](location) in your training examples so the model learns that and if I just say to my bot “how about ghana?” without any initial conversation, it gives me the statistics for Ghana. However, this doesn’t make much sense to me.
Asking the bot (initially) how about Ghana doesn’t make much sense until there is an initial conversation like previously asking for a particular location.
I don’t see the use of a slot. My current implementation. doesn’t include one
i think you would need to separate intents with context and ones without, this can be done with the inform intent.
what about ghana does not indicate an intent to be honest. thus this would be examples you would place under inform/specify/request intent - where the context isnt provided while tell me about covid cases in Austraila does indicate the intent of the user so this will fall under ask_about_covid_intent instead of a basic inform_intent.
how does the bot differentiate them is what you would train under stories.
Thank you. I will look into this.
May I also ask why we need slots in the scenario I painted earlier? I know slots are memories but I don’t see why we need them. An explanation will be much appreciated.
a typical conversation that holds context is kept on memory we preserve during that conversation, while a max_history tracker that the dialogue model uses can do that over a max 3-5 turns of the conversation, but if you need to keep the history longer or information retained at the beginning of the coversation will be needed afterwards then it is best to make use of slots which acts as features to move your conversation in different direction. it may not be so relevant in your case but eventually over time it does become an important part of the conversation where max_history parameters isn’t enough to retain sufficient history of the conversation