A simple sample - Amazon SageMaker

A simple sample

All tasks begin and end with the <crowd-form> </crowd-form> elements. Like standard HTML <form> elements, all of your form code should go between them.

For a simple tweet-analysis task, use the <crowd-classifier> element. It requires the following attributes:

  • name - the variable name to use for the result in the form output.

  • categories - a JSON formatted array of the possible answers.

  • header - a title for the annotation tool

As children of the <crowd-classifier> element, you must have three regions.

  • <classification-target> - the text the worker will classify based on the options specified in the categories attribute above.

  • <full-instructions> - instructions that are available from the "View full instructions" link in the tool. This can be left blank, but it is recommended that you give good instructions to get better results.

  • <short-instructions> - a more brief description of the task that appears in the tool's sidebar. This can be left blank, but it is recommended that you give good instructions to get better results.

A simple version of this tool would look like this.

Example of using crowd-classifier
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script> <crowd-form> <crowd-classifier name="tweetFeeling" categories="['positive','negative','neutral', 'unclear']" header="Which term best describes this tweet?" > <classification-target> My favorite football team won today! Bring on the division finals! </classification-target> <full-instructions header="Sentiment Analysis Instructions"> Try to determine the sentiment the author of the tweet is trying to express. If none seem to match, choose "cannot determine." </full-instructions> <short-instructions> Pick the term best describing the sentiment of the tweet. </short-instructions> </crowd-classifier> </crowd-form>

You can copy and paste the code into the editor in the Ground Truth labeling job creation workflow to preview the tool, or try out a demo of this code on CodePen.

View a demo of this sample template on CodePen