5

R で MTurK パッケージを使用してメカニカル ターク ヒットを作成したいと思います。使用している R コードは次のとおりです。

filecontent <- GenerateHTMLQuestion(file="file.html")
print(filecontent)
#filestring <- filecontent [["string"]]
#filestring <- filecontent [["xml.parsed"]]
#filestring <- filecontent [["url.encoded"]]
filecontentForQuestion <- filecontent$string
filecontentForQuestion <- filecontent$xml
filecontentForQuestion <- filecontent$url
print(filecontentForQuestion)
testhit<-CreateHIT(question=filecontentForQuestion,
         title="Title",
         description="Description",
         keywords="Keyword",
         reward="0.05",
         assignments="3",
         duration="3600",
         expiration="20000",
         auto.approval.delay="2590000",
         qual.req=GenerateQualificationRequirement("Approved",">","5"),
     browser = F,
     sandbox=T)

さまざまなファイルコンテンツをすべて試しましたが、このコマンドを使用すると常にエラーが発生します。残念ながら、常に次のエラーが発生します。

Error (AWS.MechanicalTurk.HTML5ParseError): There was an error parsing the
  HTML5 data in your request.  Please make sure the data is 
  well-formed and validates as HTML5

ただし、私が使用している html ファイルは MTurk API マニュアルのもので、次のとおりです。

<!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/ex
ternalHIT_v1.js'></script>
</head>
<body>
<form name='mturk_form' method='post' id='mturk_form' action='ht
tps://www.mturk.com/mturk/externalSubmit'>
<input type='hidden' value='' name='assignmentId' id='assignmentId'/>
<h1>What's up?</h1>
<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>

必要なプレースホルダーのみを含む完全な空の html5 ドキュメントを使用すると、同じエラーが発生します。なぜこれが機能しないのですか?

hitlayoutid パラメータまたは ExternalQuestion コマンドを使用すると機能するので、GenerateHTMLQuestion コマンドを明示的に使用したいと考えています。

4

0 に答える 0