- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试利用 boto 在 Mechanical Turk 中生成 HIT。目标是使用已在我的 mTurk 帐户上生成的通用布局,并将图像的 url 传递给它以迭代创建 HIT。
问题是即使正确命名参数,如果图像 urls boto 不成功。我创建命中的示例代码是:
from boto.mturk.connection import MTurkConnection
from boto.s3.connection import S3Connection
from boto.mturk.layoutparam import LayoutParameter
from boto.s3.key import Key
import datetime
mtc = MTurkConnection(aws_access_key_id=AWSKEY,
aws_secret_access_key=AWSSKEY,
host=HOST)
#Define the layout ID to use and url to the image being used (bucket and serial defined in another place
LAYOUTID = '30W9SLHWRYCURO27D44916CUTGKDS2'
S3URL = LayoutParameter('image_url','https://s3.amazonaws.com/'+BUCKET_NAME+'/'+SERIAL)
REWARD = 0.05
#Call create_hit to generate the HIT
hit_result = mtc.create_hit(hit_layout=LAYOUTID,layout_params=S3URL, keywords=keywords_list, reward=REWARD,
duration=datetime.timedelta(7),max_assignments=1)
这会产生错误您的请求缺少必需的参数。必需的参数包括 HITLayoutParameter。您没有提供所有必需的 HITLayout 参数。缺少参数名称:image_url
只是为了确保我的布局 ID 具有正确的参数名称,当我检查 mTurk 时我看到了(无法发布屏幕截图):
Layout ID: 30W9SLHWRYCURO27D44916CUTGKDS2 Parameters: image_url
使用 LayoutParameter 有什么技巧吗?还是我以错误的方式使用了 create_hit?
最佳答案
您好,我知道现在回答有点晚了,但这是您需要做的。将布局参数放入LayoutParameter类后,再打包到一个LayoutParameters类中。例如。
......
from boto.mturk.layoutparam import LayoutParameter
from boto.mturk.layoutparam import LayoutParameters
........
S3URL = LayoutParameter('image_url','https://s3.amazonaws.com/'+BUCKET_NAME+'/'+SERIAL)
# put the layout parameter in a list/tuple and pass it to LayoutParameters
params = LayoutParameters([S3URL])
hit_result = mtc.create_hit(hit_layout=LAYOUTID,layout_params=params, keywords=keywords_list, reward=REWARD,
duration=datetime.timedelta(7),max_assignments=1)
关于python - 使用 boto 和 python 从带有参数的布局创建 mTurk HIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29202837/
是否有令人信服的理由在 mturk 上为 HIT 建立外部网站?也就是说,如果任务是通过页面上的 javascript 运行的,为什么不简单地将其粘贴到 mturk 上的源代码中并在那里运行,通过其
在 Amazon Mechanical Turk 上,我在 HIT 中添加了一个指向外部网页的链接,工作人员将在其中执行实际的 HIT。但是,我想对工作人员隐藏该链接,直到他们接受 HIT。 可以通过
我面临的问题是 SCNView.hitTest 不检测对我在 cpu 上动态修改的几何体的命中。 这是概述:我有一个使用 SCNGeometry 的节点从 MTLBuffer 创建顶点数: func
我有一个观察者配置如下: { "trigger": { "schedule": { "interval": "5s" } }, "input" : {
我又遇到了一个正则表达式问题 - 我需要测试一个字符串是否出现模式 - 它可以隐藏在字符串中的某个位置 - 就在前面,前面但前面有一个空格,中间的某个地方或在结束,也许在末尾后面跟着一个空格。 我认为
我又遇到了一个正则表达式问题 - 我需要测试一个字符串是否出现模式 - 它可以隐藏在字符串中的某个位置 - 就在前面,前面但前面有一个空格,中间的某个地方或在结束,也许在末尾后面跟着一个空格。 我认为
我们正在开发我们网站的全新移动版本,它是一个使用 Sencha Touch 2(Ext JS、JavaScript)编写的 HTML5 网站。 我们在主网站上使用 Google Analytics,我
我想写一个这样的sql: "Update tablename SET hits = hits + 1 WHERE id = $id" 在zf2中,我们使用了TableGateway,我写的代码: $t
我使用 golang elastic 5 API 在 ElasticSearch 中运行查询。我使用 searchResult.TotalHits() 检查命中数,它给了我一个很大的数字(超过 100
我正在 Amazon Mturk 开展一个项目。我使用 Python Boto API。 boto.connection.create_HIT() 方法返回一个 ResultSet 对象,我试图从中获
最近我在使用 rails 项目,并使用 simplecov 生成了代码覆盖率报告。 ,我在下面得到了一份不错的报告。我知道这是一个简单的问题(我搜索了很多次但没有得到任何正确的解释) can anyo
相当复杂...我有两个表,t1 包含有关特定对象的描述信息,第二个表 t2 包含用于解码 t1 中对象的信息。 我将尝试提供一个简单的示例: ---- t1 (Name, Type, Size, Co
我们通过 Amazon Mechanical Turk 提供供两名玩家使用的基于网络的游戏。对于每场比赛,我们需要两名玩家同时进入,或最多相隔 1 分钟。我们注意到,在我们发布 HIT 后的前几分
我对 Elasticsearch 相当陌生,我一直在尝试对我的数据进行搜索,并且总是让点击部分为空。即使在数据上传和索引之后也会发生这种情况。我的映射如下: { "mappings":{
我目前正在关注 David Roonqvist 的 3D Graphics with SceneKit 一书。 第 5 章涉及 HitTest ,实现它没有问题,但只涉及他对鼠标事件的测试。 现在,我
对于外部问题,当工作人员在预览模式下查看 HIT 时,发送的 URL 类似于: /mturk?assignmentId=ASSIGNMENT_ID_NOT_AVAILABLE&hitId=3FSEU3
我正在 Agda 中试验同伦类型理论。我使用 HIT 来定义整数: {-# OPTIONS --cubical --safe #-} open import Cubical.Foundations.P
我正在实现一个网站,招募的 MTurk worker 将在该网站上执行任务。我计划使用 MTurk 任务招聘 worker ,我会将他们重定向到外部网站以进行实际工作。我有以下与此计划有关的问题。 这
当我使用以下搜索(/posts/_search)时,我的hits.total为1400: {"query": {"query_string": {"query": "Bitcoin"}}} 当我使用以
我有这样的有效负载,所有文档中都会出现相同的有效负载,但每个文档中每个标签的权重都不同。 { "tags": [ { "tag": "tag1", "weight"
我是一名优秀的程序员,十分优秀!