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:
The collector can be used with conditions:
The collector can be used with actions:
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.
The maximum number of recent assignments used to calculate the statistics. If
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',))