input: Write a function that creates an NLP application in Python to extract the top 10 most frequent words from a given text. If the text contains fewer than 10 words, it should return the most frequent words from the available words. If the text is empty, it should return an empty list.
  def top_10_frequent_words(text):
      from collections import Counter
      if not text:
          return []
      words = text.split()
      counter = Counter(words)
      return counter.most_common(10)
  
  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("Hello world hello")==[('hello', 2), ('world', 1)]
  assert top_10_frequent_words("")==[]
output: def top_10_frequent_words(text):
      from collections import Counter
      if not text:
          return []
      words = text.split()
      counter = Counter(words)
      return counter.most_common(10)