input: Write a function to classify text documents into two classes: positive and negative using the NaiveBayesClassifier from NLTK. The function should take a string as input and return the classification ('positive' or 'negative'). If the input is empty, the function should return None.
  assert classifier("This is a great movie!")=='positive'
  assert classifier("This movie was terrible")=='negative'
  assert classifier("This movie was ok")==None
  assert classifier("")==None
output: def classifier(text):
      if not text:
          return None
      from nltk.classify import NaiveBayesClassifier
      from nltk.corpus import movie_reviews
      from nltk.tokenize import word_tokenize
      import random
  
      def word_feats(words):
          return dict([(word, True) for word in words])
  
      negids = movie_reviews.fileids('neg')
      posids = movie_reviews.fileids('pos')
  
      negfeats = [(word_feats(movie_reviews.words(fileids=[f])), 'negative') for f in negids]
      posfeats = [(word_feats(movie_reviews.words(fileids=[f])), 'positive') for f in posids]
  
      trainfeats = negfeats + posfeats
      random.shuffle(trainfeats)
  
      classifier = NaiveBayesClassifier.train(trainfeats)
  
      words = word_tokenize(text)
      feats = word_feats(words)
      return classifier.classify(feats)