Toloka documentation

aggregate_solutions_by_pool

toloka.client.TolokaClient.aggregate_solutions_by_pool | Source code

Starts aggregation of responses in all completed tasks in a pool.

The method starts the aggregation process on the Toloka server. To wait for the completion of the operation use the wait_operation method.

Tip

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

Parameters Description

Parameters Type Description
type Union[AggregatedSolutionType, str, None]

Aggregation model:

pool_id Optional[str]

The ID of the pool.

answer_weight_skill_id Optional[str]

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

fields Optional[List[PoolAggregatedSolutionRequest.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 in a pool.

aggregation_operation = toloka_client.aggregate_solutions_by_pool(
        type=toloka.aggregation.AggregatedSolutionType.WEIGHTED_DYNAMIC_OVERLAP,
        pool_id=some_existing_pool_id,
        answer_weight_skill_id=some_skill_id,
        fields=[toloka.aggregation.PoolAggregatedSolutionRequest.Field(name='result')]
    )
aggregation_operation = toloka_client.wait_operation(aggregation_operation)
aggregation_results = list(toloka_client.get_aggregated_solutions(aggregation_operation.id))