class_docstr: Record for text classification
  
  Args:
      text:
          The input of the record. Provide either 'text' or 'inputs'.
      inputs:
          Various inputs of the record (see examples below).
          Provide either 'text' or 'inputs'.
      prediction:
          A list of tuples containing the predictions for the record.
          The first entry of the tuple is the predicted label, the second entry is its corresponding score.
      prediction_agent:
          Name of the prediction agent. By default, this is set to the hostname of your machine.
      annotation:
          A string or a list of strings (multilabel) corresponding to the annotation (gold label) for the record.
      annotation_agent:
          Name of the prediction agent. By default, this is set to the hostname of your machine.
      vectors:
          Vectors data mappings of the natural language text containing class attributes
      multi_label:
          Is the prediction/annotation for a multi label classification task? Defaults to `False`.
      explanation:
          A dictionary containing the attributions of each token to the prediction.
          The keys map the input of the record (see `inputs`) to the `TokenAttributions`.
      id:
          The id of the record. By default (`None`), we will generate a unique ID for you.
      metadata:
          Metadata for the record. Defaults to `{}`.
      status:
          The status of the record. Options: 'Default', 'Edited', 'Discarded', 'Validated'.
          If an annotation is provided, this defaults to 'Validated', otherwise 'Default'.
      event_timestamp:
          The timestamp for the creation of the record. Defaults to `datetime.datetime.now()`.
      metrics:
          READ ONLY! Metrics at record level provided by the server when using `rg.load`.
          This attribute will be ignored when using `rg.log`.
      search_keywords:
          READ ONLY! Relevant record keywords/terms for provided query when using `rg.load`.
          This attribute will be ignored when using `rg.log`.
  Examples:
      >>> # Single text input
      >>> import argilla as rg
      >>> record = rg.TextClassificationRecord(
      ...     text="My first argilla example",
      ...     prediction=[('eng', 0.9), ('esp', 0.1)],
      ...     vectors = {
      ...         "english_bert_vector": [1.2, 2.3, 3.1, 3.3]
      ...     }
      ... )
      >>>
      >>> # Various inputs
      >>> record = rg.TextClassificationRecord(
      ...     inputs={
      ...         "subject": "Has ganado 1 million!",
      ...         "body": "Por usar argilla te ha tocado este premio: <link>"
      ...     },
      ...     prediction=[('spam', 0.99), ('ham', 0.01)],
      ...     annotation="spam",
      ...     vectors = {
      ...                     "distilbert_uncased":  [1.13, 4.1, 6.3, 4.2, 9.1],
      ...                     "xlm_roberta_cased": [1.1, 2.1, 3.3, 4.2, 2.1],
      ...             }
      ...     )
