Skip to content

Commit 6470e0e

Browse files
committed
quickstart and howto changes
1 parent 75541ce commit 6470e0e

18 files changed

+300
-249
lines changed

articles/cognitive-services/Speech-Service/how-to-custom-speech-commands-confirmations.md

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,98 +19,103 @@ In this article, you'll learn how to add a confirmation to a command.
1919
## Prerequisites
2020

2121
You must have completed the steps in the following articles:
22-
23-
- [Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
24-
- [Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
22+
> [!div class="checklist"]
23+
> * [Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
24+
> * [Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
2525
2626
## Create a SetAlarm command
2727

28-
To demonstrate validations, let's create a new Command allowing the user to set an alarm.
28+
To demonstrate confirmations, let's create a new Command allowing the user to set an alarm.
2929

30-
1. Open your previously created Custom Commands application in [Speech Studio](https://speech.microsoft.com/)
31-
1. Create a new Command **SetAlarm**
32-
1. Add a parameter called DateTime
30+
1. Open your previously created Custom Commands application in [Speech Studio](https://speech.microsoft.com/).
31+
1. Create a new Command `SetAlarm`.
32+
1. Add a parameter called `DateTime` with the following configuration.
3333

34-
| Setting | Suggested value | Description |
35-
| ----------------- | ---------------------------------------------------------| ------------------------------------------------------------------------------------------------ |
36-
| Name | DateTime | A descriptive name for your Command parameter |
37-
| Required | true | Checkbox indicating whether a value for this parameter is required before completing the Command |
38-
| Response template | "- What time?" | A prompt to ask for the value of this parameter when it isn't known |
39-
| Type | DateTime | The type of parameter, such as Number, String, or Date Time |
40-
| Date Defaults | If date is missing use today | |
41-
| Time Defaults | If time is missing use start of day | |
34+
| Setting | Suggested value | Description |
35+
| --------------------------------- | -----------------------------------------------------| ------------|
36+
| Name | DateTime | A descriptive name for parameter |
37+
| Required | checked | Checkbox indicating whether a value for this parameter is required before completing the Command |
38+
| Response for required parameter | Simple editor -> What time? | A prompt to ask for the value of this parameter when it isn't known |
39+
| Type | DateTime | The type of parameter, such as Number, String, Date Time or Geography |
40+
| Date Defaults | If date is missing use today | Default value of the variable to use if not provided by user. |
41+
| Time Defaults | If time is missing use start of day | Default value of the variable to use if not provided by user.|
4242

43-
1. Add some sample sentences
43+
1. Add some example sentences.
4444

45-
```
45+
```
4646
set an alarm for {DateTime}
4747
set alarm {DateTime}
4848
alarm for {DateTime}
4949
```
5050

51-
1. Add a Completion rule to confirm result
51+
1. Add a Completion rule to confirm result.
5252

53-
| Setting | Suggested value | Description |
54-
| ---------- | ------------------------------------------------------- | -------------------------------------------------- |
55-
| Rule Name | Set alarm | A name describing the purpose of the rule |
56-
| Actions | SpeechResponse - "- Ok, alarm set for {DateTime}" | The action to take when the rule condition is true |
53+
| Setting | Suggested value |Description |
54+
| ---------- | ------------------------------------------------------- |-----|
55+
| Rule Name | Set alarm | A name describing the purpose of the rule |
56+
| Actions | Send speech response - Ok, alarm set for {DateTime}" |The action to take when the rule condition is true
5757

5858
## Try it out
5959

60-
Select the Test panel and try a few interactions.
60+
1. Select `Train` icon present on top of the right pane.
6161

62-
- Input: Set alarm for tomorrow at noon
63-
- Output: "Ok, alarm set for 12/06/2019 12:00:00"
64-
65-
- Input: Set an alarm
66-
- Output: "What time?"
67-
- Input: 5pm
68-
- Output: "Ok, alarm set for 12/05/2019 17:00:00"
62+
1. Once training completes, select `Test`.
63+
- Input: Set alarm for tomorrow at noon
64+
- Output: Ok, alarm set for 2020-05-02 12:00:00
65+
- Input: Set an alarm
66+
- Output: What time?
67+
- Input: 5pm
68+
- Output: Ok, alarm set for 2020-05-01 17:00:00
6969

7070
## Add the advanced rules for confirmation
7171

72-
1. Add an advanced rule for confirmation.
72+
Confirmations are achieved through addition of interactions rules.
73+
74+
1. In the existing `SetAlarm` command, add an **Interaction rule** by selection `+Add` icon in the middle pane and then selecting **Interaction rules** -> **Confirm command**.
7375

7476
This rule will ask the user to confirm the date and time of the alarm and is expecting a confirmation (yes/no) for the next turn.
7577

7678
| Setting | Suggested value | Description |
7779
| --------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------- |
7880
| Rule Name | Confirm date time | A name describing the purpose of the rule |
79-
| Conditions | Required Parameter - DateTime | Conditions that determine when the rule can run |
80-
| Actions | SpeechResponse - "- Are you sure you want to set an alarm for {DateTime}?" | The action to take when the rule condition is true |
81-
| State after execution | Wait for input | State for the user after the turn |
82-
| Expectations | Confirmation | Expectation for the next turn |
81+
| Conditions | Required Parameter -> DateTime | Conditions that determine when the rule can run |
82+
| Actions | Send speech response -> Are you sure you want to set an alarm for {DateTime}? | The action to take when the rule condition is true |
83+
| Expectations | Expecting confirmation from user | Expectation for the next turn |
84+
| Post-execution state | Wait for user's input | State for the user after the turn |
85+
86+
> [!div class="mx-imgBorder"]
87+
> ![Create required parameter response](media/custom-speech-commands/add-validation-set-temperature.png)
8388
84-
1. Add an advanced rule to handle a successful confirmation (user said yes)
89+
1. Add another interaction rule to handle a successful confirmation (user said yes)
8590

8691
| Setting | Suggested value | Description |
8792
| --------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------- |
8893
| Rule Name | Accepted confirmation | A name describing the purpose of the rule |
89-
| Conditions | SuccessfulConfirmation & Required Parameter - DateTime | Conditions that determine when the rule can run |
90-
| State after execution | Ready for Completion | State of the user after the turn |
94+
| Conditions | Confirmation was successful & Required Parameter -> DateTime | Conditions that determine when the rule can run |
95+
| Post-execution state | Execute completion rules | State of the user after the turn |
9196

9297
1. Add an advanced rule to handle a confirmation denied (user said no)
9398

9499
| Setting | Suggested value | Description |
95100
| --------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------- |
96-
| Rule Name | Denied confirm | A name describing the purpose of the rule |
97-
| Conditions | DeniedConfirmation & Required Parameter - DateTime | Conditions that determine when the rule can run |
98-
| Actions | ClearParameter - DateTime & SpeechResponse - "- No problem, what time then?" | The action to take when the rule condition is true |
101+
| Rule Name | Denied confirmation | A name describing the purpose of the rule |
102+
| Conditions | Confirmation was denied & Required Parameter -> DateTime | Conditions that determine when the rule can run |
103+
| Actions | Clear parameter value -> DateTime & Send speech response -> No problem, what time then? | The action to take when the rule condition is true |
99104
| State after execution | Wait for input | State of the user after the turn |
100-
| Expectations | ElicitParameters - DateTime | Expectation for the next turn |
105+
| Expectations | Expecting parameters(s) input from the user -> DateTime | Expectation for the next turn |
101106

102-
## Try it out
107+
## Try out the changes
103108

104-
Select the Test panel and try a few interactions.
109+
Select `Train`, wait for training complete and select `Test`.
105110

106111
- Input: Set alarm for tomorrow at noon
107-
- Output: "Are you sure you want to set an alarm for 12/07/2019 12:00:00?"
112+
- Output: Are you sure you want to set an alarm for 2020-05-02 12:00:00?
108113
- Input: No
109-
- Output: "No problem, what time then?"
114+
- Output: No problem, what time then?
110115
- Input: 5pm
111-
- Output: "Are you sure you want to set an alarm for 12/06/2019 17:00:00?"
116+
- Output: "Are you sure you want to set an alarm for 2020-05-01 17:00:00?"
112117
- Input: Yes
113-
- Output: "Ok, alarm set for 12/06/2019 17:00:00"
118+
- Output: Ok, alarm set for 2020-05-01 17:00:00
114119

115120
## Next steps
116121

articles/cognitive-services/Speech-Service/how-to-custom-speech-commands-one-step-correction.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,54 +16,52 @@ ms.author: encorona
1616

1717
In this article, you'll learn how to add one-step confirmation to a command.
1818

19-
One-step correction is used to update a command that was just completed.
20-
21-
I.e. if you just set up an alarm, you can change your mind and update the time of the alarm.
19+
One-step correction is used to update a command that was just completed. That is, if you just set up an alarm, you can change your mind and update the time of the alarm. An example of such case is as follows-
2220

2321
- Input: Set alarm for tomorrow at noon
24-
- Output: "Ok, alarm set for 12/06/2019 12:00:00"
22+
- Output: Ok, alarm set for 2020-05-02 12:00:00
2523
- Input: No, tomorrow at 1pm
26-
- Output: "Ok
24+
- Output: Ok
2725

28-
Keep in mind that this implies that you as a developer have a mechanism to update the alarm in your backend application.
26+
A real world scenario, which is generally accompanied by client executing an action as a result of command completion - this article assumes that you as a developer have a mechanism to update the alarm in your back-end application.
2927

3028
## Prerequisites
3129

3230
You must have completed the steps in the following articles:
31+
> [!div class="checklist"]
32+
33+
> * [Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
34+
> * [Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
35+
> * [How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md)
3336
34-
- [Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
35-
- [Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
36-
- [How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md)
3737

38-
## Add the advanced rules for one-step correction
38+
## Add interaction rules for one-step correction
3939

40-
To demonstrate one-step correction, let's extend the **SetAlarm** command created in the [Confirmations How To](./how-to-custom-speech-commands-confirmations.md).
41-
42-
1. Add an advanced rule to update the previous alarm.
40+
To demonstrate one-step correction, let's extend the **SetAlarm** command created in [How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md).
41+
1. Add an interaction rule to update the previously set alarm.
4342

4443
This rule will ask the user to confirm the date and time of the alarm and is expecting a confirmation (yes/no) for the next turn.
4544

4645
| Setting | Suggested value | Description |
4746
| --------------------- | ---------------------------------------------------------------- | -------------------------------------------------- |
4847
| Rule Name | Update previous alarm | A name describing the purpose of the rule |
49-
| Conditions | UpdateLastCommand & Required Parameter - DateTime | Conditions that determine when the rule can run |
50-
| Actions | SpeechResponse - "- Updating previous alarm to {DateTime}" | The action to take when the rule condition is true |
51-
| State after execution | Complete command | State of the user after the turn |
48+
| Conditions | Previous command needs to be updated & Required Parameter -> DateTime | Conditions that determine when the rule can run |
49+
| Actions | Send speech response -> Simple editor -> Updating previous alarm to {DateTime} | The action to take when the rule conditions are true |
50+
| Post-execution state | Command completed | State of the user after the turn |
5251

53-
1. Move the rule you just created to the top of advanced rules (scroll over the rule in the panel and click the UP arrow).
52+
1. Move the rule you just created to the top of interaction rules (select the rule in the panel and click the UP arrow present under `...` icon on the top of the middle pane).
5453
> [!div class="mx-imgBorder"]
5554
> ![Add a range validation](media/custom-speech-commands/one-step-correction-rules.png)
56-
57-
> [!NOTE]
58-
> In a real application, in the Actions section of this rule you'll also send back an activity to the client or call an HTTP endpoint to update the alarm in your system.
55+
> [!NOTE]
56+
> In a real application, in the Actions section of this rule you'll also send back an activity to the client or call an HTTP endpoint to update the alarm in your system.
5957
6058
## Try it out
6159

62-
Select the Test panel and try a few interactions.
60+
Select `Train`, wait for training complete, and select `Test`.
6361

6462
- Input: Set alarm for tomorrow at noon
65-
- Output: "Are you sure you want to set an alarm for 12/07/2019 12:00:00?"
63+
- Output: Are you sure you want to set an alarm for 2020-05-02 12:00:00
6664
- Input: Yes
67-
- Output: "Ok, alarm set for 12/07/2019 12:00:00"
68-
- Input: No, tomorrow at 1pm
69-
- Output: "Updating previous alarm to 12/07/2019 13:00:00"
65+
- Output: Ok, alarm set for 2020-05-02 12:00:00
66+
- Input: No, tomorrow at 2pm
67+
- Output: Updating previous alarm to 2020-05-02 14:00:00

0 commit comments

Comments
 (0)