add_label = lambda lst, lab: [(x, lab) for x in lst]
classif.train(add_label(pos[:100], 'pos') + add_label(neg[:100], 'neg'))
l_pos = np.array(classif.classify_many(pos[100:]))
l_neg = np.array(classif.classify_many(neg[100:]))
print("""Confusion matrix:
%d	%d
%d	%d""" % ((l_pos == 'pos').sum(), (l_pos ==
    'neg').sum(), (l_neg == 'pos').sum(), (l_neg == 'neg').sum()))
Implementing Bag-of-Words Naive-Bayes classifier in NLTK