book icon indicating copy to clipboard operation
book copied to clipboard

情感分析的问题

Open daming-lu opened this issue 8 years ago • 5 comments

我就做了一个小实验。就是用 one word 来做训练和预测。训练集采用 1905 个正面面词汇和 4658 个负面词汇(如附件所示)。训练过后用5+/5- 的词汇来预测。居然结果是同一个。。。参看 output_log.txt。 我觉得情感分析这一章的模型可能有问题。要么是模型搭建有错,更有可能的是Paddle本身的计算有bug。能不能请Paddle的工程师们,先尝试复现一下 情感分析这章的demo程序,预测用例就用10个训练集里面的review就好,看看能不能达到 Paddle report 的精度。比如Paddle Acc 0.82, 那么10个review应该能对8个左右。

多谢啦!

daming-lu avatar Jul 30 '18 17:07 daming-lu

收到,能否请 @chenwhql 先跑一下这个demo,看教程里的例子是否正常

kuke avatar Jul 31 '18 01:07 kuke

@kuke 收到

chenwhql avatar Jul 31 '18 01:07 chenwhql

@kuke 先用大明老师之前Demo里用过的5+/5- review string跑了一下,相比book里的demo只增加了预测的string,未做其他更改,结果如下:

review string:5+/5-
        'read the book forget the movie', //P
        'this is a great movie', //P
        'this is very bad', //N
        'the movie makes me sick', //N
        'you can never find a worse movie', //N
        'what a masterpiece', //P
        'it deserves any compliment', //P
        'no movie this year could be better than this one', //P
        'i would rather die', //N
        'the movie should be burned in hell' //N

train_conv.py: 结果:正确预测7个,错误3个

Step 190, Test Loss 0.28, Acc 0.88
Step 190, Epoch 0 Metrics [array([0.251721], dtype=float32), array([0.90625], dtype=float32)]
' read the book forget the movie ' positive:  0.2078994 negative:  0.79210055 
' this is a great movie ' positive:  0.91647774 negative:  0.0835222
' this is very bad ' positive:  0.3105783 negative:  0.68942165
' the movie makes me sick ' positive:  0.79974574 negative:  0.2002543   //Wrong
' you can never find a worse movie ' positive:  0.2696897 negative:  0.7303103
' what a masterpiece ' positive:  0.8835558 negative:  0.116444126
' it deserves any compliment ' positive:  0.48034698 negative:  0.519653  //Wrong
' no movie this year could be better than this one ' positive:  0.08220842 negative:  0.9177916  //Wrong
' i would rather die ' positive:  0.31091785 negative:  0.6890821
' the movie should be burned in hell ' positive:  0.21100903 negative:  0.788991

train_stacked_lstm.py: 结果:正确预测5个,错误5个

Step 190, Test Loss 0.32, Acc 0.86
Step 190, Epoch 0 Metrics [array([0.38115355], dtype=float32), array([0.78125], dtype=float32)]
positive:  0.56123847 negative:  0.4387615 ' read the book forget the movie '  // Wrong
positive:  0.824478 negative:  0.17552203 ' this is a great movie '
positive:  0.41358012 negative:  0.5864198 ' this is very bad '
positive:  0.7313388 negative:  0.26866126 ' the movie makes me sick ' //Wrong
positive:  0.23465317 negative:  0.76534677 ' you can never find a worse movie '
positive:  0.81831825 negative:  0.18168177 ' what a masterpiece '
positive:  0.5425726 negative:  0.4574274 ' it deserves any compliment '
positive:  0.29176933 negative:  0.7082306 ' no movie this year could be better than this one '  //Wrong
positive:  0.5571364 negative:  0.44286355 ' i would rather die ' //Wrong
positive:  0.5362198 negative:  0.46378028 ' the movie should be burned in hell ' //Wrong

chenwhql avatar Jul 31 '18 06:07 chenwhql

@daming-lu 可否把你用的测试数据提供给我们,用教程中的例子跑出来的结果看起来还合理

kuke avatar Jul 31 '18 09:07 kuke

长期没有后续回复,先关闭,如果有问题可以Reopen

chenwhql avatar Jan 08 '20 12:01 chenwhql