Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
We have taken you by the hand thus far and walked you through the code you were asked to produce step-by-step. We will still be providing useful information for you to learn more about developing conversational agents, but now we will change gears a bit and leave more for you to figure out yourself, too. Remember that you can find useful information and links on the Project Background Knowledge page.
Dialogflow
Conversational patterns set expectations about what actors participating in a conversation will do, but users often will not quite meet these expectations and make moves that do not fit into the active pattern. The conversational agent will need to be able to handle such “unexpected” moves from users. “Unexpected” here means that these moves do not fit into the currently active conversational pattern, not that such moves should not be expected from users. Two intents that we should actually expect to match with what a user could say are an appreciation intent and an intent for checking what the agent is capable of. You should add the following intents to your Dialogflow agent, making sure that you use the intent labels specified below:
...
Throughout the project, you should keep checking the validation page for issues and update the fallback intent by adding negative examples when they come to mind (e.g., when you add more training phrases for other intents).
Prolog and Patterns
Repair
When a conversational agent does not understand a user, it needs to have the conversational competence to deal with the situation. Here, we will make two important distinctions related to the type of misunderstanding. The first case is that the agent is not able to match what a user says with an intent and the Dialogflow agent matches with a fallback intent. The second case is quite different. Here the Dialogflow agent is able to make sense of what a user says and matches it with one of the intents created for that agent. The conversational agent, however, has trouble handling the intent within the conversational context as defined by the active conversational pattern. In other words, the intent does not fit into that pattern and the question is how the agent should deal with this. We provide two repair mechanisms using (somewhat special) patterns again for the agent to deal with each of these situations.
...
Responding to an out of context user intent
The Now suppose that the user said something that Dialogflow can identify match with the user’s intent, but your agent is not at a stage where that intent is appropriate. b13Exampleone of the agent’s intents but that intent does not fit into the active conversational pattern. An example for handling a situation like that is the following:
A: What recipe would you like to cook?
U: Hey there.
A: I am not sure what that means in this context.Think about what feature in Prolog you could use to symbolize that there is some intent identified, regardless of what particular intent it is
We call the second move of the user an out of context move. The agent could expect many intents to fit here but a greeting such as the user expression in the example is out of context and does not fit. In principle, there can be many intents that simply do not fit the context of the conversation. The agent should respond to such out of context intents with a response that indicates there is a mismatch with
...
the context (at least from the agent’s perspective). We call the last agent move therefore a contextMismatch
. The pattern that we want to implement here as a repair mechanism consists of the out of context user intent as first move and the contextMismatch
as second move. The identifier we use for this pattern is b13
. This pattern is somewhat different from other patterns as we only know for the first [Actor, Intent]
pair that the Actor
must be instantiated with user
but there is no specific intent we can use to instantiate the Intent
parameter. For this reason, as it should be possible to instantiate this paramater with in principle any intent, we should keep this variable and we will not instantiate it at all. To complicate things even further, to enable the agent to shape its response specifically based on the Intent
that is out of context, we want to pass this parameter on to our contextMismatch
move. We will simply add the parameter to the intent label and use contextMismatch(Intent)
for the second agent move.
Make a contextMismatch response in responses.pl
.
...
In Moore and Arar’s taxonomy, this classifies as a c30
pattern for a general capability check. Implement this pattern in the patterns.pl
file. You should use the intent labels checkCapability
and describeCapability
. Define the agent’s response in the responses.pl
file.
Visuals
Nothing we ask you to do here for this capability. It’s up to you.
...