Computer Science ›› 2020, Vol. 47 ›› Issue (1): 186-192.doi: 10.11896/jsjkx.181002011

• Artificial Intelligence • Previous Articles     Next Articles

Comment Sentiment Analysis and Sentiment Words Detection Based on Attention Mechanism

LI Yuan,LI Zhi-xing,TENG Lei,WANG Hua-ming,WANG Guo-yin   

  1. (Chongqing Key Lab of Computation Intelligence,Chongqing 400065,China)
  • Received:2018-10-31 Published:2020-01-19
  • About author:LI Yuan,born in 1992,master.Her main research interests include deep learning and network security;WANG Guo-yin,born in 1970,Ph.D,professor,Ph.D supervisor.His main research interests include rough set,granular computing,data mining and machine learning.
  • Supported by:
    This work was supported by the National Key R&D Program of China (2017YFB0802300),National Natural Science Foundation of China (61502066) and Chongqing Basic and Frontier Research Project (cstc2015jcyjA40018).

Abstract: Comment sentiment analysis is one of the research hotspots in user generated content field.Because of the diversity of comment objects and the casualness of commentators’ language,comment sentiment analysis has become a challenging issue.The existing methods mainly calculate the emotional polarity of comments by pre-building the emotional vocabulary.However,these methods cannot adapt to the problem that the same words have different emotional polarities in different contexts.To overcome this problem,the attention based convolutional-recurrent neural network (A-CRNN) model was proposed to model the emotional polarity of comments and words in different contexts.By combining the context of words in sentences,the proposed method can focus attention on a small scale around the main emotional words.The A-CRNN model calculates the emotional polarity of the words through an adaptive method,which improves the accuracy of words’ emotional polarity judgment and the accuracy of short texts’ emotional polarity.Compared with CRNN,CNN and emotional dictionary methods,the proposed method achieves better results in Chinese dataset induding Meituan Review,Party Building Review and English dataset including Amazon Product Review.

Key words: Emotional analysis, Attention mechanism, Convolutional-recurrent neural network, Multi-granularity

CLC Number: 

  • TP391
