get_assignments_df

toloka.client.TolokaClient.get_assignments_df | Source code

Downloads assignments as pandas.DataFrame.

Warning

Requires toloka-kit[pandas] extras. Install it with the following command:

pip install toloka-kit[pandas]

Experimental method. Implements the same behavior as if you download results in web-interface and then read it by pandas.

Parameters description

ParametersTypeDescription
pool_idstr

From which pool the results are loaded.

statusOptional[List[GetAssignmentsTsvParameters.Status]]

Statuses of assignments to download.

start_time_fromOptional[datetime]

Download assignments submitted after the specified date and time.

start_time_toOptional[datetime]

Download assignments submitted before the specified date and time.

exclude_bannedOptional[bool]

Exclude answers from banned Tolokers, even if their assignments have suitable status.

fieldOptional[List[GetAssignmentsTsvParameters.Field]]

Names of Assignment fields to be downloaded. Fields other then from Assignment class are always downloaded.

  • Returns:

    DataFrame with all results. Contains groups of fields with prefixes:

  • "INPUT" - Fields that were at the input in the task.

  • "OUTPUT" - Fields that were received as a result of execution.

  • "GOLDEN" - Fields with correct answers. Filled in only for golden tasks and training tasks.

  • "HINT" - Hints for completing tasks. Filled in for training tasks.

  • "ACCEPT" - Fields describing the deferred acceptance of tasks.

  • "ASSIGNMENT" - fields describing additional information about the Assignment.

  • Return type:

    DataFrame

Examples:

Get all assignments from the specified pool by pool_id to pandas.DataFrame. And apply the native pandas rename method to change columns' names.

answers_df = toloka_client.get_assignments_df(pool_id='1')
answers_df = answers_df.rename(columns={
'INPUT:image': 'task',
'OUTPUT:result': 'label',
'ASSIGNMENT:worker_id': 'annotator'
})

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