class_docstr: Base class for the weak label classes.
  
  Tries to facilitate the implementations, avoids code duplications.
  
  Args:
      dataset: Name of the dataset to which the rules will be applied.
      rules: A list of rules (labeling functions). They must return a string, or ``None`` in case of abstention.
          If None, we will use the rules of the dataset (Default).
      ids: An optional list of record ids to filter the dataset before applying the rules.
      query: An optional ElasticSearch query with the
          `query string syntax <https://docs.argilla.io/en/latest/practical_guides/filter_dataset.html>`_
          to filter the dataset before applying the rules.
  
  Raises:
      NoRulesFoundError: When you do not provide rules, and the dataset has no rules either.
      DuplicatedRuleNameError: When you provided multiple rules with the same name.
      NoRecordsFoundError: When the filtered dataset is empty.
class_docstr_tok: ["Base","class","for","the","weak","label","classes",".","Tries","to","facilitate","the","implementations",",","avoids","code","duplications",".","Args",":","dataset",":","Name","of","the","dataset","to","which","the","rules","will","be","applied",".","rules",":","A","list","of","rules","(","labeling","functions",")",".","They","must","return","a","string",",","or","``","None","``","in","case","of","abstention",".","If","None",",","we","will","use","the","rules","of","the","dataset","(","Default",")",".","ids",":","An","optional","list","of","record","ids","to","filter","the","dataset","before","applying","the","rules",".","query",":","An","optional","ElasticSearch","query","with","the","`","query","string","syntax","<","https",":","\/\/docs.argilla.io\/en\/latest\/practical_guides\/filter_dataset.html",">","`","_","to","filter","the","dataset","before","applying","the","rules",".","Raises",":","NoRulesFoundError",":","When","you","do","not","provide","rules",",","and","the","dataset","has","no","rules","either",".","DuplicatedRuleNameError",":","When","you","provided","multiple","rules","with","the","same","name",".","NoRecordsFoundError",":","When","the","filtered","dataset","is","empty","."]
docstr: Returns the weak label matrix, or optionally just a part of it.
  
  Args:
      has_annotation: If True, return only the part of the matrix that has a corresponding annotation.
          If False, return only the part of the matrix that has NOT a corresponding annotation.
          By default, we return the whole weak label matrix.
  
  Returns:
      The weak label matrix, or optionally just a part of it.
docstr_tok: ["Returns","the","weak","label","matrix",",","or","optionally","just","a","part","of","it",".","Args",":","has_annotation",":","If","True",",","return","only","the","part","of","the","matrix","that","has","a","corresponding","annotation",".","If","False",",","return","only","the","part","of","the","matrix","that","has","NOT","a","corresponding","annotation",".","By","default",",","we","return","the","whole","weak","label","matrix",".","Returns",":","The","weak","label","matrix",",","or","optionally","just","a","part","of","it","."]
code: def matrix(self, has_annotation: Optional[bool] = None) -> np.ndarray:
      """Returns the weak label matrix, or optionally just a part of it.
  
      Args:
          has_annotation: If True, return only the part of the matrix that has a corresponding annotation.
              If False, return only the part of the matrix that has NOT a corresponding annotation.
              By default, we return the whole weak label matrix.
  
      Returns:
          The weak label matrix, or optionally just a part of it.
      """
      raise NotImplementedError
  
imports: import warnings
  from collections import Counter
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from argilla import load
  from argilla.client.datasets import DatasetForTextClassification
  from argilla.client.models import TextClassificationRecord
  from argilla.labeling.text_classification.rule import Rule, load_rules
label_desc: Use image node_id 6 for calling the WeakLabelsBase obj's underlying member method code with example usage: obj.matrix(has_annotation) without return types