input: Write a function to analyze the sentiment of given text and categorize it into positive, negative, and neutral sentiments. Use the NaiveBayesClassifier from the nltk library for sentiment analysis. If the count of negative sentences is higher than the positive ones, return 'negative'. If the count of positive sentences is higher, return 'positive'. If they are equal, return 'neutral'. The function should tokenize the text into sentences before performing sentiment analysis.
  import nltk
  from nltk.tokenize import sent_tokenize
  from nltk.classify import NaiveBayesClassifier
  
  def analyze_sentiment(text):
      sents = sent_tokenize(text)
      neg = 0
      pos = 0
      for sentence in sents:
          sentiment_analysis = NaiveBayesClassifier.classify(sentence)
          if sentiment_analysis == 'neg':
              neg += 1
          if sentiment_analysis == 'pos':
              pos += 1
      
      if neg > pos:
          sentiment = 'negative'
      elif pos > neg:
          sentiment = 'positive'
      else:
          sentiment = 'neutral'
      
      return sentiment
  
  assert analyze_sentiment("I love this product! It's amazing.") == 'positive'
  assert analyze_sentiment("I hate this product! It's terrible.") == 'negative'
  assert analyze_sentiment("This is just okay.") == 'neutral'
  assert analyze_sentiment("") == 'neutral'
output: def analyze_sentiment(text):
      sents = sent_tokenize(text)
      neg = 0
      pos = 0
      for sentence in sents:
          sentiment_analysis = NaiveBayesClassifier.classify(sentence)
          if sentiment_analysis == 'neg':
              neg += 1
          if sentiment_analysis == 'pos':
              pos += 1
      
      if neg > pos:
          sentiment = 'negative'
      elif pos > neg:
          sentiment = 'positive'
      else:
          sentiment = 'neutral'
      
      return sentiment