def get_sequence_features(use_segment_ids, use_foreign_key_features,
                          string_alignment_features):
  """Gets sequence features (i.e., for input/output sequence to the model)."""
  keys_to_sequence_features = {
      constants.SOURCE_WORDPIECES_KEY:
          tf.FixedLenSequenceFeature([], dtype=tf.int64),
      constants.TARGET_ACTION_TYPES_KEY:
          tf.FixedLenSequenceFeature([], dtype=tf.int64),
      constants.TARGET_ACTION_IDS_KEY:
          tf.FixedLenSequenceFeature([], dtype=tf.int64),
      constants.COPIABLE_INPUT_KEY:
          tf.FixedLenSequenceFeature([], dtype=tf.int64)
  }

  if use_segment_ids:
    keys_to_sequence_features[
        constants.SEGMENT_ID_KEY] = tf.FixedLenSequenceFeature([],
                                                               dtype=tf.int64)

  if use_foreign_key_features:
    keys_to_sequence_features[
        constants.FOREIGN_KEY_KEY] = tf.FixedLenSequenceFeature([],
                                                                dtype=tf.int64)

  if string_alignment_features:
    keys_to_sequence_features[
        constants.ALIGNED_KEY] = tf.FixedLenSequenceFeature([], dtype=tf.int64)

  return keys_to_sequence_features
Gets sequence features (i.e., for input/output sequence to the model).
language/xsp/model/input_pipeline.py