

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Ground Truth 的文字標籤
<a name="sms-label-text"></a>

使用 Ground Truth 標籤文字。Ground Truth 支援具名實體辨識、單一標籤文字分類和多標籤文字分類的標籤文字。下列主題說明這些內建任務類型，並協助您使用該任務類型建立標籤工作。

**提示**  
若要深入瞭解支援的檔案類型和輸入資料配額，請參閱[輸入資料](sms-data-input.md)。

**Topics**
+ [使用具名實體辨識擷取文字資訊](sms-named-entity-recg.md)
+ [以文字分類來分類文字 (單一標籤)](sms-text-classification.md)
+ [以文字分類來分類文字 (多標籤)](sms-text-classification-multilabel.md)

# 使用具名實體辨識擷取文字資訊
<a name="sms-named-entity-recg"></a>

若要從非結構化文字中擷取資訊並將其分類到預先定義的類別中，請使用 Amazon SageMaker Ground Truth 具名實體辨識 (NER) 標籤任務。傳統上，NER 包含篩選文字資料來尋找稱為*命名實體*的名詞片語，並使用標籤逐一進行分類，例如 “人員”、“組織” 或 “品牌”。您可以將此任務擴大為標籤較長的文字範圍，並使用您指定的預先定義標籤來分類那些文字序列。您可以使用 Amazon SageMaker AI 主控台的 Ground Truth 區段或 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html) 作業來建立具名實體辨識標籤工作。

在獲派具名實體辨識標籤工作時，工作者會將您的標籤套用到較大文字區塊內的特定文字或片語。他們會選擇標籤，然後使用游標反白套用標籤的文字部分，以套用該標籤。Ground Truth 具名實體辨識工具支援重疊註釋、內容標籤選取，以及單一強調顯示多標籤選取。此外，工作者可以使用鍵盤快速選取標籤。

**重要**  
如果您手動建立輸入資訊清單檔案，請使用 `"source"` 來識別您要標籤的文字。如需詳細資訊，請參閱[輸入資料](sms-data-input.md)。

## 建立具名實體辨識標籤工作 (主控台)
<a name="sms-creating-ner-console"></a>

您可以依照指示 [建立標籤工作 (主控台)](sms-create-labeling-job-console.md)，了解如何在 SageMaker AI 主控台建立具名實體辨識標籤工作。在步驟 10 中，從**任務類別**下拉式清單中選擇**文字**，然後選擇**具名實體辨識**作為任務類型。

Ground Truth 提供類似下列標籤任務的工作者使用者介面。使用主控台建立標籤工作時，您可以指定指示以協助工作者完成工作，以及工作者可以選擇的標籤。

![\[顯示如何在 SageMaker AI 主控台建立具名實體辨識標籤工作的 GIF。\]](http://docs.aws.amazon.com/zh_tw/sagemaker/latest/dg/images/sms/gifs/nertool.gif)


## 建立具名實體辨識標籤工作 (API)
<a name="sms-creating-ner-api"></a>

使用 SageMaker API 作業 `CreateLabelingJob` 建立具名實體辨識標籤工作。此 API 會定義 AWS SDKs此操作。若要查看這項作業支援的特定語言 SDK 清單，請參閱 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html) 的**另請參閱**一節。

