code: def run(
      data_dir,
      export_dir=tempfile.mkdtemp(),
      supported_model=(
          text_classifier.SupportedModels.AVERAGE_WORD_EMBEDDING_CLASSIFIER
      ),
  ):
      """Runs demo."""
  
      # Gets training data and validation data.
      csv_params = text_classifier.CSVParams(
          text_column="sentence", label_column="label", delimiter="\t"
      )
      train_data = text_classifier.Dataset.from_csv(
          filename=os.path.join(os.path.join(data_dir, "train.tsv")),
          csv_params=csv_params,
      )
      validation_data = text_classifier.Dataset.from_csv(
          filename=os.path.join(os.path.join(data_dir, "dev.tsv")),
          csv_params=csv_params,
      )
  
      quantization_config = None
      if (
          supported_model
          == text_classifier.SupportedModels.AVERAGE_WORD_EMBEDDING_CLASSIFIER
      ):
          hparams = text_classifier.AverageWordEmbeddingHParams(
              epochs=10,
              batch_size=32,
              learning_rate=0,
              export_dir=export_dir,
          )
      # Warning: This takes extremely long to run on CPU
      elif (
          supported_model
          == text_classifier.SupportedModels.MOBILEBERT_CLASSIFIER
      ):
          quantization_config = (
              quantization.QuantizationConfig.for_dynamic()
          )
          hparams = text_classifier.BertHParams(
              epochs=3,
              batch_size=48,
              learning_rate=3e-5,
              export_dir=export_dir,
          )
  
      # Fine-tunes the model.
      options = text_classifier.TextClassifierOptions(
          supported_model=supported_model, hparams=hparams
      )
      model = text_classifier.TextClassifier.create(
          train_data, validation_data, options
      )
  
      # Gets evaluation results.
      metrics = model.evaluate(validation_data)
      print("Eval accuracy: %f" % metrics[1])
  
      model.export_model(quantization_config=quantization_config)
      model.export_labels(export_dir=options.hparams.export_dir)
  
file_path: mediapipe/mediapipe/model_maker/python/text/text_classifier/text_classifier_demo.py
imports: import os
  import tempfile
  from absl import app
  from absl import flags
  from absl import logging
  import tensorflow
  from mediapipe.model_maker.python.core.utils import quantization
  from mediapipe.model_maker.python.text import text_classifier
label_desc: Use image node_id 3 for calling a global function with example usage: run(data_dir, export_dir, supported_model) without return types