Skip to content

Commit 8930b4b

Browse files
authored
Merge pull request #199384 from aahill/baher-2
custom text classification updates
2 parents 9ecad95 + 7521df1 commit 8930b4b

21 files changed

+309
-351
lines changed

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/cancel-training.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Create a **POST** request by using the following URL, headers, and JSON body to
1717
Use the following URL when creating your API request. Replace the placeholder values below with your own values.
1818

1919
```rest
20-
{ENDPOINT}/language/analyze-text/projects/{PROJECT-NAME}/train/jobs/{JOB-ID}/:cancel?api-version={API-VERSION}
20+
{Endpoint}/language/authoring/analyze-text/projects/{PROJECT-NAME}/train/jobs/{JOB-ID}/:cancel?api-version={API-VERSION}
2121
```
2222

2323
|Placeholder |Value | Example |
2424
|---------|---------|---------|
2525
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2626
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `EmailApp` |
2727
|`{JOB-ID}` | This value is the training job ID.| `XXXXX-XXXXX-XXXX-XX`|
28-
|`{API-VERSION}` | The version of the API you're calling. The value referenced is for the latest released [model version](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data). | `2022-03-01-preview` |
28+
|`{API-VERSION}` | The version of the API you're calling. The value referenced is for the latest released [model version](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data). | `2022-05-01` |
2929

3030
### Headers
3131

@@ -35,4 +35,4 @@ Use the following header to authenticate your request.
3535
|--|--|
3636
|`Ocp-Apim-Subscription-Key`| The key to your resource. Used for authenticating your API requests.|
3737

38-
After you send your API request, you'll receive a 204 response indicating success, which means your training job has been canceled.
38+
After you send your API request, you'll receive a 202 response with an `Operation-Location` header used to check the status of the job.

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/create-project.md

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ To start creating a custom text classification model, you need to create a proje
1212
> [!NOTE]
1313
> The project name is case-sensitive for all operations.
1414
15-
Create a **POST** request using the following URL, headers, and JSON body to create your project and import the labels file.
15+
Create a **PATCH** request using the following URL, headers, and JSON body to create your project.
1616

1717
### Request URL
1818

19-
Use the following URL to create a project and import your labels file. Replace the placeholder values below with your own values.
19+
Use the following URL to create a project. Replace the placeholder values below with your own values.
2020

2121
```rest
22-
{YOUR-ENDPOINT}/language/analyze-text/projects/{projectName}/:import?api-version=2021-11-01-preview
22+
{Endpoint}/language/authoring/analyze-text/projects/{projectName}?api-version={API-VERSION}
2323
```
2424

