Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All scores are (0,0) #1

Closed
ayushidalmia opened this issue Jan 21, 2015 · 8 comments
Closed

All scores are (0,0) #1

ayushidalmia opened this issue Jan 21, 2015 · 8 comments

Comments

@ayushidalmia
Copy link

Hi,

I have used senti_classifier before and it worked fine. However, I had reinstalled it and since then it is giving zero score for anything and everything. Can anyone please help?

@ayushidalmia
Copy link
Author

Attaching screenshot from here:

screenshot from 2015-01-21 20 57 31

@kevincobain2000
Copy link
Owner

Seems to me that it is not able to read the pickle of sentiwordnet. Thanks, will do over the weekend.
Anyways this library has some performance issues, so I have been thinking about rewriting much wiser on ruby and pack it into gem

@cyri113
Copy link

cyri113 commented Feb 17, 2015

Have you had a chance to look at what is causing this? Thanks!

@kevincobain2000
Copy link
Owner

Hi @ayushidalmia @cderche
Sorry guys, I had been busy. Its a dirty fix but for now the scores will cooperate !
Somehow I am not able to pickle the sentiwordnet like I was able to before. I have created a new issue for that and, will fix it (

# Fix me: TypeError: can't pickle instancemethod objects
# Not able to dump the pickle somehow. http://stackoverflow.com/questions/16439301/cant-pickle-defaultdict
# pickle.dump(synsets_scores, open(pickles[0],'wb'))
#
# Temporary Fix, just don't pickle them (it takes long time ! its better to pickle)
) soon to boost up the performance. #2

runs the code     print classify( ["The movie was the worst movie"], synsets_scores, bag_of_words)
03/31/15 @ 9:40PM - kevincobain2000@Mac Air 

~/Downloads/sentiment_classifier/src/senti_classifier@master* python senti_classifier.py -p data/SentiWordNet_3.0.0_20130122.txt
(0, 0.875)

PS: Although I have pushed the latest version of SentiWordNet 8a44b86, you can download it yourself too

@kevincobain2000
Copy link
Owner

@ayushidalmia #1 and #2 Fixed ! 13c6ac4#diff-a7113eea41266357d694a46205cd66e2R187

  • Download the zip from github
  • reinstall it
03/31/15 @11:21PM - kevincobain2000@Mac Air ~/Downloads/sentiment_classifier@master* sudo python setup.py install
...
...
Using /Library/Python/2.7/site-packages
Finished processing dependencies for sentiment-classifier==0.5

03/31/15 @11:21PM - kevincobain2000@Mac Air ~/Downloads/sentiment_classifier@master* python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from senti_classifier import senti_classifier
>>> sentences = ['The movie was the worst movie', 'It was the worst acting by the actors']
>>> pos_score, neg_score = senti_classifier.polarity_scores(sentences)
>>> print pos_score, neg_score
0.0 1.7

@ayushidalmia
Copy link
Author

Cool! Will try it out in sometime.

@prasadpande1990
Copy link

@ayushidalmia Can you confirm if it is working?

@nishant2295
Copy link

How do i train the classifier with my reviews??
Can anyone help me with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants