susanli2016 / SMS-Message-Spam-Detector

A simple Flask API to detect spam or ham using Python and Sklearn
110 stars 90 forks source link

CountVectorizer: Vocabulary wasn't fitted #1

Open jabertuhin opened 5 years ago

jabertuhin commented 5 years ago

I was mainly reading your medium post. I tried to code accordingly but faced an error: "CountVectorizer: Vocabulary wasn't fitted". As I was using the saved model. You skipped the part that we also have to save the CountVectorizer's fitted vector. I resolved my issue by following this link -> https://stackoverflow.com/questions/45674411/load-pickle-file-for-counvectorizer It wiil be really helpful for others if you can update your project or I can do a pull request.

Himanshu081 commented 4 years ago

hey man please help . i am not able to solve this issue. i tried everything,searched everywhere,plese help

jabertuhin commented 4 years ago

Hi @Himanshu081, You can visit my repo for this - https://github.com/jabertuhin/sms-spam-detector-webapp I worked on this project quite a time ago. So, if you can manage to understand my solution from the code I shared, it will be great. Otherwise share you doubts, I will try to explain those to you later.

Himanshu081 commented 4 years ago

Very much appreciated man . Thanks a lot. I will post if any error occurs. Again thanks man for helping.