改进Transformer模型,提升文本分类的准确率与效率
Multi-Level Attention and Contrastive Learning for Enhanced Text Classification with an Optimized Transformer
- 融合全局与局部注意力,捕捉深层语义与细节特征
- 对比学习增强类别区分能力,准确率显著高于基线模型
- 轻量化模块降低计算开销,适合大规模文本处理
本文研究一种基于改进Transformer的文本分类算法,以提升模型在文本分类任务中的性能与效率。针对传统Transformer在捕捉深层语义关系和优化计算复杂度方面的不足,提出多层级注意力机制与对比学习策略。多层级注意力通过结合全局与局部注意力,有效建模文本的全局语义与局部特征;对比学习通过构建正负样本对,增强模型对不同类别的区分能力,提升分类效果。此外,为提高模型在大规模文本数据上的训练与推理效率,设计轻量化模块优化特征转换过程,降低计算成本。实验结果表明,改进后的Transformer模型在分类准确率、F1值和召回率上均优于BiLSTM、CNN、标准Transformer及BERT等对比模型,展现出更强的语义表示能力和泛化性能。该方法为文本分类领域的算法优化提供了新思路,具备良好的应用潜力与实用价值。未来工作将聚焦于模型在多类别不平衡数据集和跨领域任务中的表现,并探索其与其他技术的融合。
原文摘要 · Abstract (English)
This paper studies a text classification algorithm based on an improved Transformer to improve the performance and efficiency of the model in text classification tasks. Aiming at the shortcomings of the traditional Transformer model in capturing deep semantic relationships and optimizing computational complexity, this paper introduces a multi-level attention mechanism and a contrastive learning strategy. The multi-level attention mechanism effectively models the global semantics and local features in the text by combining global attention with local attention; the contrastive learning strategy enhances the model's ability to distinguish between different categories by constructing positive and negative sample pairs while improving the classification effect. In addition, in order to improve the training and inference efficiency of the model on large-scale text data, this paper designs a lightweight module to optimize the feature transformation process and reduce the computational cost. Experimental results on the dataset show that the improved Transformer model outperforms the comparative models such as BiLSTM, CNN, standard Transformer, and BERT in terms of classification accuracy, F1 score, and recall rate, showing stronger semantic representation ability and generalization performance. The method proposed in this paper provides a new idea for algorithm optimization in the field of text classification and has good application potential and practical value. Future work will focus on studying the performance of this model in multi-category imbalanced datasets and cross-domain tasks and explore the integration wi
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。