input: Write a python function to summarize text by keeping only the top frequent words.
  assert summarize_text('This is a test sentence. This is another example sentence. Test sentence number 3.') == 'This test sentence. another example sentence.'
  assert summarize_text('Python is great. Python is dynamic. Python is easy to learn.') == 'Python is. Python is. Python is'
  assert summarize_text('The quick brown fox jumps over the lazy dog. The dog was not amused.') == 'The dog The dog'
output: def summarize_text(text):
      from collections import Counter
      import re
  
      words = re.findall(r'\b\w+\b', text.lower())
      word_counts = Counter(words)
      top_words = {word for word, count in word_counts.most_common(3)}
  
      sentences = text.split('. ')
      summary = []
  
      for sentence in sentences:
          if any(word.lower() in top_words for word in re.findall(r'\b\w+\b', sentence)):
              summary.append(sentence.strip())
  
      return '. '.join(summary).strip('.')