发明名称 基于基尼指数求解文本相似度的方法
摘要 基于基尼指数求解文本相似度的方法,利用分词技术对文本分词处理,匹配停用词表对词汇进行去停用词操作,根据调研统计,得出一系列词汇位置和词性权重值,利用目标权重函数<img file="dest_path_image001.GIF" wi="70" he="26" />对文本词汇集合降维,根据语义相似度合并相似度高的词汇,对上述特征词汇集合再降维,利用向量间的相似度求解文本间的相似度。本发明比传统文本特征词汇提取方法准确度更高,具有更好的应用价值,数据处理效果好,克服了信息增益方法的缺点,结果更符合经验值,解决了文本特征词汇高维稀疏的问题和同义词与多义词的问题,计算了不同词汇对文本思想的贡献度,为后续文本相似度与文本聚类提供良好的理论基础。
申请公布号 CN106610953A 申请公布日期 2017.05.03
申请号 CN201610866921.5 申请日期 2016.09.30
申请人 四川用联信息技术有限公司 发明人 金平艳
分类号 G06F17/27(2006.01)I;G06F17/30(2006.01)I 主分类号 G06F17/27(2006.01)I
代理机构 代理人
主权项 基于基尼指数求解文本相似度的方法,本发明涉及语义网络技术领域,具体涉及基于基尼指数求解文本相似度的方法,其特征是,包括如下步骤:步骤1:利用中文分词技术分别对两文本<img file="dest_path_image001.GIF" wi="60" he="20" />进行分词处理,其具体分词技术过程如下:步骤1.1:根据《分词词典》找到待分词句子中与词典中匹配的词,把待分词的汉字串完整的扫描一遍,在系统的词典里进行查找匹配,遇到字典里有的词就标识出来;如果词典中不存在相关匹配,就简单地分割出单字作为词;直到汉字串为空步骤1.2:依据概率统计学,将待分词句子拆分为网状结构,即得n个可能组合的句子结构,把此结构每条顺序节点依次规定为<img file="836730dest_path_image002.GIF" wi="134" he="20" />,其结构图如图2所示步骤1.3:基于信息论方法,给上述网状结构每条边赋予一定的权值,其具体计算过程如下:根据《分词词典》匹配出的字典词与未匹配的单个词,第i条路径包含词的个数为<img file="dest_path_image003.GIF" wi="15" he="13" />,即n条路径词的个数集合为<img file="336195dest_path_image004.GIF" wi="117" he="20" />得<img file="dest_path_image005.GIF" wi="192" he="22" />在上述留下的剩下的(n‑m)路径中,求解每条相邻路径的权重大小在统计语料库中,计算每个词的信息量<img file="731142dest_path_image006.GIF" wi="35" he="16" />,再求解路径相邻词的共现信息量<img file="dest_path_image007.GIF" wi="61" he="16" />,既有下式:<img file="435049dest_path_image008.GIF" wi="208" he="23" />上式<img file="dest_path_image009.GIF" wi="49" he="20" />为文本语料库中词<img file="824793dest_path_image010.GIF" wi="19" he="21" />的信息量,<img file="dest_path_image011.GIF" wi="53" he="22" />为含词<img file="817413dest_path_image010.GIF" wi="16" he="20" />的文本信息量<img file="704466dest_path_image012.GIF" wi="201" he="72" />上式<img file="dest_path_image013.GIF" wi="52" he="19" />为<img file="135316dest_path_image010.GIF" wi="16" he="21" />在文本语料库中的概率,n为含词<img file="735710dest_path_image010.GIF" wi="18" he="21" />的文本语料库的个数<img file="619221dest_path_image014.GIF" wi="212" he="23" /><img file="dest_path_image015.GIF" wi="97" he="44" />上式<img file="499846dest_path_image016.GIF" wi="52" he="19" />为含词<img file="988465dest_path_image010.GIF" wi="18" he="20" />的文本数概率值,N为统计语料库中文本总数同理<img file="dest_path_image017.GIF" wi="319" he="25" /><img file="657694dest_path_image018.GIF" wi="84" he="20" />为在文本语料库中词<img file="dest_path_image019.GIF" wi="68" he="21" />的共现信息量,<img file="418714dest_path_image020.GIF" wi="76" he="20" />为相邻词<img file="dest_path_image021.GIF" wi="68" he="22" />共现的文本信息量同理<img file="227664dest_path_image022.GIF" wi="306" he="65" />上式<img file="dest_path_image023.GIF" wi="87" he="20" />为在文本语料库中词<img file="489231dest_path_image019.GIF" wi="68" he="20" />的共现概率,m为在文本库中词<img file="410920dest_path_image021.GIF" wi="68" he="21" />共现的文本数量<img file="271953dest_path_image024.GIF" wi="310" he="68" /><img file="dest_path_image025.GIF" wi="104" he="22" />为文本库中相邻词<img file="878734dest_path_image019.GIF" wi="68" he="22" />共现的文本数概率综上可得每条相邻路径的权值为<img file="76366dest_path_image026.GIF" wi="334" he="21" />步骤1.4:找到权值最大的一条路径,即为待分词句子的分词结果,其具体计算过程如下:有n条路径,每条路径长度不一样,假设路径长度集合为<img file="dest_path_image027.GIF" wi="82" he="16" />假设经过取路径中词的数量最少操作,排除了m条路径,m&lt;n,即剩下(n‑m)路径,设其路径长度集合为<img file="358836dest_path_image028.GIF" wi="121" he="22" />则每条路径权重为:<img file="dest_path_image029.GIF" wi="439" he="111" />上式<img file="828869dest_path_image030.GIF" wi="382" he="41" />分别为第1,2到<img file="dest_path_image031.GIF" wi="20" he="20" />路径边的权重值,根据步骤1.4可以一一计算得出,<img file="997199dest_path_image032.GIF" wi="82" he="22" />为剩下(n‑m)路径中第<img file="dest_path_image033.GIF" wi="17" he="23" />条路径的长度权值最大的一条路径:<img file="176901dest_path_image034.GIF" wi="311" he="26" />步骤2:根据停用表分别对两文本<img file="dest_path_image035.GIF" wi="58" he="20" />词汇进行去停用词处理,得到文本特征词汇集合<img file="811364dest_path_image036.GIF" wi="15" he="16" />,<img file="dest_path_image037.GIF" wi="17" he="17" />,其具体描述如下:停用词是指在文本中出现频率高,但对于文本标识却没有太大作用的单词,去停用词的过程就是将特征项与停用词表中的词进行比较,如果匹配就将该特征项删除综合分词和删除停用词技术,中文文本预处理过程流程图如图3步骤3:根据词汇在文本中的位置得到一系列词汇位置权重值<img file="771623dest_path_image038.GIF" wi="85" he="16" />,其具体描述如下:各个词在文本中的分布是不同的,而不同位置的词对于表示文本内容的能力也是不同的,这个可以根据统计调查得出一系列的位置权重值<img file="208290dest_path_image038.GIF" wi="84" he="16" />步骤4:根据词汇在文本中的词性得到一系列词汇词性权重值<img file="dest_path_image039.GIF" wi="19" he="21" />、<img file="564535dest_path_image040.GIF" wi="17" he="19" />、<img file="326823dest_path_image041.GIF" wi="20" he="20" />、<img file="dest_path_image042.GIF" wi="18" he="20" />,其具体描述如下:现代汉语语法中,一个句子主要由主语、谓语、宾语、定语和状语等成分构成,从词性的角度看,名词一般担当主语和宾语的角色,动词一般担当谓语的角色,形容词和副词一般担当定语的角色,词性的不同,造成了它们对文本或者句子的表示内容的能力的不一样,根据调查统计得出名词、动词、形容词、副词的权重值依次为<img file="571116dest_path_image039.GIF" wi="19" he="19" />、<img file="136440dest_path_image040.GIF" wi="17" he="19" />、<img file="897592dest_path_image041.GIF" wi="19" he="21" />和<img file="565202dest_path_image042.GIF" wi="19" he="20" />,且<img file="47524dest_path_image043.GIF" wi="141" he="20" />步骤5:综合上述步骤,利用目标权重函数<img file="dest_path_image044.GIF" wi="83" he="26" />对文本词汇集合进行进一步降维处理,得到文本特征词汇集合分别为<img file="626926dest_path_image045.GIF" wi="24" he="20" />、<img file="dest_path_image046.GIF" wi="23" he="21" />;步骤6:根据语义相似度条件,合并相似度高的词汇,对两文本特征词汇集合<img file="429535dest_path_image045.GIF" wi="23" he="20" />、<img file="270977dest_path_image046.GIF" wi="23" he="21" />再降维,此时两文本的特征词汇向量分别为<img file="503244dest_path_image047.GIF" wi="31" he="24" />、<img file="dest_path_image048.GIF" wi="33" he="28" />,其具体过程如下:步骤6.1)利用基于《知网》概念的方法,特征词汇集合<img file="269425dest_path_image045.GIF" wi="23" he="20" />、<img file="270748dest_path_image046.GIF" wi="26" he="21" />中的词汇映射到概念,求解两两词汇对应的两本体概念<img file="345407dest_path_image049.GIF" wi="56" he="20" />间语义相似度即为词汇相似度构造两本体概念<img file="799391dest_path_image049.GIF" wi="56" he="19" />语义相似度<img file="dest_path_image050.GIF" wi="92" he="20" />当两个概念共同直接子节点个数越多,则概念<img file="369263dest_path_image049.GIF" wi="56" he="20" />相似度越大,反之,越小从概念<img file="225093dest_path_image049.GIF" wi="56" he="20" />的直接子节点中找出共有的子节点个数N为了解决子节点多继承问题,有下式:<img file="673916dest_path_image051.GIF" wi="299" he="53" /><img file="dest_path_image052.GIF" wi="14" he="12" />为最长路径<img file="536568dest_path_image053.GIF" wi="20" he="21" />的权重系数,<img file="dest_path_image054.GIF" wi="15" he="23" />为<img file="582234dest_path_image055.GIF" wi="61" he="22" />共有的子节点个数N的权重系数,<img file="dest_path_image056.GIF" wi="84" he="21" />,权重系数可以根据实验结果迭代得到,<img file="544767dest_path_image057.GIF" wi="15" he="16" />为两本体概念的语义信息距离,<img file="dest_path_image058.GIF" wi="20" he="20" />为从子集中找出概念<img file="286196dest_path_image059.GIF" wi="85" he="23" />经共同父节点的最长路径上式<img file="dest_path_image060.GIF" wi="220" he="24" /><img file="922231dest_path_image061.GIF" wi="50" he="26" />、<img file="dest_path_image062.GIF" wi="42" he="24" />分别为概念<img file="508939dest_path_image063.GIF" wi="20" he="18" />、<img file="dest_path_image064.GIF" wi="25" he="17" />在本体树中的信息量,<img file="788961dest_path_image065.GIF" wi="53" he="20" />为概念<img file="435712dest_path_image063.GIF" wi="21" he="18" />、<img file="151251dest_path_image064.GIF" wi="24" he="17" />在本体树中的共有信息量步骤6.2)设定阈值g,合并相似度高的词汇,重新分配其权重条件:<img file="dest_path_image066.GIF" wi="145" he="25" />合并后的词汇为权重更大的那个,此时词汇的权重<img file="744912dest_path_image067.GIF" wi="54" he="17" />为两词汇权重的平均值,如下所式:<img file="426911dest_path_image068.GIF" wi="241" he="40" />迭代计算两两词汇间的相似度,直到没有满足上述条件的词汇为止综上即分别得,文本特征词汇向量<img file="dest_path_image069.GIF" wi="30" he="22" />、<img file="103618dest_path_image070.GIF" wi="30" he="23" />步骤7:利用文本相似度函数<img file="dest_path_image071.GIF" wi="96" he="20" />,求解两特征向量<img file="962246dest_path_image069.GIF" wi="30" he="20" />、<img file="703805dest_path_image070.GIF" wi="29" he="23" />间的相似度即为文本相似度。
地址 610054 四川省成都市成华区电子信息产业大厦1101室