发明名称 基于改进的蚁群算法实现文本聚类
摘要 基于改进的蚁群算法实现文本聚类,先对文本预处理,综合考虑词汇的词性、词位分别得到一系列权重值,根据词汇在文本中的权重和在文本库中的权重,构造目标函数<img file="dest_path_image002.GIF" wi="33" he="18" />,最后利用改进的蚁群算法对文本聚类,本发明比传统的词频‑反文档频率方法准确度更高,克服了信息增益方法只适合提取一个类别的缺点,可以精确地计算不同词汇对文本的贡献度,大大降低噪声和孤立点对簇分类的影响,易于并行实现,同时避免其早熟性收敛,运行时间复杂度低,处理速度更快,另外文本聚类结果更符合经验值。
申请公布号 CN106570112A 申请公布日期 2017.04.19
申请号 CN201610939671.3 申请日期 2016.11.01
申请人 四川用联信息技术有限公司 发明人 金平艳
分类号 G06F17/30(2006.01)I 主分类号 G06F17/30(2006.01)I
代理机构 代理人
主权项 基于改进的蚁群算法实现文本聚类,本发明涉及语义网络技术领域,具体涉及基于改进的蚁群算法实现文本聚类,其特征是,包括如下步骤:步骤1:初始化文本库,对文本进行预处理过程,其具体描述如下:步骤1.1:分词是文本预处理的第一个步骤,在英文文本中,词语间由空格隔开,因此不需要这一步骤,而中文文本中,词之间是没有空格的,必须进行分词处理,具体分词技术如下:步骤1.1.1:根据《分词词典》找到待分词句子中与词典中匹配的词,把待分词的汉字串完整的扫描一遍,在系统的词典里进行查找匹配,遇到字典里有的词就标识出来;如果词典中不存在相关匹配,就简单地分割出单字作为词;直到汉字串为空步骤1.1.2:依据概率统计学,将待分词句子拆分为网状结构,即得n个可能组合的句子结构,把此结构每条顺序节点依次规定为<img file="dest_path_image002.GIF" wi="152" he="23" />,其结构图如图2所示步骤1.1.3:基于信息论方法,给上述网状结构每条边赋予一定的权值,其具体计算过程如下:根据《分词词典》匹配出的字典词与未匹配的单个词,第i条路径包含词的个数为<img file="dest_path_image004.GIF" wi="18" he="17" />,即n条路径词的个数集合为<img file="dest_path_image006.GIF" wi="110" he="22" />得<img file="dest_path_image008.GIF" wi="213" he="25" />在上述留下的剩下的(n‑m)路径中,求解每条相邻路径的权重大小,在统计语料库中,计算每个词的信息量<img file="dest_path_image010.GIF" wi="44" he="20" />,再求解路径相邻词的共现信息量<img file="dest_path_image012.GIF" wi="74" he="20" />,既有下式:<img file="dest_path_image014.GIF" wi="225" he="26" />上式<img file="dest_path_image016.GIF" wi="52" he="25" />为文本语料库中词<img file="dest_path_image018.GIF" wi="19" he="23" />的信息量,<img file="dest_path_image020.GIF" wi="57" he="24" />为含词<img file="365856dest_path_image018.GIF" wi="19" he="23" />的文本信息量<img file="dest_path_image022.GIF" wi="213" he="80" />上式<img file="dest_path_image024.GIF" wi="52" he="24" />为<img file="971412dest_path_image018.GIF" wi="19" he="23" />在文本语料库中的概率,n为含词<img file="941030dest_path_image018.GIF" wi="19" he="23" />的文本语料库的个数<img file="dest_path_image026.GIF" wi="206" he="72" />上式<img file="dest_path_image028.GIF" wi="52" he="23" />为含词<img file="460873dest_path_image018.GIF" wi="19" he="23" />的文本数概率值,N为统计语料库中文本总数同理<img file="dest_path_image030.GIF" wi="338" he="24" /><img file="dest_path_image032.GIF" wi="108" he="28" />为在文本语料库中词<img file="dest_path_image034.GIF" wi="73" he="23" />的共现信息量,<img file="dest_path_image036.GIF" wi="110" he="29" />为相邻词<img file="17188dest_path_image034.GIF" wi="73" he="23" />共现的文本信息量同理<img file="dest_path_image038.GIF" wi="297" he="67" />上式<img file="dest_path_image040.GIF" wi="91" he="23" />为在文本语料库中词<img file="403433dest_path_image034.GIF" wi="73" he="23" />的共现概率,m为在文本库中词<img file="44367dest_path_image034.GIF" wi="73" he="23" />共现的文本数量<img file="dest_path_image042.GIF" wi="307" he="72" /><img file="dest_path_image044.GIF" wi="80" he="20" />为文本库中相邻词<img file="8648dest_path_image034.GIF" wi="73" he="23" />共现的文本数概率综上可得每条相邻路径的权值为<img file="dest_path_image046.GIF" wi="328" he="25" />步骤1.1.4:找到权值最大的一条路径,即为待分词句子的分词结果,其具体计算过程如下:有n条路径,每条路径长度不一样,假设路径长度集合为<img file="dest_path_image048.GIF" wi="123" he="25" />假设经过取路径中词的数量最少操作,排除了m条路径,m&lt;n,即剩下(n‑m)路径,设其路径长度集合为<img file="dest_path_image050.GIF" wi="130" he="23" />则每条路径权重为:<img file="dest_path_image052.GIF" wi="498" he="126" />上式<img file="dest_path_image054.GIF" wi="329" he="35" />分别为第1,2到<img file="dest_path_image056.GIF" wi="23" he="24" />路径边的权重值,根据步骤1.4可以一一计算得出,<img file="dest_path_image058.GIF" wi="93" he="29" />为剩下(n‑m)路径中第<img file="dest_path_image060.GIF" wi="17" he="24" />条路径的长度权值最大的一条路径:<img file="dest_path_image062.GIF" wi="290" he="26" />步骤1.2:去停用词为中文文本预处理第二步骤,根据停用表对文本词汇进行去停用词处理,其具体描述如下:停用词是指在文本中出现频率高,但对于文本标识却没有太大作用的单词,去停用词的过程就是将特征项与停用词表中的词进行比较,如果匹配就将该特征项删除综合分词和删除停用词技术,中文文本预处理过程流程图如图3步骤2:根据词汇在文本中的位置得到一系列词汇位置权重值<img file="dest_path_image064.GIF" wi="98" he="19" />,其具体描述如下:各个词在文本中的分布是不同的,而不同位置的词对于表示文本内容的能力也是不同的,这个可以根据统计调查得出一系列的位置权重值<img file="dest_path_image065.GIF" wi="124" he="24" />步骤3:根据词汇在文本中的词性得到一系列词汇词性权重值<img file="dest_path_image067.GIF" wi="16" he="20" />、<img file="dest_path_image069.GIF" wi="22" he="25" />、<img file="dest_path_image071.GIF" wi="19" he="20" />、<img file="dest_path_image073.GIF" wi="23" he="28" />,其具体描述如下:现代汉语语法中,一个句子主要由主语、谓语、宾语、定语和状语等成分构成,从词性的角度看,名词一般担当主语和宾语的角色,动词一般担当谓语的角色,形容词和副词一般担当定语的角色,词性的不同,造成了它们对文本或者句子的表示内容的能力的不一样,根据调查统计得出名词、动词、形容词、副词的权重值依次为<img file="dest_path_image074.GIF" wi="16" he="20" />、<img file="502295dest_path_image069.GIF" wi="22" he="25" />、<img file="744927dest_path_image071.GIF" wi="19" he="20" />和<img file="751453dest_path_image073.GIF" wi="23" he="28" />,且<img file="dest_path_image076.GIF" wi="162" he="25" />步骤4:综合上述位置与词性,根据词汇在文本中信息量,得到词汇在文本中的权重<img file="dest_path_image078.GIF" wi="26" he="20" />和词汇在文本库中的权重<img file="dest_path_image080.GIF" wi="23" he="19" />,归一化处理上述因子,得到提取特征词汇的目标函数<img file="dest_path_image082.GIF" wi="35" he="22" />,其具体计算过程如下:<img file="dest_path_image084.GIF" wi="197" he="55" />上式h为特征词汇i在文本中出现的段落数,<img file="dest_path_image086.GIF" wi="30" he="26" />为第j段的位置权重值,<img file="dest_path_image088.GIF" wi="174" he="29" />,<img file="dest_path_image090.GIF" wi="24" he="23" />为词汇i的词性权重值,<img file="dest_path_image092.GIF" wi="167" he="24" />,<img file="dest_path_image094.GIF" wi="27" he="27" />为词汇i在第j段出现的次数,<img file="dest_path_image096.GIF" wi="35" he="23" />为词汇i所在文本中特征词汇集合的总个数<img file="dest_path_image098.GIF" wi="213" he="68" /><img file="dest_path_image100.GIF" wi="35" he="24" />为文本库中文本的数量,<img file="dest_path_image102.GIF" wi="40" he="23" />为词汇i在第w文本中概率,<img file="dest_path_image104.GIF" wi="32" he="24" />为词汇i在文本库中的平均概率<img file="dest_path_image106.GIF" wi="146" he="60" />词汇在文本中的权重<img file="dest_path_image108.GIF" wi="24" he="17" />和词汇在文本库中的权重<img file="dest_path_image110.GIF" wi="26" he="20" />进行归一化处理,得<img file="dest_path_image112.GIF" wi="44" he="24" />:<img file="dest_path_image114.GIF" wi="202" he="62" />r为文本中特征词汇的个数设定一个合适的目标函数阈值y,提取文本的特征词汇向量,有下式:<img file="dest_path_image116.GIF" wi="86" he="29" />满足上式,即为文本的特征词汇步骤5:基于改进的蚁群算法,对文本库进行聚类,如图4。
地址 610054 四川省成都市成华区电子信息产业大厦1101室
您可能感兴趣的专利