0
我想用程序在boto3上創建一個機械turk的問題,但是我似乎做錯了什麼,因爲create_hit
需要的ExternalQuestion
數據結構似乎丟失了。如何用boto3提交Mechanical Turk外部問題
我嘗試創建HIT像這樣:
import boto3
#...
client = boto3.client(
'mturk',
endpoint_url=endpoint_url,
region_name=region_name,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
)
question = ExternalQuestion(external_url=question_target, frame_height=800)
response = client.create_hit(
MaxAssignments=10,
Title='Test',
Description='This is a test of ExternalQuestion',
Question=question,
AssignmentDurationInSeconds=60,
LifetimeInSeconds=24 * 60 * 60,
Reward=0.01)
從而未能:
Traceback (most recent call last):
File "createTask.py", line 21, in <module>
question = ExternalQuestion(external_url=question_target, frame_height=800)
NameError: name 'ExternalQuestion' is not defined
如何進行的任何意見表示高度讚賞。
ExternalQuestion是一種數據結構,不是一個函數。它應該在XML文件中創建,然後在Python中使用'open()'命令並將'file.read()'傳遞給Question參數 – Mangohero1
請參閱示例代碼[here](http://docs.aws .amazon.com/AWSMechTurk /最新/ AWSMturkAPI/ApiReference_ExternalQuestionArticle.html) – Mangohero1