isnowfy / snownlp

Python library for processing Chinese text
MIT License
6.45k stars 1.37k forks source link

情感模型训练模型不生效 #74

Closed dockersky closed 7 years ago

dockersky commented 7 years ago

from snownlp import sentiment sentiment.train('neg.txt', 'pos.txt') sentiment.save('sentiment.marshal4') 生成一个sentiment.marshal4.3的文件,在snownlp\sentiment目录中进行.重命名后替换成.marshal, 替换neg和pos文件,但是分数和默认还是一样的。求教哪里的问题。

isnowfy commented 7 years ago

确认下是不是用的python3,python3要替换3的那个文件,然后还要看目录替换的对不对,是下载使用的还是pip之类的安装的,pip安装的需要在相应的安装目录替换才可以

ajoeajoe commented 6 years ago

python 3 替换3的那个文件,但你里面的代码却是data_path = os.path.join(os.path.dirname(os.path.abspath(file)), 'sentiment.marshal'),调用.marshal的文件,请问里面代码也要替换成data_path = os.path.join(os.path.dirname(os.path.abspath(file)), 'sentiment.marshal.3')吗