AI annotation

Updated at:

AI annotation automatically generates structured annotation results for records in a dataset based on the data content and the judgment rules that you define. It applies to scenarios such as intent classification, quality scoring, issue identification, and text summarization. This topic describes how to create an AI annotation task from the dataset page, view its execution status, and review and correct the annotation results.

Prerequisites

A dataset is created in the target region and AgentSpace, and the data to be annotated is written to the dataset. If the dataset has multiple versions, switch to the version that you want to use before you proceed.

AI annotation consumes tokens and incurs fees based on the actual AI credit usage. To view the billing description, click Billing Details at the top of the AI annotation configuration panel.

Step 1: Go to AI annotation

  1. Log on to the AgentLoop console, select the target region and AgentSpace, and then go to Data Center.

  2. In the dataset list, find the dataset that you want to annotate and click AI Annotation in the Actions column.

  3. In the configuration panel that appears, confirm the name of the current dataset.

You can also go to the dataset details page and click AI Annotation at the top of the page.

Step 2: Configure an annotation template

An annotation template defines the data fields to read and the annotation results to generate. If you use AI annotation for the first time or need to adjust the annotation content, click Configure Annotation Template in the AI annotation panel. If a suitable template already exists, go to Step 3.

Configure fields of interest

In the Fields of Interest step, add the data required for annotation, such as user questions, model answers, and business context.

  1. Click Add Field and select a field in the dataset. To add all fields, click Add All Schema Fields.

  2. Select a display type based on the content, and enter a remark that describes the business meaning of the field.

  3. To read a subfield in a JSON object, enter a dot-separated path, such as metadata.user.name. Before you select a subfield, make sure that the data is valid JSON and the path matches the data structure.

  4. Check the preview on the right. After you confirm the field content, click Next.

We recommend that you add only fields that are related to the annotation goal. For example, to evaluate answer quality, you usually need to provide both the user question and the model answer.

Configure annotation keys

In the Annotation Configuration step, select existing annotation keys, or click New Key to create an annotation field. Each key represents an annotation dimension. For example, intent represents the user intent, and quality_score represents the answer quality.

Annotation type

Purpose

Configuration example

Text

Generate summaries, judgment reasons, or remarks

review_note: describes the basis for the judgment. Set the required text length limit.

Number

Quality scoring or numeric extraction

quality_score: set the minimum value to 1 and the maximum value to 5, and describe the scoring criteria in the description.

Boolean

Determine whether a condition is met

is_complaint: display the true value as "Complaint" and the false value as "Non-complaint".

Enumeration

Select a category from preset options

intent: add options such as "Logistics inquiry", "Return and refund", "Product inquiry", and "Other".

When you create a key, specify the key name, type, description, and corresponding configurations. The key name must start with a letter, can contain only letters, digits, and underscores (_), and can be up to 64 characters in length. We recommend that you clearly describe the judgment goal, the meaning of each value, and boundary conditions in the description.

A template can contain multiple keys. AI generates a separate result for each key selected in the task.

Preview and save

Go to Annotation View Preview and check the fields of interest, annotation controls, and display order. You can drag the handle on the left side of a card to adjust the order.

After you confirm the settings, click Save Annotation Template to return to the AI annotation configuration. You can also click Save and Go to AI Annotation to continue configuring the task. Operations on controls in the preview are only for viewing the effect and do not submit annotation results.

Step 3: Configure an AI annotation task

Select display fields and annotation keys

In the Annotation Configuration section, confirm the input and output of the task.

Parameter

Description

Display fields

Select the data fields that AI needs to read in this task. By default, all display fields in the template are selected. Fields that are not selected are excluded from the analysis.

Annotation keys

Select the annotation keys for which results need to be generated in this task. By default, all keys in the template are selected. You can clear some keys based on the task goal.

Select at least one display field and one annotation key. If a required field or key is not in the list, click Configure Annotation Template to add it and save the template first.

Configure custom business recognition rules

To add business criteria, add a Skill in the Custom Business Recognition Rules section. A Skill is an annotation guide written in Markdown that describes field meanings, judgment steps, classification boundaries, and reference examples. If you do not have additional rules, skip this step.

Method

Description

Use a template

Click Select Template, select Error Type Classification or Business Scenario Classification, and then modify the content based on your actual fields and business criteria.

Write manually

Select Manually Enter Skill.md and enter the annotation rules in the editor.

Import a file

Select Import Skill Package, upload a ZIP file, and then click Confirm Import. The package cannot exceed 10 MB in size and must contain only one SKILL.md file.

When you write rules, use the same field names, key names, and enumeration options as those in the annotation template. For example, when you define classification rules for an enumeration key, the judgment results must come from the configured options. Rules in a Skill supplement the judgment criteria. To add a key or an enumeration option, modify the annotation configuration first.

Specify how to handle existing annotation results

Handling method

Behavior

Scenario

Skip Existing Results

The default option. Retains existing values of the current key and fills in only missing annotation items.

Complete results for unfinished data and retain confirmed manual annotations.

Re-annotate and Overwrite

Regenerates results for the keys selected in this task and replaces the original values.

Re-annotate data after you adjust the judgment criteria, or update historical results in a unified manner.

"Skip Existing Results" is evaluated by key. For example, if a record already has intent but lacks quality_score, the task still fills in quality_score and retains the original intent. Keys that are not selected in this task are not re-annotated.

Configure a scheduling policy

Select an execution method based on your data processing requirements.

Execution method

Configuration

Scenario

One-time Execution

