Toloka documentation

SetSkillFromOutputField

toloka.client.actions.SetSkillFromOutputField | Source code

SetSkillFromOutputField(
    self,
    *,
    skill_id: Optional[str] = None,
    from_field: Union[RuleConditionKey, str, None] = None
)

Sets Toloker's skill value to the percentage of correct or incorrect answers.

You can use this action with MajorityVote and GoldenSet collectors.

Parameters Description

Parameters Type Description
skill_id Optional[str]

The ID of the skill to update.

from_field Union[RuleConditionKey, str, None]

The value to assign to the skill:

  • correct_answers_rate — Percentage of correct answers.
  • incorrect_answers_rate — Percentage of incorrect answers.

Examples:

In the following example, a MajorityVote collector is used to update a skill value.

new_pool = toloka.pool.Pool(....)
new_pool.quality_control.add_action(
    collector=toloka.collectors.MajorityVote(answer_threshold=2, history_size=10),
    conditions=[
        toloka.conditions.TotalAnswersCount > 2,
    ],
    action=toloka.actions.SetSkillFromOutputField(
        skill_id=some_skill_id,
        from_field='correct_answers_rate',
    ),
)