-
Notifications
You must be signed in to change notification settings - Fork 487
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
[DCR] Make ValueRecognizer internal to AdaptiveDialog #3748
Comments
@tomlm @Stevenic Not a fan of this proposal. My thoughts -
|
@cwhitten can you comment from composer side as well? Is using a recognizer set an issue for composer? |
There is nothing to recognize. ValueRecognizer is artificially mapping activity.value => intent, entities=value. It's artifical. We don't need it. This issue came from Chris, ValueRecognizer forces composer to have to deal with multiple recognizers with cascading problems. |
@vishwacsena the RecognizerSet requires non-trivial change to Composer's IA in both assigning recognizers, managing the list, and configuring different authoring views. A user needs this context to be effective in using the concept, and we just haven't worked through the design yet. We will probably get to this in R10 as part of the inline Qna authoring feature. What we discussed is that we could have the "default" template for a new recognizer on a dialog include the ValueRecognizer, but again it's not immediately clear to a user what this is for or how it works, and going through the scenario that it supports (rich card form submissions) it wasn't clear why this particular form submission required running through the recognition phase. It all seems very deterministic and static. The consensus on the call was that a trigger would do the job. I see your point about consistency around other modalities: gaze, geolocation data, etc. You feel strongly that form submissions be a part of that? |
@tomlm I still cannot get the non-value recognizer route to work as a trigger and in general I still dislike the idea of removing the value recognizer. I just tried 3 different scenarios with adaptive cards With ValueRecognizer
With the trigger route proposed in this DCR
Observations:
new EmitEvent()
{
EventName = AdaptiveEvents.RecognizedIntent,
EventValue = "=json(`{\"intent\", ${turn.activity.value.intent}}`)"
}
new OnMessageActivity()
{
Condition = "turn.activity.text == null && turn.activity.value != null && turn.activity.value.intent == 'userProfileAdaptiveCardInput'"
Actions = new List<Dialog>()
{
new SendActivity("Setting values..."),
new SetProperties()
{
Assignments = new List<PropertyAssignment>()
{
new PropertyAssignment()
{
Property = "user.email",
Value = "=turn.activity.value.email"
},
new PropertyAssignment()
{
Property = "user.age",
Value = "=turn.activity.value.number"
}
}
}
}
} @tomlm @Stevenic I have done due diligence to actually render what the end user will experience with or without ValueRecognizer would be. If we can manage setting up the @cwhitten is it a goal for composer user to understand what's persisted as recognizer? If so, do we plan to explain what we do for luis:build and the generated folder etc? I do not view card input as being separate from any other type of input. I believe the right frame of mind here is to have all inputs (type, speak, card, geolocation, gaze etc) have their own recognizer and have dialog only deal with a recognition event. |
Thank you for all of the due diligence you have done on this. Some comments: Regarding 1 EmitEventEmitEvent is bad pattern for reuse. You are trying to use EmitEvent for code reuse. Why? For any case more complex then sending a single response you would create a dialog for it. aka BookAFlight dialog. This would then simply be:
That feels clean and natural. Emitting a Recognized event feels 500 level and probably even bad practice. Put another way...in early windows programming people would write code immediately on the switch statement:
Over time that pattern has been completely replaced with simple mapping
This separates the eventing from the logic and allows you to call the logic independent of the eventing, Put another way, you don't and shouldn't pump an artificial event into the message pump to trigger OnClick(). InputDialog.Value case Alternate IdeaPerhaps we should build ValueRecognition into the base Recognizer class, and it would recognize Entities, Values, Attachments and other things and could evolve over time. RegExRecognizer/LuisRecognizer then would do something like this.
The default recognizer for an AdaptiveDialog would be ```new Recognizer()``
Definitely we need to update the composer to handle recognizerSet concepts, but we don't need to introduce that complexity just for this feature. |
Thanks @tomlm! With use case 1, my intention as the author of a bot is very simple. I have already a working bot with LU. How can have the card input take the same route with minimal work from my side. You can also flip this on the head and say users typically want to start with a simple card based bot and then want to add LU. I do agree that in cases where I have logic tucked away in a dialog, BeginDialog would work but hopefully we are not saying that you must always tuck any set of actions (apart from a single send activity) into a dialog. Even so, we still need to solve for cases where the card needs to dispatch to a single sendActivity action (e.g. Help scenario). Hopefully I do not need to wrap each one of those into its own dialog. I like the alternate idea in that we need a default recognizer for adaptive dialogs in composer. By default, could composer just include the May be we can rename Also, attachments AFAIK do not come through |
late on the party, just my two cents
|
I like this idea and think we should pull on this a bit. Can we model the adaptive card form submission directly into the recognizer? It begs the question if we want to provide it by default for all dialogs with recognition configured. When would one not want set up for them? Something we should also consider is other Adaptive Card behavior that isn't just form submissions. How will this work with Adaptive Cards v2 and the invoke/refresh capabilities? We will want to allow users to hook into that processing as well. I feel like this may fall into triggers/events, however we should have line of sight on this before we make a decision. @boydc2014, some comments:
I'm not sure is this if directed at something more broad or if your are criticizing this particular discussion. I wouldn't characterize this as a fundamental change in the SDK. In fact, the proposed trigger behavior is more like the current behavior as I hear it from Steve and Tom. "am i using Composer's feedback to drive me rethink a better model that makes more sense" is exactly what we are doing.
This is the position we've held since day 1, however the resulting abstractions need to be a direct composition of the SDK primitives. We aim to reduce friction and make the simple things easy. Card form submission is a simple thing, and it should be easy. To capture more succinctly what I'd like to understand better if we move forward with the ValueRecognizer:
|
@cwhitten, just to be clear by my #1 comment or any comments, not meant to criticizing any body or any behavior here, we are definitely having a good conversation that result into solid follow ups , by all means i'm glad we have it, and i also get chance to learn from the code sample @vishwacsena have, and all the discussions you and @tomlm posted here. I was just broadly expressing my impression from the original motivation of this DCR which seems mostly about Composer will be made complicated, plus my personal judgement of this is a "significant change". Like i listed in other comments, doing triggers vs recognizer is different, and even though we do use very simple conversion behind the ValueRecoginzer, it's still an explicit Recognizer that works in recognition phase. Moving to use trigger will have visible, if not significant, change on how user will use that (like in Vishwac's cases and in my simple example), and the message we deliver to user about how we model that behavior. So I characterize it as a problem about Since those are all speaking from myself, I totally expect you or any participation of this conversation will feel different about
And that's also i try to make it board and list it as an self-checking question. Actually, design motivations are sometimes hard to distinguish, and sometimes different motivations are by nature overlapped (if we have a design that great for Composer, that's at least one solid justification of it works in this aspect). From my personal experience, sometimes when i'm designing some features based on certain feekback, even if i convinced myself and everybody else at the design time that this is a generic solution that should work, when things are moving to implementation phase, i would also keep asking me, is this really generic and good abstraction, or i just be able to found some argument to convince myself and\or others to believe it's generic. In several cases, i did realize the design decision was not good, i reverted that at the cost of time, effort and my reputation. Maybe that's the nature of design. Anyhow, i'm definitely trying to constructive, or at least to be constructive criticism, not to be that "blindly attacking" kind of criticism. Sorry for my wordings if it feels that way, i understand nobody like someone jump in between the conversation without too much context and start questioning the fundamental approach, which i tried to avoid to be. |
per @tomlm, we need to resovle this before taking Adaptive to GA. |
Totally on the same page that we should do the necessary abstractions where possible so it is easy for developers to get set up!
Given this context, here's what I'm proposing as the update to the DCR -
|
@tomlm @Stevenic @cwhitten and @vishwacsena discussed this today. Here's the updated proposal.
This would help us
@tomlm signed up to implement the updated DCR proposal for R9. Tagging |
Currently we use a ValueRecognizer which recognizes values sent back from a card by looking for
Activity.Type == Message & String.IsNullOrEmpty(Activity.Text) && activity.Value != null
When that is seen, we return an "Intent" and map the value into entities. The issue with this approach is that it
a. forces you to always use RecognizerSet
b. always using recognizerSet forces Composer to build UX for recognizerSet
c. There is ambiguity for Composer to deal with multiple recognizers
d. It is something the developer now needs to know to add.
The much simpler solution to the problem is to add a new trigger type OnValueReceived which has the constraint built in.
Usage would be something like this:
This aligns with existing Composer IA and is more natural with the rest of the triggers.
We should also add Microsoft.OnAttachmentReceived for modeling receiving attachments.
The text was updated successfully, but these errors were encountered: