code: def test_text_dataset_from_directory_multiclass(self):
      directory = self._prepare_directory(num_classes=4, count=15)
  
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory, batch_size=8, label_mode=None
      )
      batch = next(iter(dataset))
      self.assertEqual(batch.shape, (8,))
  
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory, batch_size=8, label_mode=None
      )
      sample_count = 0
      iterator = iter(dataset)
      for batch in dataset:
          sample_count += next(iterator).shape[0]
      self.assertEqual(sample_count, 15)
  
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory, batch_size=8, label_mode="int"
      )
      batch = next(iter(dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (8,))
      self.assertEqual(batch[0].dtype.name, "string")
      self.assertEqual(batch[1].shape, (8,))
      self.assertEqual(batch[1].dtype.name, "int32")
  
      dataset = text_dataset_utils.text_dataset_from_directory(
          directory, batch_size=8, label_mode="categorical"
      )
      batch = next(iter(dataset))
      self.assertLen(batch, 2)
      self.assertEqual(batch[0].shape, (8,))
      self.assertEqual(batch[0].dtype.name, "string")
      self.assertEqual(batch[1].shape, (8, 4))
      self.assertEqual(batch[1].dtype.name, "float32")
  
file_path: keras/keras/utils/text_dataset_utils_test.py
imports: import os
  import random
  import string
  from keras import testing
  from keras.utils import text_dataset_utils
label_desc: Use image node_id 5 for calling the TextDatasetFromDirectoryTest obj's underlying member method code with example usage: obj.test_text_dataset_from_directory_multiclass() without return types