Skip to content

Commit f454820

Browse files
authored
Merge pull request #245385 from MicrosoftDocs/release-cogserv-custom-sentiment
Release cogserv custom sentiment --scheduled release at 3PM of 7/19
2 parents 33c519d + 05b2aca commit f454820

38 files changed

+2048
-91
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Custom sentiment analysis data formats
3+
titleSuffix: Azure AI services
4+
description: Learn about the data formats accepted by custom sentiment analysis.
5+
services: cognitive-services
6+
author: aahill
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: language-service
10+
ms.topic: conceptual
11+
ms.date: 07/18/2023
12+
ms.author: aahi
13+
ms.custom: language-service-custom-ner, ignite-fall-2021, event-tier1-build-2022
14+
---
15+
16+
# Accepted custom sentiment analysis data formats
17+
18+
If you are trying to [import your data](../how-to/create-project.md#import-a-custom-sentiment-analysis-project) into custom sentiment analysis, it has to follow a specific format. If you don't have data to import, you can [create your project](../how-to/create-project.md) and use Language Studio to [label your documents](../how-to/label-data.md).
19+
20+
## Labels file format
21+
22+
Your Labels file should be in the `json` format below to be used in [importing](../how-to/create-project.md#import-a-custom-sentiment-analysis-project) your labels into a project.
23+
24+
```json
25+
{
26+
"projectFileVersion": "2023-04-15-preview",
27+
"stringIndexType": "Utf16CodeUnit",
28+
"metadata": {
29+
"projectKind": "CustomTextSentiment",
30+
"storageInputContainerName": "custom-sentiment-2",
31+
"projectName": "sa-test",
32+
"multilingual": false,
33+
"description": "",
34+
"language": "en-us"
35+
},
36+
"assets": {
37+
"projectKind": "CustomTextSentiment",
38+
"documents": [
39+
{
40+
"location": "document_1.txt",
41+
"language": "en-us",
42+
"sentimentSpans": [
43+
{
44+
"category": "positive",
45+
"offset": 0,
46+
"length": 60
47+
},
48+
{
49+
"category": "neutral",
50+
"offset": 61,
51+
"length": 31
52+
}
53+
],
54+
"dataset": "Train"
55+
},
56+
{
57+
"location": "document_2.txt",
58+
"language": "en-us",
59+
"sentimentSpans": [
60+
{
61+
"category": "positive",
62+
"offset": 0,
63+
"length": 50
64+
},
65+
{
66+
"category": "positive",
67+
"offset": 51,
68+
"length": 49
69+
},
70+
{
71+
"category": "positive",
72+
"offset": 101,
73+
"length": 26
74+
}
75+
],
76+
"dataset": "Train"
77+
}
78+
]
79+
}
80+
}
81+
82+
```
83+
84+
|Key |Placeholder |Value | Example |
85+
|---------|---------|----------|--|
86+
| `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-custom-sentiment-analysis-only) to learn more about multilingual support. | `true`|
87+
|`projectName`|`{PROJECT-NAME}`|Project name|`myproject`|
88+
| storageInputContainerName|`{CONTAINER-NAME}`|Container name|`mycontainer`|
89+
| `sentimentSpans` | | Array containing all the sentiments and their locations in the document. | |
90+
| `documents` | | Array containing all the documents in your project and list of the entities labeled within each document. | [] |
91+
| `location` | `{DOCUMENT-NAME}` | The location of the documents in the storage container. Since all the documents are in the root of the container this should be the document name.|`doc1.txt`|
92+
| `dataset` | `{DATASET}` | The test set to which this file will go to when split before training. Learn more about data splitting [here](../how-to/train-model.md#data-splitting) . Possible values for this field are `Train` and `Test`. |`Train`|
93+
| `offset` | | The inclusive character position of the start of a sentiment in the text. |`0`|
94+
| `length` | | The length of the bounding box in terms of UTF16 characters. Training only considers the data in this region. |`500`|
95+
| `category` | | The sentiment associated with the span of text specified. | `positive`|
96+
| `offset` | | The start position for the entity text. | `25`|
97+
| `length` | | The length of the entity in terms of UTF16 characters. | `20`|
98+
| `language` | `{LANGUAGE-CODE}` | A string specifying the language code for the document 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) for more information about supported language codes. |`en-us`|
99+
100+
101+
102+
## Next steps
103+
* You can import your labeled data into your project directly. Learn how to [import project](../how-to/create-project.md#import-a-custom-sentiment-analysis-project)
104+
* See the [how-to article](../how-to/label-data.md) more information about labeling your data. When you're done labeling your data, you can [train your model](../how-to/train-model.md).
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Send a Custom sentiment analysis request to your custom model
3+
description: Learn how to send requests for Custom sentiment analysis.
4+
titleSuffix: Azure AI services
5+
services: cognitive-services
6+
author: aahill
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: language-service
10+
ms.topic: how-to
11+
ms.date: 06/03/2022
12+
ms.author: aahi
13+
ms.devlang: csharp, python
14+
ms.custom: language-service-custom-ner, event-tier1-build-2022
15+
---
16+
17+
# Send a Custom sentiment analysis request to your custom model
18+
19+
After the deployment is added successfully, you can query the deployment to extract entities from your text based on the model you assigned to the deployment.
20+
You can query the deployment programmatically using the [Prediction API](https://aka.ms/ct-runtime-api) or through the client libraries (Azure SDK).
21+
22+
## Test a deployed Custom sentiment analysis model
23+
24+
You can use Language Studio to submit the custom entity recognition task and visualize the results.
25+
26+
[!INCLUDE [Test model](../../../includes/custom/language-studio/test-model.md)]
27+
28+
<!--:::image type="content" source="../media/test-model-results.png" alt-text="View the test results" lightbox="../media/test-model-results.png":::--->
29+
30+
31+
## Send a sentiment analysis request to your model
32+
33+
# [Language Studio](#tab/language-studio)
34+
35+
[!INCLUDE [Get prediction URL](../../../includes/custom/language-studio/get-prediction-url.md)]
36+
37+
# [REST API](#tab/rest-api)
38+
39+
First you need to get your resource key and endpoint:
40+
41+
[!INCLUDE [Get keys and endpoint Azure Portal](../../../includes/key-endpoint-page-azure-portal.md)]
42+
43+
44+
45+
46+
### Submit a Custom sentiment analysis task
47+
48+
[!INCLUDE [submit a Custom sentiment analysis task using the REST API](../../includes/custom/rest-api/submit-task.md)]
49+
50+
### Get task results
51+
52+
[!INCLUDE [get Custom sentiment analysis task results](../../includes/custom/rest-api/get-results.md)]
53+
54+
## Next steps
55+
56+
* [Sentiment Analysis overview](../../overview.md)
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: How to create Custom sentiment analysis projects
3+
titleSuffix: Azure AI services
4+
description: Learn about the steps for using Azure resources with Custom sentiment analysis.
5+
services: cognitive-services
6+
author: aahill
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: language-service
10+
ms.topic: how-to
11+
ms.date: 06/03/2022
12+
ms.author: aahi
13+
ms.custom: language-service-custom-classification, references_regions, ignite-fall-2021, event-tier1-build-2022
14+
---
15+
16+
# How to create Custom sentiment analysis project
17+
18+
Use this article to learn how to set up the requirements for starting with Custom sentiment analysis and create a project.
19+
20+
## Prerequisites
21+
22+
Before you start using Custom sentiment analysis, you'll need:
23+
24+
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services).
25+
26+
## Create a Language resource
27+
28+
Before you start using Custom sentiment analysis, you'll need an Azure Language resource. It's recommended to create your Language resource and connect a storage account to it in the Azure portal. Creating a resource in the Azure portal lets you create an Azure storage account at the same time, with all of the required permissions preconfigured. You can also read further in the article to learn how to use a pre-existing resource, and configure it to work with Custom sentiment analysis.
29+
30+
You also need an Azure storage account where you'll upload your `.txt` documents that will be used to train a model to classify text.
31+
32+
> [!NOTE]
33+
> * You need to have an **owner** role assigned on the resource group to create a Language resource.
34+
> * If you will connect a pre-existing storage account, you should have an **owner** role assigned to it.
35+
36+
## Create Language resource and connect storage account
37+
38+
39+
> [!Note]
40+
> You shouldn't move the storage account to a different resource group or subscription once it's linked with the Language resource.
41+
42+
[!INCLUDE [create a new resource from the Azure portal](../../../includes/custom/resource-creation-azure-portal.md)]
43+
44+
[!INCLUDE [create a new resource from Language Studio](../../../includes/custom/resource-creation-language-studio.md)]
45+
46+
[!INCLUDE [create a new resource with Azure PowerShell](../../../includes/custom/resource-creation-powershell.md)]
47+
48+
49+
---
50+
51+
> [!NOTE]
52+
> * The process of connecting a storage account to your Language resource is irreversible, it cannot be disconnected later.
53+
> * You can only connect your language resource to one storage account.
54+
55+
## Using a pre-existing Language resource
56+
57+
[!INCLUDE [use an existing resource](../../../includes/custom/use-pre-existing-resource.md)]
58+
59+
60+
## Create a Custom sentiment analysis project
61+
62+
Once your resource and storage container are configured, create a new Custom sentiment analysis project. A project is a work area for building your custom AI models based on your data. Your project can only be accessed by you and others who have access to the Azure resource being used. If you have labeled data, you can [import it](#import-a-custom-sentiment-analysis-project) to get started.
63+
64+
### [Language Studio](#tab/studio)
65+
66+
[!INCLUDE [Language Studio project creation](../../../includes/custom/language-studio/create-project.md)]
67+
68+
69+
### [REST APIs](#tab/apis)
70+
71+
[!INCLUDE [REST APIs project creation](../../includes/custom/rest-api/create-project.md)]
72+
73+
---
74+
75+
## Import a Custom sentiment analysis project
76+
77+
<!--If you have already labeled data, you can use it to get started with the service. Make sure that your labeled data follows the [accepted data formats](../concepts/data-formats.md).-->
78+
79+
### [Language Studio](#tab/studio)
80+
81+
[!INCLUDE [Import project](../../../includes/custom/language-studio/import-project.md)]
82+
83+
### [REST APIs](#tab/apis)
84+
85+
[!INCLUDE [Import project](../../includes/custom/rest-api/import-project.md)]
86+
87+
---
88+
89+
## Get project details
90+
91+
### [Language Studio](#tab/studio)
92+
93+
[!INCLUDE [Language Studio project details](../../../includes/custom/language-studio/project-details.md)]
94+
95+
### [REST APIs](#tab/apis)
96+
97+
[!INCLUDE [REST API project details](../../includes/custom/rest-api/project-details.md)]
98+
99+
---
100+
101+
## Delete project
102+
103+
### [Language Studio](#tab/studio)
104+
105+
[!INCLUDE [Delete project using Language Studio](../../../includes/custom/language-studio/delete-project.md)]
106+
107+
### [REST APIs](#tab/apis)
108+
109+
[!INCLUDE [Delete project using the REST API](../../includes/custom/rest-api/delete-project.md)]
110+
111+
---
112+
113+
## Next steps
114+
115+
* [Sentiment analysis overview](../../overview.md)
116+
<!--* You should have an idea of the [project schema](design-schema.md) you will use to label your data.
117+
118+
* After your project is created, you can start [labeling your data](tag-data.md), which will inform your text classification model how to interpret text, and is used for training and evaluation.-->
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: Deploy a Custom sentiment analysis model
3+
titleSuffix: Azure AI services
4+
description: Learn about deploying a model for Custom sentiment analysis.
5+
services: cognitive-services
6+
author: aahill
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: language-service
10+
ms.topic: how-to
11+
ms.date: 05/17/2023
12+
ms.author: aahi
13+
ms.custom: language-service-custom-ta4h
14+
---
15+
16+
# Deploy a Custom sentiment analysis model
17+
18+
Once you're satisfied with how your model performs, it's ready to be deployed and used to recognize entities in text. Deploying a model makes it available for use through the [prediction API](https://aka.ms/ct-runtime-swagger).
19+
20+
## Prerequisites
21+
22+
* A successfully [created project](create-project.md) with a configured Azure storage account.
23+
* Text data that has [been uploaded](design-schema.md#data-preparation) to your storage account.
24+
<!--* [Labeled data](label-data.md) and a successfully [trained model](train-model.md).
25+
* Reviewed the [model evaluation details](view-model-evaluation.md) to determine how your model is performing.
26+
27+
For more information, see [project development lifecycle](../overview.md#project-development-lifecycle).-->
28+
29+
## Deploy model
30+
31+
After you've reviewed your model's performance and decided it can be used in your environment, you need to assign it to a deployment. Assigning the model to a deployment makes it available for use through the [prediction API](https://aka.ms/ct-runtime-swagger). It is recommended to create a deployment named *production* to which you assign the best model you have built so far and use it in your system. You can create another deployment called *staging* to which you can assign the model you're currently working on to be able to test it. You can have a maximum of 10 deployments in your project.
32+
33+
<!--# [Language Studio](#tab/language-studio)
34+
35+
[!INCLUDE [Deploy a model using Language Studio](../../../includes/custom/language-studio/deploy-model.md)]
36+
37+
# [REST APIs](#tab/rest-api)
38+
-->
39+
### Submit deployment job
40+
41+
[!INCLUDE [deploy model](../../includes/custom/rest-api/deploy-model.md)]
42+
43+
### Get deployment job status
44+
45+
[!INCLUDE [get deployment status](../../includes/custom/rest-api/get-deployment-status.md)]
46+
47+
## Swap deployments
48+
49+
After you are done testing a model assigned to one deployment and you want to assign this model to another deployment you can swap these two deployments. Swapping deployments involves taking the model assigned to the first deployment, and assigning it to the second deployment. Then taking the model assigned to second deployment, and assigning it to the first deployment. You can use this process to swap your *production* and *staging* deployments when you want to take the model assigned to *staging* and assign it to *production*.
50+
51+
# [Language Studio](#tab/language-studio)
52+
53+
[!INCLUDE [Swap deployments](../../../includes/custom/language-studio/swap-deployment.md)]
54+
55+
# [REST APIs](#tab/rest-api)
56+
57+
[!INCLUDE [Swap deployments](../../includes/custom/rest-api/swap-deployment.md)]
58+
59+
---
60+
61+
62+
## Delete deployment
63+
64+
# [Language Studio](#tab/language-studio)
65+
66+
[!INCLUDE [Delete deployment](../../../includes/custom/language-studio/delete-deployment.md)]
67+
68+
# [REST APIs](#tab/rest-api)
69+
70+
[!INCLUDE [Delete deployment](../../includes/custom/rest-api/delete-deployment.md)]
71+
72+
---
73+
74+
## Assign deployment resources
75+
76+
You can [deploy your project to multiple regions](../../../concepts/custom-features/multi-region-deployment.md) by assigning different Language resources that exist in different regions.
77+
78+
# [Language Studio](#tab/language-studio)
79+
80+
[!INCLUDE [Assign resource](../../../includes/custom/language-studio/assign-resources.md)]
81+
82+
# [REST APIs](#tab/rest-api)
83+
84+
[!INCLUDE [Assign resource](../../includes/custom/rest-api/assign-resources.md)]
85+
86+
---
87+
88+
## Unassign deployment resources
89+
90+
When unassigning or removing a deployment resource from a project, you will also delete all the deployments that have been deployed to that resource's region.
91+
92+
# [Language Studio](#tab/language-studio)
93+
94+
[!INCLUDE [Unassign resource](../../../includes/custom/language-studio/unassign-resources.md)]
95+
96+
# [REST APIs](#tab/rest-api)
97+
98+
[!INCLUDE [Unassign resource](../../includes/custom/rest-api/unassign-resources.md)]
99+
100+
---
101+
102+
## Next steps
103+
104+
* [Sentiment analysis overview](../../overview.md)
105+
<!--After you have a deployment, you can use it to [extract entities](call-api.md) from text.-->

0 commit comments

Comments
 (0)