Skip to content

Commit 8ef4a64

Browse files
authored
Merge pull request #2994 from MicrosoftDocs/main
Publish to live, Tuesday 4 AM PST, 2/18
2 parents 17e9068 + 6840b44 commit 8ef4a64

13 files changed

+591
-371
lines changed

articles/ai-services/content-safety/quickstart-custom-categories.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ print(result)
276276

277277
Remember to replace the placeholders below with your actual values for the API key, endpoint, and specific content (category name, definition, and so on). These examples help you to manage the customized categories in your account.
278278

279+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
280+
279281
#### [cURL](#tab/curl)
280282

281283
### Get a customized category or a specific version of it

articles/ai-services/personalizer/includes/quickstart-sdk-csharp.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.date: 01/19/2024
1717
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services)
1818
* The current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
1919
* Once you have your Azure subscription, <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesPersonalizer" title="Create a Personalizer resource" target="_blank">create a Personalizer resource </a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
20-
* You'll need the key and endpoint from the resource you create to connect your application to the Personalizer API. You'll paste your key and endpoint into the code below later in the quickstart.
20+
* You need the key and endpoint from the resource you create to connect your application to the Personalizer API. You paste your key and endpoint into the code below later in the quickstart.
2121
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
2222

2323
## Model configuration
@@ -66,7 +66,7 @@ dotnet add package Microsoft.Azure.CognitiveServices.Personalizer --version 1.0.
6666
6767
## Code block 1: Generate sample data
6868

69-
Personalizer is meant to run on applications that receive and interpret real-time data. In this quickstart, you'll use sample code to generate imaginary customer actions on a grocery website. The following code block defines three key methods: **GetActions**, **GetContext** and **GetRewardScore**.
69+
Personalizer is meant to run on applications that receive and interpret real-time data. In this quickstart, you use sample code to generate imaginary customer actions on a grocery website. The following code block defines three key methods: **GetActions**, **GetContext** and **GetRewardScore**.
7070

7171
- **GetActions** returns a list of the choices that the grocery website needs to rank. In this example, the actions are meal products. Each action choice has details (features) that may affect user behavior later on. Actions are used as input for the Rank API
7272

@@ -90,8 +90,7 @@ Personalizer is meant to run on applications that receive and interpret real-tim
9090

9191
1. Paste your key and endpoint into the code where indicated. Your endpoint has the form `https://<your_resource_name>.cognitiveservices.azure.com/`.
9292

93-
> [!IMPORTANT]
94-
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](/azure/key-vault/general/overview). See the Azure AI services [security](../../security-features.md) article for more information.
93+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
9594

9695
## Code block 2: Iterate the learning loop
9796

