发明名称 一种新的文本相似度求解方法
摘要 一种新的文本相似度求解方法,先对两文本<img file="dest_path_image001.GIF" wi="61" he="24" />进行分词和去停用词处理,基于信息论方法,计算词汇在文本中权重值,再对其进行归一化处理,根据词汇位置信息和词频计算词汇的权重,综合上述所有因子,构造文本中的特征值目标函数<img file="797372dest_path_image002.GIF" wi="44" he="20" />,提取文本中的特征值,最后,根据皮尔森相关系数求解文本相似度<img file="dest_path_image003.GIF" wi="81" he="21" />。本发明比传统文本相似度计算方法准确度更高,适用性更广,具有更大的应用价值,计算不同词汇对文本思想的贡献度具有更高的精确度,同时为后续的文本聚类提供良好的理论基础。
申请公布号 CN106611041A 申请公布日期 2017.05.03
申请号 CN201610863609.0 申请日期 2016.09.29
申请人 四川用联信息技术有限公司 发明人 金平艳
分类号 G06F17/30(2006.01)I;G06F17/27(2006.01)I 主分类号 G06F17/30(2006.01)I
代理机构 代理人
主权项 一种新的文本相似度求解方法,本发明涉及语义网络技术领域,具体涉及一种新的文本相似度求解方法,其特征是,包括如下步骤:步骤1:初始化文本语料库模块,对待比较文本<img file="236109dest_path_image001.GIF" wi="75" he="27" />的进行预处理,其具体处理过程如下:利用停用表对文本<img file="121151dest_path_image002.GIF" wi="64" he="23" />进行分词和去停用词处理这里分词方法利用一种基于信息论中文自动分词算法,其具体分词和去停用词步骤如下:步骤1.1:利用停用表分别对文本<img file="937797dest_path_image002.GIF" wi="64" he="23" />进行去停用词处理步骤1.2:根据《分词词典》找到待分词句子中与词典中匹配的词,其具体描述如下:把待分词的汉字串完整的扫描一遍,在系统的词典里进行查找匹配,遇到字典里有的词就标识出来;如果词典中不存在相关匹配,就简单地分割出单字作为词;直到汉字串为空步骤1.3:依据概率统计学,将待分词句子拆分为网状结构,即得n个可能组合的句子结构,把此结构每条顺序节点依次规定为<img file="300908dest_path_image003.GIF" wi="134" he="24" />,其结构图如图2所示步骤1.4:基于信息论方法,给上述网状结构每条边赋予一定的权值,其具体计算过程如下:根据《分词词典》匹配出的字典词与未匹配的单个词,第i条路径包含词的个数为<img file="575025dest_path_image004.GIF" wi="16" he="17" />,即n条路径词的个数集合为<img file="817919dest_path_image005.GIF" wi="117" he="27" />得<img file="918599dest_path_image006.GIF" wi="192" he="22" />在上述留下的剩下的(n‑m)路径中,求解每条相邻路径的权重大小在统计语料库中,计算每个词的信息量<img file="210034dest_path_image007.GIF" wi="38" he="19" />,再求解路径相邻词的共现信息量<img file="479604dest_path_image008.GIF" wi="66" he="17" />,既有下式:<img file="939404dest_path_image009.GIF" wi="197" he="25" />上式<img file="407339dest_path_image010.GIF" wi="43" he="21" />为文本语料库中词<img file="112252dest_path_image011.GIF" wi="16" he="20" />的信息量,<img file="672547dest_path_image012.GIF" wi="42" he="19" />为含词<img file="804713dest_path_image013.GIF" wi="20" he="24" />的文本信息量<img file="145565dest_path_image014.GIF" wi="187" he="72" />上式<img file="778802dest_path_image015.GIF" wi="43" he="21" />为<img file="819702dest_path_image016.GIF" wi="14" he="18" />在文本语料库中的概率,n为含词<img file="886884dest_path_image017.GIF" wi="15" he="17" />的文本语料库的个数<img file="75551dest_path_image018.GIF" wi="193" he="71" />上式<img file="59950dest_path_image019.GIF" wi="43" he="19" />为含词<img file="719470dest_path_image020.GIF" wi="13" he="16" />的文本数概率值,N为统计语料库中文本总数同理<img file="318073dest_path_image021.GIF" wi="313" he="24" /><img file="818804dest_path_image022.GIF" wi="75" he="20" />为在文本语料库中词<img file="856161dest_path_image023.GIF" wi="62" he="19" />的共现信息量,<img file="933970dest_path_image024.GIF" wi="73" he="21" />为相邻词<img file="342954dest_path_image025.GIF" wi="58" he="18" />共现的文本信息量同理<img file="319263dest_path_image026.GIF" wi="295" he="64" />上式<img file="832415dest_path_image027.GIF" wi="85" he="21" />为在文本语料库中词<img file="764730dest_path_image028.GIF" wi="58" he="18" />的共现概率,m为在文本库中词<img file="344616dest_path_image029.GIF" wi="59" he="18" />共现的文本数量<img file="57488dest_path_image030.GIF" wi="306" he="71" /><img file="374331dest_path_image031.GIF" wi="86" he="20" />为文本库中相邻词<img file="962483dest_path_image028.GIF" wi="58" he="18" />共现的文本数概率综上可得每条相邻路径的权值为<img file="339369dest_path_image032.GIF" wi="339" he="23" />步骤1.5:找到权值最大的一条路径,即为待分词句子的分词结果,其具体计算过程如下:有n条路径,每条路径长度不一样,假设路径长度集合为<img file="851122dest_path_image033.GIF" wi="104" he="23" />假设经过取路径中词的数量最少操作,排除了m条路径,m&lt;n,即剩下(n‑m)路径,设其路径长度集合为<img file="706076dest_path_image034.GIF" wi="141" he="27" />则每条路径权重为:<img file="488350dest_path_image035.GIF" wi="456" he="114" />上式<img file="410038dest_path_image036.GIF" wi="382" he="41" />分别为第1,2到<img file="831924dest_path_image037.GIF" wi="22" he="21" />路径边的权重值,根据步骤1.4可以一一计算得出,<img file="631515dest_path_image038.GIF" wi="80" he="23" />为剩下(n‑m)路径中第<img file="392928dest_path_image039.GIF" wi="18" he="27" />条路径的长度权值最大的一条路径:<img file="111617dest_path_image040.GIF" wi="311" he="33" />步骤2:基于信息论方法,计算词汇在文本中权重值<img file="970200dest_path_image041.GIF" wi="21" he="17" />步骤3:根据词汇位置信息,计算词汇在文本中的权重值<img file="166957dest_path_image042.GIF" wi="52" he="27" />步骤4:综合考虑上述两因子,构造提取文本<img file="422358dest_path_image043.GIF" wi="64" he="23" />中的特征值目标函数<img file="124997dest_path_image044.GIF" wi="53" he="25" />,分别提取文本<img file="521474dest_path_image045.GIF" wi="64" he="23" />中的特征值步骤5:根据皮尔森相关系数求解待比较文本<img file="895824dest_path_image043.GIF" wi="64" he="23" />间的文本相似度<img file="444879dest_path_image046.GIF" wi="104" he="24" />。
地址 610054 四川省成都市成华区电子信息产业大厦1101室