code: def get_simple_dnn_classifier_and_metadata(
      n_classes=2, label_vocabulary=None
  ):
      """Returns metadata for creating simple DNN classifier."""
      if label_vocabulary:
          feature_spec = tf.feature_column.make_parse_example_spec(
              feature_columns=util.dnn_columns(
                  False, n_classes=n_classes
              )
          )
          feature_spec["label"] = tf.io.FixedLenFeature(
              shape=[1], dtype=tf.string
          )
      else:
          feature_spec = tf.feature_column.make_parse_example_spec(
              feature_columns=util.dnn_columns(
                  True, n_classes=n_classes
              )
          )
      classifier = tf_estimator.DNNClassifier(
          hidden_units=[4],
          feature_columns=util.dnn_columns(False),
          n_classes=n_classes,
          label_vocabulary=label_vocabulary,
          loss_reduction=tf.losses.Reduction.SUM,
      )
      classifier = tf_estimator.add_metrics(
          classifier, util.classifier_extra_metrics
      )
      return {
          "estimator": classifier,
          "serving_input_receiver_fn": (
              tf_estimator.export.build_parsing_serving_input_receiver_fn(
                  tf.feature_column.make_parse_example_spec(
                      util.dnn_columns(False)
                  )
              )
          ),
          "eval_input_receiver_fn": build_parsing_eval_input_receiver_fn(
              feature_spec, label_key="label"
          ),
          "train_input_fn": util.make_classifier_input_fn(
              feature_spec, n_classes, label_vocabulary=label_vocabulary
          ),
      }
  
imports: import tensorflow
  from tensorflow import estimator
  from tensorflow_model_analysis.eval_saved_model import export
  from tensorflow_model_analysis.eval_saved_model.example_trainers import util
label_desc: Use image node_id 2 for calling a global function with example usage: get_simple_dnn_classifier_and_metadata(n_classes, label_vocabulary) and returns: dict