@@ -110,7 +109,7 @@ Run the application with the dotnet `dotnet run` command from your application d
110109
dotnet run
111110
```
112111

113-
On the first iteration, Personalizer will recommend a random action, because it hasn't done any training yet. You can optionally run more iterations. After about 10 minutes, the service will start to show improvements in its recommendations.
112+
On the first iteration, Personalizer recommends a random action, because it hasn't done any training yet. You can optionally run more iterations. After about 10 minutes, the service will start to show improvements in its recommendations.
114113

115114
![The quickstart program asks a couple of questions to gather user preferences, known as features, then provides the top action.](../media/csharp-quickstart-commandline-feedback-loop/quickstart-program-feedback-loop-example.png)
116115

articles/ai-services/personalizer/includes/quickstart-sdk-nodejs.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ The Personalizer learning loop is a cycle of **Rank** and **Reward** calls. In t
8787

8888
1. Paste your key and endpoint into the code where indicated.
8989

90-
> [!IMPORTANT]
91-
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](/azure/key-vault/general/overview). For more information about security, see the Azure AI services [security](../../security-features.md) article.
90+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
9291

93-
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Personalizer/quickstart-sdk/personalizer-quickstart.js" id="snippet_2":::
92+
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Personalizer/quickstart-sdk/personalizer-quickstart.js" id="snippet_2":::
9493

9594
## Run the program
9695

articles/ai-services/personalizer/includes/quickstart-sdk-python.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.date: 01/19/2024
1717
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services)
1818
* [Python 3.x](https://www.python.org/)
1919
* Once your Azure subscription is set up, <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesPersonalizer" title="Create a Personalizer resource" target="_blank">create a Personalizer resource </a> in the Azure portal and obtain your key and endpoint. After it deploys, select **Go to resource**.
20-
* You'll need the key and endpoint from the created resource to connect your application to the Personalizer API, which you'll paste into the quick-start code below.
20+
* You need the key and endpoint from the created resource to connect your application to the Personalizer API, which you paste into the quick-start code below.
2121
* You can use the free pricing tier (`F0`) to try the service, then upgrade to a paid tier for production at a later time.
2222

2323
## Model configuration
@@ -40,16 +40,16 @@ pip install azure-cognitiveservices-personalizer
4040

4141
## Code block 1: Generate sample data
4242

43-
Personalizer is meant to run on applications that receive and interpret real-time data. For the purpose of this quickstart, you'll use sample code to generate imaginary customer actions on a grocery website. The following code block defines three key functions: **get_actions**, **get_context** and **get_reward_score**.
43+
Personalizer is meant to run on applications that receive and interpret real-time data. In this quickstart, you use sample code to generate imaginary customer actions on a grocery website. The following code block defines three key functions: **get_actions**, **get_context** and **get_reward_score**.
4444

4545

4646
- **get_actions** returns a list of the choices that the grocery website needs to rank. In this example, the actions are meal products. Each action choice has details (features) that may affect user behavior later on. Actions are used as input for the Rank API
4747

4848
- **get_context** returns a simulated customer visit. It selects randomized details (context features) like which customer is present and what time of day the visit is taking place. In general, a context represents the current state of your application, system, environment, or user. The context object is used as input for the Rank API.
4949

50-
The context features in this quickstart are simplistic. However, in a real production system, designing your [features](../concepts-features.md) and [evaluating their effectiveness](../how-to-feature-evaluation.md) is very important. Refer to the linked documentation for guidance.
50+
The context features in this quickstart are simplistic. However, in a real production system, designing your [features](../concepts-features.md) and [evaluating their effectiveness](../how-to-feature-evaluation.md) is important. Refer to the linked documentation for guidance.
5151

52-
- **get_reward_score** returns a score between zero and one that represents the success of a customer interaction. It uses simple logic to determine how different contexts will respond to different action choices. For example, a certain user will always give a 1.0 for vegetarian and vegan products, and a 0.0 for other products. In a real scenario, Personalizer will learn user preferences from the data sent in Rank and Reward API calls. You won't define these explicitly as in the example code.
52+
- **get_reward_score** returns a score between zero and one that represents the success of a customer interaction. It uses simple logic to determine how different contexts respond to different action choices. For example, a certain user will always give a 1.0 for vegetarian and vegan products, and a 0.0 for other products. In a real scenario, Personalizer will learn user preferences from the data sent in Rank and Reward API calls. You won't define these explicitly as in the example code.
5353

5454
In a real production system, the [reward score](../concept-rewards.md) should be designed to align with your business objectives and KPIs. Determining how to calculate the reward metric may require some experimentation.
5555

@@ -65,8 +65,7 @@ Follow these steps to set up the Personalizer script.
6565

6666
1. Paste your key and endpoint into the code where indicated. Your endpoint has the form `https://<your_resource_name>.cognitiveservices.azure.com/`.
6767

68-
> [!IMPORTANT]
69-
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure method to store and access your credentials like [Azure Key Vault](/azure/key-vault/general/overview). For more information, see the Azure AI services [security](../../security-features.md).
68+
[!INCLUDE [Azure key vault](~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md)]
7069

7170
[!code-python[](~/cognitive-services-quickstart-code/python/Personalizer/quickstart-sdk/personalizer-quickstart.py?name=snippet_1)]
7271

@@ -88,7 +87,7 @@ Once all the above code is included in your Python file, you can run it from you
8887
python personalizer-quickstart.py
8988
```
9089

91-
On the first iteration, Personalizer will recommend a random action, because it hasn't done any training yet. You can optionally run more iterations. After about 10 minutes, the service will start to show improvements in its recommendations.
90+
On the first iteration, Personalizer recommends a random action, because it hasn't done any training yet. You can optionally run more iterations. After about 10 minutes, the service will start to show improvements in its recommendations.
9291

9392
![The quickstart program asks a couple of questions to gather user preferences, known as features, then provides the top action.](../media/quickstart/quickstart-program-feedback-cycle-example.png)
9493

0 commit comments

Comments
 (0)