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
Copy file name to clipboardExpand all lines: articles/ai-services/content-safety/concepts/custom-categories.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,15 +61,15 @@ Then, you collect a balanced dataset with **positive** and (optionally) **negati
61
61
62
62
### Step 2: Model training
63
63
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.
64
+
After you prepare your dataset and define categories, the Azure AI Content Safety service trains a new machine learning model. This model uses your definitions and uploaded dataset to perform data augmentation using a large language model. As a result, the training dataset is made larger and of higher quality. During training, the AI model analyzes the data and learns to differentiate between content that aligns with the specified category and content that does not.
65
65
66
66
### Step 3: Model inferencing
67
67
68
68
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.
69
69
70
70
### Step 4: Model usage
71
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.
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 Boolean indicating whether the content aligns with the specified category
Copy file name to clipboardExpand all lines: articles/ai-services/content-safety/how-to/custom-categories.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,20 @@ curl -X PUT "<your_endpoint>/contentsafety/text/categories/<your_category_name>?
86
86
87
87
### Start the category build process:
88
88
89
+
After you receive the response, store the operation ID (referred to as `id`) in a temporary. You need this ID to retrieve the build status using the **Get status** API.
90
+
89
91
```bash
90
-
curl -X POST "<your_endpoint>/contentsafety/text/categories/<your_category_name>:build?api-version=2024-02-15-preview" \
92
+
curl -X POST "<your_endpoint>/contentsafety/text/categories/<your_category_name>:build?api-version=2024-02-15-preview&version={version}" \
93
+
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
94
+
-H "Content-Type: application/json"
95
+
```
96
+
97
+
### Get the category build status:
98
+
99
+
To retrieve the status, utilize the `id` obtained from the previous API response and place it in the path of the API below.
100
+
101
+
```bash
102
+
curl -X GET "<your_endpoint>/contentsafety/text/categories/operations/<id>?api-version=2024-02-15-preview" \
91
103
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
92
104
-H "Content-Type: application/json"
93
105
```
@@ -172,6 +184,22 @@ result = trigger_category_build_process(category_name, version)
172
184
print(result)
173
185
```
174
186
187
+
### Get the category build status:
188
+
189
+
To retrieve the status, utilize the `id` obtained from the previous response.
Copy file name to clipboardExpand all lines: articles/ai-services/content-safety/includes/storage-account-access.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ Next, you need to give your Content Safety resource access to read from the Azur
16
16
17
17
:::image type="content" source="/azure/ai-services/content-safety/media/role-assignment.png" alt-text="Screenshot of Azure portal enabling managed identity.":::
18
18
19
-
1. Assign the role of **Storage Blob Data Contributor/Owner/Reader** to the Managed identity. Any roles highlighted below should work.
19
+
1. Assign the role of **Storage Blob Data Contributor/Owner** to the Managed identity. Any roles highlighted below should work.
20
20
21
21
:::image type="content" source="/azure/ai-services/content-safety/media/add-role-assignment.png" alt-text="Screenshot of the Add role assignment screen in Azure portal.":::
22
22
23
23
:::image type="content" source="/azure/ai-services/content-safety/media/assigned-roles.png" alt-text="Screenshot of assigned roles in the Azure portal.":::
24
24
25
-
:::image type="content" source="/azure/ai-services/content-safety/media/managed-identity-role.png" alt-text="Screenshot of the managed identity role.":::
25
+
:::image type="content" source="/azure/ai-services/content-safety/media/managed-identity-role.png" alt-text="Screenshot of the managed identity role.":::
Copy file name to clipboardExpand all lines: articles/ai-services/content-safety/quickstart-custom-categories.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,13 +69,22 @@ curl -X PUT "<your_endpoint>/contentsafety/text/categories/survival-advice?api-v
69
69
70
70
### Start the category build process:
71
71
72
-
Replace `<your_api_key>` and `<your_endpoint>` with your own values. Allow enough time for model training: the end-to-end execution of custom category training can take from around five hours to ten hours. Plan your moderation pipeline accordingly.
72
+
Replace `<your_api_key>` and `<your_endpoint>` with your own values. Allow enough time for model training: the end-to-end execution of custom category training can take from around five hours to ten hours. Plan your moderation pipeline accordingly. After you receive the response, store the operation ID (referred to as `id`) in a temporary location. This ID will be necessary for retrieving the build status using the **Get status** API in the next section.
73
73
74
74
```bash
75
75
curl -X POST "<your_endpoint>/contentsafety/text/categories/survival-advice:build?api-version=2024-02-15-preview" \
76
76
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
77
77
-H "Content-Type: application/json"
78
78
```
79
+
### Get the category build status:
80
+
81
+
To retrieve the status, utilize the `id` obtained from the previous API response and place it in the path of the API below.
82
+
83
+
```bash
84
+
curl -X GET "<your_endpoint>/contentsafety/text/categories/operations/<id>?api-version=2024-02-15-preview" \
85
+
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
86
+
-H "Content-Type: application/json"
87
+
```
79
88
80
89
## Analyze text with a customized category
81
90
@@ -141,7 +150,7 @@ print(result)
141
150
142
151
### Start the category build process
143
152
144
-
You can start the category build process with the *category name* and *version number*. Allow enough time for model training: the end-to-end execution of custom category training can take from around five hours to ten hours. Plan your moderation pipeline accordingly.
153
+
You can start the category build process with the *category name* and *version number*. Allow enough time for model training: the end-to-end execution of custom category training can take from around five hours to ten hours. Plan your moderation pipeline accordingly. After receiving the response, ensure that you store the operation ID (referred to as `id`) somewhere like your notebook. This ID will be necessary for retrieving the build status using the ‘get_build_status’ function in the next section.
0 commit comments