human
I am working on the file ".ipynb_checkpoints/Lab1 Text processing with python-checkpoint.ipynb".
The first task is:
If we modify build_analyzer() to apply the NLTK stemmer to the output of default build_analyzer(), we get a version that does stemming as well:
Can you write Python program for it?
 Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

import nltk.stem
english_stemmer = nltk.stem.SnowballStemmer('english')
class StemmedCountVectorizer(CountVectorizer):
    def build_analyzer(self):
        analyzer=super(StemmedCountVectorizer, self).build_analyzer()
        return lambda doc:(english_stemmer.stem(w) for w in analyzer(doc))