本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Augmented AI Crowd HTML Elements
以下 Crowd HTML 元素仅可用于 Amazon Augmented AI 人工工作流任务。
一个小部件,用于启用对 Amazon Textract 文档分析结果的人工审核。
Attributes
此元素支持以下属性。
header
这是将显示为标题的文本。
src
这是指向要由工作人员分析的图像的链接。
initialValue
这将为工作人员 UI 中提供的属性设置初始值。
以下是 initialValue
输入的示例:
[ { "blockType": "KEY_VALUE_SET", "confidence":
38.43309020996094
, "geometry": { "boundingBox": { "width":0.32613086700439453
, "weight":0.0942094624042511
, "left":0.4833833575248718
, "top":0.5227988958358765
}, "polygon": [ {"x":0.123
, "y":0.345
}, ... ] } "id": "8c97b240-0969-4678-834a-646c95da9cf4
", "relationships": [ { "type": "CHILD", "ids": [ "7ee7b7da-ee1b-428d-a567-55a3e3affa56
", "4d6da730-ba43-467c-a9a5-c6137ba0c472
" ] }, { "type": "VALUE", "ids": [ "6ee7b7da-ee1b-428d-a567-55a3e3affa54
" ] } ], "entityTypes": [ "KEY" ], "text": "Foo bar
" }, ]
blockTypes
这将决定工作人员可以执行的分析的类型。当前仅支持 KEY_VALUE_SET
。
键
这将指定工作人员可以添加的新键和关联的文本值。keys
的输入值可以包括以下元素:
-
importantFormKey
接受字符串,并且用于指定单个键。 -
importantFormKeyAliases
可用来指定别名,这些别名是提供的键的可接受替代项。使用此元素可标识键的替代拼写或表示形式。此参数接受包含一个或多个字符串的列表。
以下是 keys
的输入示例。
[ { importantFormKey: '
Address'
, importantFormKeyAliases: [ 'address
', 'Addr.
', 'Add.
', ] }, { importantFormKey: 'Last name
', importantFormKeyAliases: ['Surname
'] } ]
no-key-edit
这将防止工作人员编辑通过 initialValue
传递的注释的键。这可以防止工作人员编辑已在您的文档中检测到的键。该项为必填项。
no-geometry-edit
这将防止工作人员编辑通过 initialValue
传递的注释的多边形。例如,这将防止工作人员编辑给定键周围的边界框。该项为必填项。
元素层次结构
此元素具有以下父元素和子元素。
-
父元素 – crowd-form
区域
此元素支持以下区域。您可以在这些区域中使用自定义 HTML 和 CSS 代码来设置针对工作人员的说明的格式。例如,使用 short-instructions
部分可提供有关如何完成任务的正确示例和错误示例。
full-instructions
有关如何使用小部件的一般说明。
short-instructions
在醒目位置显示的重要的任务特定说明。
使用 crowd 元素的工作人员模板示例
使用此 crowd 元素的工作人员模板示例如下所示。
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script> {% capture s3_uri %}http://s3.amazonaws.com/{{ task.input.aiServiceRequest.document.s3Object.bucket }}/{{ task.input.aiServiceRequest.document.s3Object.name }}{% endcapture %} <crowd-form> <crowd-textract-analyze-document src="{{ s3_uri | grant_read_access }}" initial-value="{{ task.input.selectedAiServiceResponse.blocks }}" header="Review the key-value pairs listed on the right and correct them if they don't match the following document." no-key-edit no-geometry-edit keys="{{ task.input.humanLoopContext.importantFormKeys }}" block-types="['KEY_VALUE_SET']" > <short-instructions header="Instructions"> <style> .instructions { white-space: pre-wrap; } .instructionsImage { display: inline-block; max-width: 100%; } </style> <p class='instructions'>Click on a key-value block to highlight the corresponding key-value pair in the document. If it is a valid key-value pair, review the content for the value. If the content is incorrect, correct it. The text of the value is incorrect, correct it. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/correct-value-text.png" /> A wrong value is identified, correct it. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/correct-value.png" /> If it is not a valid key-value relationship, choose No. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/not-a-key-value-pair.png" /> If you can’t find the key in the document, choose Key not found. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/key-is-not-found.png" /> If the content of a field is empty, choose Value is blank. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/value-is-blank.png" /> <b>Examples</b> Key and value are often displayed next or below to each other. Key and value displayed in one line. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/sample-key-value-pair-1.png" /> Key and value displayed in two lines. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/sample-key-value-pair-2.png" /> If the content of the value has multiple lines, enter all the text without line break. Include all value text even if it extends beyond the highlight box. <img class='instructionsImage' src="https://assets.crowd.aws/images/a2i-console/multiple-lines.png" /></p> </short-instructions> <full-instructions header="Instructions"></full-instructions> </crowd-textract-analyze-document> </crowd-form>
输出
下面是此元素中的输出示例。您可以在亚马逊 Textract AnalyzeDocumentAPI 文档中找到有关此输出的详细说明。
{ "AWS/Textract/AnalyzeDocument/Forms/V1": { blocks: [ { "blockType": "KEY_VALUE_SET", "id": "8c97b240-0969-4678-834a-646c95da9cf4", "relationships": [ { "type": "CHILD", "ids": ["7ee7b7da-ee1b-428d-a567-55a3e3affa56", "4d6da730-ba43-467c-a9a5-c6137ba0c472"] }, { "type": "VALUE", "ids": ["6ee7b7da-ee1b-428d-a567-55a3e3affa54"] } ], "entityTypes": ["KEY"], "text": "Foo bar baz" } ] } }
一个小部件,用于启用对 Amazon Rekognition 图像监管结果的人工审核。
Attributes
此元素支持以下属性。
header
这是将显示为标题的文本。
src
这是指向要由工作人员分析的图像的链接。
categories
这支持 categories
作为字符串数组或对象数组,其中每个对象都具有一个 name
字段。
如果类别作为对象提供,则以下情况适用:
-
显示的类别是
name
字段的值。 -
返回的答复包含任何选定类别的完整对象。
如果类别作为字符串提供,则以下情况适用:
-
返回的答复是选择的所有字符串的数组。
exclusion-category
通过设置此属性,您可以在 UI 中的类别下创建一个按钮。
-
当用户选择该按钮时,将取消选择并禁用所有类别。
-
再次选择该按钮会重新启用类别,以便用户可以选择它们。
-
如果您在选择该按钮后提交,则会返回一个空数组。
元素层次结构
此元素具有以下父元素和子元素。
-
父元素 – crowd-form
AWS 区域
此元素支持以下 AWS 区域。您可以在这些区域中使用自定义 HTML 和 CSS 代码来设置针对工作人员的说明的格式。例如,使用 short-instructions
部分可提供有关如何完成任务的正确示例和错误示例。
full-instructions
有关如何使用小部件的一般说明。
short-instructions
在醒目位置显示的重要的任务特定说明。
具有 crowd 元素的示例工作人员模板
使用 crowd 元素的工作人员模板示例如下所示。
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script> {% capture s3_uri %}http://s3.amazonaws.com/{{ task.input.aiServiceRequest.image.s3Object.bucket }}/{{ task.input.aiServiceRequest.image.s3Object.name }}{% endcapture %} <crowd-form> <crowd-rekognition-detect-moderation-labels categories='[ {% for label in task.input.selectedAiServiceResponse.moderationLabels %} { name: "{{ label.name }}", parentName: "{{ label.parentName }}", }, {% endfor %} ]' src="{{ s3_uri | grant_read_access }}" header="Review the image and choose all applicable categories." > <short-instructions header="Instructions"> <style> .instructions { white-space: pre-wrap; } </style> <p class='instructions'>Review the image and choose all applicable categories. If no categories apply, choose None. <b>Nudity</b> Visuals depicting nude male or female person or persons <b>Graphic Male Nudity</b> Visuals depicting full frontal male nudity, often close ups <b>Graphic Female Nudity</b> Visuals depicting full frontal female nudity, often close ups <b>Sexual Activity</b> Visuals depicting various types of explicit sexual activities and pornography <b>Illustrated Nudity or Sexual Activity</b> Visuals depicting animated or drawn sexual activity, nudity or pornography <b>Adult Toys</b> Visuals depicting adult toys, often in a marketing context <b>Female Swimwear or Underwear</b> Visuals depicting female person wearing only swimwear or underwear <b>Male Swimwear Or Underwear</b> Visuals depicting male person wearing only swimwear or underwear <b>Partial Nudity</b> Visuals depicting covered up nudity, for example using hands or pose <b>Revealing Clothes</b> Visuals depicting revealing clothes and poses, such as deep cut dresses <b>Graphic Violence or Gore</b> Visuals depicting prominent blood or bloody injuries <b>Physical Violence</b> Visuals depicting violent physical assault, such as kicking or punching <b>Weapon Violence</b> Visuals depicting violence using weapons like firearms or blades, such as shooting <b>Weapons</b> Visuals depicting weapons like firearms and blades <b>Self Injury</b> Visuals depicting self-inflicted cutting on the body, typically in distinctive patterns using sharp objects <b>Emaciated Bodies</b> Visuals depicting extremely malnourished human bodies <b>Corpses</b> Visuals depicting human dead bodies <b>Hanging</b> Visuals depicting death by hanging</p> </short-instructions> <full-instructions header="Instructions"></full-instructions> </crowd-rekognition-detect-moderation-labels> </crowd-form>
输出
下面是此元素中的输出示例。有关此输出的详细信息,请参阅亚马逊 Rekogniti DetectModerationLabelson API 文档。
{ "AWS/Rekognition/DetectModerationLabels/Image/V3": { "ModerationLabels": [ { name: 'Gore', parentName: 'Violence' }, { name: 'Corpses', parentName: 'Violence' }, ] } }