class_docstr_tok: ["Record","for","text","classification","Args",":","text",":","The","input","of","the","record",".","Provide","either","'text","'","or","'inputs","'",".","inputs",":","Various","inputs","of","the","record","(","see","examples","below",")",".","Provide","either","'text","'","or","'inputs","'",".","prediction",":","A","list","of","tuples","containing","the","predictions","for","the","record",".","The","first","entry","of","the","tuple","is","the","predicted","label",",","the","second","entry","is","its","corresponding","score",".","prediction_agent",":","Name","of","the","prediction","agent",".","By","default",",","this","is","set","to","the","hostname","of","your","machine",".","annotation",":","A","string","or","a","list","of","strings","(","multilabel",")","corresponding","to","the","annotation","(","gold","label",")","for","the","record",".","annotation_agent",":","Name","of","the","prediction","agent",".","By","default",",","this","is","set","to","the","hostname","of","your","machine",".","vectors",":","Vectors","data","mappings","of","the","natural","language","text","containing","class","attributes","multi_label",":","Is","the","prediction\/annotation","for","a","multi","label","classification","task","?","Defaults","to","`","False","`",".","explanation",":","A","dictionary","containing","the","attributions","of","each","token","to","the","prediction",".","The","keys","map","the","input","of","the","record","(","see","`","inputs","`",")","to","the","`","TokenAttributions","`",".","id",":","The","id","of","the","record",".","By","default","(","`","None","`",")",",","we","will","generate","a","unique","ID","for","you",".","metadata",":","Metadata","for","the","record",".","Defaults","to","`","{","}","`",".","status",":","The","status","of","the","record",".","Options",":","'Default","'",",","'Edited","'",",","'Discarded","'",",","'Validated","'",".","If","an","annotation","is","provided",",","this","defaults","to","'Validated","'",",","otherwise","'Default","'",".","event_timestamp",":","The","timestamp","for","the","creation","of","the","record",".","Defaults","to","`","datetime.datetime.now","(",")","`",".","metrics",":","READ","ONLY","!","Metrics","at","record","level","provided","by","the","server","when","using","`","rg.load","`",".","This","attribute","will","be","ignored","when","using","`","rg.log","`",".","search_keywords",":","READ","ONLY","!","Relevant","record","keywords\/terms","for","provided","query","when","using","`","rg.load","`",".","This","attribute","will","be","ignored","when","using","`","rg.log","`",".","Examples",":",">",">",">","#","Single","text","input",">",">",">","import","argilla","as","rg",">",">",">","record","=","rg.TextClassificationRecord","(","...","text=","''","My","first","argilla","example","''",",","...","prediction=","[","(","'eng","'",",","0.9",")",",","(","'esp","'",",","0.1",")","]",",","...","vectors","=","{","...","``","english_bert_vector","''",":","[","1.2",",","2.3",",","3.1",",","3.3","]","...","}","...",")",">",">",">",">",">",">","#","Various","inputs",">",">",">","record","=","rg.TextClassificationRecord","(","...","inputs=","{","...","``","subject","''",":","``","Has","ganado","1","million","!","``",",","...","``","body","''",":","``","Por","usar","argilla","te","ha","tocado","este","premio",":","<","link",">","''","...","}",",","...","prediction=","[","(","'spam","'",",","0.99",")",",","(","'ham","'",",","0.01",")","]",",","...","annotation=","''","spam","''",",","...","vectors","=","{","...","``","distilbert_uncased","''",":","[","1.13",",","4.1",",","6.3",",","4.2",",","9.1","]",",","...","``","xlm_roberta_cased","''",":","[","1.1",",","2.1",",","3.3",",","4.2",",","2.1","]",",","...","}","...",")"]
docstr: Check if either text or inputs were provided. Copy text to inputs.
docstr_tok: ["Check","if","either","text","or","inputs","were","provided",".","Copy","text","to","inputs","."]
code: def _check_text_and_inputs(cls, values):
      """Check if either text or inputs were provided. Copy text to inputs."""
      if isinstance(values.get("inputs"), str):
          warnings.warn(
              "In the future, the `inputs` argument of the `TextClassificationRecord`"
              " will not accept strings. Please use the `text` argument in that case."
              " Make sure to adapt your code accordingly.",
              category=FutureWarning,
          )
  
      if values.get("inputs") is not None and not isinstance(
          values["inputs"], dict
      ):
          values["inputs"] = dict(text=values["inputs"])
  
      if (
          values.get("text") is None and values.get("inputs") is None
      ) or (
          values.get("text") is not None
          and values.get("inputs") is not None
          and values["text"] != values["inputs"].get("text")
      ):
          raise ValueError(
              "For a TextClassificationRecord you must provide either 'text' or 'inputs'"
          )
  
      if values.get("text") is not None:
          values["inputs"] = dict(text=values["text"])
      elif len(values["inputs"]) == 1 and "text" in values["inputs"]:
          values["text"] = values["inputs"]["text"]
  
      return values
  
imports: import datetime
  import logging
  import uuid
  import warnings
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pandas
  from deprecated import deprecated
  from argilla import _messages
  from argilla._constants import DEFAULT_MAX_KEYWORD_LENGTH
  from argilla.pydantic_v1 import BaseModel, Field, PrivateAttr, root_validator, validator
  from argilla.utils.span_utils import SpanUtils
label_desc: Use image node_id 1 for calling the TextClassificationRecord obj's underlying member method code with example usage: obj._check_text_and_inputs(cls, values) and returns: values