aufd34
aufd34

Reputation: 77

Sentiment anaysis using Harvard IV-4 dictionary

I was trying to compute the sentiment using Harvard IV-4dictionary. I installed the "pysentiment" successfully. I run the following:

import pysentiment as ps
hiv4 = ps.HIV4()
tokens = hiv4.tokenize(text)  
score = hiv4.get_score(tokens)

and I got the following error:

 Traceback (most recent call last):
  File "C:/Users/df/Desk Top/Finalazed/punctuation.py", line 274, in <module>
    hiv4 = ps.HIV4()
  File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\base.py", line 55, in __init__
    self._tokenizer = Tokenizer()
  File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\utils.py", line 36, in __init__
    self._stopset = self.get_stopset()
  File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\utils.py", line 52, in get_stopset
    fin = open('%s/%s'%(STATIC_PATH, f), 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\df\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\pysentiment\\static/Currencies.txt'

Could any body tell why I am getting this? Thanks.

Upvotes: 0

Views: 1160

Answers (1)

usmani
usmani

Reputation: 26

Do copy pysentiment folder in the given path. Actually pysentiment folder doesnt contain static sub folder. You can check it by diplaying hidden folder "local".

Upvotes: 1

Related Questions