【问题标题】:ruby-aws Amazon Mechanical Turkruby-aws 亚马逊机械土耳其人
【发布时间】:2015-02-11 15:23:37
【问题描述】:

我正在尝试使用 ruby​​-aws gem 使用预先创建的表单创建 HIT,并且不断收到缺少参数的错误。我已将缺少的参数限制为特定于我的表单的参数。

看来我的请求格式不正确,亚马逊几乎没有示例。我的日志说缺少以下参数:

关系、价格、环境意识、年龄、场合、性别、幽默、经验、本地、浪漫、附加信息

非常感谢任何帮助!

以下是我目前的要求:

hit = mturk.createHIT(
    :Operation => 'CreateHIT',
    :Title => 'Find a gift based on user scores',
    :Description => 'Find a gift for an individual based on survey scores.',
    :MaxAssignments => 3,
    :Signature => signature,
    :Timestamp => timestamp,
    :Reward => { :Amount => 0.25, :CurrencyCode => 'USD' },
    :HITLayoutId => '3AV6FF2M2GYMGLRQEKHZ7EBN4EZOJE',
    :HitLayoutParameter => {'Name' => 'additional_information', 'Value' => 'TEST'},
    :HitLayoutParameter => {'Name' => 'age', 'Value' => '22'},
    :HitLayoutParameter => {'Name' => 'environmental_consciousness', 'Value' => '54'},
    :HitLayoutParameter => {'Name' => 'experience', 'Value' => '32'},
    :HitLayoutParameter => {'Name' => 'gender', 'Value' => 'male'},
    :HitLayoutParameter => {'Name' => 'humor', 'Value' => '66'},
    :HitLayoutParameter => {'Name' => 'local', 'Value' => '21'},
    :HitLayoutParameter => {'Name' => 'occasion', 'Value' => '43'},
    :HitLayoutParameter => {'Name' => 'price', 'Value' => '33'},
    :HitLayoutParameter => {'Name' => 'relationship', 'Value' => '23'},
    :HitLayoutParameter => {'Name' => 'romance', 'Value' => '23'},  

    :Keywords => 'data collection, gifting, gifts, shopping, gift listings, presents',
    :AssignmentDurationInSeconds => 300,
    :LifetimeInSeconds => 604800
)

【问题讨论】:

    标签: ruby amazon-web-services mechanicalturk


    【解决方案1】:

    我能够解决这个问题 - AWS 的命名约定很糟糕。上面的示例确实使用了正确的格式,但是 HitLayoutParameter 必须是 HITLayoutParameter - 注意 CAPITAL HIT 与 Hit。

    另外,当提交多个参数时,应该只有一个 HITLayoutParameter 等于一组名称/值对。工作代码如下。

    希望这对其他人有帮助!

    最好的,

    ~DFO~

    hit = mturk.createHIT(
        :Operation => 'CreateHIT',
        :Title => 'Find a gift based on user scores',
        :Description => 'Find a gift for an individual based on survey scores.',
        :MaxAssignments => 3,
        :Signature => signature,
        :Timestamp => timestamp,
        :Reward => { :Amount => 0.25, :CurrencyCode => 'USD' },
        :HITLayoutId => '3AV6FF2M2GYMGLRQEKHZ7EBN4EZOJE',   
        :HITLayoutParameter => [ 
            {:Name => 'additional_information', :Value => 'TEST'},
            {:Name => 'age', :Value => '22'},
            {:Name => 'environmental_consciousness', :Value => '54'},
            {:Name => 'experience', :Value => '32'},
            {:Name => 'gender', :Value => 'male'},
            {:Name => 'humor', :Value => '66'},
            {:Name => 'local', :Value => '21'},
            {:Name => 'occasion', :Value => '43'},
            {:Name => 'price', :Value => '33'},
            {:Name => 'relationship', :Value => '23'},
            {:Name => 'romance', :Value => '23'}
        ],
    
        :Keywords => 'data collection, gifting, gifts, shopping, gift listings, presents',
        :AssignmentDurationInSeconds => 300,
        :LifetimeInSeconds => 604800
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多