[1]LIU C Y,RAN Q.Attitudinal Resources in Customers' Remarks in CSC and Their Impacts on Potential Customers’ Purchase Decisions[J].Journal of University of Science and Technology Beijing(Social Sciences Edition),2017,6(33):1-7.
[2]JHA V,SAVITHA R,SHENOY P D,et al.A novel sentiment aware dictionary for multi-domain sentiment classification[J].Computers & Electrical Engineering,2018,69:585-597.
[3]LIU F,WEI F,YU K,et al.Sentiment Classification of Reviews on Automobile Websites by Combining Word2Vec and Depen-dency Parsing[C]∥Proceedings of the International Conference on Smart Computing and Communication.Springer,Cham,2017:206-221.
[4]TRIPATHY A,RATH S K.Classification of sentiment of re- views using supervised machine learning techniques[J].International Journal of Rough Sets and Data Analysis (IJRSDA),2017,4(1):56-74.
[5]MANEK A S,SHENOY P D,MOHAN M C,et al.Aspect term extraction for sentiment analysis in large movie reviews using Gini Index feature selection method and SVM classifier[J].World Wide Web,2017,20(2):135-154.
[6]YORDANOVA S,KABAKCHIEVA D.Sentiment Classification of Hotel Reviews in Social Media with Decision Tree Learning[J].International Journal of Computer Applications,2017,158(5):0975-8887.
[7]TRIPATHI G,NAGANNA S.Feature selection and classification approach for sentiment analysis[J].Machine Learning and Applications:An International Journal,2015,2(2):1-16.
[8]BILAL M,ISRAR H,SHAHID M,et al.Sentiment classification of Roman-Urdu opinions using Naïve Bayesian,Decision Tree and KNN classification techniques[J].Journal of King Saud University-Computer and Information Sciences,2016,28(3):330-344.
[9]LI N,ZHAI S,ZHANG Z,et al.Structural Correspondence Learning for Cross-Lingual Sentiment Classification with One-to-Many Mappings[C]∥Thirty-First AAAI Conference on Artificial Intelligence.San Francisco,USA,2017:3490-3496.
[10]GEHRING J,AULI M,GRANGIER D,et al.Convolutional Sequence to Sequence Learning[C]∥Proceedings of the International Conference on Machine Learning.Sydney,NSW,2017:1243-1252.
[11]HE H,GIMPEL K,LIN J.Multi-perspective sentence similarity modeling with convolutionalneural networks[C]∥Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing.Doha,Qatar,2015:1576-1586.
[12]ZENG D,LIU K,CHEN Y,et al.Distant supervision for relation extraction via piecewise convolutional neural networks[C]∥Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing.Doha,Qatar,2015:1753-1762.
[13]KIM Y.Convolutional Neural Networks for Sentence Classification[C]∥Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP).Doha,Qatar,2014:1746-1751.
[14]ZHANG Y,WALLACE B.A Sensitivity Analysis of (and Practitioners’ Guide to) Convolutional Neural Networks for Sentence Classification[C]∥Proceedings of the Eighth Internatio-nal Joint Conference on Natural Language Processing.Taipei,China,2017,1:253-263.
[15]ZHANG X,ZHAO J,LECUN Y.Character-level convolutional networks for text classification[C]∥ Processing of the 2015 Neural Information Processing Systems.San Diego,USA,Neural Information Processing Systems Foundation,2015:649-657.
[16]CONNEAU A,SCHWENK H,BARRAULT L,et al.Very deep convolutional networks for text classification[C]∥ Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics.Valencia,Spain:Association for Computational Linguistics,2017:1107-1116.
[17]GUO H.A Deep Network with Visual Text Composition Beha- vior[C]∥Proceedings of the 55th Annual Meeting of the Asso-ciation for Computational Linguistics.Vancouver,Canada,2017,2:372-377.
[18]LI J,LI H.Research on Product Feature Extraction and Sentiment Classification of Short Online Review Based on Deep Learning[J].Information Studies:Theory & Application,2018,2:26.
[19]XU Y Y.Research of Sentence-Level Sentiment Classification for Text Based on Deep Neural Network[D].Shenzhen:Shenzhen University,2016.
[20]MIKOLOV T,CHEN K,CORRADO G,et al.Efficient estimation of word representations in vector space[C]∥ Proceedings of the International Conference on Learning Representations.Scottsdale,Arizona,2013:1-12.
[21]MCAULEY J J,LESKOVEC J.From amateurs to connoisseurs:modeling the evolution of user expertise through online reviews
[C]∥Proceedings of the 22nd International Conference on World Wide Web.Rio de Janeiro,Brazil:Association for Computing Machinery,2013:897-908.
[22]KRAUS M,FEUERRIEGEL S.Sentiment analysis based on rhetorical structure theory:Learning deep neural networks from discourse trees[J].Expert Systems with Applications,2019,118:65-79.
[23]JOSHI A,JAIN P,BHATTACHARYYA P,et al.Who would have thought of that!:A Hierarchical Topic Model for Extraction of Sarcasm-prevalent Topics and Sarcasm Detection[C]∥Proceedings of the Workshop on Extra-Propositional Aspects of Meaning in Computational Linguistics (ExProM).2016:1-10.
[24]WANG X,JIANG W,LUO Z.Combination of convolutional and recurrent neural network for sentiment analysis of short texts[C]∥Proceedings of the 26th International Conference on Computational Linguistics.Osaka,Japan:Association for Computational Linguistics,2016:2428-2437.
[25]KIM Y.Convolutional neural networks for sentence classification[C]∥ Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP).Doha,Qatar:Association for Computational Linguistics,2014:1746-1751.
[1] ZHAO Jia-qi, WANG Han-zheng, ZHOU Yong, ZHANG Di, ZHOU Zi-yuan. Remote Sensing Image Description Generation Method Based on Attention and Multi-scale Feature Enhancement [J]. Computer Science, 2021, 48(1): 190-196.
[2] LIU Yang, JIN Zhong. Fine-grained Image Recognition Method Combining with Non-local and Multi-region Attention Mechanism [J]. Computer Science, 2021, 48(1): 197-203.
[3] WANG Rui-ping, JIA Zhen, LIU Chang, CHEN Ze-wei, LI Tian-rui. Deep Interest Factorization Machine Network Based on DeepFM [J]. Computer Science, 2021, 48(1): 226-232.
[4] WANG Run-zheng, GAO Jian, HUANG Shu-hua, TONG Xin. Malicious Code Family Detection Method Based on Knowledge Distillation [J]. Computer Science, 2021, 48(1): 280-286.
[5] PAN Zu-jiang, LIU Ning, ZHANG Wei, WANG Jian-yong. MTHAM:Multitask Disease Progression Modeling Based on Hierarchical Attention Mechanism [J]. Computer Science, 2020, 47(9): 185-189.
[6] ZHAO Wei, LIN Yu-ming, WANG Chao-qiang, CAI Guo-yong. Opinion Word-pairs Collaborative Extraction Based on Dependency Relation Analysis [J]. Computer Science, 2020, 47(8): 164-170.
[7] YUAN Ye, HE Xiao-ge, ZHU Ding-kun, WANG Fu-lee, XIE Hao-ran, WANG Jun, WEI Ming-qiang, GUO Yan-wen. Survey of Visual Image Saliency Detection [J]. Computer Science, 2020, 47(7): 84-91.
[8] LIU Yan, WEN Jing. Complex Scene Text Detection Based on Attention Mechanism [J]. Computer Science, 2020, 47(7): 135-140.
[9] YU Yi-lin, TIAN Hong-tao, GAO Jian-wei and WAN Huai-yu. Relation Extraction Method Combining Encyclopedia Knowledge and Sentence Semantic Features [J]. Computer Science, 2020, 47(6A): 40-44.
[10] NI Hai-qing, LIU Dan, SHI Meng-yu. Chinese Short Text Summarization Generation Model Based on Semantic-aware [J]. Computer Science, 2020, 47(6): 74-78.
[11] HUANG Yong-tao, YAN Hua. Scene Graph Generation Model Combining Attention Mechanism and Feature Fusion [J]. Computer Science, 2020, 47(6): 133-137.
[12] ZHANG Zhi-yang, ZHANG Feng-li, CHEN Xue-qin, WANG Rui-jin. Information Cascade Prediction Model Based on Hierarchical Attention [J]. Computer Science, 2020, 47(6): 201-209.
[13] DENG Yi-jiao, ZHANG Feng-li, CHEN Xue-qin, AI Qing, YU Su-zhe. Collaborative Attention Network Model for Cross-modal Retrieval [J]. Computer Science, 2020, 47(4): 54-59.
[14] ZHANG Peng-fei, LI Guan-yu, JIA Cai-yan. Truncated Gaussian Distance-based Self-attention Mechanism for Natural Language Inference [J]. Computer Science, 2020, 47(4): 178-183.
[15] XU Yuan-yin,CHAI Yu-mei,WANG Li-ming,LIU Zhen. Emotional Sentence Classification Method Based on OCC Model and Bayesian Network [J]. Computer Science, 2020, 47(3): 222-230.
Full text