2525
|Placeholder |Value | Example |
2626
|---------|---------|---------|
27-
|`{YOUR-ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
27+
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
28+
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `myProject` |
29+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. See [Model lifecycle](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) to learn more about other available API versions. | `2022-05-01` |
30+
2831

2932
### Headers
3033

@@ -38,54 +41,54 @@ Use the following header to authenticate your request.
3841

3942
Use the following JSON in your request. Replace the placeholder values below with your own values.
4043

44+
# [Multi label classification](#tab/multi-classification)
45+
4146
```json
4247
{
43-
"api-version": "2021-11-01-preview",
44-
"metadata": {
45-
"name": "MyProject",
46-
"multiLingual": true,
47-
"description": "Trying out custom text classification",
48-
"modelType": "multiClassification",
49-
"language": "string",
50-
"storageInputContainerName": "YOUR-CONTAINER-NAME",
51-
"settings": {}
52-
},
53-
"assets": {
54-
"classifiers": [
55-
{
56-
"name": "Class1"
57-
}
58-
],
59-
"documents": [
60-
{
61-
"location": "doc1.txt",
62-
"language": "en-us",
63-
"dataset": "Train",
64-
"classifiers": [
65-
{
66-
"classifierName": "Class1"
67-
}
68-
]
69-
}
70-
]
71-
}
48+
"projectName": "{PROJECT-NAME}",
49+
"language": "{LANGUAGE-CODE}",
50+
"projectKind": "customMultiLabelClassification",
51+
"description": "Project description",
52+
"multilingual": "True",
53+
"storageInputContainerName": "{CONTAINER-NAME}"
7254
}
55+
7356
```
74-
For the metadata key:
7557

76-
|Key |Value | Example |
77-
|---------|---------|---------|
78-
| `modelType ` | Your Model type, for single label classification use `singleClassification`. | multiClassification |
79-
|`storageInputContainerName` | The name of your Azure blob storage container. | `myContainer` |
58+
|Key |Placeholder|Value | Example |
59+
|---------|---------|---------|--|
60+
| projectName | `{PROJECT-NAME}` | The name of your project. This value is case-sensitive. | `myProject` |
61+
| language | `{LANGUAGE-CODE}` | A string specifying the language code for the documents used in your project. If your project is a multilingual project, choose the language code of the majority of the documents. See [language support](../../language-support.md) to learn more about supported language codes. |`en-us`|
62+
| projectKind | `customMultiLabelClassification` | Your project kind. | `customMultiLabelClassification` |
63+
| multilingual | `true`| A boolean value that enables you to have documents in multiple languages in your dataset and when your model is deployed you can query the model in any supported language (not necessarily included in your training documents. See [language support](../../language-support.md#multi-lingual-option) to learn more about multilingual support. | `true`|
64+
| storageInputContainerName | `{CONTAINER-NAME}` | The name of your Azure storage container where you have uploaded your documents. | `myContainer` |
8065

81-
For the documents key:
66+
---
8267

83-
|Key |Value | Example |
84-
|---------|---------|---------|
85-
| `location` | Document name on the blob store. | `doc2.txt` |
86-
|`language` | The language of the document. | `en-us` |
87-
|`dataset` | Optional field to specify the dataset that this document will belong to. | `Train` or `Test` |
68+
# [Single label classification](#tab/single-classification)
8869

89-
This request will return an error if:
70+
```json
71+
{
72+
"projectName": "{PROJECT-NAME}",
73+
"language": "{LANGUAGE-CODE}",
74+
"projectKind": "customSingleLabelClassification",
75+
"description": "Project description",
76+
"multilingual": "True",
77+
"storageInputContainerName": "{CONTAINER-NAME}"
78+
}
79+
```
80+
|Key |Placeholder|Value | Example |
81+
|---------|---------|---------|--|
82+
| projectName | `{PROJECT-NAME}` | The name of your project. This value is case-sensitive. | `myProject` |
83+
| language | `{LANGUAGE-CODE}` | A string specifying the language code for the documents used in your project. If your project is a multilingual project, choose the language code of the majority of the documents. See [language support](../../language-support.md) to learn more about supported language codes. |`en-us`|
84+
| projectKind | `customSingleLabelClassification` | Your project kind. | `customSingleLabelClassification` |
85+
| multilingual | `true`| A boolean value that enables you to have documents in multiple languages in your dataset and when your model is deployed you can query the model in any supported language (not necessarily included in your training documents. See [language support](../../language-support.md#multi-lingual-option) to learn more about multilingual support. | `true`|
86+
| storageInputContainerName | `{CONTAINER-NAME}` | The name of your Azure storage container where you have uploaded your documents. | `myContainer` |
87+
88+
---
9089

90+
This request will return a 201 response, which means that the project is created.
91+
92+
93+
This request will return an error if:
9194
* The selected resource doesn't have proper permission for the storage account.

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/delete-deployment.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Create a **DELETE** request using the following URL, headers, and JSON body to d
1818
### Request URL
1919

2020
```rest
21-
{ENDPOINT}/language/analyze-text/projects/{PROJECT-NAME}/deployments/{deploymentName}?api-version={API-VERSION}
21+
{Endpoint}/language/authoring/analyze-text/projects/{PROJECT-NAME}/deployments/{deploymentName}?api-version={API-VERSION}
2222
```
2323

2424
|Placeholder |Value | Example |
2525
|---------|---------|---------|
2626
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2727
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `myProject` |
2828
|`{DEPLOYMENT-NAME}` | The name for your deployment name. This value is case-sensitive. | `prod` |
29-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-03-01-preview` |
29+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-05-01` |
3030

3131
### Headers
3232

@@ -37,4 +37,6 @@ Use the following header to authenticate your request.
3737
|`Ocp-Apim-Subscription-Key`| The key to your resource. Used for authenticating your API requests.|
3838

3939

40-
Once you send your API request, you will receive a `202` response indicating success, which means your deployment has been deleted.
40+
Once you send your API request, you will receive a `202` response indicating success, which means your deployment has been deleted. A successful call results with an `Operation-Location` header used to check the status of the job.
41+
42+

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/delete-model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ ms.author: aahi
1212

1313

1414

15-
Create a **DELETE** request using the following URL, headers, and JSON body to delete a model.
15+
Create a **DELETE** request using the following URL, headers, and JSON body to delete a trained model.
1616

1717

1818
### Request URL
1919

2020
```rest
21-
{ENDPOINT}/language/analyze-text/projects/{PROJECT-NAME}/models/{trainedModelLabel}?api-version={API-VERSION}
21+
{Endpoint}/language/authoring/analyze-text/projects/{PROJECT-NAME}/models/{trainedModelLabel}?api-version={API-VERSION}
2222
```
2323

2424
|Placeholder |Value | Example |
2525
|---------|---------|---------|
2626
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2727
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `myProject` |
2828
|`{trainedModelLabel}` | The name for your model name. This value is case-sensitive. | `model1` |
29-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-03-01-preview` |
29+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-05-01` |
3030

3131
### Headers
3232

@@ -37,4 +37,4 @@ Use the following header to authenticate your request.
3737
|`Ocp-Apim-Subscription-Key`| The key to your resource. Used for authenticating your API requests.|
3838

3939

40-
Once you send your API request, you will receive a `202` response indicating success, which means your model has been deleted.
40+
Once you send your API request, you will receive a `204` response indicating success, which means your trained model has been deleted.

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/delete-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ ms.author: aahi
1212
When you no longer need your project, you can delete it with the following **DELETE** request. Replace the placeholder values with your own values.
1313

1414
```rest
15-
{ENDPOINT}/language/authoring/analyze-text/projects/{PROJECT-NAME}?api-version={API-VERSION}
15+
{Endpoint}/language/authoring/analyze-text/projects/{projectName}?api-version={API-VERSION}
1616
```
1717

1818
|Placeholder |Value | Example |
1919
|---------|---------|---------|
2020
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2121
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `myProject` |
22-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-03-01-preview` |
22+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-05-01` |
2323

2424
### Headers
2525

@@ -30,4 +30,4 @@ Use the following header to authenticate your request.
3030
|Ocp-Apim-Subscription-Key| The key to your resource. Used for authenticating your API requests.|
3131

3232

33-
Once you send your API request, you will receive a `202` response indicating success, which means your project has been deleted.
33+
Once you send your API request, you will receive a `202` response indicating success, which means your project has been deleted. A successful call results with an `Operation-Location` header used to check the status of the job.

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/deploy-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ ms.author: aahi
1313
Submit a **PUT** request using the following URL, headers, and JSON body to submit a deployment job. Replace the placeholder values below with your own values.
1414

1515
```rest
16-
{ENDPOINT}/language/authoring/analyze-text/projects/{PROJECT-NAME}/deployments/{DEPLOYMENT-NAME}?api-version={API-VERSION}
16+
{Endpoint}/language/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}?api-version={API-VERSION}
1717
```
1818

1919
| Placeholder |Value | Example |
2020
|---------|---------|---------|
2121
| `{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2222
| `{PROJECT-NAME}` | The name of your project. This value is case-sensitive. | `myProject` |
2323
| `{DEPLOYMENT-NAME}` | The name of your deployment. This value is case-sensitive. | `staging` |
24-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-03-01-preview` |
24+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-05-01` |
2525

2626
#### Headers
2727

@@ -45,7 +45,7 @@ Use the following JSON in the body of your request. Use the name of the model yo
4545
|---------|---------|-----|----|
4646
| trainedModelLabel | `{MODEL-NAME}` | The model name that will be assigned to your deployment. You can only assign successfully trained models. This value is case-sensitive. | `myModel` |
4747

48-
Once you send your API request, you’ll receive a `202` response indicating that the job was submitted correctly. In the response headers, extract the `location` value. It will be formatted like this:
48+
Once you send your API request, you’ll receive a `202` response indicating that the job was submitted correctly. In the response headers, extract the `operation-location` value. It will be formatted like this:
4949

5050
```rest
5151
{ENDPOINT}/language/authoring/analyze-text/projects/{PROJECT-NAME}/deployments/{DEPLOYMENT-NAME}/jobs/{JOB-ID}?api-version={API-VERSION}

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/export-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Create a **POST** request using the following URL, headers, and JSON body to exp
1818
Use the following URL when creating your API request. Replace the placeholder values below with your own values.
1919

2020
```rest
21-
{ENDPOINT}/language/analyze-text/projects/{PROJECT-NAME}/:export?api-version={API-VERSION}
21+
{ENDPOINT}/language/authoring/analyze-text/projects/{PROJECT-NAME}/:export?stringIndexType=Utf16CodeUnit&api-version={API-VERSION}
2222
```
2323

2424
|Placeholder |Value | Example |
2525
|---------|---------|---------|
2626
|`{ENDPOINT}` | The endpoint for authenticating your API request. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
2727
|`{PROJECT-NAME}` | The name for your project. This value is case-sensitive. | `MyProject` |
28-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is the latest [model version](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) released. | `2022-03-01-preview` |
28+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is the latest [model version](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) released. | `2022-05-01` |
2929

3030
### Headers
3131

articles/cognitive-services/language-service/custom-text-classification/includes/rest-api/get-deployment-status.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Use the following **GET** request to query the status of the deployment job. You
2222
| `{PROJECT-NAME}` | The name of your project. This value is case-sensitive. | `myProject` |
2323
| `{DEPLOYMENT-NAME}` | The name of your deployment. This value is case-sensitive. | `staging` |
2424
|`{JOB-ID}` | The ID for locating your model's training status. This is in the `location` header value you received in the previous step. | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx` |
25-
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-03-01-preview` |
25+
|`{API-VERSION}` | The version of the API you are calling. The value referenced here is for the latest version released. Learn more about other available [API versions](../../../concepts/model-lifecycle.md#choose-the-model-version-used-on-your-data) | `2022-05-01` |
2626

2727
#### Headers
2828

@@ -35,7 +35,7 @@ Use the following header to authenticate your request.
3535

3636
### Response Body
3737

38-
Once you send the request, you will get the following response. Keep polling this endpoint until the **status** parameter changes to "succeeded".
38+
Once you send the request, you will get the following response. Keep polling this endpoint until the **status** parameter changes to "succeeded". You should get a `200` code to indicate the success of the request.
3939

4040
```json
4141
{

0 commit comments

Comments
 (0)