...
Note |
---|
Make sure the labels (names of intents and entities) you use in your MARBEL agent code are exactly the same as the intents and entity entry names that you have specified in your Dialogflow agent! Small spelling mistakes (e.g., using capitals or not, other misspellings) will cause issues later on! We advise to use all lowercase everywhere https://en.wikipedia.org/wiki/Camel_case starting with a lowercase letter everywhere (except for the Training phrases that you add). |
Greeting Intent
Make an intent called ‘greeting’.
...
Tip |
---|
Check that your ‘greeting’ intent is working by pressing using the microphone button in the test console. |
...
Add the following intents, following the same procedure as you did for the ‘greeting’ intent and using . Use the same intent names as specified below:
appreciation
If a user expresses appreciation or gratitude, for example, ‘thanks’.
confirmation
If a user wants to agree or say ‘yes’.
disconfirmation
If a user wants to disagree or say ‘no’.
farewell
If a user wants to say 'goodbye'.
checkCapability
the intent that represents a user querying what your agent can do. An example phrase would be “What can you do?”.
Fallback Intent
The Default fallback intent Fallback Intent is one of the more important intents and it . It is already present available when creating you create your Dialogflow agent. Fallback intents are A fallback intent is triggered if a user's input is not matched by any of the other intents known by the agent, or if it matches the training phrases you input for this intent.
It is unnecessary not necessary to input add phrases that are completely unrelated to the topic of our recipe recommendation agent, as that these would definitely 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, one could argue “I do not like mushrooms” is food related and has refers to an ingredient entity inside‘mushroom’. Yet, you might argue that it should not be matched to any other intentof the intents you specify, because you do not want users to discuss their likes and dislikes are not directly discussed with your botagent. Of courseAlternatively, one you could also argue you could to include ‘I like’ and ‘I dislike’ as training phrases for filtering by something - . But that is a design decision for you to make. This fallback intent ! The Fallback Intent should be updated as you add more intents throughout the project.
...
Before you can continue creating intents, you have to create the entities you need, since these will be part of the intent specification for certain entities (e.g.: , the presence of an entity type is used as a feature by the Dialogflow classifier model to recognize certain intents by). Some of these entities are have already given been provided to you. For information on how to upload and create entities, you should have please read this page: DialogFlow: Create an Agent, Intents and Entities.
Some entities were have not provided by us, and you been provided with the agent project. You have to add them yourself (see the list below). We provide an example for most to make sure you have at least a few entries for each entity. They may not be that intuitive at first, so make sure to extend the entity specification with more synonyms as your agent evolves.
Note |
---|
If the word you enter for an entity entry has synonyms, |
...
enter these as synonyms rather than |
...
adding these as |
...
different entity |
...
entries! |
removekeyword removeKeyword - words to remove filters (for example ‘remove’)
timeKeyWord - words that refer to measurements of time (hour, minutes, etc.)
shortTimeKeyWord - for example ‘fast’, ‘quick’ etc.
negationKeyword - to specify that something needs to be omitted (for example ‘without’ or ‘don’t’)
easyKeyWord - to specify recipes that are not hard to make (for example ‘simple’)
When you are done your entities page should look as follows:
...
...
The ‘addFilter’ Intent
Add filter The intent for filtering recipes is one of the most important intents. It is used to filter recipes for the user based on a variety of criteria. This is the first intent that employs all the entities we have created. In the user expressions, where the user is asking to filter, all different entities need to occur and be tagged in the set of examples. For example, for a training phrase like “I want a Chinese recipe”, ‘Chinese' needs to be tagged as ‘cuisine’, so this phrase can be parsed by Dialogflow in order to apply the filter Chinese ‘cuisine’ to the recipes in our database. The addFilter ‘addFilter’ intent can be found in the folder provided to you, and should be uploaded in Dialogflow by you.
Recipe Filtering
...
Helper Functions
To filter the recipes for the user in the way they intend, we parse their utterances with are mapped onto the intents and entities we made you specified in Dialogflow. This then returns the identified intent (for example, ‘addFilter’) and entity information (for example, cuisine - ‘Chinese’). We must now take this information and The MARBEL agent must be able to use this information. In order to make this happen, you need to create Prolog rules to access and gather filter the filtered available recipes in the Prolog database. This is can be done via by introducing the following functions. The Prolog predicates. We have already specified the heads of all rules can be seen in the recipe_selection.pl
and that file. That is where you still need to add the bodies should be addedfor these rules. We need a few helper functions before we can start implementing code for filtering these, which are described belownext.
nrOfIngredients
We will start off easy.
...