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. But now we will change gears a bit and leave more for you to figure out yourself. 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.
Add the following intents, following the same procedure as you did for the ‘greeting’ intent. Use the intent names as specified below:
appreciation
If a user expresses appreciation or gratitude, for example, ‘thanks’.
checkCapability
the intent that represents a user querying what your agent can do. An example phrase would be “What can you do?”.
Fallback
...
intent
Another “unexpected” intent does not have its origin with the user, but rather is a result of misunderstandings that arise due to speech recognition problems. If, in our case, Dialogflow is not able to transcribe what a user says and classify it as a known intent (one of the intents created for your Dialogflow agent), it will classify what the user says as a default fallback intent. Or, in other words, the default fallback intent is matched when your agent does not recognize an end-user expression. Check out https://cloud.google.com/dialogflow/es/docs/intents-default#fallback. You do not need to add a fallback intent, as it is already available when you create your Dialogflow agent. A fallback intent is triggered if a user's input is not matched by
Info |
---|
When you inspect the default fallback intent in your agent, you will see that the action name associated with this intent is |
The default fallback intent is a special intent for several reasons. It is matched if Dialogflow cannot match user input with any of the other intents known by the agent, or if it matches the training phrases you input for this intent.It is not necessary to add . But Dialogflow will also match with this intent if user input matches with training phrases that you provide for the fallback intent. You can add training phrases to the fallback intent that act as negative examples to make sure these phrases are not matched with any other intent. There may be cases where end-user expressions have a slight resemblance to your training phrases, but you do not want these expressions to match any normal intents.
Because phrases that are completely unrelated to the topic of our recipe recommendation agent will be classified as a fallback intent when they do not even vaguely resemble any of the training phrases that you add to the intents you create, as these would come back as an unknown intent. Thus, what you should do is think of related phrases that would be close to an intent but should not match with it. For example, “I do not like mushrooms” is food related and refers to an ingredient entity ‘mushroom’. Yet, you might argue that it should not be matched to any of the intents you specify because you do not want users to discuss their likes and dislikes with your agent. Alternatively, you could also argue to include ‘I like’ and ‘I dislike’ as training phrases for filtering by something. But that is a design decision for you to make! The Fallback Intent should be updated as you add more intents throughout the projectit is not necessary to add such phrases as negative examples. Instead, it is more useful to think of phrases that a user might say and are similar to some of the training phrases used for your Dialogflow agent that should not be matched with any of your agent’s intents. It is, however, not that easy to come up with such phrases as the cooking domain is very extensive, and it is not completely clear what a recipe recommendation should be able to understand and/or handle. Perhaps it is best to include, as a design decision, some phrases that the agent clearly will not be able to handle (e.g., because of limitations of its database). An example that comes to mind is a user saying something like “I don't want anything that has a lot of calories”. It will not be easy to handle such a request because the information that is available about calories related to the recipe in the database is very limited at best. However, arguably, even if the agent is not able to handle the request very well it should at least be able to understand the request (the Dialogflow agent should be able to make sense of it) and provide an appropriate response such as an apology, for example, that it is unable to process a request like this. Perhaps a better example would be a user saying “I am interested in rabbits” in the sense of “I have an interest in rabbits”. These statements are somewhat similar to expressing a preference about a recipe (“I’d like a recipe with rabbit”) but their meaning is quite unrelated to requests about recipes. In any case, it’s up to you to make your mind up about what kind of training phrases should be used for the fallback intent.
Tip |
---|
When talking about similarity of (training) phrases, other issues might come to mind. Using training phrases for different intents, for example, that are quite similar will confuse your Dialogflow agent. To avoid such issues, Dialogflow provides a feature called https://cloud.google.com/dialogflow/es/docs/agents-validation. You should enable this validation featurefor your Dialogflow agent and when you have done this, check out the agent validation page. You will see at least one intent issue warning: "There are no negative examples in the agent. Please add examples into 'Default Fallback Intent' intent." |
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
B Patterns for Repair and Conversation Enrichment
...
In responses.pl find text(describeCapability, ""). and fill in the atom with an appropriate response.
Visuals
Nothing we ask you to do here for this capability. It’s up to you.
...
Info |
---|
All done? Proceed with Capability 45: Filter Recipes by Inclusion CategoricalIngredients. |