Rapids manager
RapidsManager #
Can be used to build different types of rapids. That can then be added to Validation sets
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
classification_rapid #
classification_rapid(
instruction: str,
answer_options: list[str],
datapoint: str,
truths: list[str],
data_type: str = MEDIA,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a classification rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instruction/question to be shown to the labeler. |
required |
answer_options
|
list[str]
|
The options that the labeler can choose from to answer the question. |
required |
datapoint
|
str
|
The datapoint that the labeler will be labeling. |
required |
truths
|
list[str]
|
The correct answers to the question. |
required |
data_type
|
str
|
The type of the datapoint. Defaults to RapidataDataTypes.MEDIA. |
MEDIA
|
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
compare_rapid #
compare_rapid(
instruction: str,
truth: str,
datapoint: list[str],
data_type: str = MEDIA,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a compare rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instruction that the labeler will be comparing the assets on. |
required |
truth
|
str
|
The correct answer to the comparison. (has to be one of the assets) |
required |
datapoint
|
list[str]
|
The two assets that the labeler will be comparing. |
required |
data_type
|
str
|
The type of the datapoint. Defaults to RapidataDataTypes.MEDIA. |
MEDIA
|
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
select_words_rapid #
select_words_rapid(
instruction: str,
truths: list[int],
datapoint: str,
sentence: str,
required_precision: float = 1,
required_completeness: float = 1,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a select words rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instruction for the labeler. |
required |
truths
|
list[int]
|
The indices of the words that are the correct answers. |
required |
datapoint
|
str
|
The asset that the labeler will be selecting words from. |
required |
sentence
|
str
|
The sentence that the labeler will be selecting words from. (split up by spaces) |
required |
required_precision
|
float
|
The required precision for the labeler to get the rapid correct (minimum ratio of the words selected that need to be correct). defaults to 1. (no wrong words can be selected) |
1
|
required_completeness
|
float
|
The required completeness for the labeler to get the rapid correct (miminum ratio of total correct words selected). defaults to 1. (all correct words need to be selected) |
1
|
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
locate_rapid #
locate_rapid(
instruction: str,
truths: list[Box],
datapoint: str,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a locate rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instruction on what the labeler should do. |
required |
truths
|
list[Box]
|
The bounding boxes of the object that the labeler ought to be locating. |
required |
datapoint
|
str
|
The asset that the labeler will be locating the object in. |
required |
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
draw_rapid #
draw_rapid(
instruction: str,
truths: list[Box],
datapoint: str,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a draw rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instructions on what the labeler |
required |
truths
|
list[Box]
|
The bounding boxes of the object that the labeler ought to be drawing. |
required |
datapoint
|
str
|
The asset that the labeler will be drawing the object in. |
required |
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
timestamp_rapid #
timestamp_rapid(
instruction: str,
truths: list[tuple[int, int]],
datapoint: str,
metadata: Sequence[Metadata] = [],
explanation: str | None = None,
) -> Rapid
Build a timestamp rapid
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction
|
str
|
The instruction for the labeler. |
required |
truths
|
list[tuple[int, int]]
|
The possible accepted timestamps intervals for the labeler (in miliseconds). The first element of the tuple is the start of the interval and the second element is the end of the interval. |
required |
datapoint
|
str
|
The asset that the labeler will be timestamping. |
required |
metadata
|
Sequence[Metadata]
|
The metadata that is attached to the rapid. Defaults to []. |
[]
|