We’re excited to announce three new Qualification Comparators available in the Mechanical Turk API. The new Comparators, which include In, NotIn, and DoesNotExist, provide Requesters greater flexibility in targeting HITs to specific Workers.
A Comparator is an element of the QualificationRequirement data structure that represents the type of comparison made against a Qualification’s value. Using the In Comparator you can limit HITs to Workers with one of multiple Qualification values. For instance, if you need Workers from the United States, Canada, or Great Britain, your QualificationRequirement would be specified as “Location In US, CA, GB”. “Location” is the Qualification type, “In” is the Comparator and “US, CA, GB” are the Qualification values.
Here’s the SOAP request based on the example above:
<QualificationRequirement>
<QualificationTypeId>00000000000000000071</QualificationTypeId>
<Comparator>In</Comparator>
<LocaleValue>US</LocaleValue>
<LocaleValue>CA</LocaleValue>
<LocaleValue>UK</LocaleValue>
</QualificationRequirement>
The NotIn Comparator enables you to exclude Workers that have one of multiple Qualification values. If, in contrast to the example above, if you wanted to exclude Workers from the United States, Canada, or Great Britain from accepting your HITs, you would specify “Location NotIn US, CA, GB”.
<QualificationRequirement>
<QualificationTypeId>00000000000000000071</QualificationTypeId>
<Comparator>NotIn</Comparator>
<LocaleValue>US</LocaleValue>
<LocaleValue>CA</LocaleValue>
</QualificationRequirement>
Finally, the DoesNotExist Comparator allows you to limit access to Workers who do not have a specific Qualification type. For instance, if you’re using Mechanical Turk to conduct a survey, you may want to limit access to Workers who’ve not completed a survey HIT for you previously. In this case you would grant a custom Qualification (which you can create using the CreateQualificationType operation) to each Worker once they’ve completed your survey HIT. Once a Worker has been assigned your custom Qualification, you can exclude the Worker from future HITs using DoesNotExist.
Below is a sample SOAP Request, using a custom Qualification name of “SurveyCompleted” and the DoesNotExist Comparator:
<QualificationRequirement>
<QualificationTypeId>123456789SURVEYCOMPLETEDQUAL</QualificationTypeId>
<Comparator>DoesNotExist</Comparator>
</QualificationRequirement>
More detail on Qualifications, as well as Comparators available, is available in the Mechanical Turk API documentation.
Comments