Trait/Object

spacro.tasks

TaskSpecification

Related Docs: object TaskSpecification | package tasks

Permalink

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskSpecification
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type AjaxRequest <: AnyRef { type Response }

    Permalink
  2. abstract type Prompt

    Permalink
  3. abstract type Response

    Permalink
  4. abstract type WebsocketRequest

    Permalink
  5. abstract type WebsocketResponse

    Permalink

Abstract Value Members

  1. implicit abstract val ajaxRequestReader: upickle.default.Reader[AjaxRequest]

    Permalink
  2. implicit abstract val ajaxResponseWriter: ResponseWriter[AjaxRequest]

    Permalink
  3. abstract val ajaxService: Service[AjaxRequest]

    Permalink
  4. abstract val apiFlow: Flow[WebsocketRequest, WebsocketResponse, Any]

    Permalink
  5. implicit abstract val config: TaskConfig

    Permalink
  6. abstract val frozenHITTypeId: Option[String]

    Permalink
  7. abstract val hitType: HITType

    Permalink
  8. implicit abstract val promptWriter: upickle.default.Writer[Prompt]

    Permalink
  9. implicit abstract val responseReader: upickle.default.Reader[Response]

    Permalink
  10. abstract val samplePrompts: Vector[Prompt]

    Permalink
  11. abstract val taskKey: String

    Permalink
  12. abstract val taskPageBodyElements: List[TypedTag[String]]

    Permalink
  13. abstract val taskPageHeadElements: List[TypedTag[String]]

    Permalink
  14. implicit abstract val websocketRequestReader: upickle.default.Reader[WebsocketRequest]

    Permalink
  15. implicit abstract val websocketResponseWriter: upickle.default.Writer[WebsocketResponse]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def createHIT(prompt: Prompt, numAssignments: Int, lifetime: Long = 2592000L): Try[HIT[Prompt]]

    Permalink

    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

  7. final def createTaskHTMLPage(prompt: Prompt, useHttps: Boolean): String

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. final def extractFeedback(answerXML: String): String

    Permalink

    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.

    answerXML

    the XML string received from the API

    returns

    the annotator's feedback

  11. final def extractResponse(answerXML: String): Response

    Permalink

    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

  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final lazy val hitTypeId: String

    Permalink

    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.

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def makeAssignment(hitId: String, mTurkAssignment: com.amazonaws.services.mturk.model.Assignment): Assignment[Response]

    Permalink

    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.

  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped