【问题标题】:Bulk HIT Creation through Template通过模板批量创建 HIT
【发布时间】:2016-01-24 21:56:37
【问题描述】:
    library(MTurkR)
    options(MTurkR.sandbox = TRUE)
    credentials(keypair=c("XXXXXX","XXXXXX"))
    AccountBalance()
    #BulkCreateFromTemplate
    temp <- system.file("template.html", package = "MTurkR")
    a <- data.frame(hittitle = c("HIT title 1", "HIT title 2", "HIT title 3"),
                    hitvariable = c("HIT text 1", "HIT text 2", "HIT text 3"), 
                    stringsAsFactors = FALSE)
    BulkCreateFromTemplate(template = temp,
                           input = a,
                           annotation = paste("Bulk From Template", Sys.Date()),
                           title = "Categorize an image",
                           description = "Categorize this image",
                           reward = ".05",
                           expiration = seconds(days = 4),
                           duration = seconds(minutes = 5),
                           auto.approval.delay = seconds(days = 1),
                           keywords = "categorization, image, moderation, category")

我在运行模板时遇到的错误如下: 文件中的错误(con,“r”):无法打开连接 另外:警告信息: 在文件(con,“r”)中: 无法打开文件'http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd'>450':参数无效

#tempalte I am using is:
<!DOCTYPE html>
<html>
 <head>
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
  <script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/externalHIT_v1.js'></script>
 </head>
 <body>
  <form name='mturk_form' method='post' id='mturk_form' action='https://www.mturk.com/mturk/externalSubmit'>
  <input type='hidden' value='' name='assignmentId' id='assignmentId'/>
  <h1>${hittitle}</h1>
  <p>${hitvariable}</p>
  <p>What do you think?</p>
  <p><textarea name='comment' cols='80' rows='3'></textarea></p>
  <p><input type='submit' id='submitButton' value='Submit' /></p></form>
  <script language='Javascript'>turkSetAssignmentID();</script>
 </body>
</html>  

【问题讨论】:

    标签: r mechanicalturk


    【解决方案1】:

    你的问题出在这一行:

    temp <- system.file("template.html", package = "MTurkR")
    

    "template.html" 不是与 MTurkR 一起安装的文件,因此system.file() 在这里不合适。如果您尝试访问工作目录(或计算机上的其他位置)中名为 "template.html" 的文件,您只需执行以下操作:

    BulkCreateFromTemplate(template = "template.html", ...
    

    连同传递给BulkCreateFromTemplate()的其他选项。

    【讨论】:

    • 非常感谢您的帮助
    猜你喜欢
    • 2019-12-14
    • 2017-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-05
    • 1970-01-01
    • 1970-01-01
    • 2020-10-04
    相关资源
    最近更新 更多