# Can I add list of stops words in CountVectorsFeaturizer.py file

**URL:** <https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671>\
**Category:** Rasa Open Source\
**Created:** [July 29, 2019, 10:28am UTC](https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671 "2019-07-29T10:28:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prithvini04](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@prithvini04](https://forum.rasa.com/u/prithvini04)\
**Post date:** [July 29, 2019, 10:28am UTC](https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671/1 "2019-07-29T10:28:50Z")

</div>

Can I add list of spacy’s stopwords in the predefined CountVectorsFeaturizer.py file like this:

self.stop\_words = self.component\_config[‘stop\_words’]

```
    spacy_stopwords = spacy.lang.en.stop_words.STOP_WORDS

    spacystopwords=[]

    for i in spacy_stopwords:

        spacystopwords.append(i)

    self.stop_words = spacystopwords

    for stopword in self.stop_words:

        print("printing the stop words",stopword)
```

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [July 30, 2019, 9:52am UTC](https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671/2 "2019-07-30T09:52:02Z")

</div>

you can pass in stop words to the `CountVectorizer` class [sklearn.feature\_extraction.text.CountVectorizer — scikit-learn 0.21.3 documentation](https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html)

---

<div class="post-metadata">

**Author:** ![Lindafr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lindafr/32/15978_2.png) [@Lindafr](https://forum.rasa.com/u/Lindafr)\
**Post date:** [February 9, 2022, 2:54pm UTC](https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671/3 "2022-02-09T14:54:59Z")

</div>

Hi, Alan!

Can I somehow add a stopwords list file in a separate file in the bot’s folder and then refer to it in the config file instead of putting the whole list into the config file?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [February 9, 2022, 3:57pm UTC](https://forum.rasa.com/t/can-i-add-list-of-stops-words-in-countvectorsfeaturizer-py-file/13671/4 "2022-02-09T15:57:38Z")

</div>

that’s not a feature we support out of the box, but you could create a [custom component](https://rasa.com/docs/rasa/next/custom-graph-components/) to load the list from a file! The easiest way might be to subclass the [CountVectorizer](https://github.com/RasaHQ/rasa/blob/main/rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py)
