for traincv, testcv in cv:
    classifier = nltk.NaiveBayesClassifier.train(training_set[traincv[0]:
        traincv[len(traincv) - 1]])
print('accuracy:', nltk.classify.util.accuracy(classifier, training_set[
    testcv[0]:testcv[len(testcv) - 1]]))
How to use the a k-fold cross validation in scikit with naive bayes classifier and NLTK