Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: CC-BY-SA-4.0
A widget for labeling words, phrases, or character strings within a longer text.
Important: Self-contained Widget
Do not use <crowd-entity-annotation>
element with the <crowd-form>
element. It contains its own form submission logic and Submit button.
The following attributes are supported by this element.
The text to display above the image. This is typically a question or simple instruction for the worker.
A JSON formatted array of objects, each of which defines an annotation to apply to the text at initialization. Objects contain a label
value that matches one in the labels
attribute, an integer startOffset
value for labeled span’s starting unicode offset, and an integer endOffset
value for the ending unicode offset.
Example
[
{
label: 'person',
startOffset: 0,
endOffset: 16
},
...
]
A JSON formatted array of objects, each of which contains: + label
(required): The name used to identify entities. + fullDisplayName
(optional): Used for the label list in the task widget. Defaults to the label value if not specified. + shortDisplayName
(optional): An abbreviation of 3-4 letters to display above selected entities. Defaults to the label value if not specified. shortDisplayName
is highly recommended
Values displayed above the selections can overlap and create difficulty managing labeled entities in the workspace. Providing a 3-4 character shortDisplayName
for each label is highly recommended to prevent overlap and keep the workspace manageable for your workers.
Example
[
{
label: 'person',
shortDisplayName: 'per',
fullDisplayName: 'person'
}
]
Serves as the widget’s name in the DOM. It is also used as the label attribute name in form output and the output manifest.
The text to be annotated. The templating system escapes quotes and HTML strings by default. If your code is already escaped or partially escaped, see Variable filters for more ways to control escaping.
This element has the following parent and child elements. + Child elements: full-instructions, short-instructions
The following regions are supported by this element.
General instructions about how to work with the widget.
Important task-specific instructions that are displayed in a prominent place.
The following output is supported by this element.
A JSON object that specifies the start, end, and label of an annotation. This object contains the following properties. + label – The assigned label. + startOffset – The Unicode offset of the beginning of the selected text. + endOffset – The Unicode offset of the first character after the selection.
Example : Sample Element Outputs
The following is a sample of the output from this element.
{
"myAnnotatedResult": {
"entities": [
{
"endOffset": 54,
"label": "person",
"startOffset": 47
},
{
"endOffset": 97,
"label": "event",
"startOffset": 93
},
{
"endOffset": 219,
"label": "date",
"startOffset": 212
},
{
"endOffset": 271,
"label": "location",
"startOffset": 260
}
]
}
}
For more information, see the following. + Amazon SageMaker Ground Truth + HTML Elements Reference