input: Write a function to analyze the sentiment of a given text and categorize it into positive, negative, and neutral sentiments. The function should use tokenization and a Naive Bayes classifier to process the input text. If there are more negative sentences than positive ones, the sentiment should be categorized as 'negative'. If there are more positive sentences than negative ones, the sentiment should be categorized as 'positive'. If the number of positive and negative sentences is equal, the sentiment should be categorized as 'neutral'.
  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 is amazing!") == 'positive'
  assert analyze_sentiment("I hate this product. It is terrible!") == 'negative'
  assert analyze_sentiment("This product is just okay.") == '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