Amazon Mechanical Turk¶
Provides an interface with amazon mechanical turk to push opencrowd generated HITs. Amazon Mechanical Turk account specifications are defined in opencrowd/config/opencrowd.
-
class
opencrowd.model.crowd.amazonmechanicalturk.AmazonMechanicalTurk(endpoint, form_submission_action, region_name, aws_access_key_id, aws_secret_access_key)¶ Provides the python library Boto3 with the AWS information needed to start a connection
Parameters: - endpoint (str) – Pointing to either the AMT sandbox or production servers
- form_submission_action (str) – needs to match with the endpoint, this will either submit to the sandbox or production
- region_name (str) – generally ‘us-east-1’
- aws_access_key_id (str) – The aws access key, available on your aws account
- aws_secret_access_key (str) – available on your aws account
-
approve_assignment_ids(assignment_ids)¶ Approve an assignment on AMT. This will pay the worker the reward amount for the Task.
Parameters: assignment_ids (list) – assignment ids to approve on AMT
-
delete_sandbox()¶ delete all HITs on the sandbox. useful for testing
-
gather_submitted_assignments(hit_id)¶ Gather ‘submitted’ assignments under this HIT
Parameters: hit_id – gather assignments from this HIT Returns: list of assignment ids (they were updated in-place)
-
generate_crowdsource_connection()¶ Returns: boto3 mturk client
-
get_assignment(AssignmentId)¶ Get a specific assignment
Parameters: AssignmentId (str) – id of the assignment to retrieve
-
get_hit(HITId)¶ Get a specific HIT
Parameters: HITId (str) – id of the HIT to retrieve Returns: Amazon HIT dict
-
list_assignments_for_hit(hit_id)¶ Gather assignments for this HIT
Parameters: hit_id – gather assignments from this HIT Returns: list of AMT assignment dicts
-
list_hits()¶ List all HITs on AMT
Returns: list of Amazon HIT dicts
-
push(HIT)¶ One of the virtualized functions mentioned above