def create_serving_input_fn(use_segment_ids, use_foreign_key_features,
                            use_alignment_features):
  """Sets up input function that accepts serialized tf.SequenceExample."""

  def input_fn():
    placeholder, features, _ = create_placeholder_inputs(
        use_segment_ids, use_foreign_key_features, use_alignment_features)
    inputs = {constants.SERIALIZED_EXAMPLE: placeholder}
    return tf_estimator.export.ServingInputReceiver(features, inputs)

  return input_fn
Sets up input function that accepts serialized tf.SequenceExample.
language/xsp/model/input_pipeline.py