sentiment_classifier
sentiment_classifier copied to clipboard
ModuleNotFoundError: No module named 'collections\r'
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_29176/1367208207.py in <module>
----> 1 from senti_classifier import senti_classifier
C:\Project_Files\Anaconda3\lib\site-packages\senti_classifier\senti_classifier.py in <module>
227 senti_pickle = resource_stream('senti_classifier', 'data/SentiWn.p')
228 bag_of_words_pickle = resource_stream('senti_classifier', 'data/bag_of_words.p')
--> 229 synsets_scores = pickle.load(senti_pickle)
230 bag_of_words = pickle.load(bag_of_words_pickle)
231 bag_of_words = classify_polarity(bag_of_words)
ModuleNotFoundError: No module named 'collections\r'
I have tried pip install sentiment_classifier though pip install was successful, it didn't pull any files. So I referred to the Stack overflow post https://stackoverflow.com/questions/48521208/nltk-sentiment-classifier-issues-with-install and cloned GitHub repo and replaced the files into the senti_classifier folder. Now I get the above error .
Using Anaconda, Python 3.8, Windows 11
This was resolved in #13 . Looks like the version that you have is outdated. I'd suggest pulling the latest changes from master and giving it a try.
#18 has been merged. Please check if it is working as intended and then I guess we can go ahead and close this.
BTW, @kevincobain2000 if master is stable, maybe publish the changes on pip? It appears that the version on pip is quite old.
About publishing to pip https://github.com/kevincobain2000/sentiment_classifier/issues/10#issuecomment-330460863
It has been a while since I updated it to pip. Let me see if it works