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: Returns some scores/metrics of the label model with respect to the annotated records.
  
  The metrics are:
  
  - accuracy
  - micro/macro averages for precision, recall and f1
  - precision, recall, f1 and support for each label
  
  For more details about the metrics, check out the
  `sklearn docs <https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_recall_fscore_support.html#sklearn-metrics-precision-recall-fscore-support>`__.
  
  .. note:: Metrics are only calculated over non-abstained predictions!
  
  Args:
      tie_break_policy: Policy to break ties (IGNORED FOR MULTI-LABEL). You can choose among two policies:
  
          - `abstain`: Do not provide any prediction
          - `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.
      output_str: If True, return output as nicely formatted string.
  
  Returns:
      The scores/metrics in a dictionary or as a nicely formatted str.
  
  Raises:
      MissingAnnotationError: If the ``weak_labels`` do not contain annotated records.
docstr_tok: ["Returns","some","scores\/metrics","of","the","label","model","with","respect","to","the","annotated","records",".","The","metrics","are",":","-","accuracy","-","micro\/macro","averages","for","precision",",","recall","and","f1","-","precision",",","recall",",","f1","and","support","for","each","label","For","more","details","about","the","metrics",",","check","out","the","`","sklearn","docs","<","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.precision_recall_fscore_support.html","#","sklearn-metrics-precision-recall-fscore-support",">","`","__",".","..","note",":",":","Metrics","are","only","calculated","over","non-abstained","predictions","!","Args",":","tie_break_policy",":","Policy","to","break","ties","(","IGNORED","FOR","MULTI-LABEL",")",".","You","can","choose","among","two","policies",":","-","`","abstain","`",":","Do","not","provide","any","prediction","-","`","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",".","output_str",":","If","True",",","return","output","as","nicely","formatted","string",".","Returns",":","The","scores\/metrics","in","a","dictionary","or","as","a","nicely","formatted","str",".","Raises",":","MissingAnnotationError",":","If","the","``","weak_labels","``","do","not","contain","annotated","records","."]
code: def score(
      self,
      tie_break_policy: Union[TieBreakPolicy, str] = "abstain",
      output_str: bool = False,
  ) -> Union[Dict[str, float], str]:
      """Returns some scores/metrics of the label model with respect to the annotated records.
  
      The metrics are:
  
      - accuracy
      - micro/macro averages for precision, recall and f1
      - precision, recall, f1 and support for each label
  
      For more details about the metrics, check out the
      `sklearn docs <https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_recall_fscore_support.html#sklearn-metrics-precision-recall-fscore-support>`__.
  
      .. note:: Metrics are only calculated over non-abstained predictions!
  
      Args:
          tie_break_policy: Policy to break ties (IGNORED FOR MULTI-LABEL). You can choose among two policies:
  
              - `abstain`: Do not provide any prediction
              - `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.
          output_str: If True, return output as nicely formatted string.
  
      Returns:
          The scores/metrics in a dictionary or as a nicely formatted str.
  
      Raises:
          MissingAnnotationError: If the ``weak_labels`` do not contain annotated records.
      """
      from sklearn.metrics import classification_report
  
      wl_matrix = self._weak_labels.matrix(has_annotation=True)
  
      if isinstance(self._weak_labels, WeakMultiLabels):
          probabilities = self._compute_multi_label_probs(wl_matrix)
  
          annotation, prediction = self._score_multi_label(
              probabilities
          )
          target_names = self._weak_labels.labels
      else:
          if isinstance(tie_break_policy, str):
              tie_break_policy = TieBreakPolicy(tie_break_policy)
  
          probabilities = self._compute_single_label_probs(wl_matrix)
  
          annotation, prediction = self._score_single_label(
              probabilities, tie_break_policy
          )
          target_names = self._weak_labels.labels[
              : annotation.max() + 1
          ]
  
      return classification_report(
          annotation,
          prediction,
          target_names=target_names,
          output_dict=not output_str,
      )
  
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 8 for calling the MajorityVoter obj's underlying member method code with example usage: obj.score(tie_break_policy, output_str) and returns: classification_report