Multiple images in a HIT with python API

0

Hello,
I am trying to create a HIT in MTurk using the python API. Let say a single HIT has 3 images. How would I modify the api call mturk.create_hit to replace the URL of the 3 images in my XML code? I believe the call is something like this:
.....
response = mturk.create_hit(**task_attributes,
Question = questions_xml.replace('${image_url}', ....))
hit_type_id = response['HIT']['HITTypeId'] ....

So basically, how would I change the 'Question' attribute to replace the 3 image_url?
Thanks

pallavr
質問済み 5年前203ビュー
2回答
0

Start by updating the task template captured in the questions_xml variable to include separate references to the three images you want to place there: ${image1_url}, ${image2_url}, and ${image3_url}. Then you can update your create step to replace all of the variables as shown below.

Question = questions_xml.replace('${image1_url}', ....).replace('${image2_url}', ....).replace('${image3_url}', ....)

回答済み 5年前
0

Thanks!

pallavr
回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