Skip to content

Commit 5ddcf64

Browse files
authored
Merge pull request #112684 from msebolt/1705897-adding-zone-pivots-cognitive-services-content-moderator
initial draft
2 parents 7b2017a + a0a380f commit 5ddcf64

File tree

7 files changed

+77
-40
lines changed

7 files changed

+77
-40
lines changed

.openpublishing.redirection.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,21 @@
672672
"redirect_url": "/azure/machine-learning/samples-notebooks",
673673
"redirect_document_id": false
674674
},
675+
{
676+
"source_path": "articles/cognitive-services/Content-Moderator/dotnet-sdk-quickstart.md",
677+
"redirect_url": "/azure/cognitive-services/Content-Moderator/client-libraries?pivots=programming-language-csharp",
678+
"redirect_document_id": false
679+
},
680+
{
681+
"source_path": "articles/cognitive-services/Content-Moderator/java-sdk-quickstart.md",
682+
"redirect_url": "/azure/cognitive-services/Content-Moderator/client-libraries?pivots=programming-language-java",
683+
"redirect_document_id": false
684+
},
685+
{
686+
"source_path": "articles/cognitive-services/Content-Moderator/python-sdk-quickstart.md",
687+
"redirect_url": "/azure/cognitive-services/Content-Moderator/client-libraries?pivots=programming-language-python",
688+
"redirect_document_id": false
689+
},
675690
{
676691
"source_path": "articles/cognitive-services/QnAMaker/Tutorials/create-publish-query-in-portal.md",
677692
"redirect_url": "/azure/cognitive-services/QnAMaker/Quickstarts/create-publish-knowledge-base",
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: 'Quickstart: Use the Content Moderator client library'
3+
titleSuffix: Azure Cognitive Services
4+
description: The Content Moderator API offers client libraries that makes it easy to integrate Content Moderator into your applications.
5+
services: cognitive-services
6+
author: PatrickFarley
7+
manager: nitinme
8+
zone_pivot_groups: programming-languages-set-eleven
9+
10+
ms.service: cognitive-services
11+
ms.subservice: content-moderator
12+
ms.topic: quickstart
13+
ms.date: 04/24/2020
14+
ms.author: pafarley
15+
---
16+
# Quickstart: Use the Content Moderator client library
17+
18+
::: zone pivot="programming-language-csharp"
19+
20+
[!INCLUDE [C# quickstart](includes/quickstarts/content-moderator-client-library-csharp.md)]
21+
22+
::: zone-end
23+
24+
::: zone pivot="programming-language-java"
25+
26+
[!INCLUDE [Java quickstart](includes/quickstarts/content-moderator-client-library-java.md)]
27+
28+
::: zone-end
29+
30+
::: zone pivot="programming-language-python"
31+
32+
[!INCLUDE [Python quickstart](includes/quickstarts/content-moderator-client-library-python.md)]
33+
34+
::: zone-end

articles/cognitive-services/Content-Moderator/dotnet-sdk-quickstart.md renamed to articles/cognitive-services/Content-Moderator/includes/quickstarts/content-moderator-client-library-csharp.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Quickstart: Content Moderator client library for .NET"
2+
title: "Content Moderator .NET client library quickstart"
33
titleSuffix: Azure Cognitive Services
44
description: Get started with the Content Moderator client library for .NET with this quickstart.
55
services: cognitive-services
@@ -12,8 +12,6 @@ ms.date: 01/27/2020
1212
ms.author: pafarley
1313
---
1414

15-
# Quickstart: Content Moderator client library for .NET
16-
1715
Get started with the Content Moderator client library for .NET. Follow these steps to install the package and try out the example code for basic tasks. Content Moderator is a cognitive service that checks text, image, and video content for material that is potentially offensive, risky, or otherwise undesirable. When such material is found, the service applies appropriate labels (flags) to the content. Your app can then handle flagged content to comply with regulations or maintain the intended environment for users.
1816

1917
Use the Content Moderator client library for .NET to:
@@ -89,7 +87,7 @@ If you're using the Visual Studio IDE, the client library is available as a down
8987

9088
## Object model
9189

92-
The following classes handle some of the major features of the Content Moderator .NET SDK.
90+
The following classes handle some of the major features of the Content Moderator .NET client library.
9391

9492
|Name|Description|
9593
|---|---|
@@ -175,7 +173,7 @@ The following method iterates through the image URLs in a text file, creates an
175173

176174
#### Analyze content
177175

178-
For more information on the image attributes that Content Moderator screens for, see the [Image moderation concepts](./image-moderation-api.md) guide.
176+
For more information on the image attributes that Content Moderator screens for, see the [Image moderation concepts](../../image-moderation-api.md) guide.
179177

180178
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ContentModerator/Program.cs?name=snippet_imagemod_analyze)]
181179

@@ -185,7 +183,7 @@ For more information on the image attributes that Content Moderator screens for,
185183

186184
## Create a review
187185

188-
You can use the Content Moderator .NET SDK to feed content into the [Review tool](https://contentmoderator.cognitive.microsoft.com) so that human moderators can review it. To learn more about the Review tool, see the [Review tool conceptual guide](./review-tool-user-guide/human-in-the-loop.md).
186+
You can use the Content Moderator .NET client library to feed content into the [Review tool](https://contentmoderator.cognitive.microsoft.com) so that human moderators can review it. To learn more about the Review tool, see the [Review tool conceptual guide](../../review-tool-user-guide/human-in-the-loop.md).
189187

190188
The method in this section uses the [Reviews](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.contentmoderator.reviews?view=azure-dotnet) class to create a review, retrieve its ID, and check its details after receiving human input through the Review tool's web portal. It logs all of this information in an output text file. Call the method from your `Main` method:
191189

@@ -265,8 +263,8 @@ dotnet run
265263

266264
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
267265

268-
* [Portal](../cognitive-services-apis-create-account.md#clean-up-resources)
269-
* [Azure CLI](../cognitive-services-apis-create-account-cli.md#clean-up-resources)
266+
* [Portal](../../../cognitive-services-apis-create-account.md#clean-up-resources)
267+
* [Azure CLI](../../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
270268

271269
## Next steps
272270

@@ -275,5 +273,5 @@ In this quickstart, you learned how to use the Content Moderator .NET library to
275273
> [!div class="nextstepaction"]
276274
> [Image moderation concepts](https://docs.microsoft.com/azure/cognitive-services/content-moderator/image-moderation-api)
277275
278-
* [What is Azure Content Moderator?](./overview.md)
276+
* [What is Azure Content Moderator?](../../overview.md)
279277
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/ContentModerator/Program.cs).

articles/cognitive-services/Content-Moderator/java-sdk-quickstart.md renamed to articles/cognitive-services/Content-Moderator/includes/quickstarts/content-moderator-client-library-java.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
---
2-
title: "Quickstart: Content Moderator client library for Java"
2+
title: "Content Moderator Java client library quickstart"
33
titleSuffix: Azure Cognitive Services
44
description: In this quickstart, learn how to get started with the Azure Cognitive Services Content Moderator client library for Java.
55
services: cognitive-services
66
author: PatrickFarley
77
manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: content-moderator
10-
ms.topic: quickstart
10+
ms.topic: include
1111
ms.date: 01/27/2020
1212
ms.author: pafarley
1313
---
1414

15-
# Quickstart: Content Moderator client library for Java
16-
1715
Get started with the Content Moderator client library for Java. Follow these steps to install the package and try out the example code for basic tasks. Content Moderator is a cognitive service that checks text, image, and video content for material that is potentially offensive, risky, or otherwise undesirable. When such material is found, the service applies appropriate labels (flags) to the content. Your app can then handle flagged content in order to comply with regulations or maintain the intended environment for users.
1816

1917
Use the Content Moderator client library for Java to:
@@ -54,7 +52,7 @@ gradle init --type basic
5452

5553
When prompted to choose a build script DSL, select **Kotlin**.
5654

57-
Find *build.gradle.kts* and open it with your preferred IDE or text editor. Then copy in the following build configuration. This configuration defines the project as a Java application whose entry point is the class **ContentModeratorQuickstart**. It imports the Content Moderator SDK as well as the Gson sdk for JSON serialization.
55+
Find *build.gradle.kts* and open it with your preferred IDE or text editor. Then copy in the following build configuration. This configuration defines the project as a Java application whose entry point is the class **ContentModeratorQuickstart**. It imports the Content Moderator client library as well as the Gson sdk for JSON serialization.
5856

5957
```kotlin
6058
plugins {
@@ -88,7 +86,7 @@ Then create a file named *ContentModeratorQuickstart.java* in the new folder. Op
8886

8987
## Object model
9088

91-
The following classes handle some of the major features of the Content Moderator Java SDK.
89+
The following classes handle some of the major features of the Content Moderator Java client library.
9290

9391
|Name|Description|
9492
|---|---|
@@ -189,8 +187,8 @@ Then navigate to the *src/main/resources/ModerationOutput.json* file and view th
189187

190188
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
191189

192-
* [Portal](../cognitive-services-apis-create-account.md#clean-up-resources)
193-
* [Azure CLI](../cognitive-services-apis-create-account-cli.md#clean-up-resources)
190+
* [Portal](../../../cognitive-services-apis-create-account.md#clean-up-resources)
191+
* [Azure CLI](../../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
194192

195193
## Next steps
196194

@@ -199,5 +197,5 @@ In this quickstart, you learned how to use the Content Moderator Java library to
199197
> [!div class="nextstepaction"]
200198
>[Image moderation concepts](https://docs.microsoft.com/azure/cognitive-services/content-moderator/image-moderation-api)
201199
202-
* [What is Azure Content Moderator?](./overview.md)
200+
* [What is Azure Content Moderator?](../../overview.md)
203201
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/java/ContentModerator/src/main/java/ContentModeratorQuickstart.java).

articles/cognitive-services/Content-Moderator/python-sdk-quickstart.md renamed to articles/cognitive-services/Content-Moderator/includes/quickstarts/content-moderator-client-library-python.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
---
2-
title: "Quickstart: Content Moderator client library for Python"
2+
title: "Content Moderator Python client library quickstart"
33
titleSuffix: Azure Cognitive Services
44
description: In this quickstart, learn how to get started with the Azure Cognitive Services Content Moderator client library for Python.
55
services: cognitive-services
66
author: PatrickFarley
77
manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: content-moderator
10-
ms.topic: quickstart
10+
ms.topic: include
1111
ms.date: 01/27/2020
1212
ms.author: pafarley
1313
---
1414

15-
# Quickstart: Content Moderator client library for Python
16-
1715
Get started with the Content Moderator client library for Python. Follow these steps to install the package and try out the example code for basic tasks. Content Moderator is a cognitive service that checks text, image, and video content for material that is potentially offensive, risky, or otherwise undesirable. When such material is found, the service applies appropriate labels (flags) to the content. Your app can then handle flagged content in order to comply with regulations or maintain the intended environment for users.
1816

1917
Use the Content Moderator client library for Python to:
@@ -65,7 +63,7 @@ pip install --upgrade azure-cognitiveservices-vision-contentmoderator
6563

6664
## Object model
6765

68-
The following classes handle some of the major features of the Content Moderator Python SDK.
66+
The following classes handle some of the major features of the Content Moderator Python client library.
6967

7068
|Name|Description|
7169
|---|---|
@@ -88,7 +86,7 @@ These code snippets show you how to do the following tasks with the Content Mode
8886
## Authenticate the client
8987

9088
> [!NOTE]
91-
> This quickstart assumes you've [created environment variables](../cognitive-services-apis-create-account.md#configure-an-environment-variable-for-authentication) for your Content Moderator key and endpoint.
89+
> This quickstart assumes you've [created environment variables](../../../cognitive-services-apis-create-account.md#configure-an-environment-variable-for-authentication) for your Content Moderator key and endpoint.
9290
9391
Instantiate a client with your endpoint and key. Create a [CognitiveServicesCredentials](https://docs.microsoft.com/python/api/msrest/msrest.authentication.cognitiveservicescredentials?view=azure-python) object with your key, and use it with your endpoint to create an [ContentModeratorClient](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-contentmoderator/azure.cognitiveservices.vision.contentmoderator.content_moderator_client.contentmoderatorclient?view=azure-python) object.
9492

@@ -197,7 +195,7 @@ Then add the following code to iterate through your images. The rest of the code
197195

198196
### Check for adult/racy content
199197

200-
The following code checks the image at the given URL for adult or racy content and prints results to the console. See the [Image moderation concepts](./image-moderation-api.md) guide for information on what these terms mean.
198+
The following code checks the image at the given URL for adult or racy content and prints results to the console. See the [Image moderation concepts](../../image-moderation-api.md) guide for information on what these terms mean.
201199

202200
[!code-python[](~/cognitive-services-quickstart-code/python/ContentModerator/ContentModeratorQuickstart.py?name=snippet_imagemod_ar)]
203201

@@ -291,7 +289,7 @@ Use the following code to delete a given image list.
291289

292290
## Create a review
293291

294-
You can use the Content Moderator Python SDK to feed content into the [Review tool](https://contentmoderator.cognitive.microsoft.com) so that human moderators can review it. To learn more about the Review tool, see the [Review tool conceptual guide](./review-tool-user-guide/human-in-the-loop.md).
292+
You can use the Content Moderator Python client library to feed content into the [Review tool](https://contentmoderator.cognitive.microsoft.com) so that human moderators can review it. To learn more about the Review tool, see the [Review tool conceptual guide](../../review-tool-user-guide/human-in-the-loop.md).
295293

296294
The following code uses the [ReviewsOperations](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-contentmoderator/azure.cognitiveservices.vision.contentmoderator.operations.reviewsoperations?view=azure-python) class to create a review, retrieve its ID, and check its details after receiving human input through the Review tool's web portal.
297295

@@ -340,8 +338,8 @@ python quickstart-file.py
340338

341339
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
342340

343-
* [Portal](../cognitive-services-apis-create-account.md#clean-up-resources)
344-
* [Azure CLI](../cognitive-services-apis-create-account-cli.md#clean-up-resources)
341+
* [Portal](../../../cognitive-services-apis-create-account.md#clean-up-resources)
342+
* [Azure CLI](../../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
345343

346344
## Next steps
347345

@@ -350,5 +348,5 @@ In this quickstart, you learned how to use the Content Moderator Python library
350348
> [!div class="nextstepaction"]
351349
>[Image moderation concepts](https://docs.microsoft.com/azure/cognitive-services/content-moderator/image-moderation-api)
352350
353-
* [What is Azure Content Moderator?](./overview.md)
351+
* [What is Azure Content Moderator?](../../overview.md)
354352
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/ContentModerator/ContentModeratorQuickstart.py).

articles/cognitive-services/Content-Moderator/index.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ landingContent:
4040
- linkListType: quickstart
4141
links:
4242
- text: Using the .NET SDK
43-
url: dotnet-sdk-quickstart.md
43+
url: client-libraries.md?pivots=programming-language-csharp
4444
- text: Using the Python SDK
45-
url: python-sdk-quickstart.md
45+
url: client-libraries.md?pivots=programming-language-python
4646
- text: Using the Java SDK
47-
url: java-sdk-quickstart.md
47+
url: client-libraries.md?pivots=programming-language-java
4848
- linkListType: how-to-guide
4949
links:
5050
- text: Using the API console

articles/cognitive-services/Content-Moderator/toc.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@
1010
items:
1111
- name: Try Content Moderator on web
1212
href: quick-start.md
13-
- name: Using the client SDK
14-
items:
15-
- name: Using the .NET SDK
16-
href: dotnet-sdk-quickstart.md
17-
- name: Using the Python SDK
18-
href: python-sdk-quickstart.md
19-
- name: Using the Java SDK
20-
href: java-sdk-quickstart.md
13+
- name: Using the client library
14+
href: client-libraries.md
2115
- name: Tutorials
2216
items:
2317
- name: Moderate e-commerce images

0 commit comments

Comments
 (0)