input: 
  import nltk
  from nltk.tokenize import sent_tokenize
  from nltk.classify import NaiveBayesClassifier
  
  def analyze_sentiment(text):
      """ Analyze the sentiment of a given text and categorize it as positive, negative, or neutral.
      The function tokenizes the text, classifies each sentence using a NaiveBayesClassifier,
      and counts the number of positive and negative sentences.
      It then determines the overall sentiment based on these counts.
      >>> analyze_sentiment("I love this product. It's the best thing ever!")
      'positive'
      >>> analyze_sentiment("I hate this product. It's the worst.")
      'negative'
      >>> analyze_sentiment("This is a neutral statement.")
      'neutral'
      """
      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
  
output:     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