简体   繁体   中英

Increase number of assignments for old batch in Mechanical Turk

I have several projects created on the web interface, each has several batches that are already ended. The max assignment per task is 3. I need to add 2 more assignments for each HIT, is it possible?

I've tried using the API on a in-progress batch:

mturk.create_additional_assignments_for_hit(HITId=HIT_ID,NumberOfAdditionalAssignments=2)

and the response:

    {'ResponseMetadata': {'RequestId': '.....some id ...',
  'HTTPStatusCode': 200,
  'HTTPHeaders': {'x-amzn-requestid': '.....some id ...',
   'content-type': 'application/x-amz-json-1.1',
   'content-length': '2',
   'date': 'Thu, 20 Jan 2022 12:20:02 GMT'},
  'RetryAttempts': 0}}

But I can't see any update on the web for +2 extra assignments..

Found the answer.

First, the Requester UI (RUI) and the API are not fully connected, such that not all changes in the API will be visible in the RUI.

Here is my answer using the python API To "revive" old HITs and add a new assignments to them you need to:

mturk = boto3.client('mturk',
                     aws_access_key_id='xxxxxxxxxxxx',
                     aws_secret_access_key='xxxxxxxxxxxxx',
                     region_name='us-east-1',
                     endpoint_url='https://mturk-requester.us-east-1.amazonaws.com')

Extend the expiration date for the HIT (even if its already passed):

mturk.update_expiration_for_hit(HITId=HIT_ID_STRING,ExpireAt=datetime.datetime(2022, 1, 23, 20, 00, 00))

Then, increase max assignments, here we add +2 more:

mturk.create_additional_assignments_for_hit(HITId=HIT_ID_STRING,NumberOfAdditionalAssignments=2)

That's it, you can see that the total number of NumberOfAssignmentsAvailable increased by 2 and that MaxAssignments increased as well:

mturk.get_hit(HITId=HIT_ID_STRING)
 'MaxAssignments':5,
 'NumberOfAssignmentsPending': 0,
 'NumberOfAssignmentsAvailable': 2,
 'NumberOfAssignmentsCompleted': 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM