You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,7 +45,7 @@ There are several steps to use this quickstart:
45
45
46
46
Azure Cognitive Services are represented by Azure resources that you subscribe to. Create a resource for Personalizer using the [Azure portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli) on your local machine. Please refer to [How to create a Cognitive Services resource using the Azure portal](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) for more details. You can also:
47
47
48
-
* Get a [trial key](https://azure.microsoft.com/try/cognitive-services) valid for 7 days for free. After signing up, it will be available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
48
+
* Get a [trial key](https://azure.microsoft.com/try/cognitive-services) valid for 7 days for free. After signing up, it will be available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
49
49
* View your resource on the [Azure portal](https://portal.azure.com/).
50
50
51
51
After you get a key from your trial subscription or resource, create two [environment variable](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication):
@@ -76,11 +76,11 @@ When a Personalizer loop is first instantiated, there is no model since there ha
76
76
77
77
The Personalizer client is a PersonalizerClient object that authenticates to Azure using Microsoft.Rest.ServiceClientCredentials, which contains your key.
78
78
79
-
To ask for a rank of the content, create a RankRequest, then pass it to client.Rank method. The Rank method returns a RankResponse, containing the ranked content.
79
+
To ask for a rank of the content, create a RankRequest, then pass it to client.Rank method. The Rank method returns a RankResponse, containing the ranked content.
80
80
81
-
To send a reward to Personalizer, create a RewardRequest, then pass it to the client.Reward method.
81
+
To send a reward to Personalizer, create a RewardRequest, then pass it to the client.Reward method.
82
82
83
-
Determining the reward, in this quickstart is trivial. In a production system, the determination of what impacts the [reward score](concept-rewards.md) and by how much can be a complex process, that you may decide to change over time. This should be one of the primary design decisions in your Personalizer architecture.
83
+
Determining the reward, in this quickstart is trivial. In a production system, the determination of what impacts the [reward score](concept-rewards.md) and by how much can be a complex process, that you may decide to change over time. This should be one of the primary design decisions in your Personalizer architecture.
84
84
85
85
## Code examples
86
86
@@ -92,7 +92,7 @@ These code snippets show you how to do the following with the Personalizer clien
92
92
93
93
## Create a new python application
94
94
95
-
Create a new Python application in your preferred editor or IDE named `sample.py`.
95
+
Create a new Python application in your preferred editor or IDE named `sample.py`.
96
96
97
97
## Add the dependencies
98
98
@@ -126,7 +126,7 @@ Actions represent the content choices you want Personalizer to rank. Add the fol
126
126
127
127
## Create the learning loop
128
128
129
-
The Personalizer learning loop is a cycle of [rank](#request-a-rank) and [reward](#send-a-reward) calls. In this quickstart, each rank call, to personalize the content, is followed by a reward call to tell Personalizer how well the service ranked the content.
129
+
The Personalizer learning loop is a cycle of [rank](#request-a-rank) and [reward](#send-a-reward) calls. In this quickstart, each rank call, to personalize the content, is followed by a reward call to tell Personalizer how well the service ranked the content.
130
130
131
131
The following code loops through a cycle of asking the user their preferences at the command line, sending that information to Personalizer to rank, presenting the ranked selection to the customer to choose from among the list, then sending a reward to Personalizer signaling how well the service did in ranking the selection.
132
132
@@ -142,17 +142,17 @@ Add the following methods, which [get the content choices](#get-content-choices-
142
142
143
143
## Request a rank
144
144
145
-
To complete the rank request, the program asks the user's preferences to create a `currentContent` of the content choices. The process can create content to exclude from the rank, shown as `excludeActions`. The rank request needs the actions, currentContext, excludeActions, and a unique rank event ID (as a GUID), to receive the ranked response.
145
+
To complete the rank request, the program asks the user's preferences to create a `currentContent` of the content choices. The process can create content to exclude from the rank, shown as `excludeActions`. The rank request needs the actions, currentContext, excludeActions, and a unique rank event ID (as a GUID), to receive the ranked response.
146
146
147
-
This quickstart has simple context features of time of day and user food preference. In production systems, determining and [evaluating](concept-feature-evaluation.md)[actions and features](concepts-features.md) can be a non-trivial matter.
147
+
This quickstart has simple context features of time of day and user food preference. In production systems, determining and [evaluating](concept-feature-evaluation.md)[actions and features](concepts-features.md) can be a non-trivial matter.
148
148
149
149
[!code-python[The Personalizer learning loop ranks the request.](~/samples-personalizer/quickstarts/python/sample.py?name=rank)]
150
150
151
151
## Send a reward
152
152
153
153
To complete the reward request, the program gets the user's selection from the command line, assigns a numeric value to each selection, then sends the unique rank event ID and the numeric value to the reward method.
154
154
155
-
This quickstart assigns a simple number as a reward, either a zero or a 1. In production systems, determining when and what to send to the [reward](concept-rewards.md) call can be a non-trivial matter, depending on your specific needs.
155
+
This quickstart assigns a simple number as a reward, either a zero or a 1. In production systems, determining when and what to send to the [reward](concept-rewards.md) call can be a non-trivial matter, depending on your specific needs.
156
156
157
157
[!code-python[The Personalizer learning loop sends a reward.](~/samples-personalizer/quickstarts/python/sample.py?name=reward&highlight=9)]
@@ -46,7 +46,7 @@ There are several steps to use this quickstart:
46
46
47
47
Azure Cognitive Services are represented by Azure resources that you subscribe to. Create a resource for Personalizer using the [Azure portal](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) or [Azure CLI](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli) on your local machine. You can also:
48
48
49
-
* Get a [trial key](https://azure.microsoft.com/try/cognitive-services) valid for 7 days for free. After signing up, it will be available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
49
+
* Get a [trial key](https://azure.microsoft.com/try/cognitive-services) valid for 7 days for free. After signing up, it will be available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
50
50
* View your resource on the [Azure portal](https://portal.azure.com/).
51
51
52
52
After you get a key from your trial subscription or resource, create two [environment variables](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication):
@@ -59,13 +59,13 @@ In the Azure portal, both the key and endpoint values are available from the **Q
59
59
60
60
## Create a new Node.js application
61
61
62
-
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
62
+
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
63
63
64
64
```console
65
65
mkdir myapp && cd myapp
66
66
```
67
67
68
-
Run the `npm init -y` command to create a `package.json` file.
68
+
Run the `npm init -y` command to create a `package.json` file.
69
69
70
70
```console
71
71
npm init -y
@@ -97,11 +97,11 @@ When a Personalizer loop is first instantiated, there is no model since there ha
97
97
98
98
The Personalizer client is a PersonalizerClient object that authenticates to Azure using Microsoft.Rest.ServiceClientCredentials, which contains your key.
99
99
100
-
To ask for a rank of the content, create a RankRequest, then pass it to client.Rank method. The Rank method returns a RankResponse, containing the ranked content.
100
+
To ask for a rank of the content, create a RankRequest, then pass it to client.Rank method. The Rank method returns a RankResponse, containing the ranked content.
101
101
102
-
To send a reward to Personalizer, create a RewardRequest, then pass it to the client.Reward method.
102
+
To send a reward to Personalizer, create a RewardRequest, then pass it to the client.Reward method.
103
103
104
-
Determining the reward, in this quickstart is trivial. In a production system, the determination of what impacts the [reward score](concept-rewards.md) and by how much can be a complex process, that you may decide to change over time. This should be one of the primary design decisions in your Personalizer architecture.
104
+
Determining the reward, in this quickstart is trivial. In a production system, the determination of what impacts the [reward score](concept-rewards.md) and by how much can be a complex process, that you may decide to change over time. This should be one of the primary design decisions in your Personalizer architecture.
105
105
106
106
## Code examples
107
107
@@ -113,7 +113,7 @@ These code snippets show you how to do the following with the Personalizer clien
113
113
114
114
## Create a new Node.js application
115
115
116
-
Create a new Node.js application in your preferred editor or IDE named `sample.js`.
116
+
Create a new Node.js application in your preferred editor or IDE named `sample.js`.
117
117
118
118
## Add the dependencies
119
119
@@ -143,7 +143,7 @@ Actions represent the content choices you want Personalizer to rank. Add the fol
143
143
144
144
## Create the learning loop
145
145
146
-
The Personalizer learning loop is a cycle of [rank](#request-a-rank) and [reward](#send-a-reward) calls. In this quickstart, each rank call, to personalize the content, is followed by a reward call to tell Personalizer how well the service ranked the content.
146
+
The Personalizer learning loop is a cycle of [rank](#request-a-rank) and [reward](#send-a-reward) calls. In this quickstart, each rank call, to personalize the content, is followed by a reward call to tell Personalizer how well the service ranked the content.
147
147
148
148
The following looping code loops through a cycle of asking the user their preferences at the command line, sending that information to Personalizer to rank, presenting the ranked selection to the customer to choose from among the list, then sending a reward to Personalizer signaling how well the service did in ranking the selection.
149
149
@@ -158,17 +158,17 @@ Add the following methods, which [get the content choices](#get-content-choices-
158
158
159
159
## Request a rank
160
160
161
-
To complete the rank request, the program asks the user's preferences to create content choices. The process can create content to exclude from the rank, shown as `excludeActions`. The rank request needs the [actions](concepts-features.md#actions-represent-a-list-of-options), currentContext, excludeActions, and a unique rank event ID (as a GUID), to receive the ranked response.
161
+
To complete the rank request, the program asks the user's preferences to create content choices. The process can create content to exclude from the rank, shown as `excludeActions`. The rank request needs the [actions](concepts-features.md#actions-represent-a-list-of-options), currentContext, excludeActions, and a unique rank event ID (as a GUID), to receive the ranked response.
162
162
163
-
This quickstart has simple context features of time of day and user food preference. In production systems, determining and [evaluating](concept-feature-evaluation.md)[actions and features](concepts-features.md) can be a non-trivial matter.
163
+
This quickstart has simple context features of time of day and user food preference. In production systems, determining and [evaluating](concept-feature-evaluation.md)[actions and features](concepts-features.md) can be a non-trivial matter.
164
164
165
165
[!code-javascript[The Personalizer learning loop ranks the request.](~/samples-personalizer/quickstarts/node/sample.js?name=rank)]
166
166
167
167
## Send a reward
168
168
169
169
To complete the reward request, the program gets the user's selection from the command line, assigns a numeric value to each selection, then sends the unique rank event ID and the numeric value to the reward method.
170
170
171
-
This quickstart assigns a simple number as a reward, either a zero or a 1. In production systems, determining when and what to send to the [reward](concept-rewards.md) call can be a non-trivial matter, depending on your specific needs.
171
+
This quickstart assigns a simple number as a reward, either a zero or a 1. In production systems, determining when and what to send to the [reward](concept-rewards.md) call can be a non-trivial matter, depending on your specific needs.
172
172
173
173
[!code-javascript[The Personalizer learning loop sends a reward.](~/samples-personalizer/quickstarts/node/sample.js?name=reward)]
0 commit comments