input: from typing import List
  
  def compress_sequence(nums: List[int]) -> List[List[int]]:
      """ Compress the given data sequence based on the sign of consecutive numbers.
      If two consecutive numbers have the same sign (both positive or both negative),
      they are grouped together; otherwise, they are separated into different groups.
      
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2, 6, 0], [-7]]
      """
output:     result = []
      current_group = [nums[0]]
      
      for i in range(1, len(nums)):
          if (nums[i] >= 0 and nums[i-1] >= 0) or (nums[i] < 0 and nums[i-1] < 0):
              current_group.append(nums[i])
          else:
              result.append(current_group)
              current_group = [nums[i]]
      
      result.append(current_group)
      return result