Toloka documentation

find_aggregated_solutions

toloka.client.TolokaClient.find_aggregated_solutions

Gets aggregated responses after the AggregatedSolutionOperation completes.

It is better to use the "get_aggregated_solutions" method, that allows to iterate through all results.

Note

In all aggregation purposes we are strongly recommending using our crowd-kit library, that have more aggregation methods and can perform on your computers.

Parameters Description

Parameters Type Description
operation_id str

From what aggregation operation you want to get results.

task_id_lt Optional[str]

Jobs with an ID greater than the specified value.

task_id_lte Optional[str]

Jobs with an ID greater than or equal to the specified value.

task_id_gt Optional[str]

Jobs with an ID less than the specified value.

task_id_gte Optional[str]

Jobs with an ID less than or equal to the specified value.

sort Union[List[str], AggregatedSolutionSortItems, None]

How to sort results. Defaults to None.

limit Optional[int]

Limit on the number of results returned. The maximum is 100,000. Defaults to None, in which case it returns first 50 results.

Examples:

How to get all aggregated solutions from pool.

current_result = toloka_client.find_aggregated_solutions(aggregation_operation.id)
aggregation_results = current_result.items
while current_result.has_more:
    current_result = toloka_client.find_aggregated_solutions(
        aggregation_operation.id,
        task_id_gt=current_result.items[len(current_result.items) - 1].task_id,
    )
    aggregation_results = aggregation_results + current_result.items
print(len(aggregation_results))