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
demandé il y a 5 ans203 vues
2 réponses
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}', ....)

répondu il y a 5 ans
0

Thanks!

pallavr
répondu il y a 5 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions