This repository was archived by the owner on Jul 9, 2025. It is now read-only.
feat: Managed LU sample - updates to TodoBotWithLuis#2284
Merged
Conversation
cwhitten
previously requested changes
Mar 18, 2020
Composer/packages/server/assets/projects/ToDoBotWithLuisSample/ComposerDialogs/Main/Main.dialog
Show resolved
Hide resolved
added 3 commits
March 18, 2020 07:17
…mposer into vishwac/todoWithLuisUpdates m master
…osoft/BotFramework-Composer into vishwac/todoWithLuisUpdates
luhan2017
previously approved these changes
Mar 19, 2020
Contributor
|
how about add score requirements to intents of main dialog? Otherwise todo like 'play basketball' will be routed to Delete |
Contributor
Author
|
Yes. The original sample had this and I missed this in the rewrite. I'll update the PR. |
…mposer into vishwac/todoWithLuisUpdates m master
xieofxie
reviewed
Mar 26, 2020
Composer/packages/server/assets/projects/ToDoBotWithLuisSample/dialogs/AddItem/AddItem.dialog
Show resolved
Hide resolved
cwhitten
approved these changes
Mar 27, 2020
lei9444
pushed a commit
to lei9444/BotFramework-Composer-1
that referenced
this pull request
Jun 15, 2021
* sample updates * Fixing PR feedback * Fix up folder structure. * Fix additem locale in file name * Fix SaveAs.spec * Add sleep Co-authored-by: Vishwac Sena Kannan <vishwacsenakannan@BYS-MS-X11.fareast.corp.microsoft.com> Co-authored-by: Dong Lei <donglei@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #806
Managed LUconstructs@entity definition syntaxValueandAllowInterruptionproperties.Documentation
Advanced dialog and language understand concepts
Conversations do not always progress is a linear fashion. Users might want to over specify information or present information out of order or would like to make corrections etc.
Bot Framework composer relies on the advanced dialog capabilities offered by Adaptive dialogs as well as relies on managing one or more backing LUIS applications to support these advanced scenarios.
This topic looks at each one of these in a bit more detail. For this doc, snippets/ concepts covered here are available in the
TestManagedLUsample.Flexible entity extraction
Let's take this simple example -
To this prompt from the bot, the user can say one of the following
In several of these examples, we need the bot to not just verbatim take everything the user said as input but detect
vishwacorvas the user name.Within composer, you can achieve this by setting the recognizer on the dialog to LUIS and subsequently using LU notation to define user response to the specific
what is your nameinput.Take a look at the input and all its configured properties in the
TestManagedLUunderUserProfiledialog,BeginDialogtrigger,AskForNameinput.The input has the following configuration -
And the following
Expected responseLU configurationTwo key properties of interest are
valueandallowInterruptions. The expression specified invalueproperty will be evaluated on every single time user responds to the specific input.In this case, the expression
=coalesce(@userName, @personName)attempts to take the first non null entity valueuserNameorpersonNameand assigns it touser.name. The input will issue a prompt if the propertyuser.nameis null even after the value assignment unlessalways promptevaluates totrue.The next property of interest is
allowInterruptions. This is set to the following expression -!@userName && !@personName. This literally means what this expression reads - allow an interruption if we did not find a value for entityuserNameor entitypersonNameNotice that you can just focus on things the user can say to respond to this specific input in the
Expected replies. With these capabilities, you get to provide labelled examples of the entity and use it no matter where/ how it was expressed in the user input.If a specific user input does not work, simply try adding that utterance to the
Expected response.Out of order entity extraction
Consider this example
The user could have pre-emptively answered multiple questions in the same resposne. Here is an example
You can see how this is all wired up in the
TestManagedLUunderAdddialog,BeginDialogtrigger,AskForTitleandAskForListTypeinputs.By including the
valueproperty on each of these inputs, we can pick up any entities recognized by the recognizer even if it was specified out of order.Interruption
Interruptions can be handled at two levels - locally within a dialog as well as re-routing as a global interruption. By default adapive dialog does this for any inputs -
allowInterruptionexpression.a. If it evaluates to
true, evaluate the triggers that are tied to the parent adaptive dialog that holds the input action. If any triggers match, execute the actions associated with that trigger and then issue a re-prompt when the input action resumes.b. If it evaluates to
false, evaluate thevalueproperty and assign it as a value to theproperty. Ifnullrun the internal entity recognizer for that input action (e.g. number recognizer for number input etc) to resolve a value for that input action.Handling interruptions locally
With this, you can add contextual responses to inputs via
OnIntenttriggers within a dialog. Consider this example:See
TestManagedLUunderUserProfiledialog,Why,NoValueorCanceltriggers.Handling interruptions globally
Adaptive dialogs have a consultation mechanism which propagates a user message up the parent dialogs until a dialog has a trigger that fires. If no dialog's triggers fired upon consultation then the active input action gets the user utterance back for its own processing. Consider this example -
Notice that the bot understood interruption and presented the help response. See
TestManagedLUUserProfileas well asHelpdialogs.