input: Write a function to classify text documents into two classes: positive and negative using a Naive Bayes classifier. The function should take a list of texts (strings) as input, train the classifier with predefined positive and negative examples, and then return the class labels for the input texts.
  
  def classify_text(texts): 
      import nltk
      from nltk.classify import NaiveBayesClassifier 
      
      def label_words(words): 
          return dict([(word, True) for word in words]) 
  
      positiveText = "This is a great movie!"
      negativeText = "This movie was terrible"
  
      positive_tokens = nltk.word_tokenize(positiveText) 
      negative_tokens = nltk.word_tokenize(negativeText)
  
      positive_data = [(label_words(positive_tokens), 'positive')] 
      negative_data = [(label_words(negative_tokens), 'negative')]
   
      train_data = positive_data + negative_data 
      classifier = NaiveBayesClassifier.train(train_data) 
      
      results = []
      for text in texts:
          label = classifier.classify(label_words(nltk.word_tokenize(text)))
          results.append(label)
  
      return results
  
  assert classify_text(["This movie was ok", "This movie was terrible"]) == ['positive', 'negative']
  assert classify_text(["This is a great movie!", "Don't watch this movie"]) == ['positive', 'negative']
  assert classify_text(["The movie was good", "The movie was bad"]) == ['positive', 'negative']
  assert classify_text(["Enjoyed it!", "Hated it"]) == ['positive', 'negative']
output: def classify_text(texts): 
      import nltk
      from nltk.classify import NaiveBayesClassifier 
      
      def label_words(words): 
          return dict([(word, True) for word in words]) 
  
      positiveText = "This is a great movie!"
      negativeText = "This movie was terrible"
  
      positive_tokens = nltk.word_tokenize(positiveText) 
      negative_tokens = nltk.word_tokenize(negativeText)
  
      positive_data = [(label_words(positive_tokens), 'positive')] 
      negative_data = [(label_words(negative_tokens), 'negative')]
   
      train_data = positive_data + negative_data 
      classifier = NaiveBayesClassifier.train(train_data) 
      
      results = []
      for text in texts:
          label = classifier.classify(label_words(nltk.word_tokenize(text)))
          results.append(label)
  
      return results