《电子技术应用》
您所在的位置:首页 > 通信与网络 > 设计应用 > 基于BERT-CNN的新闻文本分类的知识蒸馏方法研究
基于BERT-CNN的新闻文本分类的知识蒸馏方法研究
2023年电子技术应用第1期
叶榕,邵剑飞,张小为,邵建龙
昆明理工大学 信息工程与自动化学院,云南 昆明 650500
摘要: 近年来,随着大数据时代进入人类的生活之后,人们的生活中出现很多无法识别的文本、语义等其他数据,这些数据的量十分庞大,语义也错综复杂,这使得分类任务更加困难。如何让计算机对这些信息进行准确的分类,已成为当前研究的重要任务。在此过程中,中文新闻文本分类成为这个领域的一个分支,这对国家舆论的控制、用户日常行为了解、用户未来言行的预判都有着至关重要的作用。针对新闻文本分类模型参数量多和训练时间过长的不足,在最大限度保留模型性能的情况下压缩训练时间,力求二者折中,故提出基于BERT-CNN的知识蒸馏。根据模型压缩的技术特点,将BERT作为教师模型,CNN作为学生模型,先将BERT进行预训练后再让学生模型泛化教师模型的能力。实验结果表明,在模型性能损失约2.09%的情况下,模型参数量压缩约为原来的1/82,且时间缩短约为原来的1/670。
中图分类号:TP391.1
文献标志码:A
DOI: 10.16157/j.issn.0258-7998.223094
中文引用格式: 叶榕,邵剑飞,张小为,等. 基于BERT-CNN的新闻文本分类的知识蒸馏方法研究[J]. 电子技术应用,2023,49(1):8-13.
英文引用格式: Ye Rong,Shao Jianfei,Zhang Xiaowei,et al. Knowledge distillation of news text classification based on BERT-CNN[J]. Application of Electronic Technique,2023,49(1):8-13.
Knowledge distillation of news text classification based on BERT-CNN
Ye Rong,Shao Jianfei,Zhang Xiaowei,Shao Jianlong
School of Information Engineering and Automation, Kunming University of Science and Technology, Kunming 650500, China
Abstract: In recent years, after the era of big data has entered human life, many unrecognizable text, semantic and other data have appeared in people's lives, which are very large in volume and intricate in semantics, which makes the classification task more difficult. How to make computers classify this information accurately has become an important task of current research. In this process, Chinese news text classification has become a branch in this field, which has a crucial role in the control of national public opinion, the understanding of users' daily behavior, and the prediction of users' future speech and behavior. In view of the shortage of news text classification models with large number of parameters and long training time, the BERT-CNN based knowledge distillation is proposed to compress the training time while maximizing the model performance and striving for a compromise between the two. According to the technical characteristics of model compression, BERT is used as the teacher model and CNN is used as the student model, and BERT is pre-trained first before allowing the student model to generalize the capability of the teacher model. The experimental results show that the model parametric number compression is about 1/82 and the time reduction is about 1/670 with the model performance loss of about 2.09%.
Key words : news text;BERT;CNN;knowledge distillation

0 引言

    随着大数据时代的到来,今日头条、新浪微博和豆瓣等主流新闻媒体APP产生海量新闻文本,因此如何将这些新闻文本进行快速有效的分类对于用户体验乃至国家网络舆情控制是十分必要的。针对中文新闻文本分类任务,研究者提出许多分类算法和训练模型,证明深度学习分类方法的有效性。

    以BERT[1](Bidirectional Encoder Representation from Transformers)预训练模型为例:在文献[2]的实验中可以得出,BERT-CNN模型取得的效果最佳,但是从工程落地的角度来说,模型参数量过于巨大,仅仅一个BERT模型,参数就达一亿多。本文使用的是谷歌开源的面向中文的BERT预训练模型,占用内存大小为325 Mb。另一方面,针对训练时间过长的缺点,以该实验为例,训练18万条新闻文本数据消耗的时间为3.5 h,很显然对于未来的模型工程落地还存在很大的差距。因此,本文在保证不下降过多模型的准确率的前提下,将BERT-CNN进行模型压缩,降低模型体积以及模型的训练时间,提升模型的泛化能力。

    本文创新点主要体现在:(1)对实验数据集进行了扩充处理,提升模型泛化能力;(2)通过观察不同的T和α的组合对模型蒸馏性能的影响确定最优组合值而不是固定值;(3)蒸馏场景不再局限于传统情感分析(二分类),本实验面向10分类的文本分析,不同标签文本的蒸馏性能也不尽相同。




本文详细内容请下载:https://www.chinaaet.com/resource/share/2000005068




作者信息:

叶榕,邵剑飞,张小为,邵建龙

(昆明理工大学 信息工程与自动化学院,云南 昆明 650500)




wd.jpg

此内容为AET网站原创,未经授权禁止转载。