使用哈佛 IV-4 字典进行情感分析

Sentiment anaysis using Harvard IV-4 dictionary

我正在尝试使用哈佛 IV-4 词典来计算情绪。 我成功安装了 "pysentiment"。 我 运行 以下内容:

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

我收到以下错误:

 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'

任何人都可以告诉我为什么得到这个吗?谢谢

复制给定路径中的 pysentiment 文件夹。实际上 pysentiment 文件夹不包含静态子文件夹。您可以通过显示隐藏文件夹"local".

来查看它