input: Write a function to implement a natural language processing application in Python that extracts the top 10 most frequent words from a given text. The function should take a single string as input and return a list of tuples where each tuple contains a word and its frequency, sorted by frequency in descending order. If the text contains fewer than 10 unique words, the function should return all the words along with their frequencies.
  assert extract_top_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 extract_top_words("") == []
  assert extract_top_words("This is a test. This is only a test. Test, test, test.") == [('test.', 3), ('This', 2), ('is', 2), ('a', 2), ('test', 1), ('only', 1)]
  assert extract_top_words("A quick brown fox jumps over the lazy dog.") == [('A', 1), ('quick', 1), ('brown', 1), ('fox', 1), ('jumps', 1), ('over', 1), ('the', 1), ('lazy', 1), ('dog.', 1)]
  assert extract_top_words("One one was a racehorse, two two was one too.") == [('one', 3), ('was', 2), ('a', 1), ('racehorse,', 1), ('two', 1), ('too.', 1)]
output: def extract_top_words(text):
      from collections import Counter
      words = text.split()
      word_counts = Counter(words)
      sorted_words = sorted(word_counts.items(), key=lambda x: x[1], reverse=True)
      return sorted_words[:10]