def change_mapping(self, label2int: Dict[str, int]):
        """Allows you to change the mapping between labels and integers.

        This will update the ``self.matrix`` as well as the ``self.annotation``.

        Args:
            label2int: New label to integer mapping. Must cover all previous labels.
        """
        # save masks for swapping
        label_masks = {}
        annotation_masks = {}

        for label in self._label2int:
            # Check new label2int mapping
            if label not in label2int:
                raise MissingLabelError(f"The label '{label}' is missing in the new mapping.")
            # compute masks
            label_masks[label] = self.matrix() == self._label2int[label]
            annotation_masks[label] = self._annotation == self._label2int[label]

        # swap integers
        for label in self._label2int:
            self.matrix()[label_masks[label]] = label2int[label]
            self._annotation[annotation_masks[label]] = label2int[label]

        # update mapping dicts
        self._label2int = label2int.copy()
        self._int2label = {val: key for key, val in self._label2int.items()}
Allows you to change the mapping between labels and integers.

        This will update the ``self.matrix`` as well as the ``self.annotation``.

        Args:
            label2int: New label to integer mapping. Must cover all previous labels.
        
argilla-v1/src/argilla_v1/labeling/text_classification/weak_labels.py