作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2026, Vol. 52 ›› Issue (7): 107-120. doi: 10.19678/j.issn.1000-3428.0070533

• 计算智能与模式识别 • 上一篇    下一篇

基于多粒度语义间隔损失的半监督文本分类方法

廖国安1, 徐计1,2, 陈艳平1,2   

  1. 1. 贵州大学公共大数据国家重点实验室, 贵州 贵阳 550025;
    2. 贵州大学计算机科学与技术学院, 贵州 贵阳 550025
  • 收稿日期:2024-10-24 修回日期:2025-01-07 出版日期:2026-07-15 发布日期:2025-03-14
  • 作者简介:廖国安(CCF学生会员),男,硕士研究生,主研方向为自然语言处理、粒计算、机器学习;徐计(通信作者),特聘教授、博士,E-mail:jixu@gzu.edu.cn;陈艳平,特聘教授、博士、博士生导师。
  • 基金资助:
    国家自然科学基金(62366008,61966005)。

Semi-Supervised Text Classification Method Based on Multi-Granularity Semantic Margin Loss

LIAO Guoan1, XU Ji1,2, CHEN Yanping1,2   

  1. 1. State Key Laboratory of Public Big Data, Guizhou University, Guiyang 550025, Guizhou, China;
    2. College of Computer Science and Technology, Guizhou University, Guiyang 550025, Guizhou, China
  • Received:2024-10-24 Revised:2025-01-07 Online:2026-07-15 Published:2025-03-14

摘要: 半监督文本分类使用少量标注数据和大量未标注数据训练文本分类模型。然而,现有基于伪标签的方法存在由于决策边界欠拟合和伪标签偏差导致的误差累积问题。为此,本文提出一个基于多粒度语义间隔损失的交叉标注模型。首先通过基于Transformer的双向编码器表示(BERT)预训练模型提取包含上下文信息的向量序列,然后利用注意力网络和文本卷积神经网络(TextCNN)分别捕获全局语义特征和局部语义特征,并将这两部分特征融合形成新的语义特征,同时考虑不同类别之间的语义相似性,以在特征嵌入空间中将相似类别的样本分开,从而减轻误差累积的影响。最后,增加一个与类别相关的间隔,通过自适应局部阈值学习得到的伪标签样本与间隔进行正负样本损失计算,使每个类别样本在嵌入空间形成高密度分布,从而缓解决策边界的欠拟合。实验结果表明,该模型能够有效融合多粒度语义信息,生成高内聚伪标签样本,提升半监督文本分类的性能。

关键词: 文本分类, 伪标签, 间隔损失, 特征提取, 决策边界, 半监督学习, 自然语言处理

Abstract: Semi-supervised text classification uses a limited set of labeled data in conjunction with a large corpus of unlabeled data to develop text classification models. Current pseudo-labeling techniques often face challenges such as pseudo-label bias stemming from decision boundary underfitting and error accumulation. To address these issues, a cross-annotation model based on the multi-granularity semantic margin loss is introduced. Initially, the Bidirectional Encoder Representations from Transformers (BERT)-pretrained model is employed to extract vector sequences enriched with contextual information. Subsequently, an attention mechanism and Text Convolutional Neural Network (TextCNN) are utilized to capture global and local semantic features, respectively. These features are subsequently fused to create enriched semantic representations, factoring in semantic similarities across different categories to separate similar classes within the feature-embedding space, thereby reducing the impact of error accumulation. Additionally, a category-specific margin to calculate the positive and negative sample loss between pseudo-labels derived through adaptive local threshold learning is introduced. The margin enables a high-density distribution of samples within each class in the embedding space, thereby mitigating decision boundary underfitting. Experimental evaluations demonstrate that the proposed model effectively integrates multi-granular semantic information, achieves high cohesion among pseudo-labeled samples, and significantly improves the performance of semi-supervised text classification.

Key words: text classification, pseudo-label, margin loss, feature extraction, decision boundary, semi-supervised learning, natural language processing

中图分类号: