code: def paths_and_labels_to_dataset(
      file_paths, labels, label_mode, num_classes, max_length
  ):
      """Constructs a dataset of text strings and labels."""
      path_ds = tf.data.Dataset.from_tensor_slices(file_paths)
      string_ds = path_ds.map(
          lambda x: path_to_string_content(x, max_length),
          num_parallel_calls=tf.data.AUTOTUNE,
      )
      if label_mode:
          label_ds = dataset_utils.labels_to_dataset(
              labels, label_mode, num_classes
          )
          string_ds = tf.data.Dataset.zip((string_ds, label_ds))
      return string_ds
  
imports: import numpy
  from keras.api_export import keras_export
  from keras.utils import dataset_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: paths_and_labels_to_dataset(file_paths, labels, label_mode, num_classes, max_length) and returns: string_ds