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
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
@@ -67,7 +60,7 @@ In the command below, replace `<your_api_key>`, `<your_endpoint>`, and other nec
67
60
### Create new category version
68
61
69
62
```bash
70
-
curl -X PUT "<your_endpoint>/contentsafety/text/categories/survival-advice?api-version=2024-09-15-preview" \
63
+
curl -X PUT "<your_endpoint>/contentsafety/text/categories/<your_category_name>?api-version=2024-09-15-preview" \
71
64
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
72
65
-H "Content-Type: application/json" \
73
66
-d "{
@@ -77,29 +70,56 @@ curl -X PUT "<your_endpoint>/contentsafety/text/categories/survival-advice?api-v
77
70
}"
78
71
```
79
72
> [!TIP]
80
-
> Every time you change your category name, definition or samples, a new version will be created. You can use the version number to trace back to previous versions. Please remember this version number, as it will be required in the URL for the next step- training custom categories.
81
-
### Get new category version
73
+
> Every time you change your category name, definition or samples,a new version will be created. You can use the version number to trace back to previous versions. Please remember this version number, as it will be required in the URL for the next step- training custom categories.
Replace <your_api_key> and <your_endpoint> with your own values, and also **append the version number you obtained from the last step.** 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.
107
+
Replace <your_api_key> and <your_endpoint> with your own values, and also **append the version number in the url you obtained from the last step.** 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.
97
108
98
109
```bash
99
110
curl -X POST "<your_endpoint>/contentsafety/text/categories/survival-advice:build?api-version=2024-09-15-preview&version={version}" \
|`customCategoryAnalysis`| Object containing the analysis result for the category. | — |
163
+
|`detected`| Indicates whether the specified category was detected. | false |
127
164
128
165
129
166
#### [Python](#tab/python)
@@ -231,11 +268,122 @@ version = 1
231
268
result = analyze_text_with_customized_category(text, category_name, version)
232
269
print(result)
233
270
```
271
+
---
272
+
273
+
## Other custom categories operations
274
+
275
+
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.
276
+
277
+
#### [cURL](#tab/curl)
278
+
279
+
### Get a customized category or a specific version of it
280
+
281
+
Replace the placeholders with your own values and run the following command in a terminal window:
282
+
283
+
```bash
284
+
curl -X GET "<endpoint>/contentsafety/text/categories/<your_category_name>?api-version=2024-09-15-preview&version=1" \
285
+
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
286
+
-H "Content-Type: application/json"
287
+
```
288
+
289
+
### List categories of their latest versions
290
+
291
+
Replace the placeholders with your own values and run the following command in a terminal window:
292
+
293
+
```bash
294
+
curl -X GET "<endpoint>/contentsafety/text/categories?api-version=2024-09-15-preview" \
295
+
-H "Ocp-Apim-Subscription-Key: <your_api_key>" \
296
+
-H "Content-Type: application/json"
297
+
```
298
+
299
+
### Delete a customized category or a specific version of it
300
+
301
+
Replace the placeholders with your own values and run the following command in a terminal window:
Copy file name to clipboardExpand all lines: articles/search/search-pagination-page-layout.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Occasionally, the content of seaarch results are unexpected. For example, you mi
49
49
50
50
+ Change **`searchMode=any`** (default) to **`searchMode=all`** to require matches on all criteria instead of any of the criteria. This is especially true when boolean operators are included the query.
51
51
52
-
+ Experiment with different lexical analyzers or custom analyzers to see if it changes the query outcome. The default analyzer breakz up hyphenated words and reduces words to root forms, which usually improves the robustness of a query response. However, if you need to preserve hyphens, or if strings include special characters, you might need to configure custom analyzers to ensure the index contains tokens in the right format. For more information, see [Partial term search and patterns with special characters (hyphens, wildcard, regex, patterns)](search-query-partial-matching.md).
52
+
+ Experiment with different lexical analyzers or custom analyzers to see if it changes the query outcome. The default analyzer breaks up hyphenated words and reduces words to root forms, which usually improves the robustness of a query response. However, if you need to preserve hyphens, or if strings include special characters, you might need to configure custom analyzers to ensure the index contains tokens in the right format. For more information, see [Partial term search and patterns with special characters (hyphens, wildcard, regex, patterns)](search-query-partial-matching.md).
0 commit comments