Creates a HIT on MTurk.
Creates a HIT on MTurk.
If the HIT is successfully created, saves the HIT to disk and returns it. Otherwise returns a Failure with the error.
Saving the HIT requires a serializer for it; for this reason, the method needs a upickle serializer for the Prompt type.
the data from which to generate the question for the HIT
the created HIT, wrapped in a Try in case of error
Extracts the annotator's feedback from an answer XML string.
Extracts the annotator's feedback from an answer XML string.
The feedback field needs to be manually included in the form on the client in order for this to work.
(Otherwise, this just returns the empty string.)
Notes from the documentation for extractResponse
apply here.
the XML string received from the API
the annotator's feedback
Extracts the annotator's response from an "answer" XML object retrieved from the MTurk API after the completion of an assignment.
Extracts the annotator's response from an "answer" XML object retrieved from the MTurk API after the completion of an assignment.
See http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_QuestionAnswerDataArticle.html for a specification of the XML documents that may be received from the API as answers. There are helpful classes in the Java API for parsing this XML; see implementations of this method for examples.
the XML string received from the API
the well-typed data representation of an annotator response
The HIT Type ID for this task.
The HIT Type ID for this task.
When this is accessed with a certain set of parameters for the first time, a new HIT Type ID will be registered on Amazon's systems. Subsequent calls with the same parameters will always return this same value, for the life of the HIT Type (which I believe expires 30 days after the last time it is used. It may be 90 days. TODO check on that. But it doesn't really matter...)
I'm not 100% sure this needs to be lazy... but it's not hurting anyone as it is.
Makes an Assignment data structure corresponding to a completed assignment on MTurk.
Makes an Assignment data structure corresponding to a completed assignment on MTurk. Does not save it to disk since it hasn't been reviewed yet. TODO: this should create some sort of "reviewable assignment" instead, which perhaps can be saved immediately to avoid possible problems, and which will help ensure everything gets reviewed as appropriate.
Specifies a kind of task to run on MTurk.
The code defining an individual task type will be here. An instance of this class will correspond to a single HIT Type ID, which is Mechanical Turk's way of categorizing HITs uploaded to the system. This specifies the method to convert from
Prompt
s (as in, the type parameter seen all over this project) into XML strings that are POSTed to the MTurk API as questions shown to annotators. It also has a method for converting from annotator responses (also XML strings) intoResponse
s.To implement the actual logic & interface of a task, the work is done in the client-side code.
TaskSpecification is also responsible for holding HIT Type ID of its HIT Type.