Skip to content

Commit c34b707

Browse files
committed
merge cc concept docs
1 parent d922758 commit c34b707

File tree

7 files changed

+93
-88
lines changed

7 files changed

+93
-88
lines changed

.openpublishing.redirection.applied-ai-services.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@
249249
"source_path_from_root": "/articles/ai-services/content-safety/how-to/incident-response.md",
250250
"redirect_url": "/azure/ai-services/content-safety/how-to/custom-categories-rapid",
251251
"redirect_document_id": true
252+
},
253+
{
254+
"source_path_from_root": "/articles/ai-services/content-safety/concepts/custom-categories-rapid.md",
255+
"redirect_url": "/azure/ai-services/content-safety/concepts/custom-categories",
256+
"redirect_document_id": true
252257
}
253258
]
254259
}

articles/ai-services/content-safety/concepts/custom-categories-rapid.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

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

Lines changed: 81 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,63 +14,122 @@ ms.author: pafarley
1414

1515
# Custom categories
1616

17-
The Azure AI Content Safety custom category feature lets you create and manage your own content categories for enhanced moderation and filtering. This feature enables customers to define categories specific to their needs, provide sample data, train a custom machine learning model, and use it to classify new content according to the predefined categories.
17+
Azure AI Content Safety lets you create and manage your own content moderation categories for enhanced moderation and filtering that matches your specific policies or use cases.
1818

19-
## Types of analysis
19+
## Types of customization
20+
21+
There are multiple ways to define and use custom categories, which are detailed and compared in this section.
2022

2123
| API | Functionality |
2224
| :--------- | :------------ |
23-
| Customized categories | Create, get, and delete a customized category or list all customized categories for further annotation tasks |
25+
| [Customized categories (standard) API](#custom-categories-standard-api) | Use a customizable machine learning model to create, get, query, and delete a customized category. Or, list all your customized categories for further annotation tasks. |
26+
| [Custom categories (rapid) API](#custom-categories-rapid-api) | Use a large language model (LLM) to quickly learn specific content patterns in emerging content incidents. |
27+
28+
### Customized categories (standard) API
29+
30+
The Custom categories (standard) API enables customers to define categories specific to their needs, provide sample data, train a custom machine learning model, and use it to classify new content according to the learned categories.
31+
32+
This is the standard workflow for customization with machine learning models. Depending on the training data quality, it can reach very good performance levels, but it can take up to several hours to train the model.
33+
34+
This implementation works on text content, not image content.
35+
36+
### Custom categories (rapid) API
37+
38+
The Custom categories (rapid) API is designed to be quicker and more flexible than the standard method. It's meant to be used for identifying, analyzing, containing, eradicating, and recovering from cyber incidents that involve inappropriate or harmful content on online platforms.
39+
40+
An incident may involve a set of emerging content patterns (text, image, or other modalities) that violate Microsoft community guidelines or the customers' own policies and expectations. These incidents need to be mitigated quickly and accurately to avoid potential live site issues or harm to users and communities.
41+
42+
This implementation works on text content and image content.
43+
44+
> [!TIP]
45+
> One way to deal with emerging content incidents is to use [Blocklists](/azure/ai-services/content-safety/how-to/use-blocklist), but that only allows exact text matching and no image matching. The Custom categories (rapid) API offers the following advanced capabilities:
46+
- semantic text matching using embedding search with a lightweight classifier
47+
- image matching with a lightweight object-tracking model and embedding search.
48+
2449

2550
## How it works
2651

27-
The Azure AI Content Safety custom category feature provides a streamlined process for creating, training, and using custom content classification models. Here's a look at the underlying workflow:
52+
#### [Custom categories (standard) API](#tab/standard)
53+
54+
The Azure AI Content Safety custom category feature uses a multi-step process for creating, training, and using custom content classification models. Here's a look at the workflow:
2855

2956
### Step 1: Definition and setup
3057

3158
When you define a custom category, you need to teach the AI what type of content you want to identify. This involves providing a clear **category name** and a detailed **definition** that encapsulates the content's characteristics.
3259

33-
Then, you collect a balanced dataset with **positive** and (optionally) **negative examples** to help the AI to learn the nuances of your category. This data should be representative of the variety of content that the model will encounter in a real-world scenario.
60+
Then, you collect a balanced dataset with **positive** and (optionally) **negative** examples to help the AI to learn the nuances of your category. This data should be representative of the variety of content that the model will encounter in a real-world scenario.
3461

3562
### Step 2: Model training
3663

37-
Once your dataset is ready, the Azure AI Content Safety service uses it to train a new model. During training, the AI analyzes the data and learns to distinguish between content that matches the category and content that doesn't.
64+
Once your dataset is ready, the Azure AI Content Safety service uses it to train a new machine learning model. During training, the AI analyzes the data and learns to distinguish between content that matches the category and content that doesn't.
3865

3966
### Step 3: Model inferencing
4067

4168
After training, you need to evaluate the model to ensure it meets your accuracy requirements. Test the model with new content that it hasn't received before. The evaluation phase helps you identify any potential adjustments you need to make deploying the model into a production environment.
4269

70+
### Step 4: Model usage
71+
72+
You use the **analyzeCustomCategory** API to analyze text content and determine whether it matches the custom category you've defined. The service will return a score indicating the likelihood that the content matches the category.
73+
74+
#### [Custom categories (rapid) API](#tab/rapid)
75+
76+
To use the custom category (rapid) API, you first create an **incident** object with a text description. Then, you upload any number of image or text samples to the incident. The LLM on the backend will then use these to evaluate future input content. No training step is needed.
77+
78+
You can include your defined incident in a regular text analysis or image analysis request. The service will indicate whether the submitted content is an instance of your incident. The service can still do other content moderation tasks in the same API call.
79+
80+
---
81+
4382
## Limitations
4483

84+
### Language availability
85+
86+
The Custom categories APIs support all languages that are supported by Content Safety text moderation. See [Language support](/azure/ai-services/content-safety/language-support).
87+
4588
### Input limitations
4689

47-
See the following table for the input limitations of the service.
90+
#### [Custom categories (standard) API](#tab/standard)
91+
92+
93+
See the following table for the input limitations of the custom categories (standard) API:
4894

4995
| Object | Limitation |
5096
| ---------------- | ------------ |
5197
| Supported languages | English only |
52-
| Number of categories per user | 5 |
53-
| Number of versions per category | 5 |
54-
| Number of concurrent builds (processes) per category | 1 |
55-
| Inference operations per second | 10 |
56-
| Number of custom categories in one text analyze request | 5 |
57-
| Number of samples in a category version | minimum 50, maximum 10K (no duplicate samples allowed) |
58-
| Sample file size | maximum 128000 bytes |
59-
| Length of a text sample | maximum 125K characters |
60-
| Length of a category definition | maximum 1000 characters |
61-
| Length of a category name | maximum 128 characters |
62-
| Length of a blob url | maximum 500 characters |
63-
98+
| Number of categories per user | 5 |
99+
| Number of versions per category | 5 |
100+
| Number of concurrent builds (processes) per category | 1 |
101+
| Inference operations per second | 10 |
102+
| Number of custom categories in one text analyze request | 5 |
103+
| Number of samples in a category version | minimum 50, maximum 10K (no duplicate samples allowed) |
104+
| Sample file size | maximum 128000 bytes |
105+
| Length of a text sample | maximum 125K characters |
106+
| Length of a category definition | maximum 1000 chars |
107+
|Length of a category name | maximum 128 characters |
108+
|Length of a blob url | maximum 500 characters |
109+
110+
#### [Custom categories (rapid) API](#tab/rapid)
111+
112+
See the following table for the input limitations of the custom categories (rapid) API:
113+
114+
| Object | Limitation |
115+
| :------------ | :----------- |
116+
| Maximum length of an incident name | 100 characters |
117+
| Maximum number of text/image samples per incident | 1000 |
118+
| Maximum size of each sample | Text: 500 characters<br>Image: 4 MB  |
119+
| Maximum number of text or image incidents per resource| 100 |
120+
| Supported Image formats | BMP, GIF, JPEG, PNG, TIF, WEBP |
64121

65122
### Region availability
66123

67-
To use this API, you must create your Azure AI Content Safety resource in one of the supported regions. See [Region availability](../overview.md#region-availability).
124+
To use these APIs, you must create your Azure AI Content Safety resource in one of the supported regions. See [Region availability](../overview.md#region-availability).
68125

69126

70127
## Next steps
71128

72-
Follow the how-to guide to create custom categories in Azure AI Content Safety.
129+
Follow a how-to guide to use the Azure AI Content Safety APIs to create custom categories.
130+
131+
* [Use custom category (standard) API](../how-to/custom-categories.md)
132+
* [Use the custom categories (rapid) API](../how-to/custom-categories-rapid.md)
73133

74-
* [Use custom category API](../how-to/custom-categories.md)
75134

76135

articles/ai-services/content-safety/how-to/custom-categories-rapid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,5 +800,5 @@ print(response.text)
800800

801801
## Related content
802802

803-
- [Custom categories (rapid) concepts](../concepts/custom-categories-rapid.md)
803+
- [Custom categories concepts](../concepts/custom-categories.md)
804804
- [What is Azure AI Content Safety?](../overview.md)

articles/ai-services/content-safety/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ There are different types of analysis available from this service. The following
5151
| [Groundedness detection](/rest/api/cognitiveservices/contentsafety/text-groundedness-detection-operations/detect-groundedness-options) (preview) | Detects whether the text responses of large language models (LLMs) are grounded in the source materials provided by the users. [Quickstart](./quickstart-groundedness.md) |
5252
| [Protected material text detection](/rest/api/cognitiveservices/contentsafety/text-operations/detect-text-protected-material) (preview) | Scans AI-generated text for [known text content](./concepts/protected-material.md) (for example, song lyrics, articles, recipes, selected web content). [Quickstart](./quickstart-protected-material.md)|
5353
| Custom categories API (preview) | Lets you create and train your own [custom content categories](./concepts/custom-categories.md) and scan text for matches. [Quickstart](./quickstart-custom-categories.md) |
54-
| Custom categories (rapid) API (preview) | Lets you define [emerging harmful content patterns](./concepts/custom-categories-rapid.md) and scan text and images for matches. [How-to guide](./how-to/custom-categories-rapid.md) |
54+
| Custom categories (rapid) API (preview) | Lets you define [emerging harmful content patterns](./concepts/custom-categories.md) and scan text and images for matches. [How-to guide](./how-to/custom-categories-rapid.md) |
5555
| [Analyze text](/rest/api/cognitiveservices/contentsafety/text-operations/analyze-text) API | Scans text for sexual content, violence, hate, and self harm with multi-severity levels. |
5656
| [Analyze image](/rest/api/cognitiveservices/contentsafety/image-operations/analyze-image) API | Scans images for sexual content, violence, hate, and self harm with multi-severity levels. |
5757

@@ -136,7 +136,7 @@ For more information, see [Language support](/azure/ai-services/content-safety/l
136136

137137
To use the Content Safety APIs, you must create your Azure AI Content Safety resource in the supported regions. Currently, the Content Safety features are available in the following Azure regions:
138138

139-
|Region | Moderation APIs | Prompt Shields<br>(preview) | Protected material<br>detection (preview) | Groundedness<br>detection (preview) | Custom categories<br>(rapid) (preview) | Custom categories<br>(full) | Blocklists |
139+
|Region | Moderation APIs | Prompt Shields<br>(preview) | Protected material<br>detection (preview) | Groundedness<br>detection (preview) | Custom categories<br>(rapid) (preview) | Custom categories<br>(standard) | Blocklists |
140140
|---|---|---|---|---|---|---|--|
141141
| East US ||||||||
142142
| East US 2 || | || | ||
@@ -160,7 +160,7 @@ Feel free to [contact us](mailto:[email protected]) if you need
160160

161161
Content Safety features have query rate limits in requests-per-10-seconds. See the following table for the rate limits for each feature.
162162

163-
|Pricing tier | Moderation APIs | Prompt Shields<br>(preview) | Protected material<br>detection (preview) | Groundedness<br>detection (preview) | Custom categories<br>(rapid) (preview) | Custom categories<br>(full) (preview)|
163+
|Pricing tier | Moderation APIs | Prompt Shields<br>(preview) | Protected material<br>detection (preview) | Groundedness<br>detection (preview) | Custom categories<br>(rapid) (preview) | Custom categories<br>(standard) (preview)|
164164
|--------|---------|-------------|---------|---------|---------|--|
165165
| F0 | 1000 | 1000 | 1000 | 50 | 1000 | 1000|
166166
| S0 | 1000 | 1000 | 1000 | 50 | 1000 | 1000|

articles/ai-services/content-safety/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ items:
6767
href: concepts/groundedness.md
6868
- name: Protected material detection
6969
href: concepts/protected-material.md
70-
- name: Custom categories (rapid)
71-
href: concepts/custom-categories-rapid.md
70+
- name: Custom categories
71+
href: concepts/custom-categories.md
7272
- name: Harm categories
7373
href: concepts/harm-categories.md
7474
- name: Reference

articles/ai-services/content-safety/whats-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The custom categories API lets you create and train your own custom content cate
2424

2525
### Custom categories (rapid) API
2626

27-
The custom categories (rapid) API lets you quickly define emerging harmful content patterns and scan text and images for matches. See [Custom categories (rapid)](./concepts/custom-categories-rapid.md) to learn more.
27+
The custom categories (rapid) API lets you quickly define emerging harmful content patterns and scan text and images for matches. See [Custom categories](./concepts/custom-categories.md) to learn more.
2828

2929
## March 2024
3030

0 commit comments

Comments
 (0)