-
Notifications
You must be signed in to change notification settings - Fork 376
Cross train cornet cases #2520
Description
Describe the bug
Current cross train design only cover the happy path that assume intent trigger and only intent trigger will followed by one or more begin dialog action.
There are a few cases don't meet this assumption and thus not working as expected.
- beginDialog in OnBeginDialog trigger
Example:
Main.dialog have 2 triggers
OnBeginDialog, in this trigger, it directly started a dialog called DialogA
OnIntent(Name=IntentB) trigger, in this trigger, started a dialog called DialogB
So Main.lu looks like
# IntentB
utterance for IntentB
The issue is that for dialogA.lu, we should cross train IntentB into dialogA.lu's _interruption intent.
which means in the config used, we should allow trigger key as "empty", such as
- no beginDialog action in OnIntent trigger
Example:
Main.dialog have 2 triggers
OnIntent(Name=IntentA) in this trigger, started a dialog called DialogA
OnIntent(Name=IntentB) in this trigger, just an SendActivity action
Main.lu will be
#IntentA
utterance for IntentA
#IntentB
utterance for IntentB
The issue is, for dialogA.lu, i think IntentB should goes into _interruption after cross train. So the config we will support is
{
"Main.lu":
{
"IntentA" : ["dialogA.lu"],
"IntentB": [], // we previously assume key must have a dialog
}
}- Local intent should not be cross-trained
Here by local intent, i mean those intents created with Inputs, I think today the library will bring local intents into _Interruption.
Example
Main.dialog have 3 trigge
OnBeginDialog, in this trigger, it has a TextInput which created a local intent (Inputs.TextInput.123)
OnIntent(Name=IntentA) in this trigger, started a dialog called DialogA
OnIntent(Name=IntentB) in this trigger, started a dialog called DialogB
In this case, I think today's implementation will bring Inputs.TextInput.123 into dialogA.lu's _intteruption intent, which i don't think it's right, because i assume what's goes into _interruption should only be trigger phrases, so that i can be correctly dispatched again when bubbling up. Otherwise, even we hit _interruption in children and buble up, it won't match.
So the proposed fix is to let cross train library only care about trigger intents. Leave local intents alone. As a library, it just means the library will only touch the intent listed in config, since we will support [] as target, that will work when someone just want to include certain intent.
{
"Main.lu":
{
"IntentA" : ["dialogA.lu"], // dialogA.lu only cross-pick from IntentB/C
"IntentB" : [],
"IntentC" => ...
}
}
{ "Main.lu": { "": ["dialogA.lu"], // we previously assume key can't be empty "IntentB": ["dialogB.lu"], } }