code: def create_datasets():
      (raw_train_ds, raw_val_ds, raw_test_ds), info = tfds.load(
          "imdb_reviews",
          data_dir="/tmp/data",
          split=["train[:80%]", "train[80%:]", "test"],
          as_supervised=True,
          batch_size=32,
          with_info=True,
      )
  
      def custom_standardization(input_data):
          lowercase = tf.strings.lower(input_data)
          stripped_html = tf.strings.regex_replace(
              lowercase, "<br />", " "
          )
          return tf.strings.regex_replace(
              stripped_html, f"[{re.escape(string.punctuation)}]", ""
          )
  
      vectorize_layer = TextVectorization(
          standardize=custom_standardization,
          max_tokens=max_features,
          output_mode="int",
          output_sequence_length=500,
      )
  
      text_ds = raw_train_ds.map(lambda x, y: x)
      vectorize_layer.adapt(text_ds)
  
      def vectorize_text(text, label):
          text = tf.expand_dims(text, -1)
          return vectorize_layer(text), label
  
      # Vectorize the data
      train_ds = raw_train_ds.map(vectorize_text)
      val_ds = raw_val_ds.map(vectorize_text)
      test_ds = raw_test_ds.map(vectorize_text)
  
      return train_ds, val_ds, test_ds
  
file_path: BigDL/python/nano/tutorial/training/tensorflow/tensorflow_sparse_embedding.py
imports: import os
  import re
  import string
  import tensorflow
  import tensorflow_datasets
  from tensorflow.keras import layers
  from tensorflow.keras.layers import TextVectorization
  from bigdl.nano.tf.keras.layers import Embedding
  from bigdl.nano.tf.optimizers import SparseAdam
  from bigdl.nano.tf.keras import Model
label_desc: Use image node_id 1 for calling a global function with example usage: create_datasets() and returns: train_ds,  val_ds,  test_ds, tf, vectorize_layer,  label