class_docstr: A rule (labeling function) in form of an ElasticSearch query.
  
  Args:
      query: An ElasticSearch query with the `query string syntax <https://docs.argilla.io/en/latest/practical_guides/filter_dataset.html>`_.
      label: The label associated to the query. Can also be a list of labels.
      name: An optional name for the rule to be used as identifier in the
          `argilla.labeling.text_classification.WeakLabels` class. By default, we will use the ``query`` string.
  
  Examples:
      >>> import argilla as rg
      >>> urgent_rule = Rule(query="inputs.text:(urgent AND immediately)", label="urgent", name="urgent_rule")
      >>> not_urgent_rule = Rule(query="inputs.text:(NOT urgent) AND metadata.title_length>20", label="not urgent")
      >>> not_urgent_rule.apply("my_dataset")
      >>> my_dataset_records = rg.load(name="my_dataset")
      >>> not_urgent_rule(my_dataset_records[0])
      "not urgent"
class_docstr_tok: ["A","rule","(","labeling","function",")","in","form","of","an","ElasticSearch","query",".","Args",":","query",":","An","ElasticSearch","query","with","the","`","query","string","syntax","<","https",":","\/\/docs.argilla.io\/en\/latest\/practical_guides\/filter_dataset.html",">","`","_",".","label",":","The","label","associated","to","the","query",".","Can","also","be","a","list","of","labels",".","name",":","An","optional","name","for","the","rule","to","be","used","as","identifier","in","the","`","argilla.labeling.text_classification.WeakLabels","`","class",".","By","default",",","we","will","use","the","``","query","``","string",".","Examples",":",">",">",">","import","argilla","as","rg",">",">",">","urgent_rule","=","Rule","(","query=","''","inputs.text",":","(","urgent","AND","immediately",")","''",",","label=","''","urgent","''",",","name=","''","urgent_rule","''",")",">",">",">","not_urgent_rule","=","Rule","(","query=","''","inputs.text",":","(","NOT","urgent",")","AND","metadata.title_length",">","20","''",",","label=","''","not","urgent","''",")",">",">",">","not_urgent_rule.apply","(","``","my_dataset","''",")",">",">",">","my_dataset_records","=","rg.load","(","name=","''","my_dataset","''",")",">",">",">","not_urgent_rule","(","my_dataset_records","[","0","]",")","``","not","urgent","''"]
docstr: The rule string representation.
docstr_tok: ["The","rule","string","representation","."]
code: def __str__(self):
      """The rule string representation."""
      return repr(self)
  
imports: from typing import Dict, List, Optional, Union
  import argilla
  from argilla.client import singleton
  from argilla.client.api import load
  from argilla.client.models import TextClassificationRecord
  from argilla.client.sdk.text_classification.models import LabelingRule
label_desc: Use image node_id 15 for calling the Rule obj's underlying member method code with example usage: obj.__str__() and returns: repr