# Question about TF-IDF in RASA

**URL:** <https://forum.rasa.com/t/question-about-tf-idf-in-rasa/44961>\
**Category:** Tutorials, Resources & Videos\
**Created:** [June 23, 2021, 11:49am UTC](https://forum.rasa.com/t/question-about-tf-idf-in-rasa/44961 "2021-06-23T11:49:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![magda](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@magda](https://forum.rasa.com/u/magda)\
**Post date:** [June 23, 2021, 11:49am UTC](https://forum.rasa.com/t/question-about-tf-idf-in-rasa/44961/1 "2021-06-23T11:49:30Z")

</div>

Hello,

I wanted to do a custom component for tf-idf vectorizer as is count vectorizer. I followed the CountVectorsFeaturizer code. However, when I set use\_idf to True I get the following error `ValueError: Input has n_features=1081 while the model has been trained with n_features=81`. When use\_idf is set to False everything works. I uploaded the code in [TF-IDF in RASA](https://gist.github.com/magdalini-anastasiadou/21011a4b389f98f3de071ea32fc3a006)

Thanks in advance
