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
preguntada hace 5 años203 visualizaciones
2 Respuestas
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}', ....)

respondido hace 5 años
0

Thanks!

pallavr
respondido hace 5 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas