Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Dialogflow

Add the following intents, following the same procedure as you did for the ‘greeting’ intent. Use the intent names as specified below:

  1. appreciation

    1. If a user expresses appreciation or gratitude, for example, ‘thanks’.

  2. checkCapability

    1. 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 is one of the more important intents. It is already available when you create your Dialogflow agent. 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 not necessary to add phrases that are completely unrelated to the topic of our recipe recommendation agent, 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 project.

Visuals

No updates.

Prolog and Patterns

B Patterns for Repair and Conversation Enrichment

A good handling of repair is vital to making your agent robust to misunderstanding. There are a few common ways in which misunderstanding occurs, that need to be addressed by proper repair patterns.

b12 The agent does not understand the user's’s utterance

Example:

U: chicken soup

A: what do you mean?

Your user has just said something odd or does not match the current situation and so your Dialogflow cannot identify the user's intention and goes to a default fallback intent. In this pattern, your agent can try to come to an understanding by asking for a rephrasing with ‘paraphraseRequest’. Add a b12 pattern using the defaultFallback intent and paraphraseRequest response.

In responses.pl: paraphrase requests are determined depending on the context of the conversation (the pattern that is currently active). Under the paraphrase request section in responses.pl, you should create ‘text/3’, which specifies the active pattern, the agent response name, and what the agent should say. Fill all these in. 

% Intent: paraphrase request

text(c10, paraphraseRequest, ""). % we don't care exactly what user said. 
                                        we got some response.

text(a50recipeSelect, paraphraseRequest, " ") :- % this should be used 
                                if the number of filtered recipes is greater than 0
                                
text(a50recipeSelect, paraphraseRequest, " ") :- % this should be used 
                                if the number of filtered recipes is  0                                
	
text(a50recipeConfirm, paraphraseRequest, "").

text(c43, paraphraseRequest, "").

b13 Out of Context. 

The user said something that Dialogflow can identify with the user’s intent, but your agent is not at a stage where that intent is appropriate.

Example:

A: what recipe would you like to cook?

U: goodbye

A: 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. The agent should respond with a ‘contextMismatch’ response. 

Make a contextMismatch response in response.pl.

b42 Appreciation 

Example:

U: Thanks

A: You're welcome.

Your user says thank you and shows some ‘appreciation’ and your agent should respond appropriately with an ‘appreciationReceipt’.

In patterns.pl specify the B42 pattern. Furthermore, go into responses.pl and create a corresponding text fact.

C pattern for Checking Capabilities

c30 General Capability Check

Your user wants to know what your agent does. Create a pattern for this. 

Example:

U: what can you do?

A: At the moment I can …. 

You should use the intents/predicates 'checkCapability' (for the user) and 'describeCapability' (for the agent).

In responses.pl find text(describeCapability, ""). and fill in the atom with an appropriate response.

Test it Out

Say random stuff like “the sky is blue” in all steps and see how your agent responds and if it freezes or if you are allowed to continue.

Before the repairs, the agent froze if it did not understand and could not proceed. Now you should be able to say something random, it says it does not understand and you could then continue the pattern.

Return to https://socialrobotics.atlassian.net/wiki/spaces/PM2/pages/2216001572/Building+Your+Agent#Agent-Capability-10%3A-Allow-for-Filter-Removal

  • No labels