input: Write a function to classify a given text as either 'positive' or 'negative' using a NaiveBayesClassifier trained on provided example texts. The function should tokenize the input text and convert it into a format suitable for classification. If the text is classified as positive, the function should return 'positive'; otherwise, it should return 'negative'. If the input text is empty, the function should return None.
  
  assert classify_text("This is a great movie!") == 'positive'
  assert classify_text("This movie was terrible") == 'negative'
  assert classify_text("This movie was ok") == 'negative'
  assert classify_text("") == None
output: def classify_text(text):
      if not text:
          return None
      from nltk.tokenize import word_tokenize
      from nltk.classify import NaiveBayesClassifier
      from nltk.corpus import subjectivity
      from nltk.sentiment import SentimentAnalyzer
      from nltk.sentiment.util import extract_unigram_feats
  
      n_instances = 100
      subj_docs = [(sent, 'subj') for sent in subjectivity.sents(categories='subj')[:n_instances]]
      obj_docs = [(sent, 'obj') for sent in subjectivity.sents(categories='obj')[:n_instances]]
  
      train_subj_docs = subj_docs[:80]
      test_subj_docs = subj_docs[80:100]
      train_obj_docs = obj_docs[:80]
      test_obj_docs = obj_docs[80:100]
  
      training_docs = train_subj_docs + train_obj_docs
      testing_docs = test_subj_docs + test_obj_docs
  
      sentim_analyzer = SentimentAnalyzer()
      all_words_neg = sentim_analyzer.all_words([mark_negation(doc) for doc in training_docs])
  
      unigram_feats = sentim_analyzer.unigram_word_feats(all_words_neg, min_freq=4)
      sentim_analyzer.add_feat_extractor(extract_unigram_feats, unigrams=unigram_feats)
  
      training_set = sentim_analyzer.apply_features(training_docs)
      test_set = sentim_analyzer.apply_features(testing_docs)
  
      trainer = NaiveBayesClassifier.train
      classifier = sentim_analyzer.train(trainer, training_set)
  
      tokenized_text = word_tokenize(text)
      features = sentim_analyzer.apply_features([tokenized_text])
      result = classifier.classify(features[0][0])
  
      return 'positive' if result == 'subj' else 'negative'