input: Write a function to create a natural language processing application that extracts the top 10 most frequent words from a given text. The function should return a list of tuples where each tuple contains a word and its frequency. If the text is empty, the function should return an empty list.
  assert top_10_frequent_words("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")==[('dolor', 1), ('Lorem', 1), ('ipsum', 1), ('amet', 1), ('consectetur', 1), ('adipiscing', 1), ('elit,', 1), ('sed', 1), ('do', 1), ('eiusmod', 1)]
  assert top_10_frequent_words("This is a test. This test is to check if the test works correctly. test")==[('test', 4), ('This', 2), ('is', 2), ('a', 1), ('to', 1), ('check', 1), ('if', 1), ('the', 1), ('works', 1), ('correctly.', 1)]
  assert top_10_frequent_words("The quick brown fox jumps over the lazy dog. The dog was not amused.")==[('The', 2), ('dog.', 1), ('dog', 1), ('was', 1), ('not', 1), ('amused.', 1), ('quick', 1), ('brown', 1), ('fox', 1), ('jumps', 1)]
  assert top_10_frequent_words("")==[]
output: def top_10_frequent_words(text):
      if not text:
          return []
      words = text.split()
      freq = {}
      for word in words:
          if word in freq:
              freq[word] += 1
          else:
              freq[word] = 1
      sorted_freq = sorted(freq.items(), key=lambda x: x[1], reverse=True)
      return sorted_freq[:10]