input: Write a function to analyze the sentiment of given text and categorize it into positive, negative, and neutral sentiments. The function should use sentence tokenization and a Naive Bayes classifier for sentiment analysis. Return 'positive' if there are more positive sentiments, 'negative' if there are more negative sentiments, and 'neutral' if the number of positive and negative sentiments are equal. If the input text is empty, return 'neutral'.
  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 is fantastic.") == 'positive'
  assert analyze_sentiment("I hate this product. It is terrible.") == 'negative'
  assert analyze_sentiment("It is alright but could be better.") == '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