Sentiment analysis

更新时间:
复制 MD 格式

Service activation and resource plan purchase

Before using pre-trained models, ensure that the NLP Self-Learning Platform service is activated. After you activate the service, you can purchase a resource plan.

NLP Self-Learning Platform: Activation page

Self-Learning Platform resource plan: Purchase page

1. Create a project

The NLP Self-Learning Platform (Go to the Self-Learning Platform console) supports various project types and application algorithms. This tutorial shows you how to create a sentiment analysis project on the NLP Self-Learning Platform.

Go to My Projects or click Create Project. Under Application Algorithms, select Sentiment Analysis and click Create.

On the next page, enter a project name and description.

2. Data preparation

Go to My Projects. In the Data Center, you can manage your data. You can create a dataset in two ways:

1. Create an annotation task. 2. Upload a dataset.

2.1 Create an annotation task

Step 1: Upload documents for annotation and add annotators

Note

The project creator and project administrators are annotators by default. You can also assign annotation tasks to Alibaba Cloud RAM users that you create. Assigned users can log on to the platform with their RAM user credentials to perform data annotation.

RAM user logon instructions:

1. Go to the RAM user logon page: https://signin.aliyun.com/login.htm

2. After you log on, go to My Projects and create an annotation task.

Note: Only data files with UTF-8 encoding are supported.

Step 2: Annotate data

2.2 Upload a dataset

Models learn patterns from labeled data. Therefore, you must first prepare a labeled dataset.

If you already have labeled data, you must format it as required by the NLP Self-Learning Platform before uploading it.

The labeled data that you upload must be in JSON format and must conform to the following structure. The text content is in the `content` field, and the label is in the `records` object. The `records` object contains the sentiment polarity, which can be positive or negative.

{
  "0": {
    "id": "1",
    "content": "So beautiful! And it's very thick with excellent water absorption. Really cheap and good. I couldn't wait to install it as soon as I got it. I tried it, and it's great!",
    "records": {
      "sentiment": [
        "positive"
      ]
    }
  },
   "1": {
    "id": "2",
    "content": "I bought the 88 CNY one. It makes a little noise when pulled indoors, but it's not too loud and is acceptable. The wheels have steel ball bearings. I use it every day, so I hope it's durable, especially the wheels.",
    "records": {
      "sentiment": [
        "negative"
      ]
    }
  }

3. Create a model

In the Model Hub, click Create Model.

To view the details of a model, click View in the corresponding row.

Model details page

Model testing

After the model is trained, you can test its performance online.

image