如何在Mechanical Turk中查看HIT注释

时间:2014-11-05 20:12:21

标签: python amazon-web-services boto mechanicalturk

我正在尝试为我的HIT注释一些内容,即AppleID

>>> hit = conn.create_hit(
                    question=q,
                    reward = 0.05,
                    max_assignments=3,
                    title='Question',
                    annotation='apple_id=123456789'
             )

然后我如何查看注释。我正在尝试以下方法,但它没有显示在那里:

>>> hit[0]
<boto.mturk.connection.HIT object at 0x10d311050>
>>> hit[0].__dict__
{
    'IsValid': u'True',
    'HIT': '',
    'Request': '', 
    'HITId': u'3ZFRE2BDQ9EC3501ZSVWGUVL0EUXZT', 
    'HITTypeId': u'3I39O3TFTUXGEG283QLYWHJW0ZEJ8V'
}

我如何抓住annotation字段?

1 个答案:

答案 0 :(得分:0)

您需要在此明确指定response groups以获取必要的数据 - http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_CommonParametersArticle.html#response-groups

在这种情况下,您需要包含响应组HITDetail。然后:

>>> hit = conn.create_hit(
                question=q,
                reward = 0.05,
                max_assignments=3,
                title='Question',
                annotation = 'This is my annotATION!',
                response_groups=['Minimal', 'HITDetail']
             )
>>> annotation = create_hit_rs[0].RequesterAnnotation
>>> annotation
'This is my annotATION!'