class_docstr: APIs to help create and train a BERT-based text classifier.
class_docstr_tok: ["APIs","to","help","create","and","train","a","BERT-based","text","classifier","."]
docstr: Creates, trains, and returns a BERT-based classifier.
  
  Args:
    train_data: Training data.
    validation_data: Validation data.
    options: Options for creating and training the text classifier.
  
  Returns:
    A BERT-based classifier.
code: def create_bert_classifier(
      cls,
      train_data: text_ds.Dataset,
      validation_data: text_ds.Dataset,
      options: text_classifier_options.TextClassifierOptions,
  ) -> "_BertClassifier":
      """Creates, trains, and returns a BERT-based classifier.
  
      Args:
        train_data: Training data.
        validation_data: Validation data.
        options: Options for creating and training the text classifier.
  
      Returns:
        A BERT-based classifier.
      """
      bert_classifier = _BertClassifier(
          model_spec=options.supported_model.value(),
          model_options=options.model_options,
          hparams=options.hparams,
          label_names=train_data.label_names,
      )
      bert_classifier._create_and_train_model(
          train_data, validation_data
      )
      return bert_classifier
  
imports: import abc
  import os
  import tempfile
  from typing import Any, Optional, Sequence, Tuple
  import tensorflow
  from tensorflow_addons import optimizers
  import tensorflow_hub
  from mediapipe.model_maker.python.core.data import dataset
  from mediapipe.model_maker.python.core.tasks import classifier
  from mediapipe.model_maker.python.core.utils import hub_loader
  from mediapipe.model_maker.python.core.utils import loss_functions
  from mediapipe.model_maker.python.core.utils import metrics
  from mediapipe.model_maker.python.core.utils import model_util
  from mediapipe.model_maker.python.core.utils import quantization
  from mediapipe.model_maker.python.text.text_classifier import bert_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import dataset
  from mediapipe.model_maker.python.text.text_classifier import hyperparameters
  from mediapipe.model_maker.python.text.text_classifier import model_options
  from mediapipe.model_maker.python.text.text_classifier import model_spec
  from mediapipe.model_maker.python.text.text_classifier import model_with_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import preprocessor
  from mediapipe.model_maker.python.text.text_classifier import text_classifier_options
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_writer
  from mediapipe.tasks.python.metadata.metadata_writers import text_classifier
label_desc: Use image node_id 2 for calling the _BertClassifier obj's underlying member method code with example usage: obj.create_bert_classifier(cls, train_data, validation_data, options) and returns: bert_classifier