我正在使用here提供的脚本从Amazon Mechanical Turk平台删除已部署的HIT。但是,mturk客户端出现以下异常:
An error occurred (RequestError) when calling the DeleteHIT operation: This HIT is currently in the state 'Reviewable'. This operation can be called with a status of: Reviewing, Reviewable (1574723552282 s)
对我来说,错误消息本身似乎是错误的。有人对此行为有解释吗?
答案 0 :(得分:0)
尝试类似的方法,我在某个地方找到了它,它可以解决您的问题,
# if hit is reviewable and has assignments, approve assignments
if status == 'Reviewable':
assignments = mturk.list_assignments_for_hit(HITId=hit['HITId'], AssignmentStatuses=['Submitted'])
if assignments['NumResults'] > 0:
for assign in assignments['Assignments']:
mturk.approve_assignment(AssignmentId=assign['AssignmentId'])
try:
mturk.delete_hit(HITId=hit['HITId'])
except:
print('Not deleted')