Set Data Time Range. The annotation is performed once after the task is created.

Annotate existing data at a time, or re-annotate data within a specified time range.

Periodic Execution

Set Schedule Start Time and Execution Interval. The interval can be in seconds, minutes, hours, or days.

Data is continuously written and needs to be annotated on a regular basis.

For one-time execution, the last 1 hour is selected by default. Adjust the time range based on the data to be annotated. The data time range corresponds to the system time field __time__ of the dataset. Make sure that the time range covers the target data.

The current query conditions or annotation filters on the dataset details page are not automatically applied to the AI annotation task. Confirm the processing scope in the task configuration.

Step 4: Start annotation and view the execution status

  1. Check the display fields, annotation keys, business rules, handling method for existing results, and scheduling policy.

  2. Click Start Annotation.

  3. After the task is created, you are redirected to the Data Processing list. Open the annotation task that you created to view the task configuration and execution status.

  4. Click the Run History tab to view the status, number of output rows, and duration of each execution. If an execution fails, view the error message in the corresponding record.

For a periodic task, you can click Pause or Resume on the task details page to control subsequent scheduling.

When you use a set of annotation rules for the first time, we recommend that you run a one-time annotation on a test dataset that contains a small amount of representative data, check the results, and then process production data.

Step 5: View and review annotation results

Annotation results are saved to the corresponding records in the current dataset. After the task runs, return to the dataset details page and refresh the data list to view the results.

View and correct a single result

  1. In the data list, open the annotation panel of the target record and switch to Annotation View.

  2. Compare the results of each key against the original content in the display fields.

  3. To correct a result, modify the value in the corresponding control and click Submit Annotation. To continue checking subsequent records, click Complete and Next.

Filter by annotation results

Click Annotation Filter on the dataset details page to find data based on the annotation status or the result of a specific key. For example, you can filter records whose is_complaint is "Complaint", or records whose quality_score is within a low score range.

Annotated indicates that a record contains at least one annotation result. It does not mean that all keys in the template are filled in. If multiple annotation conditions are configured, data must meet all of the conditions.

Example: Annotate customer service conversation quality

Assume that a dataset contains two fields: question is the user question, and answer is the customer service answer. You want to identify the user intent, determine whether the user is complaining, and evaluate the answer quality.

Configure the template

Add question and answer as fields of interest, and create the following annotation keys.

Key

Type

Configuration and judgment goal

intent

Enumeration

The options are "Logistics inquiry", "Return and refund", "Product inquiry", and "Other". Identifies the main request of the user.

is_complaint

Boolean

The true value is displayed as "Complaint" and the false value as "Non-complaint". Determines whether the user explicitly expresses dissatisfaction or makes a complaint.

quality_score

Number

The minimum value is 1 and the maximum value is 5. Evaluates whether the answer resolves the user question.

review_note

Text

The maximum length is set to 80. Briefly describes the basis for the score.

Enter business rules

Enter the following content in the Skill editor. If you use the manual input method, you can replace the sample skeleton with this content and adjust it based on your business requirements.

---
name: customer-service-annotation
description: Identify the intent of customer service conversations and evaluate answer quality
---

# Customer service conversation annotation rules

Fields of interest: question is the user question, and answer is the customer service answer.

1. intent: Identify the main request of the user. Select only from the configured enumeration options.
2. is_complaint: true if the user explicitly expresses dissatisfaction or makes a complaint;
   false if the user only makes a general inquiry.
3. quality_score:
   - 1: The main issue is not resolved. Only a perfunctory or irrelevant answer is given.
   - 3: The question is partially addressed, but key information or a solution is missing.
   - 5: The question is accurately addressed, and a clear and actionable solution is provided.
   - 2 and 4 are used for cases between the adjacent criteria.
4. review_note: Briefly describe the basis for the score based on question and answer.
   Do not exceed 80 characters, and do not add facts that do not exist in the conversation.

Select the two display fields and four annotation keys, select One-time Execution, set the time range to cover the sample data, and then click Start Annotation.

Check the results

Consider the following conversation:

  • question: My order is already three days past the estimated delivery time and I still haven't received it. This is really disappointing.

  • answer: Please wait patiently.

You can refer to the following example to check whether the annotation results comply with the rules.

Key

Sample result

intent

Logistics inquiry

is_complaint

Complaint, which corresponds to the Boolean value true

quality_score

1

review_note

The reply only asks the user to wait and does not describe the logistics progress or provide a way to check it.

FAQ

Why is the Start Annotation button unavailable?

Make sure that at least one display field and one annotation key are selected and that a valid execution time configuration is specified. If fields are still loading or fail to load, or a Skill is being imported, wait until the operation is complete or reload the page, and then submit the task again.

Why are no new annotation results generated for some data?

Check the task running status and the data time range first. If you use Skip Existing Results, keys that already have values are retained. To update these results, create a new task and select Re-annotate and Overwrite.

How do I re-annotate historical data?

Go to AI Annotation from the dataset page again, confirm the keys and business rules that need to be updated, select Re-annotate and Overwrite, select One-time Execution, set a time range that covers the target data, and then start annotation.

Are images automatically recognized if the display type is set to image?

AI annotation currently analyzes text and structured content. The image display type in a template is used only to view images and does not automatically enable image content recognition.

How do I improve annotation results?

Provide the context required for judgment. In key descriptions and Skills, clearly define classification boundaries, scoring criteria, and how to handle insufficient information. Then, check the results on a small amount of representative data first. For critical results, perform manual reviews to correct them.

References

Data annotation