无法创建超过10个作业的HIT

2024-10-02 00:26:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用下面的代码,使用Boto 3在Mechanical Turk上创建一个HIT:

new_hit = mturk.create_hit(
    Title='my title',
    Description='my description',
    Keywords='my, keywords',
    Reward='0.02',
    MaxAssignments=25,
    LifetimeInSeconds=9999,
    AssignmentDurationInSeconds=9999,
    AutoApprovalDelayInSeconds=9999,
    Question='''<?xml version="1.0" encoding="UTF-8"?>
<ExternalQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd">
<ExternalURL>https://myexternalurl/</ExternalURL>
<FrameHeight>540</FrameHeight>
</ExternalQuestion>'''
)

这将创建一个命中25个作业

但是,当我尝试检索结果时,只有10个赋值:

results = mturk.list_assignments_for_hit(
    HITId='my HIT ID',
    AssignmentStatuses=['Submitted', 'Approved']
)

# This always maxes out at 10
print 'Number of assignments: ' + str(len(results['Assignments']))

我尝试了几种不同的点击率和不同的MaxAssignments值。它总是在10个作业时达到最大值。看来机械土耳其人正在悄悄地把MaxAssignments限制在10

我在土耳其人的机械文件里找到了两条线索。首先:

HITs created with fewer than 10 assignments cannot be extended to have 10 or more assignments. Attempting to add assignments in a way that brings the total number of assignments for a HIT from fewer than 10 assignments to 10 or more assignments will result in an AWS.MechanicalTurk.InvalidMaximumAssignmentsIncrease exception.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/mturk.html#MTurk.Client.create_additional_assignments_for_hit.

第二:

If a HIT is created with 10 or more maximum assignments, there is an additional fee. For more information, see Amazon Mechanical Turk Pricing.

https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_CreateHITOperation.html

但这并不能解释为什么我不能在第一个实例中对MaxAssignments使用大于10的值。我没有任何错误

如何创建和检索每次命中10个以上的作业


Tags: ortohttpscomformymore作业
1条回答
网友
1楼 · 发布于 2024-10-02 00:26:51

是否尝试过指定MaxResults参数,如下所示:

response = client.list_assignments_for_hit(
    HITId='string',
    NextToken='string',
    MaxResults=123,
    AssignmentStatuses=[
        'Submitted'|'Approved'|'Rejected',
    ]
)

相关问题 更多 >

    热门问题