title: AttributeError: 'NoneType' object has no attribute 'items' for classifier = nltk.NaiveBayesClassifier.train(training_set)
body: <p>I am getting this error for AttributeError: 'NoneType' object has no attribute 'items. The code is as follows:</p>
  
  <pre><code>import nltk
  import random
  from nltk.corpus import movie_reviews
  from nltk.classify import NaiveBayesClassifier
  from nltk.probability import FreqDist
  
  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 = []
  for w in movie_reviews.words():
  all_words.append(w.lower())
  
  all_words =nltk.FreqDist(all_words)
  
  word_features = list(all_words.keys())[:3000]
  print (word_features)
  
  def find_features(documents):
      words = set(documents)
      features = {}
      for w in word_features:
          features[w] = (w in words)
  
  
  featuresets = [(find_features(rev), category) for (rev, category) in 
  documents]
  
  training_set = featuresets[:1500]
  testing_set = featuresets[1500:]
  
  
  classifier = nltk.NaiveBayesClassifier.train(training_set)
  
  print ("Naive Bayes Classifier Algo Accuracy: ",nltk.classify.accuracy(classifier, testing_set))*100)
  
  classifier.show_most_informative_features(15)
  </code></pre>
  
  <p>I have been following a video tutorial and it is the same code there. There it runs fine but here it shows the following error:</p>
  
  <pre><code>AttributeError: 'NoneType' object has no attribute 'items'
  </code></pre>
  
  <p>for the line</p>
  
  <blockquote>
    <p>classifier = nltk.NaiveBayesClassifier.train(training_set)</p>
  </blockquote>
  
  <p>What is the reason and the solution?</p>