Toloka documentation

get_aggregated_solutions

toloka.client.TolokaClient.get_aggregated_solutions | Source code

Finds all aggregated responses that match certain criteria.

Pass to the get_aggregated_solutions the ID of the operation started by the aggregate_solutions_by_pool method.

get_aggregated_solutions returns a generator. You can iterate over all found aggregated responses using the generator. Several requests to the Toloka server are possible while iterating.

If you need to sort aggregated responses use the find_aggregated_solutions method.

Tip

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

Parameters Description

Parameters Type Description
operation_id str

The ID of the aggregation operation.

task_id_lt Optional[str]

Responses for tasks with IDs less than the specified value.

task_id_lte Optional[str]

Responses for tasks with IDs less than or equal to the specified value.

task_id_gt Optional[str]

Responses for tasks with IDs greater than the specified value.

task_id_gte Optional[str]

Responses for tasks with IDs greater than or equal to the specified value.

  • Yields:

    The next matching aggregated response.

  • Yield type:

    Generator[AggregatedSolution, None, None]

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))