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
asked 5 years ago198 views
2 Answers
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}', ....)

answered 5 years ago
0

Thanks!

pallavr
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions