Toloka documentation

aggregate_solutions_by_task

toloka.client.TolokaClient.aggregate_solutions_by_task | Source code

Aggregates responses to a single task on the Toloka server.

Tip

Try crowd-kit library. It has many aggregation methods and executes on your computer.

Parameters Description

Parameters Type Description
task_id Optional[str]

The ID of the task.

pool_id Optional[str]

The ID of the pool containing the task.

answer_weight_skill_id Optional[str]

The ID of the skill that determines the weight of the Toloker's responses.

fields Optional[List[WeightedDynamicOverlapTaskAggregatedSolutionRequest.Field]]

Output data fields to aggregate. For the best results, each of these fields should have limited number of response options.

Examples:

The example shows how to aggregate responses to a single task.

aggregated_response = toloka_client.aggregate_solutions_by_task(
    type=toloka.aggregation.AggregatedSolutionType.WEIGHTED_DYNAMIC_OVERLAP,
    pool_id=some_existing_pool_id,
    task_id=some_existing_task_id,
    answer_weight_skill_id=some_skill_id,
    fields=[toloka.aggregation.PoolAggregatedSolutionRequest.Field(name='result')]
)
print(aggregated_response.output_values['result'])