How can I make a registration bot in dialogflow? - dialogflow-es

I want to do registrations using dialogflow. For example: I want bot to ask following questions:
What's your name?
What's your email?
and so on.
I tried to implement this but not able to manage intents properly. What should I do to achieve that? Thanks

First, you need to add the training phrases and then extract the entities for the names & email ids. Once it's done, you need to add the prompts and the follow-up chatbot messages in the Bot reply order.
In Dialogflow ES, go to the intent > add training phrases > extract the name, email ids by clicking on the particular words and it will be reflected in the 'Action and parameter' section then add the prompts.
In Dialogflow CX, go to the Build > flow section > select the route of your intent > select the intent > add training phrases and extract the names, email ids then add prompts to be displayed by the chatbot.
Here's an example - how it will be displayed
If you need any more info, please refer to the following doc for more details.

Related

Is it possible for users to choose between a few intents for Bot Framework Composer (LUIS)?

I'm trying to get something like this Stack Overflow question but within Bot Framework Composer. In Power Virtual Agents, if the bot is not sure about which 'Topic' aka 'Intent' is the right one, it gives the user a few options. How can I achieve that in Bot Framework Composer, or at least extend the bot with code?
In your dialog, create a trigger for "Duplicated intents recognized" :
Duplicated intents recognized automatically sets some variables for the turn that you use to customize your logic in how to handle duplicate intent recognition.
From here I refer to the Enterprise Assistant template :
conversation.lastAmbiguousUtterance = turn.activity.text
You don't really need to use this, but it's set in the Enterprise template in case you want to use the user input in the bot's response
dialog.candidates =
=take(sortByDescending(where(flatten(select(turn.recognized.candidates,
x, if (x.intent=="ChooseIntent", x.result.candidates, x))), c,
not(startsWith(c.intent, "DeferToRecognizer_QnA")) && c.score >
turn.minThreshold), 'score'), turn.maxChoices)
This basically organizes the duplicate intents into a list, dialog.candidates, by
sorting the intent recognized in descending order (so first element is the highest recognition score intent)
filtering out intents starting with "DeferToRecognizer_QnA" that are automatically generated from cross-training
filtering out intent scores that don't meet the minimum threshold that you set
getting only the number of intents for max choices that you set
From here you can set your logic so that if
count(dialog.candidates) = 0
, you emit an UnknownIntent event, or emit a recognizedIntent for
=first(dialog.candidates).result
if your dialog.candidates has at least one result.
Or, you can customize your logic to handle however which way you want, which in your case is inputting dialog.candidates in an adaptive card so the user can choose which intent they wanted.

Google Dialogflow is not detecting all the entities in the user entered text

We are trying to implement chatbot using Google dialog flow. Created 2 intents (movies & purchases) as below.
And created 2 Entities (Movies & Purchases as below).
When I tested it with 'I cannot watch my purchased movie', it is detecting 'movies' intent and it is detecting only one entity 'movies'. It is not detecting 'purchases' entity even though the word 'purchased' is in the user entered text.
Can any one please let me know how to make sure that dialog flow detects all the entities present in the user entered text and also why it is detecting 'movies' intent as 'purchases' intent also have the training phrases that can match the user entered text.
In the image of your conversation in Dialogflow it shows that Dialogflow matched the user phrase to the movie intent. In your movie intent setup you have setup only 1 parameter,
movies. Dialogflow will only recognize one entity because you have setup the intent to only look for 1 entity.
If you want the movie intent to be able to recognize both entities you should add a phrase that contains both a movies and a purchase intent and make sure both entities are available in the Actions and Parameters section of your intent.
Here is a quick example that detects a gender and an age category entity.

How to ask the user to add new element in DialogFlow?

I am trying to build a bot in Dialogflow.
Here is what I need:
customer: Hello
bot: hello, what's your name?
customer: John
bot: Please enter the first element.
customer: element1
bot: Did you finish?
customer: No
bot: Please enter the second element.
....
Please advise how can I implement it? I am trying to create an intent with action and prompt but the agent doesn't ask me "Please enter the first element".
I also need to make first, second .. a counter that updates with each iteration / question.
Can you please advise where can I find a guideline how to achieve this kind task?
So far I have created an agent and playing with intents.
One way would be to write some code for fulfillment (using webhook or even inline editor), analyze incoming messages in your code and generate answer.
If you don't want to write any code, it should be also possible to achieve this using Dialogflow's context to store some information and followup intents to continue asking for elements. But in case you would like to ask user for multiple elements - it could be hard to maintain in Dialogflow. I have created and tested sample bot this way with following intents:
Please note that I have removed default Welcome intent to not interfere with custom "hello" intent.

Parameter value filling with quick responses in messenger

I have created a bot using Dialogflow (api.ai) and integrated it with Facebook messenger. I want to get the parameter values from user: like city, date (today, tomorrow) by using the quick reply feature of messenger, where user is presented with select-box like options, and can tap on one of the options. The required parameter receives the user-tapped value, saving the user from typing it manually.
I cannot find anywhere in documentation any way to fill up parameter values (slots) using quick replies. There is an option to give quick replies in response section, but the response section is called on fulfilment, and if I take user input in response, then I have to create another follow up intent to process the user-response further, because the current intent gets fulfilled after response.
If I add quick replies in the response section, then I have to create multiple levels of follow-up intents. Ex: I take city input in one intent, and give two options to user (like New York, Delhi). Then I have to create two follow up intents, each for handling one reply (New York and Delhi), and then for each follow up intent, I will have to create more follow up intents to get more parameter inputs. Below is the flow diagram of this case. --->
This can get pretty complex when more levels are added! Amazon Lex has this feature of filling slots using quick replies. Can't I just fill up parameter values directly using the quick replies like Lex?
You don't have to go this far. There is a simple way of using entities & prompts in dialogflow.com. The workflow can be: Weather(intent)->quick reply(New york/Delhi)->City(intent) use entities here->quick reply(Today/Tomorrow)->Use different intents here for today & tomorrow as you will have different responses. You don't need to create different intents unless you have different responses. User says can have different parameters for which you can define different prompts as well. This will again reduce your complexity of creating follow-up intents. Let me know if you need more explanation on this.

How to find out when user has enter wrong input when chatting with bot?

i am developing one Bot Framework related application in that i am showing like near by places for that user enter like this way "show me nearby places" here i am pass the key value "places" to google API and its producing the exact results, But here my question is when user enter wrong input like "show nearby places" and show places nearby me" at this time i want to show message "please enter correct input" for this how to show the user friendly message. please give the proper suggestion for me.
Thanks in advance.
You will have to use a NLP tool such as wit.ai, luis.ai or api.ai. The jury is out on which is the best tool so my advice will be to try out all and see for yourself.
You will essentially define stories and tell the NLP engine what the components of a statement are. So if you pass a statement to the NLP engine, it will parse the intents and objects to you.
For example your statement is "show me places nearby". Set your intent as 'nearby' and your entity as 'wit/location'. The tool should recognize variants of the above statement.
You can check out the recipe wit.ai have created for it here.
Else if you want just a string matching mechanism, check if your user's message has the substring 'location' and then show nearby places. Check out gupshup.io which has a Bot Builder that allows you to do this easily. (disclosure: I work there)

Resources