Please wait a minute...
Advanced Search
数据分析与知识发现  2024, Vol. 8 Issue (6): 69-81     https://doi.org/10.11925/infotech.2096-3467.2023.0319
  研究论文 本期目录 | 过刊浏览 | 高级检索 |
基于有监督对比学习的文本情感语义优化方法研究*
熊曙初1,2,李轩1(),吴佳妮1,周赵宏1,孟晗2
1湖南工商大学计算机学院 长沙 410205
2湖南工商大学前沿交叉学院 长沙 410205
Research on Text Sentiment Semantic Optimization Method Based on Supervised Contrastive Learning
Xiong Shuchu1,2,Li Xuan1(),Wu Jiani1,Zhou Zhaohong1,Meng Han2
1School of Computer Science, Hunan University of Technology and Business,Changsha 410205, China
2School of Frontier Crossover Studies, Hunan University of Technology and Business,Changsha 410205, China
全文: PDF (1355 KB)   HTML ( 6
输出: BibTeX | EndNote (RIS)      
摘要 

【目的】解决因中文独特表达与词义变迁现象导致的文本特征抽取偏移与模糊语义分离困难等问题。【方法】提出一种有监督对比学习语义优化方法。首先使用预训练模型生成语义向量;其次设计有监督联合自监督方法构造对比样本对;最后构建有监督对比损失进行语义空间度量与优化。【结果】在ChnSentiCorp数据集上,经所提方法优化后的5种主流神经网络模型F1值分别实现了2.77~3.82个百分点的提升。【局限】受限于硬件资源,未构建数量更大的对比学习样本对。【结论】语义优化方法可以有效解决特征抽取偏移与模糊语义分离困难等问题,为文本情感分析任务提供新的研究思路。

服务
把本文推荐给朋友
加入引用管理器
E-mail Alert
RSS
作者相关文章
熊曙初
李轩
吴佳妮
周赵宏
孟晗
关键词 文本情感分析有监督学习对比学习表示学习语义空间优化    
Abstract

[Objective] This study aims to solve problems such as text feature extraction bias and difficult separation of ambiguous semantics caused by the unique expressions and semantic drift phenomenon in Chinese. [Methods] This paper proposes a supervised contrastive learning semantic optimization method, which first uses a pre-trained model to generate semantic vectors, then designs a supervised joint self-supervised method to construct contrastive sample pairs, and finally constructs a supervised contrastive loss for semantic space measurement and optimization. [Results] On the ChnSentiCorp dataset, the five mainstream neural network models optimized by this method achieved F1 value improvements of 2.77%-3.82%. [Limitations] Due to limited hardware resources, a larger number of contrastive learning sample pairs were not constructed. [Conclusions] The semantic optimization method can effectively solve problems such as text feature extraction bias and difficult separation of ambiguous semantics, and provide new research ideas for text sentiment analysis tasks.

Key wordsText Sentiment Analysis    Supervised Learning    Contrastive Learning    Representation Learning    Semantic Space Optimization
收稿日期: 2023-04-11      出版日期: 2024-04-18
ZTFLH:  TP391  
  G350  
基金资助:*国家社会科学基金项目(21BTQ088)
通讯作者: 李轩,ORCID:0000-0001-9926-3860,E-mail:lixuan1005@foxmail.com。   
引用本文:   
熊曙初, 李轩, 吴佳妮, 周赵宏, 孟晗. 基于有监督对比学习的文本情感语义优化方法研究*[J]. 数据分析与知识发现, 2024, 8(6): 69-81.
Xiong Shuchu, Li Xuan, Wu Jiani, Zhou Zhaohong, Meng Han. Research on Text Sentiment Semantic Optimization Method Based on Supervised Contrastive Learning. Data Analysis and Knowledge Discovery, 2024, 8(6): 69-81.
链接本文:  
https://manu44.magtech.com.cn/Jwk_infotech_wk3/CN/10.11925/infotech.2096-3467.2023.0319      或      https://manu44.magtech.com.cn/Jwk_infotech_wk3/CN/Y2024/V8/I6/69
Fig.1  有监督对比学习语义优化研究框架
Fig.2  有监督对比学习文本情感语义优化方法
text label
我今天真的很开心。 1
栓Q!这本书不好看! 0
Table 1  文本情感标注示例
Fig.3  BERT模型编码部分结构
数据集 样本数
训练集 9 600
验证集 1 200
测试集 1 200
Table 2  数据集划分情况
数据集 积极 消极
训练集 4 799 4 801
验证集 593 607
测试集 608 592
Table 3  文本标签信息
参数名称 参数值
预训练模型层数 12
预训练模型隐藏层大小 768
Batch Size 4
评估步长 500
样本数量 9 600
批量大小 4
训练轮次 5
学习率 1e-5
温度系数 τ 0.05
Table 4  实验1参数设置
Fig.4  向量空间优化损失
参数名称 参数值
预训练模型层数 12
预训练模型隐藏层大小 768
MLP网络层数 1
MLP隐藏层大小 768
评估步长 30
训练样本数量 9 600
验证样本数量 1 200
测试样本数量 1 200
Batch Size 64
Table 5  实验2参数设置
Fig.5  情感分析模型训练损失
训练轮数 未优化模型准确率/% 已优化模型准确率/%
1 77.67 94.25
2 80.67 94.42
3 80.00 94.42
Table6  训练时分类准确率
模型 准确率/%
未优化模型 79.93
已优化模型 94.17
Table7  训练后分类准确率
参数名称 参数值
预训练模型层数 12
预训练模型隐藏层大小 768
MLP网络层数 1
TextCNN卷积核大小 2,3,4
LSTM网络层数 1
LSTM隐藏层大小 200
BiLSTM网络层数 1
BiLSTM隐藏层大小 200
GRU网络层数 1
GRU隐藏层大小 200
Batch Size 64
Table 8  实验3参数设置
神经网络模型 精确率 召回率 F1值
优化前/% 提升值/百分点 优化前/% 提升值/百分点 优化前/% 提升值/百分点
BERT-TextCNN 90.58 4.00 91.94 2.46 90.82 3.82
BERT-LSTM 91.16 3.42 92.59 1.65 91.39 3.24
BERT-BiLSTM 91.50 3.08 92.76 1.65 91.70 2.94
BERT-MLP 91.66 2.92 92.92 1.32 91.86 2.77
BERT-GRU 91.66 3.01 93.42 0.99 91.90 2.82
Table 9  评价指标提升效果
Fig.6  各类神经网络模型训练损失对比
[1] 中国互联网络信息中心. 第53次中国互联网络发展状况统计报告[R]. 2023.
[1] (CNNIC. The 53th Statistical Report on China’s Internet Development[R]. 2023.)
[2] 王晰巍, 王小天, 李玥琪. 重大突发事件网络舆情UGC的事理图谱构建研究——以自然灾害7·20河南暴雨为例[J]. 图书情报工作, 2022, 66(16): 13-23.
doi: 10.13266/j.issn.0252-3116.2022.16.002
[2] (Wang Xiwei, Wang Xiaotian, Li Yueqi. Research on the Construction of the Event Evolution Graph of UGC of Network Public Opinions for Major Emergencies——Taking the Natural Disaster 7·20 Torrential Rain in Henan as an Example[J]. Library and Information Service, 2022, 66(16): 13-23.)
doi: 10.13266/j.issn.0252-3116.2022.16.002
[3] 徐月梅, 曹晗, 王文清, 等. 跨语言情感分析研究综述[J]. 数据分析与知识发现, 2023, 7(1): 1-21.
[3] (Xu Yuemei, Cao Han, Wang Wenqing, et al. Cross-Lingual Sentiment Analysis: A Survey[J]. Data Analysis and Knowledge Discovery, 2023, 7(1): 1-21.)
[4] 季陈, 叶慧雯, 王子民, 等. 基于BiLSTM-CapsNet混合模型的社交文本情感分析[J]. 南京理工大学学报, 2022, 46(2): 205-210.
[4] (Ji Chen, Ye Huiwen, Wang Zimin, et al. Social Text Sentiment Analysis Based on BiLSTM-CapsNet Hybrid Model[J]. Journal of Nanjing University of Science and Technology, 2022, 46(2): 205-210.)
[5] 杨青, 张亚文, 朱丽, 等. 基于注意力机制和BiGRU融合的文本情感分析[J]. 计算机科学, 2021, 48(11): 307-311.
doi: 10.11896/jsjkx.201000075
[5] (Yang Qing, Zhang Yawen, Zhu Li, et al. Text Sentiment Analysis Based on Fusion of Attention Mechanism and BiGRU[J]. Computer Science, 2021, 48(11): 307-311.)
doi: 10.11896/jsjkx.201000075
[6] 王颖洁, 朱久祺, 汪祖民, 等. 自然语言处理在文本情感分析领域应用综述[J]. 计算机应用, 2022, 42(4): 1011-1020.
doi: 10.11772/j.issn.1001-9081.2021071262
[6] (Wang Yingjie, Zhu Jiuqi, Wang Zumin, et al. Review of Applications of Natural Language Processing in Text Sentiment Analysis[J]. Journal of Computer Applications, 2022, 42(4): 1011-1020.)
doi: 10.11772/j.issn.1001-9081.2021071262
[7] Hearst M A. Direction-Based Text Interpretation as an Information Access Refinement[M]// Text-Based Intelligent Systems:Current Research and Practice in Information Extraction and Retrieval. Mahwah, NJ: Lawrence Erlbaum, 1992: 257-274.
[8] Turney P D. Thumbs Up or Thumbs Down? Semantic Orientation Applied to Unsupervised Classification of Reviews[OL]. arXiv Preprint, arXiv: cs/0212032.
[9] Asghar M Z, Khan A, Ahmad S, et al. Lexicon-Enhanced Sentiment Analysis Framework Using Rule-Based Classification Scheme[J]. PLoS One, 2017, 12(2): e0171649.
[10] 栗雨晴, 礼欣, 韩煦, 等. 基于双语词典的微博多类情感分析方法[J]. 电子学报, 2016, 44(9): 2068-2073.
doi: 10.3969/j.issn.0372-2112.2016.09.007
[10] (Li Yuqing, Li Xin, Han Xu, et al. A Bilingual Lexicon-Based Multi-class Semantic Orientation Analysis for Microblogs[J]. Acta Electronica Sinica, 2016, 44(9): 2068-2073.)
doi: 10.3969/j.issn.0372-2112.2016.09.007
[11] 马耀红. 基于机器学习的多粒度文本情感分类方法研究[D]. 武汉: 武汉大学, 2021.
[11] (Ma Yaohong. Multi-granular Text Sentiment Classification for Method Research Based on Machine Learning[D]. Wuhan: Wuhan University, 2021.)
[12] Pang B, Lee L, Vaithyanathan S. Thumbs Up? Sentiment Classification Using Machine Learning Techniques[OL]. arXiv Preprint, arXiv: cs/0205070.
[13] 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.
[14] 杨爽, 陈芬. 基于SVM多特征融合的微博情感多级分类研究[J]. 数据分析与知识发现, 2017, 1(2): 73-79.
[14] (Yang Shuang, Chen Fen. Analyzing Sentiments of Micro-blog Posts Based on Support Vector Machine[J]. Data Analysis and Knowledge Discovery, 2017, 1(2): 73-79.)
[15] 曾子明, 杨倩雯. 基于LDA和AdaBoost多特征组合的微博情感分析[J]. 数据分析与知识发现, 2018, 2(8): 51-59.
[15] (Zeng Ziming, Yang Qianwen. Sentiment Analysis for Micro-blogs with LDA and AdaBoost[J]. Data Analysis and Knowledge Discovery, 2018, 2(8): 51-59.)
[16] 施荣华, 金鑫, 胡超. 基于图注意力网络的方面级别文本情感分析[J]. 计算机工程, 2022, 48(2): 34-39.
doi: 10.19678/j.issn.1000-3428.0060517
[16] (Shi Ronghua, Jin Xin, Hu Chao. Aspect-Level Text Emotion Analysis Based on Graph Attention Network[J]. Computer Engineering, 2022, 48(2): 34-39.)
doi: 10.19678/j.issn.1000-3428.0060517
[17] 王婷, 杨文忠. 文本情感分析方法研究综述[J]. 计算机工程与应用, 2021, 57(12): 11-24.
doi: 10.3778/j.issn.1002-8331.2101-0022
[17] (Wang Ting, Yang Wenzhong. Review of Text Sentiment Analysis Methods[J]. Computer Engineering and Applications, 2021, 57(12): 11-24.)
doi: 10.3778/j.issn.1002-8331.2101-0022
[18] 滕飞, 郑超美, 李文. 基于长短期记忆多维主题情感倾向性分析模型[J]. 计算机应用, 2016, 36(8): 2252-2256.
doi: 10.11772/j.issn.1001-9081.2016.08.2252
[18] (Teng Fei, Zheng Chaomei, Li Wen. Multidimensional Topic Model for Oriented Sentiment Analysis Based on Long Short-Term Memory[J]. Journal of Computer Applications, 2016, 36(8): 2252-2256.)
doi: 10.11772/j.issn.1001-9081.2016.08.2252
[19] 张军, 张丽, 沈凡凡, 等. RoBERTa融合BiLSTM及注意力机制的隐式情感分析[J]. 计算机工程与应用, 2022, 58(23): 142-150.
doi: 10.3778/j.issn.1002-8331.2203-0505
[19] (Zhang Jun, Zhang Li, Shen Fanfan, et al. Implicit Sentiment Analysis Based on RoBERTa Fused with BiLSTM and Attention Mechanism[J]. Computer Engineering and Applications, 2022, 58(23): 142-150.)
doi: 10.3778/j.issn.1002-8331.2203-0505
[20] 张铭泉, 周辉, 曹锦纲. 基于注意力机制的双BERT有向情感文本分类研究[J]. 智能系统学报, 2022, 17(6): 1220-1227.
[20] (Zhang Mingquan, Zhou Hui, Cao Jingang. Dual BERT Directed Sentiment Text Classification Based on Attention Mechanism[J]. CAAI Transactions on Intelligent Systems, 2022, 17(6): 1220-1227.)
[21] 李希, 刘喜平, 李旺才, 等. 对比学习研究综述[J]. 小型微型计算机系统, 2023, 44(4): 787-797.
[21] (Li Xi, Liu Xiping, Li Wangcai, et al. Survey on Contrastive Learning Research[J]. Journal of Chinese Computer Systems, 2023, 44(4): 787-797.)
[22] Liu X, Zhang F J, Hou Z Y, et al. Self-Supervised Learning: Generative or Contrastive[J]. IEEE Transactions on Knowledge and Data Engineering, 2023, 35(1): 857-876.
[23] Chen T, Kornblith S, Norouzi M, et al. A Simple Framework for Contrastive Learning of Visual Representations[C]// Proceedings of the 37th International Conference on Machine Learning. 2020: 1597-1607.
[24] He K M, Fan H Q, Wu Y X, et al. Momentum Contrast for Unsupervised Visual Representation Learning[C]// Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 9726-9735.
[25] Chen T, Kornblith S, Swersky K, et al. Big Self-Supervised Models are Strong Semi-Supervised Learners[C]// Proceedings of the 34th Conference on Neural Information Processing Systems. 2020.
[26] Chen X L, He K M. Exploring Simple Siamese Representation Learning[C]// Proceedings of 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2021: 15745-15753.
[27] Wang D, Ding N, Li P J, et al. CLINE: Contrastive Learning with Semantic Negative Examples for Natural Language Understanding[OL]. arXiv Preprint, arXiv: 2107.00440.
[28] Gao T Y, Yao X C, Chen D Q. SimCSE: Simple Contrastive Learning of Sentence Embeddings[OL]. arXiv Preprint, arXiv: 2104.08821.
[29] Pan X, Wang M X, Wu L W, et al. Contrastive Learning for Many-to-Many Multilingual Neural Machine Translation[OL]. arXiv Preprint, arXiv: 2105.09501.
[30] Xiong L E, Xiong C Y, Li Y, et al. Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrieval[OL]. arXiv Preprint, arXiv: 2007.00808.
[31] Xu S S, Zhang X X, Wu Y, et al. Sequence Level Contrastive Learning for Text Summarization[C]// Proceedings of the 36th AAAI Conference on Artificial Intelligence. 2022: 11556-11565.
[32] Mao X L, Shan Y R, Li F F, et al. CLSpell: Contrastive Learning with Phonological and Visual Knowledge for Chinese Spelling Check[J]. Neurocomputing, 2023, 554: 126468.
[33] 郭东恩, 夏英, 罗小波, 等. 基于有监督对比学习的遥感图像场景分类[J]. 光子学报, 2021, 50(7): 0710002.
[33] (Guo Dongen, Xia Ying, Luo Xiaobo, et al. Remote Sensing Image Scene Classification Based on Supervised Contrastive Learning[J]. Acta Photonica Sinica, 2021, 50(7): 0710002.)
[34] Sedghamiz H, Raval S, Santus E, et al. SupCL-Seq: Supervised Contrastive Learning for Downstream Optimized Sequence Representations[OL]. arXiv Preprint, arXiv: 2109.07424.
[35] Mikolov T, Chen K, Corrado G, et al. Efficient Estimation of Word Representations in Vector Space[OL]. arXiv Preprint, arXiv: 1301.3781.
[36] Vaswani A, Shazeer N, Parmar N, et al. Attention is All You Need[C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. 2017: 6000-6010.
[37] Devlin J, Chang M W, Lee K, et al. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding[OL]. arXiv Preprint, arXiv: 1810.04805.
[1] 岳崇浩, 张剑, 吴义熔, 李小龙, 华晟, 童顺航, 孙水发. 基于融合多策略对比学习的中文医疗术语标准化研究*[J]. 数据分析与知识发现, 2024, 8(6): 144-157.
[2] 张岚泽, 赵晓亮, 刘津彤, 顾益军. 基于空间-邻域自适应的图卷积神经网络信贷欺诈检测模型*[J]. 数据分析与知识发现, 2024, 8(4): 137-151.
[3] 李婕, 张智雄, 王宇飞. 增加类簇级对比的SCCL文本深度聚类方法研究*[J]. 数据分析与知识发现, 2024, 8(3): 98-109.
[4] 李慧, 刘莎, 胡耀华, 孟玮. 融合异质网络与表示学习的科研合作预测方法研究*[J]. 数据分析与知识发现, 2023, 7(9): 78-88.
[5] 曹琨, 吴新年, 靳军宝, 郑玉荣, 付爽. 基于共词和Node2Vec表示学习的新兴技术识别方法*[J]. 数据分析与知识发现, 2023, 7(9): 89-99.
[6] 吴佳伦, 张若楠, 康武林, 袁普卫. 基于患者相似性分析的药物推荐深度学习模型研究*[J]. 数据分析与知识发现, 2023, 7(6): 148-160.
[7] 崔焕庆, 杨峻铸, 宋玮情. 基于相似特征和关系图优化的姓名消歧*[J]. 数据分析与知识发现, 2023, 7(5): 71-80.
[8] 周宁, 钟娜, 靳高雅, 刘斌. 基于混合词嵌入的双通道注意力网络中文文本情感分析*[J]. 数据分析与知识发现, 2023, 7(3): 58-68.
[9] 李合龙, 任昌松, 柳欣茹, 汪存华. 金融市场文本情绪研究综述*[J]. 数据分析与知识发现, 2023, 7(12): 22-39.
[10] 林哲, 陈平华. 基于块注意力机制和Involution的文本情感分析模型*[J]. 数据分析与知识发现, 2023, 7(11): 37-45.
[11] 邓启平, 陈卫静, 嵇灵, 张宇娥. 一种基于异质信息网络的学术文献作者重名消歧方法*[J]. 数据分析与知识发现, 2022, 6(4): 60-68.
[12] 陈文杰,文奕,杨宁. 基于节点向量表示的模糊重叠社区划分算法*[J]. 数据分析与知识发现, 2021, 5(5): 41-50.
[13] 韩普,张展鹏,张明淘,顾亮. 基于多特征融合的中文疾病名称归一化研究*[J]. 数据分析与知识发现, 2021, 5(5): 83-94.
[14] 张鑫,文奕,许海云. 一种融合表示学习与主题表征的作者合作预测模型*[J]. 数据分析与知识发现, 2021, 5(3): 88-100.
[15] 张金柱, 于文倩. 基于短语表示学习的主题识别及其表征词抽取方法研究[J]. 数据分析与知识发现, 2021, 5(2): 50-60.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
版权所有 © 2015 《数据分析与知识发现》编辑部
地址:北京市海淀区中关村北四环西路33号 邮编:100190
电话/传真:(010)82626611-6626,82624938
E-mail:jishu@mail.las.ac.cn