

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# SageMaker 人工智能人群 HTML 元素
<a name="general-topiclist"></a>

下面列出了一些 Crowd HTML Elements，它们能让构建自定义模板变得更容易，并为工作人员提供熟悉的 UI。Ground Truth、Augmented AI 和 Mechanical Turk 支持这些元素。

## Crowd HTML Elements V2
<a name="elements-v2"></a>

Crowd HTML V2 Elements 引入了专为支持工作人员而设计的增强型标注功能，并提供了专为 GenAI 模型训练使用案例量身定制的新功能。这些 V2 元素与 Crowd HTML 元素 crowd-form、short-instructions、crowd-button、crowd-tabs 和 crowd-tab 兼容。如果将其它元素与 V2 元素结合使用，则注释应用程序将无法正常运行。

### crowd-text-ranking
<a name="sms-ui-template-crowd-text-ranking"></a>

一个小组件，供工作人员根据您指定的维度对各种文本输入进行滑动和排名。

查看使用此 Crowd HTML 元素的 HTML 模板的交互式示例[CodePen](https://codepen.io/sagemaker_crowd_html_elements_2/pen/ZYGqBPQ)。

```
<script src="https://assets.crowd.aws/crowd-html-elements-v2.js"></script>

<crowd-form>
  <crowd-text-ranking
    name="textRanking"
    ordinal-ranking-dimensions='[{"name":"Clarity","allowTie":true},{"name":"Inclusivity","allowTie":false}]'
    text="Explain why you can see yourself in a mirror at a level that a 16 year old can understand."
    responses='["When light is emitted from light source like a light bulb, some of it travels toward your body, where it may be reflected toward the mirror with some probability or it may be absorbed. If it were reflected off your body, then some of it could travel toward the mirror, where it could be reflected again. If it is the case where light strikes the mirror, the light is then again redirected as a reflection. If that light is pointed in the direction of your eyes, then the light will enter your eyes. Then, your brain processes the electrical signal made by your eyes and sees it as an image.","You can see yourself because of a series of light reflections. Light travels from the light source, hits and reflects off of your body and travels toward the mirror. Then, it reflects off of the mirror and travels to your eyes, where your brain registers it as a picture of yourself.","Light travels in various directions from a light source like a light bulb. Some of the light reflects off of your body with some probability, after which some of it travels to the mirror. Upon striking the mirror, the some of the light again reflects off the mirror and travels toward your eyes, wherein your eyes detect the light after absorbing it. After this process, your brain processes the signal as an image of yourself.","The phenomenon of self-visual perception via a mirror at an ontological plane derives from the intricate interplay of photons within the electromagnetic spectrum, quantum mechanical principles, and the neurocognitive processes underpinning self-recognition. In essence, the mirror serves as an interface wherein incident photons, emitted from an external object, interact with the reflective surface at a specific angle of incidence governed by the laws of geometric optics. This interaction culminates in the process of specular reflection, leading to the formation of a virtual image."]'
  >
    <short-instructions>
      <h1>Hello these are my instructions 1</h1>
      <p>Hello these are my instructions 2</p>
      <p>Hello these are my instructions 3</p>
    </short-instructions>
  </crowd-text-ranking>
</crowd-form>
```

#### 属性
<a name="crowd-text-ranking-attributes"></a>

以下是此元素支持的属性。

##### 文本
<a name="crowd-text-ranking-attributes-text"></a>

对响应进行排名时要引用的文本或对该文本的 S3 引用。

##### ordinal-ranking-dimensions
<a name="crowd-text-ranking-attributes-ordinal-ranking"></a>

`ordinal-ranking-dimensions` 对象的必需数组，用于指定对响应进行排名的维度。此维度包含**名称**和一个名为 **allowTie** 的属性，该属性决定工作人员能否为响应提供相同的排名。

##### 响应
<a name="crowd-text-ranking-attributes-responses"></a>

`ordinal-ranking-dimensions` 对象的必需数组，用于指定对响应进行排名的维度。此维度包含**名称**和一个名为 **allowTie** 的属性，该属性决定工作人员能否为响应提供相同的排名。

##### name
<a name="crowd-text-ranking-attributes-name"></a>

一个必需的字符串字段，用于标识工作人员提交的答案。它与工作人员提交的输出数据合同中的密钥相匹配。

有关更多信息，请参阅下列内容。
+ [使用 Amazon G SageMaker round Truth 使用人类训练数据标签](sms.md)
+ [Crowd HTML 元素参考](sms-ui-template-reference.md)

### crowd-question-answer-generation
<a name="sms-ui-template-crowd-question-answer-generation"></a>

一个小组件，供工作人员突出显示文本的各个部分并根据您的说明分配问答对

查看使用此 Crowd HTML 元素的 HTML 模板的交互式示例[CodePen](https://codepen.io/sagemaker_crowd_html_elements_2/pen/zxGmobo)。

```
<script src="https://assets.crowd.aws/crowd-html-elements-v2.js"></script>

<crowd-form>
  <crowd-question-answer-generation
    name="questionAnswerGeneration"
    text='The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest 
    in the world, with an estimated 390 billion individual trees divided into 16,000 species. For a long time, it was thought that the 
    Amazon rainforest was only ever sparsely populated, as it was impossible to sustain a large population through agriculture given the poor soil. 
    Archeologist Betty Meggers was a prominent proponent of this idea, as described in her book Amazonia: Man and Culture in a Counterfeit Paradise. 
    She claimed that a population density of 0.2 inhabitants per square kilometre (0.52/sq mi) is the maximum that can be sustained in the rainforest 
    through hunting, with agriculture needed to host a larger population. However, recent anthropological findings have suggested that the region was 
    actually densely populated. Some 5 million people may have lived in the Amazon region in AD 1500, divided between dense coastal settlements, such as that at
    Marajó, and inland dwellers. By 1900 the population had fallen to 1 million and by the early 1980s it was less than 200,000.'
    min-questions="1"
    max-questions="10"
    question-min-words="1"
    question-max-words="100"
    answer-min-words="1"
    answer-max-words="100"
    question-tags='[
      "tag1",
      "tag2",
      "tag3"
    ]'
    allow-custom-question-tags="true"
  >
    <short-instructions>
      <p>User instructions will be displayed here.</p>
    </short-instructions>
  </crowd-question-answer-generation>
</crowd-form>
```

#### 属性
<a name="crowd-question-answer-generation-attributes"></a>

以下是此元素支持的属性。

##### 文本
<a name="crowd-question-answer-generation-attributes-text"></a>

对响应进行排名时要引用的文本或对该文本的 S3 引用。

##### min-questions
<a name="crowd-question-answer-generation-attributes-min-questions"></a>

可选整数，用于指定工作人员在任务期间必须创建的最小问题数量。如果未提供，系统将要求您至少编写一个问答对。

##### max-questions
<a name="crowd-question-answer-generation-attributes-max-questions"></a>

可选整数，用于指定工作人员在任务期间可以创建的最大问题数量。

##### question-min-words
<a name="crowd-question-answer-generation-attributes-question-min-words"></a>

可选整数，用于指定问题中支持的最小字数。如果未提供，系统将要求您在问题中至少提供一个字。

##### question-max-words
<a name="crowd-question-answer-generation-attributes-question-max-words"></a>

可选整数，用于指定问题中支持的最大字数。

##### answer-min-words
<a name="crowd-question-answer-generation-attributes-answer-min-words"></a>

可选整数，用于指定答案中支持的最小字数。如果未提供，系统将要求您在答案中至少编写一个字。

##### answer-max-words
<a name="crowd-question-answer-generation-attributes-answer-max-words"></a>

可选整数，用于指定答案中支持的最大字数。

##### question-tags
<a name="crowd-question-answer-generation-attributes-question-tags"></a>

一个必需的字符串数组，用于指定工作人员可以分配给问答对的可能标签。如果此数组为空，则 question-tags 字段不可见。

##### allow-custom-question-tags
<a name="crowd-question-answer-generation-attributes-allow-custom-question-tags"></a>

必需的布尔字段，用于指示工作人员是否可以指定自定义问题标签。

##### name
<a name="crowd-question-answer-generation-attributes-name"></a>

一个必需的字符串字段，用于标识工作人员提交的答案。它与工作人员提交的输出数据合同中的密钥相匹配。

有关更多信息，请参阅下列内容。
+ [使用 Amazon G SageMaker round Truth 使用人类训练数据标签](sms.md)
+ [Crowd HTML 元素参考](sms-ui-template-reference.md)