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 methods that computes the probabilities.
  
  Args:
      wl_matrix: The weak label matrix.
  
  Returns:
      A matrix of "probabilities" with nr or records x nr of labels.
      The label order matches the one from `self.weak_labels.labels`.
docstr_tok: ["Helper","methods","that","computes","the","probabilities",".","Args",":","wl_matrix",":","The","weak","label","matrix",".","Returns",":","A","matrix","of","``","probabilities","''","with","nr","or","records","x","nr","of","labels",".","The","label","order","matches","the","one","from","`","self.weak_labels.labels","`","."]
code: def _compute_single_label_probs(
      self, wl_matrix: np.ndarray
  ) -> np.ndarray:
      """Helper methods that computes the probabilities.
  
      Args:
          wl_matrix: The weak label matrix.
  
      Returns:
          A matrix of "probabilities" with nr or records x nr of labels.
          The label order matches the one from `self.weak_labels.labels`.
      """
      counts = np.column_stack(
          [
              np.count_nonzero(
                  wl_matrix == self._weak_labels.label2int[label],
                  axis=1,
              )
              for label in self._weak_labels.labels
          ]
      )
      with np.errstate(invalid="ignore"):
          probabilities = counts / counts.sum(axis=1).reshape(
              len(counts), -1
          )
  
      # we treat abstentions as ties among all labels (see snorkel)
      probabilities[np.isnan(probabilities)] = 1.0 / len(
          self._weak_labels.labels
      )
  
      return probabilities
  
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 4 for calling the MajorityVoter obj's underlying member method code with example usage: obj._compute_single_label_probs(wl_matrix) and returns: probabilities