Toloka documentation

AcceptanceRate

toloka.client.collectors.AcceptanceRate | Source code

AcceptanceRate(
    self,
    *,
    uuid: Optional[UUID] = None,
    history_size: Optional[int] = None
)

Counts accepted and rejected Toloker's assignments.

If non-automatic acceptance is set in the pool, you may use this collector to:

  • Set a Toloker's skill.
  • Block access for Tolokers with too many rejected responses.

The collector can be used with conditions:

The collector can be used with actions:

Parameters Description

Parameters Type Description
uuid Optional[UUID]

The ID of a collector. Note that when you clone a pool, both pools start using the same collector, because it is not cloned. Usually, it is not an intended behavior. For example, in this case one collector gathers history size from both pools.

history_size Optional[int]

The maximum number of recent assignments used to calculate the statistics. If history_size is omitted, all Toloker's assignments are counted.

Examples:

The example shows how to block a Toloker if they make too many mistakes. If more than 35% of responses are rejected, then the Toloker is restricted to access the project. The rule is applied after collecting 3 or more responses.

new_pool = toloka.pool.Pool(....)
new_pool.quality_control.add_action(
    collector=toloka.collectors.AcceptanceRate(),
    conditions=[
        toloka.conditions.TotalAssignmentsCount > 2,
        toloka.conditions.RejectedAssignmentsRate > 35,
    ],
    action=toloka.actions.RestrictionV2(
        scope=toloka.user_restriction.UserRestriction.PROJECT,
        duration=15,
        duration_unit='DAYS',
        private_comment='The Toloker often makes mistakes',
    )
)