我正在使用 MTurk 的 python SKD ( boto3
) 开发众包系统,目前在请求者沙箱环境中。基本上,我正在我的代码中创建一个 HIT(使用AutoApprovalDelayInSeconds = 1
),我在工作人员沙箱 HIT 列表中看到它,我接受它并提交答案。然后,当我list_assignments_for_hit
为刚刚提交答案的 HIT ID 调用代码时,有时我在 API 的响应中看不到任何结果。它是随机的,有时结果是响应,有时不是运行相同的代码并执行完全相同的步骤。我无法弄清楚问题是什么。
这就是我创建 HIT 的方式:
mturk = boto3.client('mturk',
aws_access_key_id=access_key,
aws_secret_access_key=secret_access_key",
region_name='us-east-1',
endpoint_url=self.endpoint
)
question = open(self.xml_question, mode='r').read()
new_hit = mturk.create_hit(
Title=self.title,
Description=self.desc,
Keywords=self.keywords,
Reward=self.reward,
MaxAssignments=self.max_assignments,
LifetimeInSeconds=172800,
AssignmentDurationInSeconds=600,
AutoApprovalDelayInSeconds=1,
Question=question,
)
And this is how I get the result:
worker_results = mturk.list_assignments_for_hit(HITId=new_hit['HIT']['HITId'],
AssignmentStatuses=['Submitted'])
谢谢你们的帮助。