[1] LEI Li-hui and WANG Jing. Parallelization of LTL Model Checking Based on Possibility Measure[J]. Computer Science, 2018, 45(4): 71 -75 .
[2] SUN Qi, JIN Yan, HE Kun and XU Ling-xuan. Hybrid Evolutionary Algorithm for Solving Mixed Capacitated General Routing Problem[J]. Computer Science, 2018, 45(4): 76 -82 .
[3] ZHANG Jia-nan and XIAO Ming-yu. Approximation Algorithm for Weighted Mixed Domination Problem[J]. Computer Science, 2018, 45(4): 83 -88 .
[4] WU Jian-hui, HUANG Zhong-xiang, LI Wu, WU Jian-hui, PENG Xin and ZHANG Sheng. Robustness Optimization of Sequence Decision in Urban Road Construction[J]. Computer Science, 2018, 45(4): 89 -93 .
[5] SHI Wen-jun, WU Ji-gang and LUO Yu-chun. Fast and Efficient Scheduling Algorithms for Mobile Cloud Offloading[J]. Computer Science, 2018, 45(4): 94 -99 .
[6] ZHOU Yan-ping and YE Qiao-lin. L1-norm Distance Based Least Squares Twin Support Vector Machine[J]. Computer Science, 2018, 45(4): 100 -105 .
[7] LIU Bo-yi, TANG Xiang-yan and CHENG Jie-ren. Recognition Method for Corn Borer Based on Templates Matching in Muliple Growth Periods[J]. Computer Science, 2018, 45(4): 106 -111 .
[8] GENG Hai-jun, SHI Xin-gang, WANG Zhi-liang, YIN Xia and YIN Shao-ping. Energy-efficient Intra-domain Routing Algorithm Based on Directed Acyclic Graph[J]. Computer Science, 2018, 45(4): 112 -116 .
[9] CUI Qiong, LI Jian-hua, WANG Hong and NAN Ming-li. Resilience Analysis Model of Networked Command Information System Based on Node Repairability[J]. Computer Science, 2018, 45(4): 117 -121 .
[10] WANG Zhen-chao, HOU Huan-huan and LIAN Rui. Path Optimization Scheme for Restraining Degree of Disorder in CMT[J]. Computer Science, 2018, 45(4): 122 -125 .