-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Managed LU sample - updates to TodoBotWithLuis #2284
Merged
Merged
Conversation
This file contains 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
vishwacsena
requested review from
cwhitten,
a-b-r-o-w-n,
boydc2014,
luhan2017 and
hibrenda
March 16, 2020 23:39
a-b-r-o-w-n
changed the title
Managed LU sample - updates to TodoBotWithLuis
feat: Managed LU sample - updates to TodoBotWithLuis
Mar 17, 2020
cwhitten
previously requested changes
Mar 18, 2020
Composer/packages/server/assets/projects/ToDoBotWithLuisSample/ComposerDialogs/Main/Main.dialog
Outdated
Show resolved
Hide resolved
…mposer into vishwac/todoWithLuisUpdates m master
…osoft/BotFramework-Composer into vishwac/todoWithLuisUpdates
luhan2017
previously approved these changes
Mar 19, 2020
how about add score requirements to intents of main dialog? Otherwise todo like 'play basketball' will be routed to Delete |
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 LU
constructs@
entity definition syntaxValue
andAllowInterruption
properties.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
TestManagedLU
sample.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
vishwac
orv
as 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 name
input.Take a look at the input and all its configured properties in the
TestManagedLU
underUserProfile
dialog,BeginDialog
trigger,AskForName
input.The input has the following configuration -
And the following
Expected response
LU configurationTwo key properties of interest are
value
andallowInterruptions
. The expression specified invalue
property 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 valueuserName
orpersonName
and assigns it touser.name
. The input will issue a prompt if the propertyuser.name
is null even after the value assignment unlessalways prompt
evaluates 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 entityuserName
or entitypersonName
Notice 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
TestManagedLU
underAdd
dialog,BeginDialog
trigger,AskForTitle
andAskForListType
inputs.By including the
value
property 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 -
allowInterruption
expression.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 thevalue
property and assign it as a value to theproperty
. Ifnull
run 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
OnIntent
triggers within a dialog. Consider this example:See
TestManagedLU
underUserProfile
dialog,Why
,NoValue
orCancel
triggers.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
TestManagedLU
UserProfile
as well asHelp
dialogs.