def _make_multi_label_records(
        self,
        probabilities: np.ndarray,
        records: List[TextClassificationRecord],
        include_abstentions: bool,
        prediction_agent: str,
    ) -> List[TextClassificationRecord]:
        """Helper method to create records given predicted probabilities.

        Args:
            probabilities: The predicted probabilities.
            records: The records associated with the probabilities.
            include_abstentions: Whether to include records in the output, for which the label model abstained.
            prediction_agent: String used for the ``prediction_agent`` in the returned records.

        Returns:
            A list of records that include the predictions of the label model.
        """
        records_with_prediction = []
        for prob, rec in zip(probabilities, records):
            all_abstained = np.isnan(prob).all()
            # maybe skip record
            if not include_abstentions and all_abstained:
                continue

            pred_for_rec = None
            if not all_abstained:
                pred_for_rec = [(self._weak_labels.labels[i], prob[i]) for i in np.argsort(prob)[::-1]]

            records_with_prediction.append(rec.copy(deep=True))
            records_with_prediction[-1].prediction = pred_for_rec
            records_with_prediction[-1].prediction_agent = prediction_agent

        return records_with_prediction
Helper method to create records given predicted probabilities.

        Args:
            probabilities: The predicted probabilities.
            records: The records associated with the probabilities.
            include_abstentions: Whether to include records in the output, for which the label model abstained.
            prediction_agent: String used for the ``prediction_agent`` in the returned records.

        Returns:
            A list of records that include the predictions of the label model.
        
argilla-v1/src/argilla_v1/labeling/text_classification/label_models.py