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

ParametersTypeDescription
operation_idstr

The ID of the aggregation operation.

task_id_ltOptional[str]

Responses for tasks with IDs less than the specified value.

task_id_lteOptional[str]

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

task_id_gtOptional[str]

Responses for tasks with IDs greater than the specified value.

task_id_gteOptional[str]

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

batch_sizeOptional[int]

A limit of items returned by each request to Toloka. The maximum allowed value: 100,000. The default value: 50.

  • 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.client.aggregation.AggregatedSolutionType.WEIGHTED_DYNAMIC_OVERLAP,
pool_id=some_existing_pool_id,
answer_weight_skill_id=some_skill_id,
fields=[toloka.client.aggregation.PoolAggregatedSolutionRequest.Field(name='result')]
)
aggregation_operation = toloka_client.wait_operation(aggregation_operation)
aggregation_results = list(toloka_client.get_aggregated_solutions(aggregation_operation.id))

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming