def _action_id_to_table_name_map(segment_ids, copy_strings):
  """Returns a map of action_ids to table names for columns."""
  current_segment_id = 0
  table_name = None
  # The first copy_string for a new segment_id is the table name.
  # Following copy_string are for columns belonging to that table.
  # TODO(petershaw): This is really hacky! We should provide a better channel
  # for passing this information to the output during inference.
  action_id_to_table_name_map = {}
  for action_id, (segment_id,
                  copy_string) in enumerate(zip(segment_ids, copy_strings)):
    if segment_id > current_segment_id:
      current_segment_id = segment_id
      table_name = copy_string
    elif table_name:
      action_id_to_table_name_map[action_id] = table_name
  return action_id_to_table_name_map
Returns a map of action_ids to table names for columns.
language/xsp/model/run_inference.py