toloka.client.task.Task
| Source code
Task( self, *, input_values: Optional[Dict[str, Any]] = None, known_solutions: Optional[List[BaseTask.KnownSolution]] = None, message_on_unknown_solution: Optional[str] = None, id: Optional[str] = None, infinite_overlap=None, overlap=None, pool_id: Optional[str] = None, remaining_overlap: Optional[int] = None, reserved_for: Optional[List[str]] = None, unavailable_for: Optional[List[str]] = None, traits_all_of: Optional[List[str]] = None, traits_any_of: Optional[List[str]] = None, traits_none_of_any: Optional[List[str]] = None, origin_task_id: Optional[str] = None, created: Optional[datetime] = None, baseline_solutions: Optional[List[BaselineSolution]] = None)
A task that is assigned to Tolokers.
Tasks are grouped into TaskSuites.
Parameters | Type | Description |
---|---|---|
input_values | Optional[Dict[str, Any]] | A dictionary with input data for a task. Input field names are keys in the dictionary. |
known_solutions | Optional[List[BaseTask.KnownSolution]] | A list of all responses considered correct. It is used with control and training tasks. If there are several output fields, then you must specify all their correct combinations. |
message_on_unknown_solution | Optional[str] | A hint used in training tasks. |
id | Optional[str] | The ID of a task. |
pool_id | Optional[str] | The ID of the pool that the task belongs to. |
remaining_overlap | Optional[int] | The number of times left for this task to be assigned to Tolokers. Read-only field. |
reserved_for | Optional[List[str]] | IDs of Tolokers who have access to the task. |
unavailable_for | Optional[List[str]] | IDs of Tolokers who don't have access to the task. |
traits_all_of | Optional[List[str]] | The task can be assigned to Tolokers who have all of the specified traits. |
traits_any_of | Optional[List[str]] | The task can be assigned to Tolokers who have any of the specified traits. |
traits_none_of_any | Optional[List[str]] | The task can not be assigned to Tolokers who have any of the specified traits. |
origin_task_id | Optional[str] | The ID of a parent task. This parameter is set if the task was created by copying. |
created | Optional[datetime] | The UTC date and time when the task was created. |
baseline_solutions | Optional[List[BaselineSolution]] | Preliminary responses for dynamic overlap and aggregation of results by skill. They are used to calculate a confidence level of the first responses from Toloker. |
Examples:
Creating a simple task with one input field.
task = toloka.client.Task( input_values={'image': 'https://some.url/img0.png'}, pool_id='1')
See more complex example in the description of the create_tasks method.