Python 将我的HTML从本地计算机发布到HIT-in-Mturk沙箱

Python 将我的HTML从本地计算机发布到HIT-in-Mturk沙箱,python,amazon-web-services,Python,Amazon Web Services,我正在研究如何使用python将我的HTML文件从本地计算机发布到沙箱中的HITs。我将python和HTML放在同一个目录中,并在给定的教程中使用了该模板 我的想法是:第11行有一个bug。函数open无法接受HTML文件,因此我得到了一个错误。如何修复此错误?HTML文件的内容是什么 它不应该只是HTML。Turk希望html被包装在一个标记中 查看示例并查看html问题的格式。很可能您的html文件格式不正确。请参见下面的示例

我正在研究如何使用python将我的HTML文件从本地计算机发布到沙箱中的HITs。我将python和HTML放在同一个目录中,并在给定的教程中使用了该模板


我的想法是:第11行有一个bug。函数
open
无法接受HTML文件,因此我得到了一个错误。如何修复此错误?

HTML文件的内容是什么

它不应该只是HTML。Turk希望html被包装在一个标记中


查看示例并查看html问题的格式。

很可能您的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>


一切都很美好。
阳性
情绪包括:喜悦、兴奋、喜悦

负面情绪包括: 愤怒、讽刺、焦虑

中性:既不是正的也不是正的 否定的,如陈述事实

不适用:当无法编辑文本时 明白

当喜怒哀乐交织在一起时, 用你的判断力来选择更强烈的情感

选择文本所表达的主要情感。 ]]> 0

botocore.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)


    
      
          
            
        <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>