I have a QnA with almost 200 questions. My clients are asking to add LUIS services in our bot. I tried to implement Bot with QnA and LUIS together but I am wondering what shall I put in the utterances? all the QnA questions?
these questions are really vivid and no pattern between them. In such case, how to make LUIS recognize the most matched question?
Please comment.
thanks,
Vivek
I presume you've designed your bot so that "QnAMaker question" is just one LUIS intent among multiple intents. If that's the case, just add as many QnA question utterances as you like so that LUIS will come to understand what a QnA question looks like as distinct from the other intents. It may take a lot of training and you should be prepared for low confidence scores, so just plan to accommodate that.
If you have multiple QnA knowledge bases each with their own LUIS intent, you may need to add every single question as an utterance to ensure that LUIS knows which specific knowledge base each question applies to. However, you can also write some failsafe code to account for situations where LUIS guesses the wrong knowledge base. It might look something like this:
[LuisIntent("KnowledgeBase2")]
public async Task KnowledgeBase2Handler(IDialogContext context, LuisResult result)
{
if (KnowledgeBaseContains(result.Query, knowledgeBase2))
{
// Answer the question with the correctly-selected knowledge base
}
else
{
foreach (var kb in knowledgeBases)
{
if (KnowledgeBaseContains(result.Query, kb))
{
// Answer the question with the correct knowledge base
// that LUIS didn't guess
}
}
}
}
Related
In our chatbot we have a fallback intent but it would be great if I could know if the user was
asking a question
just saying arbitrary things like "cool", "ok", "got it"
complaining (derogatory texts)
I think (3) can be achieved with sentiment analysis, but is there a tool or an additional API that can guess this sort level of categorisation.
These are chat texts so they are super short.
You can achieve your second option by activating smallTalk in Dialogflow. This is specially design and pre-built trained agent to handle such query 'hello, cool' okay, got it, etc.
For the first option asking a question. I am not sure, but before providing an open-end to the user (basically a broad category of the question) I would suggest narrowing down the scope and category with some option and then create an intent for a feature (less open-end scope of conversation the more effective it will be)
I am creating a HR chatbot using Dialogflow. I am unable to figure out the right approach to have the bot handle both direct questions and questions asked in a contextual manner. For example:
Contextual case:
User: I want to know how many leaves i can get in a year
Bot: You get x number of leaves
User: Ok cool how do i apply for one then?
Bot: Follow this process to apply for a leave
Direct case (2 separate conversations with direct questions):
Conversation 1:
User: I want to know how many leaves i can get in a year
Bot: You get x number of leaves
Conversation 2:
User: I want to know how to apply for leave
Bot: Follow this process to apply for a leave
Approaches I have tried:
1) Adding input and output contexts to handle contextual cases and add direct questions to knowledge base.
The issue with this approach is that since we cannot give multiple phrases in knowledge base, most direct questions do not match
2) Have 2 intents, one with input and output contexts and one to handle direct questions. (For example: One intent would be leaves.apply.context which would have both input and output context set and would have training phrases like how do i apply for this and another intent leaves.apply.direct which would have training phrases like how do i apply for a leave and no context). I'm not convinced that this is the right way as I am essentially creating two intents for the same question with the same response.
So is there a recommended approach to solve this problem?
I don't think there is a recommended approach to this, it is a matter of taste. Your solutions are a nice way of approaching this, but I don't think you will get around the fact that you will have to make an extra intent with the same response if you want to allow a follow-up question to also be approachable directly due to the context.
If you really don't like to create two intents for the same response, I think you would be able to workout this scenario by creating two intents and dropping the contextual flow. Just create a HowManyLeavesAvailableIntent and a HowToApplyForLeaveIntent without any context and train the HowToApplyForLeaveIntent to trigger on phrases that would follow-up HowManyLeavesAvailableIntent and direct questions for HowToApplyForLeaveIntent. Due to the missing context, this might not be ideal because it can create weird mappings to intents, but it would allow you to have just one intent for how to apply for leave.
I have created a pizza bot in dialogflow. The scenario is like..
Bot says: Hi What do you want.
User says : I want pizza.
If the user says I want watermelon or I love pizza then dialogflow should respond with error message and ask the same question again. After getting a valid response from the user the bot should prompt the second like
Bot says: What kind of pizza do you want.
User says: I want mushroom(any) pizza.
If the user gives some garbage data like I want icecream or I want good pizza then again bot has to respond with an error and should ask the same question. I have trained the bot with the intents but the problem is validating the user input.
How can I make it possible in dialogflow?
A glimpse of training data & output
If you have already created different training phrases, then invalid phrases will typically trigger the Fallback Intent. If you're just using #sys.any as a parameter type, then it will fill it with anything, so you should define more narrow Entity Types.
In the example Intent you provided, you have a number of training phrases, but Dialogflow uses these training phrases as guidance, not as absolute strings that must be matched. From what you've trained it, it appears that phrases such as "I want .+ pizza" should be matched, so the NLU model might read it that way.
To narrow exactly what you're looking for, you might wish to create an Entity Type to handle pizza flavors. This will help narrow how the NLU model will interpret what the user will say. It also makes it easier for you to understand what type of pizza they're asking for, since you can examine just the parameters, and not have to parse the entire string again.
How you handle this in the Fallback Intent depends on how the rest of your system works. The most straightforward is to use your Fulfillment webhook to determine what state of your questioning you're in and either repeat the question or provide additional guidance.
Remember, also, that the conversation could go something like this:
Bot says: Hi What do you want.
User says : I want a mushroom pizza.
They've skipped over one of your questions (which wasn't necessary in this case). This is normal for a conversational UI, so you need to be prepared for it.
The type of pizzas (eg mushroom, chicken etc) should be a custom entity.
Then at your intent you should define the training phrases as you have but make sure that the entity is marked and that you also add a template for the user's response:
There are 3 main things you need to note here:
The entities are marked
A template is used. To create a template click on the quote symbol in the training phrases as the image below shows. Make sure that again your entity is used here
Make your pizza type a required parameter. That way it won't advance to the next question unless a valid answer is provided.
One final advice is to put some more effort in designing the interaction and the responses. Greeting your users with "what do you want" isn't the best experience. Also, with your approach you're trying to force them into one specific path but this is not how a conversational app should be. You can find more about this here.
A better experience would be to greet the users, explain what they can do with your app and let them know about their options. Example:
- Hi, welcome to the Pizza App! I'm here to help you find the perfect pizza for you [note: here you need to add any other actions your bot can perform, like track an order for instance]! Our most popular pizzas are mushroom, chicken and margarita? Do you know what you want already or do you need help?
I am making a chat bot to answer questions on a particular subject(example, physics). How would you structure all the possible questions as intent in dialogflow?
I am considering the following 2 methods,
Methods:
make each question as an unique intent.
group all the questions into one "asking questions" intent and use entity to identify the specific question being asked.
Pros:
Dialogflow can easily match users input to the specific questions using low confidence score threshold, and can give multiple training phrases per question.
Only need one "asking questions" intent, neater and maintaining it is easier.
Cons:
There will be tons of intents, and maintaining it might be a nightmare. Might also reach the max number of intents.
Detecting entity might be more strict and less robust.
I would suggest you to try Knowledge Base feature of DialogFlow.
You can give multiple web-page links from where it can gather all the questions, or you can manually prepare a list and upload it to DialogFlow.
That way you don't need to make it in separate intents, it will try to match it automatically.
Let me know if you have any confusion.
This looks like an FAQ type chatbot. You can develop the chatbot in 2 ways:
Use Prebuilt Agents - Go to prebuilt agent and select and import FAQ and add your intents.
Use Knowledge Base approach - This is in Beta mode right now, but super easy to build.
a. You need to enable Beta Features from the agent settings
b. Go to Knowledge Base on the left menu, create a new document and upload CSV file (Q and A). You can also provide a link for Q/A if you have.
Check out the documentation for more details.
Knowledge Base seems to be the best way, but it only supports English content
I am trying to make an automated chatbot using wit.ai
Till now I have learned that we can add intent and entity so chatbot can better understand the question.
I have a dataset of questions and answers.
1) If there is any way by which I can set answers corresponding to a question(or similar questions) in wit, and how do we set these answers?
for example :
if a user asks:
what is a phone?
then our bot should reply the answer which is set by us.
2) if there is any other platform where we can add our dataset of questions and answers to make a chatbot?
1) No, you can't! Since wit.ai is working based on intent classification and entity extraction. You can just learn wit bot to detect intent of a query (for example intent can be restaurant search, or greeting). Then you can return any desired answers in your side.
2) Almost all platforms are based on intent and entity. You should got for QA bots, like DeepQA.
Try Quinto
You can create question-answer formats there.
You can use google dialogflow for this one, https://dialogflow.com/