亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從我的本地計算機將我的 HTML 發布到 Mturk 沙箱中的 HIT

從我的本地計算機將我的 HTML 發布到 Mturk 沙箱中的 HIT

喵喔喔 2023-10-31 14:08:19
我正在研究如何使用 python 將 HTML 文件從本地計算機發布到沙箱中的 HIT。我將 python 和 HTML 放在同一目錄中,并使用給定教程中的模板。https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMechanicalTurkRequester/Welcome.html。 1 import boto3      2 MTURK_SANDBOX = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'      3 mturk = boto3.client('mturk',      4    aws_access_key_id = "AKIAWMEANKTGFT3M57VI",      5    aws_secret_access_key = "HhzM8VKe7flOEeSkh4uHeJ7l333Ud3UxnArL/lB0",      6    region_name='us-east-1',      7    endpoint_url = MTURK_SANDBOX      8 )      9 print("I have $" + mturk.get_account_balance()['AvailableBalance'] + " in my Sandbox account")     10     11 html_layout = open('./HTML_template.html', 'r').read()     12 new_hit = mturk.create_hit(     13     Title = 'Finish all tasks',     14     Description = 'Please follow the instructions described in the webpage',     15     Keywords = 'multiple choice',     16     Reward = '0.01',     17     MaxAssignments = 1,     18     LifetimeInSeconds = 172800,     19     AssignmentDurationInSeconds = 600,     20     AutoApprovalDelayInSeconds = 14400,     21     Question = html_layout,     22 )     23 print("A new HIT has been created. You can preview it here:" )     24 print("https://workersandbox.mturk.com/mturk/preview?groupId=" + new_hit['HIT']['HITGroupId'])     25 print("HITID = " + new_hit['HIT']['HITId'] + " (Use to Get Results)")     26 # Remember to modify the URL above when you're publishing     27 # HITs to the live marketplace.     28 # Use: https://worker.mturk.com/mturk/preview?groupId=這是我運行命令時的錯誤消息python3 create_tasks.pybotocore.exceptions.ClientError: An error occurred (ParameterValidationError) when calling the CreateHIT operation: There was an error parsing the XML question or answer data in your request.  Please make sure the data is well-formed and validates against the appropriate schema. Details: Scanner State 24 not Recognized  (1602359732641 s)這是我的想法:第 11 行有一個錯誤。該函數open無法接受 HTML 文件,因此我收到錯誤。我該如何修復這個錯誤?
查看完整描述

2 回答

?
慕虎7371278

TA貢獻1802條經驗 獲得超4個贊

您的 HTML 文件的格式很可能不正確。請看下面的例子。




    

      

          

            

        <crowd-form>

          <crowd-classifier

            name="sentiment"

            categories="['Positive', 'Negative', 'Neutral', 'N/A']"

            header="What sentiment does this text convey?"

          >

            <classification-target>

            Everything is wonderful.

            </classification-target>

            

            <full-instructions header="Sentiment Analysis Instructions">

            <p><strong>Positive</strong> 

              sentiment include: joy, excitement, delight</p>

            <p><strong>Negative</strong> sentiment include: 

              anger, sarcasm, anxiety</p>

            <p><strong>Neutral</strong>: neither positive or 

              negative, such as stating a fact</p>

            <p><strong>N/A</strong>: when the text cannot be 

              understood</p>

            <p>When the sentiment is mixed, such as both joy and sadness,

              use your judgment to choose the stronger emotion.</p>

            </full-instructions>

         

            <short-instructions>

             Choose the primary sentiment that is expressed by the text. 

            </short-instructions>

          </crowd-classifier>

        </crowd-form>

      </body>

    </html>

  ]]></HTMLContent>

  <FrameHeight>0</FrameHeight>

</HTMLQuestion>


查看完整回答
反對 回復 2023-10-31
?
蕭十郎

TA貢獻1815條經驗 獲得超13個贊

您的 HTML 文件的內容是什么?

它不應該只是 HTML。Turk 希望 html 包含在標簽中。


查看完整回答
反對 回復 2023-10-31
  • 2 回答
  • 0 關注
  • 161 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號