APP下载

一种改进TF-IDF的中文邮件识别算法研究

2020-06-19吴小晴万国金李程文林梦思曹书强

现代电子技术 2020年12期
关键词:仿真分析

吴小晴 万国金 李程文 林梦思 曹书强

摘  要: 传统的TF?IDF算法没有很好地分配分词的权重,对一些能代表邮件类别出现频率较大的词语计算的IDF值反而较小,IDF值小说明单词的区分能力弱而不符合实际情况。为了提升垃圾邮件识别的准确率,提出一种改进TF?IDF算法和类中心向量的中文垃圾邮件识别方法。通过改进传统的TF?IDF计算方式,在传统的TF?IDF算法里面加入卡方统计量CHI和位置影响因子能够很好地改善一些重要词汇的权重问题,并结合逆向最大匹配算法的邮件文本分词和类中心向量算法的特征选择进行垃圾邮件分类。实验结果表明,所提算法相较于传统的TF?IDF算法对垃圾邮件识别的准确率提升了约3.6%,具有一定的实际应用价值。

关键词: TF?IDF算法; 邮件识别; 卡方统计量; 权重分配; 邮件分类; 仿真分析

中图分类号: TN911.23?34; TP181               文献标识码: A                      文章编号: 1004?373X(2020)12?0083?04

Abstract: A Chinese spam recognition method with improved TF?IDF algorithm and class centre vector is proposed to improve the accuracy of spam recognition. The traditional TF?IDF algorithm does not assign the weight of word segmentation well, and the calculated IDF value for some words that can represent the mail category and has higher frequency of occurrence is relatively small. The small IDF value indicates that the capacity of distinguishing the words is weak and does not accord with the actual demand. In this paper, the traditional TF?IDF calculation pattern is improved. The traditional TF?IDF algorithm adding the chi?square statistic CHI and position influence factor can improve the weight of some important words, and the spam classification can be performed by combining it with the feature selection of class center vector algorithm and mail text segmentation of the reverse maximum matching algorithm. The experimental results show that, in comparison with the traditional TF?IDF algorithm, this algorithm can increase the accuracy of spam identification by about 3.6%, which has a certain practical application value.

Keywords: TF?IDF algorithm; mail recognition; CHI; weight allocation; mail classification; simulation analysis

0  引  言

如今邮件成为日常沟通通信的主要方式之一,而垃圾邮件的存在给用户带来困扰。在卡巴斯基实验室发布的2018年第二季度垃圾邮件和钓鱼邮件的数据里,来自中国的垃圾邮件数目占邮件总量的14.36%,在统计的国家中国排名第一[1]。邮件分类识别的常用方法有基于IP地址和域名的黑白名单拦截方法、朴素贝叶斯算法[2]、决策树算法[3]、支持向量机算法[4]、K近邻算法分类[5]、类中心向量算法。现存在的技术在垃圾邮件识别准确率并不是很高,故本文算法在传统的TF?IDF算法[6]上改进,采用更精确的分词算法与邮件特征词向量的转化算法,在保证正确提取邮件内容的前提下提高垃圾邮件识别的准确率。

1  郵件分类的常用方法介绍

1) 黑白名单拦截方法[7]。现有一些组织和机构专门管理邮件黑名单,处理垃圾邮件地址的问题。若一个IP地址被列入黑名单,ISP服务商就会屏蔽该IP地址,用户则不会收到该地址发送的邮件。但是如果对方设置动态IP或者在不知道对方邮箱的前提下就没办法拦截邮件。

传统的TF?IDF并不能很好地处理特征词的权重问题。传统的TF?IDF算法思想认为,如果垃圾邮件类别中包含词条[t]的邮件数为[m],非垃圾邮件包含[t]的邮件数为[k],则所有包含[t]的邮件数[n=m+k],当[m]大的时候,[n]就会大,TF?IDF公式得到的IDF的值会小,说明单词[t]的区分能力不强。实际上,若某些词条多次出现在一个类别的邮件中,则该词条几乎能够代表这个类的邮件文本的特征,应给予较高的权重,并选来作为该类邮件的特征词。

猜你喜欢

仿真分析
DYNA在安全带固定点强度仿真分析中的应用
预应力混凝土连续刚构桥施工监测与仿真分析
半挂汽车列车直角转弯仿真分析
民用飞机直流开关电弧效应仿真分析
温度大时滞串级—Smith预估控制系统建模与仿真
ADAMS/Car 与MATLAB联合仿真在《汽车理论》教学中的应用
基于DIALux仿真分析的室内绿色照明方案设计
基于LPC的语音信号预测仿真分析