def tokenize_reviews_mapper(self, category, review):
        # special case - pass through category counts (which are
        # already formatted like the output of this mapper)
        if category == 'all':
            yield category, review
            return

        counts = {}
        for word in words(review):
            counts[word] = counts.get(word, 0) + 1

        yield category, counts
Split reviews into words, yielding out (category, {word: count}) and
dataset/ETHPy150Open Yelp/dataset-examples/category_predictor/category_predictor.py/CategoryPredictor.tokenize_reviews_mapper