input: Write a function to analyze the sentiment of a given text and categorize it into positive, negative, or neutral sentiments. Use the following code structure:
  
  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
  
  # End analyze sentiment definition
  
  assert analyze_sentiment("I love this product. It's amazing!") == 'positive'
  assert analyze_sentiment("This is terrible. I hate it.") == 'negative'
  assert analyze_sentiment("It's ok, not great but not bad either.") == '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