設定請求時，請遵循[建立標籤工作 (API)](sms-create-labeling-job-api.md)上的指示並執行下列動作：
+ 此任務類型的註釋前 Lambda 函式會以 `PRE-NamedEntityRecognition` 結尾。若要尋找您區域的註釋前 Lambda ARN，請參閱 [PreHumanTaskLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_HumanTaskConfig.html#SageMaker-Type-HumanTaskConfig-PreHumanTaskLambdaArn)。
+ 此任務類型的註釋合併 Lambda 函式會以 `ACS-NamedEntityRecognition` 結尾。若要尋找您區域的註釋合併 Lambda ARN，請參閱 [AnnotationConsolidationLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_AnnotationConsolidationConfig.html#SageMaker-Type-AnnotationConsolidationConfig-AnnotationConsolidationLambdaArn)。
+ 您必須為 `[HumanTaskUiArn](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UiConfig.html#sagemaker-Type-UiConfig-HumanTaskUiArn)` 提供下列項目：

  ```
  arn:aws:sagemaker:aws-region:394669845002:human-task-ui/NamedEntityRecognition
  ```

  以您用來建立標籤工作的 AWS 區域取代 `aws-region`。例如，在美國西部 (北加州) 中建立標籤工作時使用 `us-west-1`。
+ 使用 `instructions` 參數在標籤類別組態檔案中提供工作者指示。您可以在 `shortInstruction` 和 `fullInstruction` 欄位中使用字串或 HTML 標記語言。如需詳細資訊，請參閱[在標籤類別組態檔案中提供工作者指示](#worker-instructions-ner)。

  ```
  "instructions": {"shortInstruction":"<h1>Add header</h1><p>Add Instructions</p>", "fullInstruction":"<p>Add additional instructions.</p>"}
  ```

下列是用 [AWS Python SDK (Boto3) 請求](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.create_labeling_job)在美國東部 (維吉尼亞北部) 區域建立標籤工作的範例。所有以紅色標示的參數都應該用您的規格和資源加以取代。

```
response = client.create_labeling_job(
    LabelingJobName='example-ner-labeling-job',
    LabelAttributeName='label',
    InputConfig={
        'DataSource': {
            'S3DataSource': {
                'ManifestS3Uri': 's3://bucket/path/manifest-with-input-data.json'
            }
        },
        'DataAttributes': {
            'ContentClassifiers': [
                'FreeOfPersonallyIdentifiableInformation'|'FreeOfAdultContent',
            ]
        }
    },
    OutputConfig={
        'S3OutputPath': 's3://bucket/path/file-to-store-output-data',
        'KmsKeyId': 'string'
    },
    RoleArn='arn:aws:iam::*:role/*',
    LabelCategoryConfigS3Uri='s3://bucket/path/label-categories.json',
    StoppingConditions={
        'MaxHumanLabeledObjectCount': 123,
        'MaxPercentageOfInputDatasetLabeled': 123
    },
    HumanTaskConfig={
        'WorkteamArn': 'arn:aws:sagemaker:region:*:workteam/private-crowd/*',
        'UiConfig': {
            'HumanTaskUiArn': 'arn:aws:sagemaker:us-east-1:394669845002:human-task-ui/NamedEntityRecognition'
        },
        'PreHumanTaskLambdaArn': 'arn:aws:lambda:us-east-1:432418664414:function:PRE-NamedEntityRecognition',
        'TaskKeywords': [
            'Named entity Recognition',
        ],
        'TaskTitle': 'Named entity Recognition task',
        'TaskDescription': 'Apply the labels provided to specific words or phrases within the larger text block.',
        'NumberOfHumanWorkersPerDataObject': 1,
        'TaskTimeLimitInSeconds': 28800,
        'TaskAvailabilityLifetimeInSeconds': 864000,
        'MaxConcurrentTaskCount': 1000,
        'AnnotationConsolidationConfig': {
            'AnnotationConsolidationLambdaArn': 'arn:aws:lambda:us-east-1:432418664414:function:ACS-NamedEntityRecognition'
        },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
```

### 在標籤類別組態檔案中提供工作者指示
<a name="worker-instructions-ner"></a>

您必須在使用 `CreateLabelingJob` 中的 `LabelCategoryConfigS3Uri` 參數識別的標籤類別組態檔案中提供工作者指示。您可以使用這些指示來提供您希望工作者執行的任務詳細資訊，並協助他們有效率地使用工具。

您可以分別使用 `instructions` 參數中的 `shortInstruction` 和 `fullInstruction` 提供簡短指示和詳細指示。若要深入了解這些指示類型，請參閱[建立指示頁面](sms-creating-instruction-pages.md)。

以下是標籤類別組態檔案的範例，其中包含可用於具名實體辨識標籤工作的指示。

```
{
  "document-version": "2018-11-28",
  "labels": [
    {
      "label": "label1",
      "shortDisplayName": "L1"
    },
    {
      "label": "label2",
      "shortDisplayName": "L2"
    },
    {
      "label": "label3",
      "shortDisplayName": "L3"
    },
    {
      "label": "label4",
      "shortDisplayName": "L4"
    },
    {
      "label": "label5",
      "shortDisplayName": "L5"
    }
  ],
  "instructions": {
    "shortInstruction": "<p>Enter description of the labels that workers have 
                        to choose from</p><br><p>Add examples to help workers understand the label</p>",
    "fullInstruction": "<ol>
                        <li><strong>Read</strong> the text carefully.</li>
                        <li><strong>Highlight</strong> words, phrases, or sections of the text.</li>
                        <li><strong>Choose</strong> the label that best matches what you have highlighted.</li>
                        <li>To <strong>change</strong> a label, choose highlighted text and select a new label.</li>
                        <li>To <strong>remove</strong> a label from highlighted text, choose the X next to the 
                        abbreviated label name on the highlighted text.</li>
                        <li>You can select all of a previously highlighted text, but not a portion of it.</li>
                        </ol>"
  }
}
```

## 具名實體辨識輸出資料
<a name="sms-ner-output-data"></a>

建立具名實體辨識標籤工作後，您的輸出資料會位於使用 API 時在 `S3OutputPath` 參數中指定的 Amazon S3 儲存貯體中，或在主控台**工作概觀**區段的**輸出資料集位置**中。

若要進一步了解 Ground Truth 產生的輸出資訊清單檔案，以及 Ground Truth 用來儲存輸出資料的檔案結構，請參閱[標籤工作輸出資料](sms-data-output.md)。

# 以文字分類來分類文字 (單一標籤)
<a name="sms-text-classification"></a>

若要將文章和文字分類到預先定義的類別，請使用文字分類。例如，您可以使用文字分類來識別評論中所傳達的情緒，或識別某段文字底下的情緒。使用 Amazon SageMaker Ground Truth 文字分類，讓工作者將文字分類到您定義的類別。使用 Amazon SageMaker AI 主控台的 Ground Truth 區段或 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html) 操作來建立文字分類標籤工作。

**重要**  
如果您手動建立輸入資訊清單檔案，請使用 `"source"` 來識別您要標籤的文字。如需詳細資訊，請參閱[輸入資料](sms-data-input.md)。

## 建立文字分類標籤工作 (主控台)
<a name="sms-creating-text-classification-console"></a>

您可以依照指示 [建立標籤工作 (主控台)](sms-create-labeling-job-console.md)，了解如何在 SageMaker AI 主控台建立文字分類標籤工作。在步驟 10 中，從**任務類別**下拉式清單中選擇**文字**，然後選擇**文字分類 (單一標籤)**做為任務類型。

Ground Truth 提供類似下列標籤任務的工作者使用者介面。使用主控台建立標籤工作時，您可以指定指示以協助工作者完成工作，以及工作者可以選擇的標籤。

![\[說明如何在 SageMaker AI 主控台建立文字分類標籤工作的 GIF。\]](http://docs.aws.amazon.com/zh_tw/sagemaker/latest/dg/images/sms/gifs/single-label-text.gif)


## 建立文字分類標籤工作 (API)
<a name="sms-creating-text-classification-api"></a>

若要建立文字分類標籤工作，請使用 SageMaker API 作業 `CreateLabelingJob`。此 API 會定義 AWS SDKs此操作。若要查看這項作業支援的特定語言 SDK 清單，請參閱 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html) 的**另請參閱**一節。

設定請求時，請遵循[建立標籤工作 (API)](sms-create-labeling-job-api.md)上的指示並執行下列動作：
+ 此任務類型的註釋前 Lambda 函式會以 `PRE-TextMultiClass` 結尾。若要尋找您區域的註釋前 Lambda ARN，請參閱 [PreHumanTaskLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_HumanTaskConfig.html#SageMaker-Type-HumanTaskConfig-PreHumanTaskLambdaArn)。
+ 此任務類型的註釋合併 Lambda 函式會以 `ACS-TextMultiClass` 結尾。若要尋找您區域的註釋合併 Lambda ARN，請參閱 [AnnotationConsolidationLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_AnnotationConsolidationConfig.html#SageMaker-Type-AnnotationConsolidationConfig-AnnotationConsolidationLambdaArn)。

下列是用 [AWS Python SDK (Boto3) 請求](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.create_labeling_job)，在美國東部 (維吉尼亞北部) 區域建立標籤工作的範例。所有以紅色標示的參數都應該用您的規格和資源加以取代。

```
response = client.create_labeling_job(
    LabelingJobName='example-text-classification-labeling-job,
    LabelAttributeName='label',
    InputConfig={
        'DataSource': {
            'S3DataSource': {
                'ManifestS3Uri': 's3://bucket/path/manifest-with-input-data.json'
            }
        },
        'DataAttributes': {
            'ContentClassifiers': [
                'FreeOfPersonallyIdentifiableInformation'|'FreeOfAdultContent',
            ]
        }
    },
    OutputConfig={
        'S3OutputPath': 's3://bucket/path/file-to-store-output-data',
        'KmsKeyId': 'string'
    },
    RoleArn='arn:aws:iam::*:role/*,
    LabelCategoryConfigS3Uri='s3://bucket/path/label-categories.json',
    StoppingConditions={
        'MaxHumanLabeledObjectCount': 123,
        'MaxPercentageOfInputDatasetLabeled': 123
    },
    HumanTaskConfig={
        'WorkteamArn': 'arn:aws:sagemaker:region:*:workteam/private-crowd/*',
        'UiConfig': {
            'UiTemplateS3Uri': 's3://bucket/path/worker-task-template.html'
        },
        'PreHumanTaskLambdaArn': 'arn:aws:lambda:us-east-1:432418664414:function:PRE-TextMultiClass,
        'TaskKeywords': [
            Text classification',
        ],
        'TaskTitle': Text classification task',
        'TaskDescription': 'Carefully read and classify this text using the categories provided.',
        'NumberOfHumanWorkersPerDataObject': 123,
        'TaskTimeLimitInSeconds': 123,
        'TaskAvailabilityLifetimeInSeconds': 123,
        'MaxConcurrentTaskCount': 123,
        'AnnotationConsolidationConfig': {
            'AnnotationConsolidationLambdaArn': 'arn:aws:lambda:us-east-1:432418664414:function:ACS-TextMultiClass'
        },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
```

### 提供文字分類標籤工作的範本
<a name="worker-template-text-classification"></a>

如果您使用 API 來建立標籤工作，則必須在 `UiTemplateS3Uri` 中提供工作者任務範本。複製並修改下列範本。僅修改 [https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-quick-instructions](https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-quick-instructions)、[https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-full-instructions](https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-full-instructions) 和 `header`。

將此範本上傳至 S3，並在 `UiTemplateS3Uri` 中提供此檔案的 S3 URI。

```
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>
<crowd-form>
  <crowd-classifier
    name="crowd-classifier"
    categories="{{ task.input.labels | to_json | escape }}"
    header="classify text"
  >
    <classification-target style="white-space: pre-wrap">
      {{ task.input.taskObject }}
    </classification-target>
    <full-instructions header="Classifier instructions">
      <ol><li><strong>Read</strong> the text carefully.</li>
      <li><strong>Read</strong> the examples to understand more about the options.</li>
      <li><strong>Choose</strong> the appropriate labels that best suit the text.</li></ol>
    </full-instructions>
    <short-instructions>
      <p>Enter description of the labels that workers have to choose from</p>
      <p><br></p><p><br></p><p>Add examples to help workers understand the label</p>
      <p><br></p><p><br></p><p><br></p><p><br></p><p><br></p>
    </short-instructions>
  </crowd-classifier>
  </crowd-form>
```

## 文字分類輸出資料
<a name="sms-text-classification-output-data"></a>

建立文字分類標籤工作後，您的輸出資料會位於使用 API 時在 `S3OutputPath` 參數中指定的 Amazon S3 儲存貯體中，或在主控台**工作概觀**區段的**輸出資料集位置**欄位中。

若要進一步了解 Ground Truth 產生的輸出資訊清單檔案，以及 Ground Truth 用來儲存輸出資料的檔案結構，請參閱[標籤工作輸出資料](sms-data-output.md)。

若要檢視文字分類標籤工作的輸出資訊清單檔案範例，請參閱[分類任務輸出](sms-data-output.md#sms-output-class)。

# 以文字分類來分類文字 (多標籤)
<a name="sms-text-classification-multilabel"></a>

若要將文章和文字分類成多種預先定義的類別，請使用多表千文字分類任務類型。例如，您可以使用此工作類型來識別一種以上以文字傳達的情緒。下列章節說明如何從主控台和 API 建立多標籤文字分類任務。

處理多標籤文字分類任務時，工作者應該選擇所有適用的標籤，但必須至少選擇一個標籤。使用此任務類型建立工作時，最多可提供 50 個標籤類別。

沒有套用任何標籤時，Amazon SageMaker Ground Truth 不提供 “無” 類別。若要將此選項提供給工作者，請在建立多標籤文字分類工作時，包括類似 “無” 或 “其他” 的標籤。

若要限制工作者為每個文件或所選文字選擇單一標籤，請使用 [以文字分類來分類文字 (單一標籤)](sms-text-classification.md) 任務類型。

**重要**  
如果您手動建立輸入資訊清單檔案，請使用 `"source"` 來識別要標籤的文字。如需詳細資訊，請參閱[輸入資料](sms-data-input.md)。

## 建立多標籤文字分類標籤工作 (主控台)
<a name="sms-creating-multilabel-text-classification-console"></a>

您可以依照指示 [建立標籤工作 (主控台)](sms-create-labeling-job-console.md)，了解如何在 Amazon SageMaker AI 主控台建立多標籤文字分類標籤工作。在步驟 10 中，從**任務類別**下拉式清單中選擇**文字**，然後選擇**文字分類 (多標籤)**做為任務類型。

Ground Truth 提供類似下列標籤任務的工作者使用者介面。使用主控台建立標籤工作時，您可以指定指示以協助工作者完成工作，以及工作者可以選擇的標籤。

![\[說明如何在 Amazon SageMaker AI 主控台建立多標籤文字分類標籤工作的 GIF。\]](http://docs.aws.amazon.com/zh_tw/sagemaker/latest/dg/images/sms/gifs/multi-label-text.gif)


## 建立多標籤文字分類標籤工作 (API)
<a name="sms-creating-multilabel-text-classification-api"></a>

若要建立多標籤文字分類標籤工作，請使用 SageMaker API 作業 `CreateLabelingJob`。此 API 會定義 AWS SDKs此操作。若要查看這項作業支援的特定語言 SDK 清單，請參閱 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html) 的**另請參閱**一節。

設定請求時，請遵循[建立標籤工作 (API)](sms-create-labeling-job-api.md)上的指示並執行下列動作：
+ 此任務類型的註釋前 Lambda 函式會以 `PRE-TextMultiClassMultiLabel` 結尾。若要尋找您區域的註釋前 Lambda ARN，請參閱 [PreHumanTaskLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_HumanTaskConfig.html#SageMaker-Type-HumanTaskConfig-PreHumanTaskLambdaArn)。
+ 此任務類型的註釋合併 Lambda 函式會以 `ACS-TextMultiClassMultiLabel` 結尾。若要尋找您區域的註釋合併 Lambda ARN，請參閱 [AnnotationConsolidationLambdaArn](https://docs.aws.amazon.com/sagemaker/latest/dg/API_AnnotationConsolidationConfig.html#SageMaker-Type-AnnotationConsolidationConfig-AnnotationConsolidationLambdaArn)。

下列是用 [AWS Python SDK (Boto3) 請求](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.create_labeling_job)，在美國東部 (維吉尼亞北部) 區域建立標籤工作的範例。所有以紅色標示的參數都應該用您的規格和資源加以取代。

```
response = client.create_labeling_job(
    LabelingJobName='example-multi-label-text-classification-labeling-job,
    LabelAttributeName='label',
    InputConfig={
        'DataSource': {
            'S3DataSource': {
                'ManifestS3Uri': 's3://bucket/path/manifest-with-input-data.json'
            }
        },
        'DataAttributes': {
            'ContentClassifiers': [
                'FreeOfPersonallyIdentifiableInformation'|'FreeOfAdultContent',
            ]
        }
    },
    OutputConfig={
        'S3OutputPath': 's3://bucket/path/file-to-store-output-data',
        'KmsKeyId': 'string'
    },
    RoleArn='arn:aws:iam::*:role/*,
    LabelCategoryConfigS3Uri='s3://bucket/path/label-categories.json',
    StoppingConditions={
        'MaxHumanLabeledObjectCount': 123,
        'MaxPercentageOfInputDatasetLabeled': 123
    },
    HumanTaskConfig={
        'WorkteamArn': 'arn:aws:sagemaker:region:*:workteam/private-crowd/*',
        'UiConfig': {
            'UiTemplateS3Uri': 's3://bucket/path/custom-worker-task-template.html'
        },
        'PreHumanTaskLambdaArn': 'arn:aws:lambda::function:PRE-TextMultiClassMultiLabel,
        'TaskKeywords': [
            'Text Classification',
        ],
        'TaskTitle': 'Multi-label text classification task',
        'TaskDescription': 'Select all labels that apply to the text shown',
        'NumberOfHumanWorkersPerDataObject': 123,
        'TaskTimeLimitInSeconds': 123,
        'TaskAvailabilityLifetimeInSeconds': 123,
        'MaxConcurrentTaskCount': 123,
        'AnnotationConsolidationConfig': {
            'AnnotationConsolidationLambdaArn': 'arn:aws:lambda:us-east-1:432418664414:function:ACS-TextMultiClassMultiLabel'
        },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
```

### 建立多標籤文字分類的範本
<a name="custom-template-multi-label-text-classification"></a>

如果您使用 API 來建立標籤工作，則必須在 `UiTemplateS3Uri` 中提供工作者任務範本。複製並修改下列範本。僅修改 [https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-quick-instructions](https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-quick-instructions)、[https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-full-instructions](https://docs.aws.amazon.com/sagemaker/latest/dg/sms-creating-instruction-pages.html#sms-creating-full-instructions) 和 `header`。

將此範本上傳至 S3，並在 `UiTemplateS3Uri` 中提供此檔案的 S3 URI。

```
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>
<crowd-form>
  <crowd-classifier-multi-select
    name="crowd-classifier-multi-select"
    categories="{{ task.input.labels | to_json | escape }}"
    header="Please identify all classes in the below text"
  >
    <classification-target style="white-space: pre-wrap">
      {{ task.input.taskObject }}
    </classification-target>
    <full-instructions header="Classifier instructions">
      <ol><li><strong>Read</strong> the text carefully.</li>
      <li><strong>Read</strong> the examples to understand more about the options.</li>
      <li><strong>Choose</strong> the appropriate labels that best suit the text.</li></ol>
    </full-instructions>
    <short-instructions>
      <p>Enter description of the labels that workers have to choose from</p>
      <p><br></p>
      <p><br></p><p>Add examples to help workers understand the label</p>
      <p><br></p><p><br></p><p><br></p><p><br></p><p><br></p>
    </short-instructions>
  </crowd-classifier-multi-select>
  </crowd-form>
```

若要了解如何建立自訂範本，請參閱[自訂標籤工作流程](sms-custom-templates.md)。

## 多標籤文字分類輸出資料
<a name="sms-text-classification-multi-select-output-data"></a>

建立多標籤文字分類標籤工作後，您的輸出資料會位於使用 API 時在 `S3OutputPath` 參數中指定的 Amazon S3 儲存貯體中，或在主控台**工作概觀**區段的**輸出資料集位置**欄位中。

若要進一步了解 Ground Truth 產生的輸出資訊清單檔案，以及 Ground Truth 用來儲存輸出資料的檔案結構，請參閱[標籤工作輸出資料](sms-data-output.md)。

若要檢視多標籤文字分類標籤工作的輸出資訊清單檔案範例，請參閱[多標籤分類任務輸出](sms-data-output.md#sms-output-multi-label-classification)。