Tasks

In order to upload tasks to a pool, you need to create JSON objects that contain:

  • The input data for the tasks (such as text or image URLs).

  • Correct responses (for control tasks).

  • Hints (for training tasks).

Toloka automatically combines the tasks into suites. You only need to specify the number of tasks to include in each suite (the mixer_config key in the pool).

If you want to create the suites yourself, follow the instructions in Task suites. For more information about creating task suites, see the Toloka requester's guide.

A sample task in JSON with key descriptions is shown below.

You can use the API for performing the following operations with tasks:

Sample task in JSON

{
   "id": "95199da8-77f4-4ceb-8316-2916a84b4641",
   "origin_task_id": "e3da7fe1-828d-4d9c-b49d-42c0eb5fcfde",
   "pool_id": "1",
   "input_values": {
      "image_url":"www.images/image1.ru"
   },
   "known_solutions":[
      {
         "output_values":{
            "result": "OK",
            "like": false
         },
         "correctness_weight": 0.8
      },
      {
         "output_values":{
            "result": "OK",
            "like": true
         },
         "correctness_weight": 1
      }
   ], 
   "message_on_unknown_solution": "The cat is in a good mood",
   "overlap": 3,
   "infinite_overlap": false,
   "reserved_for": [], 
   "unavailable_for":[],
   "created": "2016-09-07T08: 49: 27.272"
}

Keys

Key

Value

Data type

Required during creation

id

Task ID.

String

Not used

origin_task_id
The ID of a task from another pool from which this task was copied for majority vote verification. String Not used
pool_id

The ID of the pool that the task is uploaded to.

String

Yes

input_values

Input data for a task. List of pairs:

"<field 1 ID>": "<value of field 1>",
"<field 2 ID>": "<value of field 2>",
...
"<field n ID>": "<value of field n>"

JSON

Yes

known_solutions

Responses and hints for control tasks and training tasks.

If multiple output fields are included in the validation, all combinations of the correct response must be specified.

JSON

No

known_solutions.output_values

Correct responses in a task (for control tasks). If multiple correct responses are possible, define output_values for each possible response and set the weight for the correct response (the correctness_weight key).

"<field 1 ID>": "<correct answer>",
"<field 2 ID>": "<correct answer>",
...
"<field n ID>": "<correct answer n>"            

JSON

No

known_solutions.correctness_weight

The weight of a correct response. Allows you to set multiple versions of correct responses and rank them by correctness. For example, if a correct response is weighted 0.5, it counts as half of a mistake for the user. The more correct the response in correctValues, the higher its weight.

Floating-point number

No

message_on_unknown_solution

Hint for the task (for training tasks).

String

No

overlap

The overlap on the task suite.

Number

No, if the parameter is used when creating tasks
allow_defaults=true
and the overlap is specified in the pool parameters (key defaults.default_overlap_for_new_tasks)
infinite_overlap
Assigns tasks with infinite overlap. For example, this is used for sets of training tasks where you want to assign them to all users:
  • true — Use infinite overlap.

  • false — Use the overlap that is set for the task or pool.

The default value is false.

Boolean

No

origin_task_id
ID of the task it was copied from String No
reserved_for

IDs of users who will have access to the task.

Array

No

unavailable_for

IDs of users who shouldn't have access to the task.

Array

No

created

The UTC date and time when the task suite was created, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

Not used