【发布时间】:2018-10-22 14:06:52
【问题描述】:
我正在使用here 给出的教程。它说 HIT 已创建,但是当我去这里 https://requestersandbox.mturk.com/ 时,我没有找到我创建的项目。虽然个别工作人员 URL 确实返回 HIT 网络界面。
我想知道的原因是,我不仅想自动化 HIT 创建,还想批量发布。我的代码如下:
MTURK_SANDBOX = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'
mturk = boto3.client('mturk',
aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET,
region_name='us-east-1',
endpoint_url=MTURK_SANDBOX
)
print("I have $" + mturk.get_account_balance()['AvailableBalance'] + " in my Sandbox account")
question = open('questions.xml', encoding='utf8').read()
new_hit = mturk.create_hit(
Title='Is this Tweet happy, angry, excited, scared, annoyed or upset?',
Description='Read this tweet and type out one word to describe the emotion of the person posting it: happy, angry, scared, annoyed or upset',
Keywords='text, quick, labeling',
Reward='0.15',
MaxAssignments=1,
LifetimeInSeconds=172800,
AssignmentDurationInSeconds=600,
AutoApprovalDelayInSeconds=14400,
Question=question,
)
print("A new HIT has been created. You can preview it here:")
print("https://workersandbox.mturk.com/mturk/preview?groupId=" + new_hit['HIT']['HITGroupId'])
print("HITID = " + new_hit['HIT']['HITId'] + " (Use to Get Results)")
【问题讨论】:
标签: python boto3 mechanicalturk