Augmented AI Crowd HTML Elements
The following Crowd HTML Elements are only available for Amazon Augmented AI human workflow tasks.
A widget to enable human review of a Amazon Textract document analysis result.
Attributes
The following attributes are supported by this element.
header
This is the text that is displayed as the header.
src
This is a link to the image to be analyzed by the worker.
initialValue
This sets initial values for attributes found in the worker UI.
The following is an example of an initialValue
input:
[ { "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
This determines the kind of analysis the workers can do. Only
KEY_VALUE_SET
is currently supported.
keys
This specifies new keys and the associated text value the worker can add. The
input values for keys
can include the following elements:
-
importantFormKey
accepts strings, and is used to specify a single key. -
importantFormKeyAliases
can be used to specify aliases that are acceptable alternatives to the keys supplied. Use this element to identify alternative spellings or presentations of your keys. This parameter accepts a list of one or more strings.
The following is an example of an input for keys
.
[ { importantFormKey: '
Address'
, importantFormKeyAliases: [ 'address
', 'Addr.
', 'Add.
', ] }, { importantFormKey: 'Last name
', importantFormKeyAliases: ['Surname
'] } ]
no-key-edit
This prevents the workers from editing the keys of annotations passed through
initialValue
. This prevents workers from editing the keys that have
been detected on your documents. This is required.
no-geometry-edit
This prevents workers from editing the polygons of annotations passed through
initialValue
. For example, this would prevent the worker from
editing the bounding box around a given key. This is required.
Element Hierarchy
This element has the following parent and child elements.
-
Parent elements – crowd-form
-
Child elements – full-instructions, short-instructions
Regions
The following regions are supported by this element. You can use custom HTML and CSS
code within these regions to format your instructions to workers. For example, use the
short-instructions
section to provide good and bad examples of how to
complete a task.
full-instructions
General instructions about how to work with the widget.
short-instructions
Important task-specific instructions that are displayed in a prominent place.
Example of a Worker Template Using the crowd Element
An example of a worker template using this crowd element would look like the following.
Output
The following is a sample of the output from this element. You can find a detailed explanation of this output in the Amazon Textract AnalyzeDocument API documentation.
{ "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" } ] } }
A widget to enable human review of an Amazon Rekognition image moderation result.
Attributes
The following attributes are supported by this element.
header
This is the text that is displayed as the header.
src
This is a link to the image to be analyzed by the worker.
categories
This supports categories
as an array of strings or an array of objects where each object has a name
field.
If the categories come in as objects, the following applies:
-
The displayed categories are the value of the
name
field. -
The returned answer contains the full objects of any selected categories.
If the categories come in as strings, the following applies:
-
The returned answer is an array of all the strings that were selected.
exclusion-category
By setting this attribute you create a button underneath the categories in the UI.
-
When a user chooses the button, all categories are deselected and disabled.
-
Choosing the button again re-enables the categories so that users can choose them.
-
If you submit after choosing the button, it returns an empty array.
Element Hierarchy
This element has the following parent and child elements.
-
Parent elements – crowd-form
-
Child elements – full-instructions, short-instructions
Amazon Regions
The following Amazon Regions are supported by this element. You can use custom HTML and CSS
code within these Regions to format your instructions to workers. For example, use the
short-instructions
section to provide good and bad examples of how to complete
a task.
full-instructions
General instructions about how to work with the widget.
short-instructions
Important task-specific instructions that are displayed in a prominent place.
Example Worker Template with the crowd Element
An example of a worker template using the crowd element would look like the following.
Output
The following is a sample of the output from this element. For details about this output, see Amazon Rekognition DetectModerationLabels API documentation.
{ "AWS/Rekognition/DetectModerationLabels/Image/V3": { "ModerationLabels": [ { name: 'Gore', parentName: 'Violence' }, { name: 'Corpses', parentName: 'Violence' }, ] } }