def _score_single_label(
        self, probabilities: np.ndarray, tie_break_policy: TieBreakPolicy
    ) -> Tuple[np.ndarray, np.ndarray]:
        """Helper method to compute scores for single-label classifications.

        Args:
            probabilities: The probabilities.
            tie_break_policy: Policy to break ties. You can choose among two policies:

                - `abstain`: Exclude from scores.
                - `random`: randomly choose among tied option using deterministic hash.

                The last policy can introduce quite a bit of noise, especially when the tie is among many labels,
                as is the case when all the labeling functions (rules) abstained.

        Returns:
            A tuple of the annotation and prediction array.
        """
        # 1.e-8 is taken from the abs tolerance of np.isclose
        is_max = np.abs(probabilities.max(axis=1, keepdims=True) - probabilities) < 1.0e-8
        is_tie = is_max.sum(axis=1) > 1

        prediction = np.argmax(is_max, axis=1)
        # we need to transform the indexes!
        annotation = np.array(
            [self._weak_labels.labels.index(self._weak_labels.int2label[i]) for i in self._weak_labels.annotation()],
            dtype=np.short,
        )

        if not is_tie.any():
            pass
        # resolve ties
        elif tie_break_policy is TieBreakPolicy.ABSTAIN:
            prediction, annotation = prediction[~is_tie], annotation[~is_tie]
        elif tie_break_policy is TieBreakPolicy.RANDOM:
            for i in np.nonzero(is_tie)[0]:
                equal_prob_idx = np.nonzero(is_max[i])[0]
                random_idx = int(hashlib.sha1(f"{i}".encode()).hexdigest(), 16) % len(equal_prob_idx)
                prediction[i] = equal_prob_idx[random_idx]
        else:
            raise NotImplementedError(
                f"The tie break policy '{tie_break_policy.value}' is not implemented for MajorityVoter!"
            )

        return annotation, prediction
Helper method to compute scores for single-label classifications.

        Args:
            probabilities: The probabilities.
            tie_break_policy: Policy to break ties. You can choose among two policies:

                - `abstain`: Exclude from scores.
                - `random`: randomly choose among tied option using deterministic hash.

                The last policy can introduce quite a bit of noise, especially when the tie is among many labels,
                as is the case when all the labeling functions (rules) abstained.

        Returns:
            A tuple of the annotation and prediction array.
        
argilla-v1/src/argilla_v1/labeling/text_classification/label_models.py