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: Literal["media", "text"] = "media",
context: str | None = None,
media_context: list[str] | None = None,
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 "media" (any form of image, video or audio). |
'media'
|
context
|
str
|
The context is text that will be shown in addition to the instruction. Defaults to None. |
None
|
media_context
|
list[str]
|
A list of image URLs / paths that will be shown in addition to the instruction (can be combined with context). Pass a single-element list for one image, or multiple to display several images. Defaults to None. |
None
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|
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: Literal["media", "text"] = "media",
context: str | None = None,
media_context: list[str] | None = None,
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 "media" (any form of image, video or audio). |
'media'
|
context
|
str
|
The context is text that will be shown in addition to the instruction. Defaults to None. |
None
|
media_context
|
list[str]
|
A list of image URLs / paths that will be shown in addition to the instruction (can be combined with context). Pass a single-element list for one image, or multiple to display several images. Defaults to None. |
None
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|
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,
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
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
locate_rapid #
locate_rapid(
instruction: str,
truths: list[Box],
datapoint: str,
context: str | None = None,
media_context: list[str] | None = None,
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 |
context
|
str
|
The context is text that will be shown in addition to the instruction. Defaults to None. |
None
|
media_context
|
list[str]
|
A list of image URLs / paths that will be shown in addition to the instruction (can be combined with context). Pass a single-element list for one image, or multiple to display several images. Defaults to None. |
None
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|
Source code in src/rapidata/rapidata_client/validation/rapids/rapids_manager.py
draw_rapid #
draw_rapid(
instruction: str,
truths: list[Box],
datapoint: str,
context: str | None = None,
media_context: list[str] | None = None,
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. All boxes are attached as the ground truth — labelers are graded on whether their drawn lines fall within any of these boxes. |
required |
datapoint
|
str
|
The asset that the labeler will be drawing the object in. |
required |
context
|
str
|
The context is text that will be shown in addition to the instruction. Defaults to None. |
None
|
media_context
|
list[str]
|
A list of image URLs / paths that will be shown in addition to the instruction (can be combined with context). Pass a single-element list for one image, or multiple to display several images. Defaults to None. |
None
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|
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,
context: str | None = None,
media_context: list[str] | None = None,
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 |
context
|
str
|
The context is text that will be shown in addition to the instruction. Defaults to None. |
None
|
media_context
|
list[str]
|
A list of image URLs / paths that will be shown in addition to the instruction (can be combined with context). Pass a single-element list for one image, or multiple to display several images. Defaults to None. |
None
|
explanation
|
str
|
The explanation that will be shown to the labeler if the answer is wrong. Defaults to None. |
None
|