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:
- TotalAssignmentsCount — Total count of checked assignments submitted by a Toloker.
- AcceptedAssignmentsRate — A percentage of accepted assignments.
- RejectedAssignmentsRate — A percentage of rejected assignments.
The collector can be used with actions:
- RestrictionV2 blocks access to projects or pools.
- ApproveAllAssignments accepts all Toloker's assignments.
- RejectAllAssignments rejects all Toloker's assignments.
- SetSkill sets Toloker's skill value.
- SetSkillFromOutputField sets Toloker's skill value using an output field.
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', ) )