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.
Try crowd-kit library. It has many aggregation methods and executes on your computer.
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. |
batch_size | Optional[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