0
機械翻訳でboto3を使用して質問をプログラムで作成しようとしていますが、create_hit
に必要なデータ構造ExternalQuestion
が欠落していると思われます。投稿する機械的なTurk ExternalQuestions with boto3
私はそうのような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/latest/AWSMturkAPI/ApiReference_ExternalQuestionArticle.html) – Mangohero1