Rapidata job manager
RapidataJobManager #
A rapidata manager for job definitions. Used to create and retrieve job definitions.
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
create_classification_job_definition #
create_classification_job_definition(
name: str,
instruction: str,
answer_options: list[str],
datapoints: list[str],
data_type: Literal["media", "text"] = "media",
responses_per_datapoint: int = 10,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
confidence_threshold: float | None = None,
quorum_threshold: int | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a classification job definition.
With this order you can have a datapoint (image, text, video, audio) be classified into one of the answer options. Each response will be exactly one of the answer options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. (Will not be shown to the labeler) |
required |
instruction
|
str
|
The instruction for how the data should be classified. |
required |
answer_options
|
list[str]
|
The list of options for the classification. |
required |
datapoints
|
list[str]
|
The list of datapoints for the classification - each datapoint will be labeled. |
required |
data_type
|
str
|
The data type of the datapoints. Defaults to "media" (any form of image, video or audio). Other option: "text". |
'media'
|
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
contexts
|
list[str]
|
The list of contexts for the classification. Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction and options. (Therefore will be different for each datapoint) Will be match up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the classification (each inner list is the images shown for that datapoint). Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction and options. (Therefore will be different for each datapoint) Use a single-element inner list for one image per datapoint, or multiple entries to display several images. |
None
|
confidence_threshold
|
float
|
The probability threshold for the classification. Defaults to None. If provided, the classification datapoint will stop after the threshold is reached or at the number of responses, whatever happens first. |
None
|
quorum_threshold
|
int
|
The number of matching responses required to reach quorum. Defaults to None. If provided, the classification datapoint will stop after the quorum is reached or at the number of responses, whatever happens first. Cannot be used together with confidence_threshold. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the classification. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
create_compare_job_definition #
create_compare_job_definition(
name: str,
instruction: str,
datapoints: list[list[str]],
data_type: Literal["media", "text"] = "media",
responses_per_datapoint: int = 10,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
a_b_names: list[str] | None = None,
confidence_threshold: float | None = None,
quorum_threshold: int | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a compare job definition.
With this order you compare two datapoints (image, text, video, audio) and the annotators will choose one of the two based on the instruction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. (Will not be shown to the labeler) |
required |
instruction
|
str
|
The instruction for the comparison. Will be shown along side each datapoint. |
required |
datapoints
|
list[list[str]]
|
Outher list is the datapoints, inner list is the options for the comparison - each datapoint will be labeled. |
required |
data_type
|
str
|
The data type of the datapoints. Defaults to "media" (any form of image, video or audio). Other option: "text". |
'media'
|
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
contexts
|
list[str]
|
The list of contexts for the comparison. Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be matched up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the comparison (each inner list is the images shown for that datapoint). Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be matched up with the datapoints using the list index. Use a single-element inner list for one image per datapoint, or multiple entries to display several images. |
None
|
a_b_names
|
list[str]
|
Custom naming for the two opposing models defined by the index in the datapoints list. Defaults to None. If provided has to be a list of exactly two strings. example: The results will then correctly show "Model A" and "Model B". If not provided, the results will be shown as "A" and "B". |
None
|
confidence_threshold
|
float
|
The probability threshold for the comparison. Defaults to None. If provided, the comparison datapoint will stop after the threshold is reached or at the number of responses, whatever happens first. |
None
|
quorum_threshold
|
int
|
The number of matching responses required to reach quorum. Defaults to None. If provided, the comparison datapoint will stop after the quorum is reached or at the number of responses, whatever happens first. Cannot be used together with confidence_threshold. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the comparison. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
create_ranking_job_definition #
create_ranking_job_definition(
name: str,
instruction: str,
datapoints: list[list[str]],
comparison_budget_per_ranking: int,
responses_per_comparison: int = 1,
data_type: Literal["media", "text"] = "media",
random_comparisons_ratio: float = 0.5,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
) -> RapidataJobDefinition
Create a ranking job definition.
With this order you can have a multiple lists of datapoints (image, text, video, audio) be ranked based on the instruction. Each list will be ranked independently, based on comparison matchups.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. |
required |
instruction
|
str
|
The instruction for the ranking. Will be shown with each matchup. |
required |
datapoints
|
list[list[str]]
|
The outer list is determines the independent rankings, the inner list is the datapoints for each ranking. |
required |
comparison_budget_per_ranking
|
int
|
The number of comparisons that will be collected per ranking (outer list of datapoints). Rankings with more than 10 datapoints are matched adaptively (Elo-style) within this budget. Rankings with 10 or fewer datapoints compare every unique pair, spreading the budget evenly across the pairs — the total is rounded down to a multiple of the number of pairs, and is at least one comparison per pair. |
required |
responses_per_comparison
|
int
|
The number of responses that will be collected per comparison. Defaults to 1. |
1
|
data_type
|
str
|
The data type of the datapoints. Defaults to "media" (any form of image, video or audio). Other option: "text". |
'media'
|
random_comparisons_ratio
|
float
|
The ratio of random comparisons to the total number of comparisons. Defaults to 0.5. Only applies to rankings with more than 10 datapoints; smaller rankings compare every unique pair. |
0.5
|
contexts
|
list[str]
|
The list of contexts for the ranking. Defaults to None. If provided has to be the same length as the outer list of datapoints and will be shown in addition to the instruction. (Therefore will be different for each ranking) Will be matched up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the ranking (each inner list is the images shown for that ranking). Defaults to None. If provided has to be the same length as the outer list of datapoints and will be shown in addition to the instruction. (Therefore will be different for each ranking) Will be matched up with the datapoints using the list index. Use a single-element inner list for one image per ranking, or multiple entries to display several images. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the ranking. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | |
create_free_text_job_definition #
create_free_text_job_definition(
name: str,
instruction: str,
datapoints: list[str],
data_type: Literal["media", "text"] = "media",
responses_per_datapoint: int = 10,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a free text job definition.
With this order you can have a datapoint (image, text, video, audio) be labeled with free text. The annotators will be shown a datapoint and will be asked to answer a question with free text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. |
required |
instruction
|
str
|
The instruction to answer with free text. Will be shown along side each datapoint. |
required |
datapoints
|
list[str]
|
The list of datapoints for the free text - each datapoint will be labeled. |
required |
data_type
|
str
|
The data type of the datapoints. Defaults to "media" (any form of image, video or audio). Other option: "text". |
'media'
|
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
contexts
|
list[str]
|
The list of contexts for the free text. Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be matched up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the free text (each inner list is the images shown for that datapoint). Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be matched up with the datapoints using the list index. Use a single-element inner list for one image per datapoint, or multiple entries to display several images. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the free text. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
create_select_words_job_definition #
create_select_words_job_definition(
name: str,
instruction: str,
datapoints: list[str],
sentences: list[str],
responses_per_datapoint: int = 10,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a select words job definition.
With this order you can have a datapoint (image, text, video, audio) be labeled with a list of words. The annotators will be shown a datapoint as well as a list of sentences split up by spaces. They will then select specific words based on the instruction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. |
required |
instruction
|
str
|
The instruction for how the words should be selected. Will be shown along side each datapoint. |
required |
datapoints
|
list[str]
|
The list of datapoints for the select words - each datapoint will be labeled. |
required |
sentences
|
list[str]
|
The list of sentences for the select words - Will be split up by spaces and shown along side each datapoint. Must be the same length as datapoints. |
required |
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the select words. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
create_locate_job_definition #
create_locate_job_definition(
name: str,
instruction: str,
datapoints: list[str],
responses_per_datapoint: int = 10,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a locate job definition.
With this order you can have people locate specific objects in a datapoint (image, text, video, audio). The annotators will be shown a datapoint and will be asked to select locations based on the instruction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. (Will not be shown to the labeler) |
required |
instruction
|
str
|
The instruction what should be located. Will be shown along side each datapoint. |
required |
datapoints
|
list[str]
|
The list of datapoints for the locate - each datapoint will be labeled. |
required |
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
contexts
|
list[str]
|
The list of contexts for the locate. Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be match up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the locate (each inner list is the images shown for that datapoint). Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Use a single-element inner list for one image per datapoint, or multiple entries to display several images. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the locate. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
create_draw_job_definition #
create_draw_job_definition(
name: str,
instruction: str,
datapoints: list[str],
responses_per_datapoint: int = 10,
contexts: list[str] | None = None,
media_contexts: list[list[str]] | None = None,
settings: Sequence[RapidataSetting] | None = None,
failure_tolerance: float | None = None,
private_metadata: list[dict[str, str]] | None = None,
) -> RapidataJobDefinition
Create a draw job definition.
With this order you can have people draw lines on a datapoint (image, text, video, audio). The annotators will be shown a datapoint and will be asked to draw lines based on the instruction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job. (Will not be shown to the labeler) |
required |
instruction
|
str
|
The instruction for how the lines should be drawn. Will be shown along side each datapoint. |
required |
datapoints
|
list[str]
|
The list of datapoints for the draw lines - each datapoint will be labeled. |
required |
responses_per_datapoint
|
int
|
The number of responses that will be collected per datapoint. Defaults to 10. |
10
|
contexts
|
list[str]
|
The list of contexts for the comparison. Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Will be match up with the datapoints using the list index. |
None
|
media_contexts
|
list[list[str]]
|
The list of image URLs / paths shown for the draw lines (each inner list is the images shown for that datapoint). Defaults to None. If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint) Use a single-element inner list for one image per datapoint, or multiple entries to display several images. |
None
|
settings
|
Sequence[RapidataSetting]
|
The list of settings for the draw lines. Defaults to []. Decides how the tasks should be shown. |
None
|
failure_tolerance
|
float
|
The fraction of datapoints allowed to fail while still creating the job definition (0.0-1.0). Defaults to None, which uses rapidata_config.upload.failureTolerance (default 0.0 = strict). 0.0 means any failed upload aborts creation so no incomplete definition is left behind; the failed datapoints can then be retried into the same dataset via the raised FailedUploadException.retry(). 1.0 creates the definition regardless of failures, as long as at least one datapoint uploads successfully. |
None
|
private_metadata
|
list[dict[str, str]]
|
Key-value string pairs for each datapoint. Defaults to None. If provided has to be the same length as datapoints. This will NOT be shown to the labelers but will be included in the result purely for your own reference. |
None
|
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
get_job_definition_by_id #
get_job_definition_by_id(
job_definition_id: str,
) -> RapidataJobDefinition
Get a job definition by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_definition_id
|
str
|
The ID of the job definition. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
JobDefinition |
RapidataJobDefinition
|
The JobDefinition instance. |
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
find_job_definitions #
find_job_definitions(
name: str = "", amount: int = 10, page: int = 1
) -> list[RapidataJobDefinition]
Find your recent jobs given criteria. If nothing is provided, it will return the most recent job definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job definition - matching job definition will contain the name. Defaults to "" for any job definition. |
''
|
amount
|
int
|
The amount of job definitions to return. Defaults to 10. |
10
|
page
|
int
|
The page of job definitions to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataJobDefinition]
|
list[JobDefinition]: A list of JobDefinition instances. |
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
get_job_by_id #
get_job_by_id(job_id: str) -> RapidataJob
Get a job by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
str
|
The ID of the job. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
RapidataJob |
RapidataJob
|
The Job instance. |
Source code in src/rapidata/rapidata_client/job/rapidata_job_manager.py
find_jobs #
find_jobs(
name: str = "", amount: int = 10, page: int = 1
) -> list[RapidataJob]
Find your recent jobs given criteria. If nothing is provided, it will return the most recent jobs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the job - matching job will contain the name. Defaults to "" for any job. |
''
|
amount
|
int
|
The amount of jobs to return. Defaults to 10. |
10
|
page
|
int
|
The page of jobs to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataJob]
|
list[RapidataJob]: A list of RapidataJob instances. |