class_docstr: Preprocessor for an Average Word Embedding model.
  
  Takes (text, label) data and applies regex tokenization and padding to the
  text to generate (token IDs, label) data.
  
  Attributes:
    seq_len: Length of the input sequence to the model.
    do_lower_case: Whether text inputs should be converted to lower-case.
    vocab: Vocabulary of tokens used by the model.
class_docstr_tok: ["Preprocessor","for","an","Average","Word","Embedding","model",".","Takes","(","text",",","label",")","data","and","applies","regex","tokenization","and","padding","to","the","text","to","generate","(","token","IDs",",","label",")","data",".","Attributes",":","seq_len",":","Length","of","the","input","sequence","to","the","model",".","do_lower_case",":","Whether","text","inputs","should","be","converted","to","lower-case",".","vocab",":","Vocabulary","of","tokens","used","by","the","model","."]
docstr: Preprocesses data into input for an Average Word Embedding model.
  
  Args:
    dataset: Stores (text, label) data.
  
  Returns:
    Dataset containing (token IDs, label) data.
docstr_tok: ["Preprocesses","data","into","input","for","an","Average","Word","Embedding","model",".","Args",":","dataset",":","Stores","(","text",",","label",")","data",".","Returns",":","Dataset","containing","(","token","IDs",",","label",")","data","."]
code: def preprocess(
      self, dataset: text_classifier_ds.Dataset
  ) -> text_classifier_ds.Dataset:
      """Preprocesses data into input for an Average Word Embedding model.
  
      Args:
        dataset: Stores (text, label) data.
  
      Returns:
        Dataset containing (token IDs, label) data.
      """
      token_ids_list = []
      labels_list = []
      for text, label in dataset.gen_tf_dataset():
          _validate_text_and_label(text, label)
          token_ids = self._tokenize_and_pad(
              text.numpy()[0].decode("utf-8")
          )
          token_ids_list.append(token_ids)
          labels_list.append(label.numpy()[0])
  
      token_ids_ds = tf.data.Dataset.from_tensor_slices(token_ids_list)
      labels_ds = tf.data.Dataset.from_tensor_slices(labels_list)
      preprocessed_ds = tf.data.Dataset.zip((token_ids_ds, labels_ds))
      return text_classifier_ds.Dataset(
          dataset=preprocessed_ds,
          size=dataset.size,
          label_names=dataset.label_names,
      )
  
imports: import collections
  import hashlib
  import os
  import re
  from typing import Mapping, Sequence, Tuple, Union
  import tensorflow
  import tensorflow_hub
  from mediapipe.model_maker.python.core.data import cache_files
  from mediapipe.model_maker.python.text.text_classifier import bert_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import dataset
label_desc: Use image node_id 6 for calling the AverageWordEmbeddingClassifierPreprocessor obj's underlying member method code with example usage: obj.preprocess(dataset) and returns: text_classifier_ds