无法在我的仪表板上看到已创建的MTurk

2024-04-29 07:23:37 发布

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

我正在使用给定的教程here。它说HIT已经创建,但是当我在这里https://requestersandbox.mturk.com/我找不到我创建的项目。虽然单个worker URL确实返回HIT web界面。在

我想知道的原因是,我不仅要自动创建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)")

Tags: keyhttpscomawsnewhereaccessus