code: def _make_serving_input_fn(tf_transform_output):
      """Creates an input function reading from raw data.
  
      Args:
        tf_transform_output: Wrapper around output of tf.Transform.
  
      Returns:
        The serving input function.
      """
      raw_feature_spec = RAW_DATA_FEATURE_SPEC.copy()
      # Remove label since it is not available during serving.
      raw_feature_spec.pop(LABEL_KEY)
  
      def serving_input_fn():
          """Input function for serving."""
          # Get raw features by generating the basic serving input_fn and calling it.
          # Here we generate an input_fn that expects a parsed Example proto to be fed
          # to the model at serving time.  See also
          # tf.estimator.export.build_raw_serving_input_receiver_fn.
          raw_input_fn = tf_estimator.export.build_parsing_serving_input_receiver_fn(
              raw_feature_spec, default_batch_size=None
          )
          serving_input_receiver = raw_input_fn()
  
          # Apply the transform function that was used to generate the materialized
          # data.
          raw_features = serving_input_receiver.features
          transformed_features = (
              tf_transform_output.transform_raw_features(raw_features)
          )
  
          return tf_estimator.export.ServingInputReceiver(
              transformed_features,
              serving_input_receiver.receiver_tensors,
          )
  
      return serving_input_fn
  
file_path: transform/examples/sentiment_example.py
imports: import argparse
  import os
  import pprint
  import tempfile
  import apache_beam
  import tensorflow
  from tensorflow import estimator
  import tensorflow_transform
  import tensorflow_transform.beam
  from tfx_bsl.public import tfxio
label_desc: Use image node_id 6 for calling a global function with example usage: _make_serving_input_fn(tf_transform_output) and returns: serving_input_fn, tf_estimator