title: I want to remove all the German stop words from data set
body: <p>I want to remove the german stop words from my data set before fitting my model and predicting accuracy. I am not sure why the below code is not able to help. All NLTK and associated libraries have already been installed.</p>
  
  <pre><code>import nltk
  nltk.download()
  
  from nltk.stem.snowball import SnowballStemmer
  stemmer = SnowballStemmer('german', ignore_stopwords=True)
  
  
  class StemmedCountVectorizer(CountVectorizer):
  
          def build_analyzer(self):
          analyzer = super(StemmedCountVectorizer, self).build_analyzer()
          return lambda doc: [stemmer.stem(w) for w in analyzer(doc)]
  
  
  stemmed_count_vect = StemmedCountVectorizer(stop_words='german')
  
  text_mnb_stemmed = Pipeline([('vect', stemmed_count_vect), ('tfidf',
                              TfidfTransformer()), ('mnb',
                              MultinomialNB(fit_prior=False))])
  
  text_mnb_stemmed = text_mnb_stemmed.fit(X, y)
  
  predicted_mnb_stemmed = text_mnb_stemmed.predict(X)
  
  np.mean(predicted_mnb_stemmed == y)
  </code></pre>