ikegami-yukino / oseti

Dictionary based Sentiment Analysis for Japanese
MIT License
91 stars 15 forks source link

Get RuntimeError with MeCab.Tagger #4

Closed JiaxiangBU closed 1 year ago

JiaxiangBU commented 3 years ago

Here is the error message.

import oseti
oseti.__version__
'0.2'
analyzer = oseti.Analyzer()
# 需要安装 MeCab
---------------------------------------------------------------------------

RuntimeError                              Traceback (most recent call last)

<ipython-input-29-ca5c71867aee> in <module>
----> 1 analyzer = oseti.Analyzer()
      2 # 需要安装 MeCab

d:\install\miniconda\lib\site-packages\oseti\oseti.py in __init__(self, mecab_args)
     18         self.word_dict = json.load(open(os.path.join(DICT_DIR, 'pn_noun.json')))
     19         self.wago_dict = json.load(open(os.path.join(DICT_DIR, 'pn_wago.json')))
---> 20         self.tagger = MeCab.Tagger(mecab_args)
     21         self.tagger.parse('')  # for avoiding bug
     22 

d:\install\miniconda\lib\site-packages\MeCab.py in __init__(self, *args)
    251 
    252     def __init__(self, *args):
--> 253         _MeCab.Tagger_swiginit(self, _MeCab.new_Tagger(*args))
    254 Tagger.parse = new_instancemethod(_MeCab.Tagger_parse, None, Tagger)
    255 Tagger.parseToNode = new_instancemethod(_MeCab.Tagger_parseToNode, None, Tagger)

RuntimeError: 
ikegami-yukino commented 1 year ago

@JiaxiangBU conda / Anaconda is not recommended to use MeCab.