input: Write a function to classify text documents into two classes: positive and negative using the NaiveBayesClassifier from nltk. If the given text is classified as positive return 'positive', otherwise return 'negative'. If the given text is empty then return 'neutral'.
  assert classify_sentiment('This is a great movie!')=='positive'
  assert classify_sentiment('This movie was terrible')=='negative'
  assert classify_sentiment('This movie was ok')=='neutral'
  assert classify_sentiment('')=='neutral'
output: def classify_sentiment(text):
      if not text:
          return 'neutral'
      from nltk.classify import NaiveBayesClassifier
      from nltk.corpus import movie_reviews
      from nltk.tokenize import word_tokenize
      import random
      
      def extract_features(words):
          return dict([(word, True) for word in words])
      
      documents = [(list(movie_reviews.words(fileid)), category)
                   for category in movie_reviews.categories()
                   for fileid in movie_reviews.fileids(category)]
      
      random.shuffle(documents)
      
      all_words = nltk.FreqDist(w.lower() for w in movie_reviews.words())
      word_features = list(all_words)[:2000]
      
      featuresets = [(extract_features(d), c) for (d,c) in documents]
      train_set, test_set = featuresets[:1500], featuresets[1500:]
      classifier = NaiveBayesClassifier.train(train_set)
      
      words = word_tokenize(text.lower())
      features = extract_features(words)
      sentiment = classifier.classify(features)
      
      return 'positive' if sentiment == 'pos' else 'negative'