Skip to content

Labeling selection

LabelingSelection #

LabelingSelection(
    amount: int,
    retrieval_mode: RapidataRetrievalMode = Shuffled,
    max_iterations: int | None = None,
    advance_on_view: bool = False,
)

Bases: RapidataSelection

Labeling selection class.

Decides how many actual datapoints you want to show per session.

Parameters:

Name Type Description Default
amount int

The amount of labeling rapids that will be shown per session.

required
retrieval_mode RetrievalMode

The retrieval mode to use. Defaults to "Shuffled".

Shuffled
max_iterations int | None

An annotator can answer the same task only once if the retrieval_mode is "Shuffled" or "Sequential". max_iterations can increase the amount of responses an annotator can do to the same task (datapoint).

None
advance_on_view bool

Move an annotator past a task as soon as it is shown, even without an answer, so a skipped task is not served to them again. Requires "Shuffled" or "Sequential". Defaults to False.

False
Source code in src/rapidata/rapidata_client/selection/labeling_selection.py
def __init__(
    self,
    amount: int,
    retrieval_mode: RapidataRetrievalMode = RapidataRetrievalMode.Shuffled,
    max_iterations: int | None = None,
    advance_on_view: bool = False,
):
    if advance_on_view and retrieval_mode == RapidataRetrievalMode.Random:
        raise ValueError(
            'advance_on_view requires the "Shuffled" or "Sequential" retrieval mode'
        )
    self.amount = amount
    self.retrieval_mode = retrieval_mode
    self.max_iterations = max_iterations
    self.advance_on_view = advance_on_view