BUPTLdy / Sentiment-Analysis

Chinese Shopping Reviews sentiment analysis
http://buptldy.github.io/2016/07/20/2016-07-20-sentiment%20analysis/
351 stars 168 forks source link

文章很棒,但是自己LSTM跑的结果好像不对哦 #1

Closed soledada closed 8 years ago

soledada commented 8 years ago

SVM is ok:

D:\program\Sentiment-Analysis-master>python predict.py svm 酒店的环境不错,空间挺大的 Using Theano backend. Building prefix dict from the default dictionary ... Loading model from cache c:\users\v-\appdata\local\temp\jieba.cache Loading model cost 0.314 seconds. Prefix dict has been built succesfully. 酒店的环境不错,空间挺大的 positive

D:\program\Sentiment-Analysis-master>python predict.py svm 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 Using Theano backend. Building prefix dict from the default dictionary ... Loading model from cache c:\users\v-\appdata\local\temp\jieba.cache Loading model cost 0.317 seconds. Prefix dict has been built succesfully. 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 negative

get the wrong result with LSTM:

D:\program\Sentiment-Analysis-master>python predict.py lstm 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 Using Theano backend. loading model...... loading weights...... Building prefix dict from the default dictionary ... Loading model from cache c:\users\v-\appdata\local\temp\jieba.cache Loading model cost 0.319 seconds. Prefix dict has been built succesfully. 1/1 [==============================] - 0s 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 positive

D:\program\Sentiment-Analysis-master>python predict.py lstm 酒店的环境不错,空间挺大的 Using Theano backend. loading model...... loading weights...... Building prefix dict from the default dictionary ... Loading model from cache c:\users\v-\appdata\local\temp\jieba.cache Loading model cost 0.324 seconds. Prefix dict has been built succesfully. 1/1 [==============================] - 0s 酒店的环境不错,空间挺大的 negative

BUPTLdy commented 8 years ago

@soledada ~/Sentiment Analysis$ python predict.py lstm 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 Using Theano backend. loading model...... loading weights...... Building prefix dict from the default dictionary ... Loading model from cache /tmp/jieba.cache Loading model cost 0.299 seconds. Prefix dict has been built succesfully. 1/1 [==============================] - 0s 电脑散热太差,偶尔还蓝屏,送货也太慢了吧 negative ~/Sentiment Analysis$ python predict.py lstm 酒店的环境不错,空间挺大的 Using Theano backend. loading model...... loading weights...... Building prefix dict from the default dictionary ... Loading model from cache /tmp/jieba.cache Loading model cost 0.299 seconds. Prefix dict has been built succesfully. 1/1 [==============================] - 0s 酒店的环境不错,空间挺大的 positive

自己跑了下没错呀,注意到你是在windows下跑的,其中导入训练好的模型文件使用的是linux下的文件路径。

soledada commented 8 years ago

我修改了一下路径,还是有问题。但是训练了一下就好像都是对的了。 感谢作者