Toloka documentation

Pool

toloka.client.pool.Pool | Source code

Pool(
    self,
    *,
    project_id: Optional[str] = None,
    private_name: Optional[str] = None,
    may_contain_adult_content: Optional[bool] = None,
    reward_per_assignment: Optional[float] = None,
    assignment_max_duration_seconds: Optional[int] = None,
    defaults: Optional[Defaults] = ...,
    will_expire: Optional[datetime] = None,
    private_comment: Optional[str] = None,
    public_description: Optional[str] = None,
    public_instructions: Optional[str] = None,
    auto_close_after_complete_delay_seconds: Optional[int] = None,
    dynamic_pricing_config: Optional[DynamicPricingConfig] = None,
    auto_accept_solutions: Optional[bool] = None,
    auto_accept_period_day: Optional[int] = None,
    assignments_issuing_config: Optional[AssignmentsIssuingConfig] = None,
    priority: Optional[int] = None,
    filter: Optional[FilterCondition] = None,
    quality_control: Optional[QualityControl] = ...,
    speed_quality_balance: Optional[SpeedQualityBalanceConfig] = None,
    dynamic_overlap_config: Optional[DynamicOverlapConfig] = None,
    mixer_config: Optional[MixerConfig] = None,
    training_config: Optional[TrainingConfig] = None,
    metadata: Optional[Dict[str, List[str]]] = None,
    owner: Optional[Owner] = None,
    id: Optional[str] = None,
    status: Optional[Status] = None,
    last_close_reason: Optional[CloseReason] = None,
    created: Optional[datetime] = None,
    last_started: Optional[datetime] = None,
    last_stopped: Optional[datetime] = None,
    type: Optional[Type] = None
)

A set of tasks that are issued and checked according to the same rules within the project

Groups tasks by the following criteria: one-time start-up, which Tolokers can perform tasks, quality control, price for TaskSuite's, overlap. Tasks, golden tasks and assignments are related to a pool.

Parameters Description

Parameters Type Description
project_id Optional[str]

ID of the project that the pool was created for.

private_name Optional[str]

Name of the pool (only visible to the requester).

may_contain_adult_content Optional[bool]

Whether the tasks contain adult content.

reward_per_assignment Optional[float]

Payment per task suite in U.S. dollars. For cents, use the dot (".") as the separator. The minimum payment is $0.01. Only training and control tasks can be uploaded to zero-price pools.

assignment_max_duration_seconds Optional[int]

The time allowed for completing a task suite, in seconds. Tasks not completed within this time are reassigned to other Tolokers. We recommend allowing no more than 60 seconds per task suite (including the time for page loading and sending responses).

defaults Optional[Defaults]

Settings that are applied by default when uploading new task suites to a pool.

will_expire Optional[datetime]

The date and time in UTC when the pool should be closed (even if all the task suites haven't been completed).

private_comment Optional[str]

Comments on the pool (only visible to the requester).

public_description Optional[str]

Description for Tolokers. If it is filled in, the text will be displayed instead of the project's public_description in the list of tasks for Tolokers.

public_instructions Optional[str]

Optional[str]

auto_close_after_complete_delay_seconds Optional[int]

Waiting time (in seconds) before automatic closure of the pool after all tasks are completed. Minimum — 0, maximum — 259200 seconds (three days). Use it if: * Your data processing is close to real time. * You need an open pool where you upload tasks. * Dynamic overlap is enabled in the pool (dynamic_overlap_config).

dynamic_pricing_config Optional[DynamicPricingConfig]

The dynamic pricing settings.

auto_accept_solutions Optional[bool]

Whether tasks must be checked manually:

  • True - Automatic task acceptance (manual checking isn't necessary).
  • False - The requester will check the tasks.
auto_accept_period_day Optional[int]

Optional[int]

assignments_issuing_config Optional[AssignmentsIssuingConfig]

Settings for assigning tasks in the pool.

priority Optional[int]

The priority of the pool in relation to other pools in the project with the same task price and set of filters. Tolokers are assigned tasks with a higher priority first. Possible values: from -100 to 100. If the project has multiple pools, the order for completing them depends on the parameters:

  • Pools with identical filter settings and price per task are assigned to Tolokers in the order in which they were started. The pool that was started earlier will be completed sooner. You can change the order for completing the pools.
  • Pools with different filter settings and/or a different price per task are sent out for completion when the pool opens.
filter Optional[FilterCondition]

Settings for Toloker selection filters.

quality_control Optional[QualityControl]

Settings for quality control rules and the ID of the pool with training tasks.

speed_quality_balance Optional[SpeedQualityBalanceConfig]

Settings for balance between speed and quality of pool done.

dynamic_overlap_config Optional[DynamicOverlapConfig]

Dynamic overlap setting. Allows you to change the overlap depending on how well Tolokers handle the task.

mixer_config Optional[MixerConfig]

Parameters for automatically creating a task suite (“smart mixing”).

training_config Optional[TrainingConfig]

Optional[TrainingConfig]

metadata Optional[Dict[str, List[str]]]

Optional[Dict[str, List[str]]]

owner Optional[Owner]

Optional[Owner]

id Optional[str]

Pool ID. Read only field.

status Optional[Status]

Status of the pool. Read only field.

last_close_reason Optional[CloseReason]

The reason for closing the pool the last time. Read only field.

created Optional[datetime]

When this pool was created. Read only field.

last_started Optional[datetime]

The date and time when the pool was last started. Read only field.

last_stopped Optional[datetime]

The date and time when the pool was last stopped. Read only field.

type Optional[Type]

Types of pool. Read only field.

Examples:

How to create a new pool in a project.

toloka_client = toloka.TolokaClient(your_token, 'PRODUCTION')
new_pool = toloka.pool.Pool(
    project_id=existing_project_id,
    private_name='Pool 1',
    may_contain_adult_content=False,
    will_expire=datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=365),
    reward_per_assignment=0.01,
    assignment_max_duration_seconds=60*20,
    defaults=toloka.pool.Pool.Defaults(default_overlap_for_new_task_suites=3),
    filter=toloka.filter.Languages.in_('EN'),
)
new_pool.set_mixer_config(real_tasks_count=10)
new_pool.quality_control.add_action(...)
new_pool = toloka_client.create_pool(new_pool)
print(new_pool.id)

Methods Summary

Method Description
is_archived None
is_closed None
is_locked None
is_open None
set_assignments_issuing_config A shortcut setter for assignments_issuing_config
set_captcha_frequency A shortcut setter for quality_control.captcha_frequency
set_checkpoints_config A shortcut setter for quality_control.checkpoints_config
set_defaults A shortcut setter for defaults
set_dynamic_overlap_config A shortcut setter for dynamic_overlap_config
set_dynamic_pricing_config A shortcut setter for dynamic_pricing_config
set_filter A shortcut setter for filter
set_mixer_config A shortcut setter for mixer_config
set_owner A shortcut setter for owner
set_quality_control A shortcut setter for quality_control
set_quality_control_configs A shortcut method for setting
set_speed_quality_balance A shortcut setter for speed_quality_balance
set_training_config A shortcut setter for training_config
set_training_requirement A shortcut setter for quality_control.training_requirement