Add a more Voice Input options and create the beginning of a branching dialog scenario
In this demo scenario, we are authoring, the goal is to have the trainee practice giving specific feedback vs more general feedback that is hard to learn from. An example might be:
Specific/growth-minded feedback: "You seemed very distracted during the meeting today. Is there anything going on that is preventing you from being fully engaged? How about we do a dry-run before the next meeting to make sure we've got the presentation nailed"
General/closed-minded feedback: "You seem really checked out. You're going to need to bring your 'A' game if you want to continue to work here"
We want to encourage the trainee to focus on language that is specific and objective oriented. We have created an intent called "UnspecificFeedback" that includes hyperbole like "You always, you never, etc". We will need to test and iterate to determine what we need these intents to contain in order for the AI to pick up on the nuance of this goal.
For reference, the intents that we are comparing contain the following phrases:
|at the meeting this morning||a lot|
|during the meeting last Thursday||all the time|
|during the meeting last week||never|
|During the meeting today||every time|
|During today's meeting||so many times|
|last week||you always|
|On Monday||not once|
|On Tuesday||you never|
Step 1: Add a Second Intent to the Voice Input Resource
- In the Conversation script, navigate to the frame that contains the Voice Input resource.
- Add a second "Recognizer" to the Voice Input resource. This time, chose the intent "UnspecificFeedback":
- Make sure "Persistent" is checked on the Voice Input resource. This means the resource will remain open and will continue to listen for intents and fire events, so if your trainee wants to try again with more specific feedback, they can.
Step 2: Create a new Subframe for the Unspecific Feedback" Event
- Click on the '+' after the Event in the "Unspecific Feedback" recognizer. This will create a new subframe that will open when unspecific feedback is given.
- Drag a new Dialog resource into the new frame and choose an appropriate response from the employee. In this case, we have chosen the response "What are you talking about".
- STOP: Save and test in the headset. Run through the scenario a few times and try different feedback. See if you can get the employee to respond both ways. To reset the scenario and try again follow this article.
After testing a few times, we found that we needed to adjust the confidence values on the intents in order for the scenario to behave as expected. You can determine the appropriate confidence level by testing your intents in Watson. See this quick video on testing intents.
Step 3: Add a "Fail" Condition
In order for the conversation to seem more natural, we should include a case for when the AI is not able to interpret what the trainee has said. This could either be a notification prompting the trainee to try again, or a hint about what to say, or a response from the character that indicates they have not understood.
- Use the Event Link Shortcut on the Voice Input resource.
- Choose the "Fail" option. This will create a third branch that will open and run when the trainee's spoken words are not deemed to match either of the intents:
- Add a Dialog Resource to this new frame. In this tutorial, we selected the audio "Stacey Confused" to indicate that she did not understand what the trainee was saying.
- STOP: Save and test in the headset. Now, if you say something that is not recognized by the AI, the third "fail" option should play.
Step 4: Replay Fail Branch
Finally, in order for this frame to play more than once (in the event of multiple attempts by the trainee to say the right thing), we need to replay this frame. Frames by default only open and run once, but we can change it so that it will reopen as many times as we need.
- First, take a look at the condition in the Fail frame and make sure "ignore previous" is checked:
This ensures that each time the "fail" event is fired the condition will interpret that as a new occurrence.
- Now, use the Event Link Shortcut on the Dialog resource in this frame and create a subframe on "close" of the Dialog resource:
- Add a "Replay Frame" resource to this new frame.
- Configure it to replay the "On Voice Input fail" frame:
Now, each time the character finishes their "confused" dialog, the frame will reset and be ready to play the next time the Voice Input resource fails to produce meaningful results.
- STOP: Save and test in the headset. Now, you should be able to say "nonsense" things to the character over and over again and elicit the "confused" response. You may notice some stranger behaviour with the animations. We will address this in the next tutorial.
Step 5: Deactivate Voice Input Resource
It is important to remember to deactivate the voice input resource once you have successfully moved down one of the branches. Otherwise, it will remain open and listening for intents )if you have made it persistent). This can lead to unexpected behaviour.
- Add a "Deactivate Resource" resource to each of the "Specific Feedback" and "Unspecific Feedback" branches:
- Deactivate the voice input resource. It can be helpful to name the resource a descriptive name so that it is easy to find in the resource list:
In the Headset
This is what your scenario will look like so far: