class_docstr: A basic label model that computes the majority vote across all rules.
  
  For single-label classification, it will predict the label with the most votes.
  For multi-label classification, it will predict all labels that got at least one vote by the rules.
  
  Args:
      weak_labels: The weak labels object.
class_docstr_tok: ["A","basic","label","model","that","computes","the","majority","vote","across","all","rules",".","For","single-label","classification",",","it","will","predict","the","label","with","the","most","votes",".","For","multi-label","classification",",","it","will","predict","all","labels","that","got","at","least","one","vote","by","the","rules",".","Args",":","weak_labels",":","The","weak","labels","object","."]
docstr: 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.
docstr_tok: ["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","."]
code: 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
  
imports: import hashlib
  import logging
  from enum import Enum
  from typing import Dict, List, Tuple, Union
  import numpy
  from argilla import DatasetForTextClassification, TextClassificationRecord
  from argilla.labeling.text_classification.weak_labels import WeakLabels, WeakMultiLabels
  from argilla.utils.dependency import requires_dependencies
label_desc: Use image node_id 7 for calling the MajorityVoter obj's underlying member method code with example usage: obj._make_multi_label_records(probabilities, records, include_abstentions, prediction_agent) and returns: records_with_prediction