【发布时间】:2017-07-07 03:19:54
【问题描述】:
我是 MTurk 的新手,我一直在尝试在这个平台上实现我的网络应用程序以进行点选。我已经根据 kaflurbaleen.blogspot 的教程使用 ExternalQuestion 成功创建了一个 HIT。但是,当我在沙箱中测试代码时,我意识到 HIT 没有按预期工作。我发现了以下两个问题。
-
我找不到应该附加到 URL 的“assignmentId”。在接受任务之前检查了workersandbox,发现如下网址 https://workersandbox.mturk.com/mturk/preview?groupId=3JCELWMC4P1FAXE0GMTAW1L96T93VS
据我了解,在接受上述链接后,应将“assignmentId”附加到 URL。并且这个参数必须使用 'externalSubmit' 方法返回给 Mturk 服务器。验收后发现只有以下参数 hitId&prevHitSubmitted&prevRequester&requesterId&prevReward&hitAutoAppDelayInSeconds&groupId&signature
我还意识到该应用程序在 iframe 中无法正常运行。每个(鼠标单击 + shift)都应该创建一个红色球体,如原始网站https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html 所示。
我试图用谷歌搜索答案,但收效甚微。我现在对这两个阻碍我研究的问题束手无策。任何帮助将不胜感激。使用 BOTO3 创建 HIT 的代码如下。
import boto.mturk.connection
# define the host environment
sandbox_host = 'mechanicalturk.sandbox.amazonaws.com'
real_host = 'mechanicalturk.amazonaws.com'
mturk = boto.mturk.connection.MTurkConnection(
host = sandbox_host,
debug = 1
)
# test the setup of boto by printing the version and account balance
print(boto.Version)
print(mturk.get_account_balance())
# link to my web app, which will be loaded by the iframe of Mturk
URL = "https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html"
# setting task description of the iframe
title = "A Special HIT for Picking!"
description = "Vertex picking!"
keywords = ["3D mesh", "vertices"]
frame_height = 500 # the height of the iframe holding the external hit
amount = .00
# creating the HIT (task)
questionform = boto.mturk.question.ExternalQuestion( URL, frame_height )
response = mturk.create_hit(
title = title,
description = description,
keywords = keywords,
question = questionform,
reward = boto.mturk.price.Price( amount = amount),
response_groups = ('Minimal', 'HITDetail'),
)
# trying to get some outputs
HIT = response[0]
assert response.status
print ('[create_hit( %s, $%s ): %s]' % ( URL, amount, HIT.HITId ) )
# The response included several fields that will be helpful later
print ('Your HIT has been created. You can see it at this link:')
print ('https://workersandbox.mturk.com/mturk/preview?groupId={}'.format(HIT.HITTypeId))
print ('Your HIT ID is: {}'.format(HIT.HITId))
【问题讨论】:
标签: python amazon boto3 mechanicalturk