class_docstr: A wrapper for `seqio.Task` using a `seqio.TfdsDataSource`.
  
  Reads raw data from TensorFlow Datasets.
  
  For backward compatibility with the original T5 task format, this task
  separates preprocessing into text and token stages, with optional caching in
  between.
class_docstr_tok: ["A","wrapper","for","`","seqio.Task","`","using","a","`","seqio.TfdsDataSource","`",".","Reads","raw","data","from","TensorFlow","Datasets",".","For","backward","compatibility","with","the","original","T5","task","format",",","this","task","separates","preprocessing","into","text","and","token","stages",",","with","optional","caching","in","between","."]
docstr: TfdsTask constructor.
  
  Args:
    name: string, a unique name for the Task. A ValueError will be raised if
      another task with this name is already registered.
    tfds_name: string, the name and version number of a TFDS dataset,
      optionally with a config.
    text_preprocessor: a function (or list of functions) that (each) takes in
      a tf.data.Dataset of string features and returns a tf.data.Dataset of
      string features. Can be set to None as a no-op. If a list is given, they
      will be executed sequentially.
    metric_fns: list(callable), list of metric functions with the signature
      metric_fn(targets, predictions) to use during evaluation.
    tfds_data_dir: string, an optional path to a specific TFDS data directory
      to use.
    splits: a list(string) of allowable splits to load, a dict mapping
      allowable canonical splits (e.g., 'validation') to TFDS splits or slices
      (e.g., 'train[':1%']), or None. The default, None, uses all available
      splits from the TFDS dataset info.
    **task_kwargs: dict, additional keyword arguments for the parent `Task`
      class.
docstr_tok: ["TfdsTask","constructor",".","Args",":","name",":","string",",","a","unique","name","for","the","Task",".","A","ValueError","will","be","raised","if","another","task","with","this","name","is","already","registered",".","tfds_name",":","string",",","the","name","and","version","number","of","a","TFDS","dataset",",","optionally","with","a","config",".","text_preprocessor",":","a","function","(","or","list","of","functions",")","that","(","each",")","takes","in","a","tf.data.Dataset","of","string","features","and","returns","a","tf.data.Dataset","of","string","features",".","Can","be","set","to","None","as","a","no-op",".","If","a","list","is","given",",","they","will","be","executed","sequentially",".","metric_fns",":","list","(","callable",")",",","list","of","metric","functions","with","the","signature","metric_fn","(","targets",",","predictions",")","to","use","during","evaluation",".","tfds_data_dir",":","string",",","an","optional","path","to","a","specific","TFDS","data","directory","to","use",".","splits",":","a","list","(","string",")","of","allowable","splits","to","load",",","a","dict","mapping","allowable","canonical","splits","(","e.g.",",","'validation","'",")","to","TFDS","splits","or","slices","(","e.g.",",","'train","[","':1","%","'","]",")",",","or","None",".","The","default",",","None",",","uses","all","available","splits","from","the","TFDS","dataset","info",".","*","*","task_kwargs",":","dict",",","additional","keyword","arguments","for","the","parent","`","Task","`","class","."]
code: def __init__(
      self,
      name,
      tfds_name,
      text_preprocessor,
      metric_fns,
      tfds_data_dir=None,
      splits=None,
      **task_kwargs,
  ):
      """TfdsTask constructor.
  
      Args:
        name: string, a unique name for the Task. A ValueError will be raised if
          another task with this name is already registered.
        tfds_name: string, the name and version number of a TFDS dataset,
          optionally with a config.
        text_preprocessor: a function (or list of functions) that (each) takes in
          a tf.data.Dataset of string features and returns a tf.data.Dataset of
          string features. Can be set to None as a no-op. If a list is given, they
          will be executed sequentially.
        metric_fns: list(callable), list of metric functions with the signature
          metric_fn(targets, predictions) to use during evaluation.
        tfds_data_dir: string, an optional path to a specific TFDS data directory
          to use.
        splits: a list(string) of allowable splits to load, a dict mapping
          allowable canonical splits (e.g., 'validation') to TFDS splits or slices
          (e.g., 'train[':1%']), or None. The default, None, uses all available
          splits from the TFDS dataset info.
        **task_kwargs: dict, additional keyword arguments for the parent `Task`
          class.
      """
      super().__init__(
          name,
          source=seqio.TfdsDataSource(
              tfds_name=tfds_name,
              tfds_data_dir=tfds_data_dir,
              splits=splits,
          ),
          text_preprocessor=text_preprocessor,
          metric_fns=metric_fns,
          dataset_fn=None,
          splits=None,
          **task_kwargs,
      )
  
imports: from collections.abc import Mapping
  import re
  import seqio
  from t5.data import utils
  import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new TfdsTask object from inherited base classes: FunctionTask with example: obj = TfdsTask(name, tfds_name, text_preprocessor, metric_fns, tfds_data_dir, splits)