sealed trait TaskSpecification extends AnyRef
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 Prompts
(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)
into Responses.
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.
- Alphabetic
- By Inheritance
- TaskSpecification
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Abstract Value Members
- implicit abstract val ajaxRequestReader: upickle.default.Reader[AjaxRequest]
- implicit abstract val ajaxResponseWriter: ResponseWriter[AjaxRequest]
- abstract val ajaxService: Service[AjaxRequest]
- abstract val apiFlow: Flow[WebsocketRequest, WebsocketResponse, Any]
- implicit abstract val config: TaskConfig
- abstract val frozenHITTypeId: Option[String]
- abstract val hitType: HITType
- implicit abstract val promptWriter: upickle.default.Writer[Prompt]
- implicit abstract val responseReader: upickle.default.Reader[Response]
- abstract val samplePrompts: Vector[Prompt]
- abstract val taskKey: String
- abstract val taskPageBodyElements: List[TypedTag[String]]
- abstract val taskPageHeadElements: List[TypedTag[String]]
- implicit abstract val websocketRequestReader: upickle.default.Reader[WebsocketRequest]
- implicit abstract val websocketResponseWriter: upickle.default.Writer[WebsocketResponse]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
createHIT(prompt: Prompt, numAssignments: Int, lifetime: Long = 2592000L): Try[HIT[Prompt]]
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.
- prompt
the data from which to generate the question for the HIT
- returns
the created HIT, wrapped in a Try in case of error
- final def createTaskHTMLPage(prompt: Prompt, useHttps: Boolean): String
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
extractFeedback(answerXML: String): String
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
extractResponseapply here.- answerXML
the XML string received from the API
- returns
the annotator's feedback
-
final
def
extractResponse(answerXML: String): Response
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.
- answerXML
the XML string received from the API
- returns
the well-typed data representation of an annotator response
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
lazy val
hitTypeId: String
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.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
makeAssignment(hitId: String, mTurkAssignment: com.amazonaws.services.mturk.model.Assignment): Assignment[Response]
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.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )