crowd-classifier-multi-select - Amazon SageMaker

crowd-classifier-multi-select

A widget for classifying various forms of content—such as audio, video, or text—into one or more categories. The content to classify is referred to as an object.

See an interactive example of an HTML template that uses this Crowd HTML Element in CodePen.

The following is an example of an HTML worker task template built using this element. Copy the following code and save it in a file with the extension .html. Open the file in any browser to preview and interact with this template.

<script src="https://assets.crowd.aws/crowd-html-elements.js"></script> <crowd-form> <crowd-classifier-multi-select name="category" categories="['Positive', 'Negative', 'Neutral']" header="Select the relevant categories" exclusion-category="{ text: 'None of the above' }" > <classification-target> {{ task.input.taskObject }} </classification-target> <full-instructions header="Text Categorization Instructions"> <p><strong>Positive</strong> sentiment include: joy, excitement, delight</p> <p><strong>Negative</strong> sentiment include: anger, sarcasm, anxiety</p> <p><strong>Neutral</strong>: neither positive or negative, such as stating a fact</p> <p><strong>N/A</strong>: when the text cannot be understood</p> <p>When the sentiment is mixed, such as both joy and sadness, choose both labels.</p> </full-instructions> <short-instructions> Choose all categories that are expressed by the text. </short-instructions> </crowd-classifier-multi-select> </crowd-form>

Attributes

The following attributes are supported by the crowd-classifier-multi-select element. Each attribute accepts a string value or string values.

categories

Required. A JSON-formatted array of strings, each of which is a category that a worker can assign to the object.

header

Required. The text to display above the image. This is typically a question or simple instruction for workers.

name

Required. The name of this widget. In the form output, the name is used as a key for the widget's input.

exclusion-category

Optional. A JSON-formatted string with the following format: "{ text: 'default-value' }". This attribute sets a default value that workers can choose if none of the labels applies to the object shown in the worker UI.

Element Hierarchy

This element has the following parent and child elements:

Regions

This element uses the following regions.

classification-target

The content to be classified by the worker. Content can be plain text or an object that you specify in the template using HTML. For example, you can use HTML elements to include a video or audio player, embedding a PDF file, or include a comparison of two or more images.

full-instructions

General instructions about how to classify text.

short-instructions

Important task-specific instructions. These instructions are displayed prominently.

Output

The output of this element is an object that uses the specified name value as a property name, and a string from categories as the property's value.

Example : Sample Element Outputs

The following is a sample of output from this element.

[ { "<name>": { labels: ["label_a", "label_b"] } } ]

See Also

For more information, see the following: