input: from typing import List
  
  def compress_sequence(nums: List[int]) -> List[List[int]]:
      """ Compresses a given data sequence by grouping consecutive numbers based on their sign.
      If the sign of consecutive numbers is the same, they are grouped together; otherwise,
      they form a new group.
      
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2], [6], [0, -7]]
      >>> compress_sequence([1, -3, -5, 4, -2])
      [[1], [-3, -5], [4], [-2]]
      """
output:     result = []
      if not nums:
          return result
  
      current_group = [nums[0]]
      for num in nums[1:]:
          if (num >= 0 and current_group[-1] >= 0) or (num < 0 and current_group[-1] < 0):
              current_group.append(num)
          else:
              result.append(current_group)
              current_group = [num]
      result.append(current_group)
      return result