Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Greeting Intent

Make an intent called greeting. In Training Phrases add some user ‘greeting’. Under ‘Training Phrases’ add a number of expressions (at least 10) . These would be things that the user could say as a greeting, by which a user may greet - try and be thorough. Under Action ‘Action and parameters parameters’ make sure the box above the table is filled in with the name of your intent as shown in the image below.

...

Appreciation, Confirmation, Disconfirmation, Farewell Intents

Repeat Add the following intents, following the same process procedure as the one for Greeting Intent for the following intentsyou did for the ‘greeting’ intent and using the same intent names as specified:

  1. appreciation

    1. If a user expresses appreciation or gratitude (for example: ‘thanks’).

  2. confirmation

    1. If a user wants to agree or say yes‘yes’.

  3. disconfirmation

    1. If a user wants to disagree or say no‘no’.

  4. farewell

    1. If a user wants to say 'goodbye'.

...

  1. checkCapability

...

    1. the intent

...

    1. that represents a user

...

    1. querying what your

...

    1. agent can do

...

    1. . An example would be “What can you do?”.

Fallback Intent

The Default fallback intent is one of the more important intents and it is already present when creating your Dialogflow agent. Fallback intents are 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.

It is unnecessary to input phrases that are completely unrelated to the topic, as that 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 it. For example, one could argue “I do not like mushrooms” is food related and has an ingredient entity inside but . Yet, it should not be matched to any other intent, because likes and dislikes are not directly discussed with your bot. (HoweverOf course, one could argue you could use I like and I dislike include ‘I like’ and ‘I dislike’ as training phrases for filtering by something , - that is a design decision for you to make). This fallback intent should be updated as you add more intents throughout the project. 

Entities

Before we you can continue creating intents we , you have to create the entities we 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 already given to you in a Folder. For information on how to upload and create entities, you should have read this page. : DialogFlow: Create an Agent, Intents and Entities

Some entities were not provided provided by us, and 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. If the word you enter has synonyms, use the synonym option rather than entering them as multiple entity inputs.

...

Add filter intent 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 “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 to the recipes in our database. The addFilter intent can be found in the folder provided to you, and should be uploaded in Dialogflow by you.

...

To filter the recipes for the user in the way they intend, we parse their utterances with the intents and entities we made in Dialogflow. This then returns the identified intent (for example addFilter‘addFilter’) and entity information (cuisine - “Chinese”‘Chinese’). We must now take this information and create Prolog rules to access and gather the filtered recipes. This is done via the following functions. The heads of all rules can be seen in recipe_selection.pl and that is where the bodies should be added. We need a few helper functions before we can start filtering these, which are described below.

...

In the diet rule, we need to find all the ingredients that a certain recipe has and then input them into a new function we shall create below diet called ingredientsMeetDiet which returns , called ‘ingredientsMeetDiet’. This function should return a list of ingredients that fit the dietary restriction. This list should be returned with the name DietaryRestriction.

Code Block
ingredientsMeetDiet([ Ingredient | Rest ], _DietaryRestriction). :-

The fact above ingredientsMeetDiet predicate is our stop clause as ingredientsMeetDiet will be a recursive rule that will check each ingredient to see if it fits the , which will recursively check each ingredient and return ‘false’ when an ingredient does not meet the given dietary restriction. The predicate typeIngredient ‘typeIngredient’ can be used to check if an ingredient meets a dietary restriction. Fill in the body of the rule for ingredientsMeetDiet. 

...

...

ingredientsMeetDiet([ Ingredient | Rest ], DietaryRestriction) :-

What’s an Easy Recipe?

Code Block
easyRecipe(RecipeID) :-

Make a rule that can return all easy recipes recipes. 

 A recipe is easy when:

  • they it can be made within 45 minutes, 

  • have it has less than 18 steps, and

  • it has less than 15 ingredients

Recipe Filtering

...

Functions

applyFilter Functions

These functions filter our recipes and return a list of filtered recipes in the form of their RecipeIDs. The heads of the rules are in the recipe_selection.pl file. 

...