A method and system for obtaining word similarity by combining CNKI and Cilin
By introducing sememe node density information and path information into the word similarity calculations of HowNet and Cilin, a combination model is constructed, which solves the problem of insufficient calculation accuracy and scope in the existing technology and achieves higher word similarity calculations. Matching of accuracy and human subjective judgment.
Patent Information
- Application Number
- CN202111510160.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-12-10
AI Technical Summary
The existing technology fails to make full use of the content and path information of sememe information in the similarity calculation of Chinese words in CNKI and CiLin, resulting in insufficient calculation accuracy and scope, and cannot fully comply with human subjective judgment.
Combining HowNet and CiLin, a word similarity calculation model is constructed by introducing sememe node density information and path information, and the weight parameters in the sememe information content of HowNet and CiLin topology are used to adjust the relationship between word distance and information content. Influence, a higher Pearson correlation coefficient is calculated.
It improves the accuracy and range of word similarity calculation, obtains results that are more consistent with human subjective judgment, and enhances the robustness of calculation.
Smart Images

Figure CN114254614B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of big data preprocessing, and in particular relates to a method and system for obtaining word similarity by combining HowNet and Cilin. Background Art
[0002] The calculation of word semantic similarity is a very important issue in natural language processing and is widely used in information retrieval, machine translation, question-answering systems and other fields. Currently, the commonly used methods for calculating word semantic similarity are divided into two categories: one is a method based on statistical analysis of large-scale corpora, which converts the problem of word similarity into the problem of word distribution probability in large-scale corpora, but this method is computationally intensive and complex; the other method is to calculate the semantic similarity between words through an ontology knowledge base built by human experts. Such knowledge bases include Wordnet, HowNet, and the extended version of Synonymous Cilin built by Harbin Institute of Technology. At present, ontology-based similarity calculation has achieved good results in the research of computing languages in English. However, the similarity calculation of Chinese words in HowNet and Cilin is relatively rare.
[0003] HowNet is a common sense knowledge base that Mr. Dong Zhendong spent decades building. It takes common concepts as objects and describes the relationship between these concepts. Words contain multiple meanings used as semantic descriptions of words. Meanings are sub-items of the rational meaning of words. For example, "apple" has multiple meanings, including fruit trees, fruits, companies, and movies. The meaning of words in all contexts is explained by multiple meanings, which are also called "concepts" and described by "knowledge representation language". The vocabulary that makes up the "knowledge representation language" is the original meaning, which is the smallest unit to describe the concept. Therefore, the calculation of concept similarity can be attributed to the calculation of the similarity of original meanings. The commonly used HowNet word similarity method constructs the original meaning tree through the upper and lower relationship of the original meaning, and then calculates the distance between the two original meaning nodes whose distance needs to be calculated to their nearest common ancestor. However, the depth information of the original meaning also has a certain influence on the calculation of the similarity of the original meaning. When the distance between two original meaning nodes is fixed, the shallower the original meaning node, the more abstract the concept expressed, and the deeper the original meaning node, the more specific the concept expressed. Therefore, the similarity between two shallower semes is less than the similarity between two deeper semes. There are also methods that calculate the similarity of words by density information between semes and semantic and antonym relationships, but the above methods do not use the information content of semes.
[0004] "Tongyi Cilin" is a computable Chinese word library, compiled by Mei Jiaju and others in 1983, with the original intention of helping creation and translation work. Due to the long history of the word library, the Information Retrieval Laboratory of Harbin Institute of Technology invested a lot of manpower and material resources to complete the "HIT Information Retrieval Research Laboratory Tongyi Cilin Extended Edition". Based on this extended version, the main method calculates the similarity between words by the hierarchical relationship between the concepts of words. For example, the method with word distance as the main factor and the number of branch nodes and branch interval as fine-tuning parameters. Or by assigning different edge weights to the edges between different layers, the words are calculated according to the interval between concepts and the number of direct subordinates of the nearest common upper node. The disadvantage of this method is that the information content of the words is not considered, in order to add the information content of the words to the calculation of the similarity of the words. The existing method improves the hierarchical structure of Harbin Institute of Technology's "Tongyi Cilin" so that it can reflect the differences in the information content of all words in the word forest. However, when calculating the information content of words, the distance factor of the words is not taken into account. Summary of the invention
[0005] The technical problem to be solved by the present invention is how to improve the accuracy and range of word similarity. The purpose of the present invention is to provide a word similarity acquisition method and system combining HowNet and CiLin. According to the semantic hierarchy tree of HowNet, the density information of the semantic nodes is introduced on the basis of the original information content, and the HowNet semantic information content is obtained, so that the word similarity calculation result that is more in line with human judgment can be obtained. At the same time, based on the calculation process of the synonym CiLin of the extended version of Harbin Institute of Technology, a weight parameter about the path information is set. By changing the value of the parameter, the influence of the word distance and the information content on the word similarity is adjusted, and a higher Pearson correlation coefficient is obtained, which is more in line with the result of human subjective judgment, thereby improving the calculation accuracy and range of word similarity.
[0006] The present invention is achieved through the following technical solutions:
[0007] A method for obtaining word similarity by combining HowNet and CiLin, comprising the following steps:
[0008] According to the semantic primitive hierarchy tree of HowNet and the path information in the semantic primitive hierarchy tree, the information content of HowNet semantic primitives is calculated;
[0009] According to the information content of the semantic source in HowNet, a first word similarity calculation model is constructed;
[0010] Construct a second word similarity calculation model based on the path information in the extended version of "Synonym Cilin" Cilin topology tree;
[0011] Obtain a word pair to be tested, and calculate the similarity of the word pair to be tested using the first word similarity calculation model and the second word similarity calculation model respectively according to the distribution of the word pair to be tested in HowNet and the extended version of Synonyms Cilin;
[0012] The word similarities calculated by the two calculation models are combined to obtain the final word similarity of the word pair to be tested.
[0013] In the existing calculation of word similarity, when using HowNet to calculate word similarity, the information content is rarely used for calculation. Most of them construct the semantic tree through the upper and lower relationship of the semantic originals, and then use the path information between the semantic originals. Or they only use the original information content without considering the impact of the semantic original density information on the information content. In addition, when using the revised topological structure of the Synonymous Cilin to calculate word similarity, the impact of path information is not considered. Therefore, when calculating in HowNet, the present invention introduces density information of semantic nodes on the basis of the existing original information content. In this way, when the density of the branch where the current semantic node is located is greater, it means that the classification is more detailed, the description is more detailed, and the semantic information it carries is richer, and the word similarity calculation result that is more in line with human judgment can be obtained. A weight parameter is set in the "Synonym Cilin" after the revised topological structure. By changing the value of the parameter, the influence of word distance and Cilin information content on word similarity is adjusted to obtain a higher Pearson correlation coefficient, which is more in line with the result of human subjective judgment. Finally, by combining the calculation results of the above two word similarities, the word similarity of the word pair is obtained according to the distribution of the word pair in HowNet and Synonym Cilin. This not only expands the scope of word calculation and obtains stronger robustness, but also can obtain a higher Pearson correlation coefficient, which is more in line with the result of human subjective judgment.
[0014] Furthermore, the process of obtaining the information content of the HowNet semantic source includes:
[0015] According to the total number of nodes in the semantic hierarchy tree of HowNet and the number of subordinate nodes corresponding to the semantic nodes in the semantic hierarchy tree, the first information content of the semantic original is calculated;
[0016] According to the semantic density information and semantic depth information in the semantic hierarchy tree path information of the current semantic node, the node sum of the current semantic node and its sibling nodes is calculated according to the semantic density information; the second information content of the semantic original is calculated;
[0017] The information content of the semantic original is obtained by combining the first information content and the second information content of the semantic original.
[0018] Furthermore, the process of calculating the similarity of the word pair to be tested by using the first word similarity calculation model includes:
[0019] Calculate the HowNet semantic information content of the two words in the word pair at the corresponding semantic nodes in the HowNet semantic hierarchy tree, and obtain two HowNet semantic information content contents;
[0020] According to the common information of the two semantic primitives in HowNet, the similarity of the word pair is calculated. The calculation process is as follows:
[0021]
[0022]
[0023] Among them, the function LCS(w1, w2) represents the nearest common node of the semantic nodes corresponding to the word pair w1 and w2, IC(LCS(w1, w2)) represents the common information of the semantic nodes corresponding to the word pair, and IC(w1) and IC(w2) respectively represent the semantic information content of the corresponding words in HowNet.
[0024] Furthermore, the calculation formula of the information content IC(C) of HowNet is obtained as follows:
[0025]
[0026] Among them, max_nodes represents the total number of nodes in the semantic primitive hierarchy tree, function hypo(C) represents the number of lower nodes corresponding to the semantic primitive node in the semantic primitive hierarchy tree, function f(C) represents the density information of the tree where the current semantic primitive node is located, c1 represents the weight factor that weighs the influence of semantic primitive depth information and semantic primitive density information on the information content, k represents the influence weight of path information, k is set to 0.5, and c1 is set to 0.6.
[0027] Furthermore, the process of calculating the similarity of the word pair to be tested using the second word similarity calculation model is as follows:
[0028] According to the extended version of the "Synonym Cilin" Cilin topology tree, the Cilin topology tree is divided from the root node downward into major categories, medium categories, minor categories, word groups and atomic word groups, and some abstract concepts in the atomic word groups are placed in the corresponding upper structure;
[0029] Obtain the path information of the concept corresponding to each word in the tested word pair from the Cilin topological tree, and calculate the information content corresponding to the concept according to the concept depth information in the path information of the concept corresponding to each word;
[0030] The similarity of the word pair to be tested is calculated based on the information content of the concepts corresponding to the two words in the word pair to be tested and the depth information between the corresponding concepts.
[0031] Furthermore, the process of calculating the information content IC1(C) of the concepts in Cilin is:
[0032]
[0033] Among them, max_depth represents the maximum depth of the Cilin topological tree, depth(C) represents the depth of the currently calculated concept node, function hypo(C) represents the number of subordinate nodes corresponding to the current concept node in the Cilin topological tree, max_nodes represents the total number of concept nodes in the Cilin topological tree, k represents the influence weight of the path information, and k is set to 0.5.
[0034] Furthermore, the similarity calculation formula of the second word similarity calculation model is:
[0035]
[0036] Among them, α represents an adjustable parameter, p represents the weight parameter used to adjust the path information and information content between the corresponding concepts of the tested word pair w1 and w2, N represents the length of the reachable path between the corresponding concepts, level(i) represents the level of the i-th path in the Cilin topological tree, and the function weight is used to calculate the weight value of the i-th path.
[0037] Furthermore, the calculation formula for obtaining the final word similarity of the word pair to be tested is:
[0038] sim(w1,w2)=λsim1(w1,w2)+(1-λ)sim2(w1,w2), where λ represents the weight assigned when selecting the corresponding calculation model according to the distribution of the tested word pair w1 and w2 in HowNet and the extended version Synonymous Dictionary, sim1 represents the calculation result of the first word similarity calculation model, and sim2 represents the calculation result of the second word similarity calculation model.
[0039] Furthermore, according to the distribution of the word pair to be tested in HowNet and the extended version of Tongyi Cilin, when the word is included in both HowNet and the extended version of Tongyi Cilin, it is represented by B, when the word is only included in HowNet, it is represented by A, and when the word is only included in the extended version of Tongyi Cilin, it is represented by C. The process of obtaining the final word similarity of the word pair to be tested is:
[0040] When w1∈B and w2∈B, set λ to 0.5;
[0041] When w1∈A and w2∈B, determine whether w2 has a synonym in the extended version of the Synonymous Dictionary. If so, set λ to 0.6; if not, set λ to 1.
[0042] When w1∈B and w2∈C, determine whether w1 has a synonym in the extended version of the Synonymous Dictionary. If so, set λ to 0.4; if not, set λ to 0.
[0043] When w1∈A and w2∈C, determine whether w2 has a synonym in the extended version of "Synonym Cilin". If so, select the maximum value as the final word similarity of the word pair to be tested based on the calculation results of sim1 and sim2. If not, the final word similarity of the word pair to be tested is 0.1.
[0044] When w1∈A and w2∈A, set λ to 1, and when w1∈C and w2∈C, set λ to 0.
[0045] On the other hand, the present invention provides a system for obtaining word similarity by combining HowNet and Cilin, comprising:
[0046] HowNet information content calculation module, used to calculate the HowNet semantic content according to the HowNet semantic hierarchy tree and the path information in the semantic hierarchy tree;
[0047] HowNet similarity calculation module, used to construct a first word similarity calculation model according to the HowNet semantic information content, and calculate the similarity sim1 of the word pair to be tested;
[0048] The Cilin similarity calculation module is used to construct a second word similarity calculation model based on the path information in the Cilin topological tree of the extended version of "Synonymous Cilin" and calculate the similarity sim2 of the word pair to be tested;
[0049] The similarity acquisition module for the word pair to be tested is used to combine the calculation results output by the HowNet similarity calculation module and the CiLin similarity calculation module according to the distribution of the word pair to be tested in HowNet and the extended version of Synonymous CiLin, so as to obtain the final word similarity of the word pair to be tested.
[0050] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0051] The present invention introduces density information of semantic nodes when calculating information content by using HowNet, so that when the density of the branch where the current semantic node is located is greater, it means that the classification is more detailed, the description is more detailed, the semantic information it carries is richer, and the word similarity calculation result that is more in line with human judgment can be obtained. A weight parameter is set in the "Synonym Cilin" after the revised topological structure is used. By changing the value of the parameter, the influence of word distance and Cilin information content on word similarity is adjusted to obtain a higher Pearson correlation coefficient, which is more in line with the result of human subjective judgment. By combining the above two word similarity calculation results, the word similarity of the word pair is obtained according to the distribution of the word pair in HowNet and Synonym Cilin, which not only expands the scope of word calculation and obtains stronger robustness, but also can obtain a higher Pearson correlation coefficient, which is more in line with the result of human subjective judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:
[0053] Figure 1 This is a flow chart of the method for obtaining word similarity by combining HowNet and Cilin in the present invention;
[0054] Figure 2 A schematic diagram of the structure of a Cilin topological tree in a specific implementation manner of the present invention;
[0055] Figure 3 The distribution of the words in this invention in HowNet and CiLin;
[0056] Figure 4 The present invention is a flow chart of using the Pearson correlation coefficient to perform performance testing. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0058] Example 1
[0059] like Figure 1 As shown, this embodiment 1 provides a method for obtaining word similarity by combining HowNet and Cilin, comprising the following steps:
[0060] S1. Calculate the information content of HowNet semantic primitives based on the semantic primitive hierarchy tree of HowNet and the path information in the semantic primitive hierarchy tree;
[0061] S2. Constructing a first word similarity calculation model based on the semantic information content of HowNet;
[0062] S3, constructing a second word similarity calculation model according to the path information in the extended version of "Synonym Cilin" Cilin topological tree;
[0063] S4, obtaining a word pair to be tested, and calculating the similarity of the word pair to be tested using the first word similarity calculation model and the second word similarity calculation model respectively according to the distribution of the word pair to be tested in HowNet and the extended version of Synonyms Cilin;
[0064] S5. Combining the word similarities calculated by the two calculation models to obtain the final word similarity of the word pair to be tested.
[0065] Specifically, the process of obtaining the information content of the HowNet semantic source in step S1 includes:
[0066] S11, calculating the first information content of the sememe according to the total number of nodes in the sememe hierarchy tree of HowNet and the number of subordinate nodes corresponding to the sememe node in the sememe hierarchy tree;
[0067] S12, according to the semantic original density information and the semantic original depth information in the semantic original hierarchical tree path information where the current semantic original node is located, the node sum of the current semantic original node and its sibling nodes is calculated according to the semantic original density information; the second information content of the semantic original is calculated;
[0068] S13. Combining the first information content content and the second information content content of the semantic original, obtain the information content content of the HowNet semantic original.
[0069] It is generally believed that the similarity between two words should be determined by the shared information content between them. In a well-classified semantic hierarchy system, the semantic similarity calculation formula corresponding to the concept is given as follows:
[0070] sim(c1,c2)=IC(LCS(c1,c2)) (1)
[0071] In formula (1), function LCS(c1, c2) represents the nearest common node of semantic nodes c1 and c2, and IC(C) represents the function for calculating the information content of semantic node C. The general method for calculating the information content is as follows:
[0072] IC R (C) = -logP(C) (2)
[0073] In formula (2), P(C) represents the probability of the semantic primitive node C appearing in the total semantic primitive nodes. Based on formula (2), considering the depth information of the nodes in the semantic primitive hierarchy tree, formula (2) is improved to obtain a new method for calculating the information content, which is as follows:
[0074]
[0075] In formula (3), max_nodes represents the total number of nodes in the semantic source hierarchical tree, and function hypo(C) represents the number of subordinate nodes of the semantic source node in the hierarchical tree. Formula (3) takes into account the depth information of the node. The deeper the node, the fewer the number of subordinate nodes, which means more information content. On the contrary, the closer the node is to the root node, the more the number of subordinate nodes, and the less information content is obtained, which is in line with the information content theory in information theory.
[0076] However, formula (3) ignores the fact that when the depths of two semantic primitives are different, but the semantic primitives corresponding to the two words have the same number of subordinate nodes, the information content of the two semantic primitives is the same. Based on this situation, a parameter is set to measure the influence of semantic primitive depth information and HowNet semantic primitive information content on the final information content. The specific calculation formula is as follows:
[0077]
[0078] In formula (4), max_depth represents the maximum depth of the semantic primitive hierarchy tree, depth(C) represents the depth of the currently calculated semantic primitive node, and the log base is 2. The parameter k is used to measure the influence of semantic primitive depth information and HowNet semantic primitive information content on the final information content, and the value of k is 0.5.
[0079] In formula (4), it is assumed that the information content of a sememe node is in a logarithmic relationship with its depth. Therefore, a sense tree consisting of sememes and abstract concepts can be constructed by extracting abstract concepts. It is also assumed that the information content of a sememe node is in a linear relationship with its depth rather than a logarithmic relationship. The modified specific formula for calculating the information content is as follows:
[0080]
[0081] From the above description, it can be seen that the density information of the semantic primitive node is not taken into account in the existing methods. Based on the structure of the semantic primitive hierarchical tree, the present invention considers that the information content of the semantic primitive node and its depth are in a logarithmic relationship, and introduces the density information of the semantic primitive node to improve the calculation accuracy. The specific formula for the information content of the semantic primitive in HowNet is as follows:
[0082]
[0083] Among them, max_nodes represents the total number of nodes in the semantic primitive hierarchy tree, function hypo(C) represents the number of lower nodes corresponding to the semantic primitive node in the semantic primitive hierarchy tree, function f(C) reflects the density information of the tree where the current semantic primitive node is located, and the function value is the sum of the number of the current semantic primitive and its sibling nodes. c1 is the weight factor, which is used to weigh the influence of semantic primitive depth and semantic primitive density information on the information content. The weight factor c1 is 0.6, which reflects that the depth information is the main relationship and the density information of the semantic primitive is the secondary relationship. k represents the influence weight of the path information, which is 0.5, and the log base is 2.
[0084] According to formula (6), the information content of two semantic nodes is calculated. The similarity between two words can be calculated by calculating the similarity between the concepts that make up the words. Generally, the similarity between two words without given context is the maximum value of their concept similarity. The formula is as follows:
[0085] sim(w1,w2)=maxsim(p 1i ,q 2j )(i=1...n,j=1...m) (7)
[0086] where p 1i ,q 2j They represent the i-th and j-th meanings of the word pair w1 and w2 respectively, and the smallest unit of the meaning is represented by the semantic primitive, so the word similarity calculation can be calculated by the semantic primitive similarity calculation. It is generally believed that the similarity of words should be calculated from the perspective of the difference between the semantic primitives. The greater the difference in the information content of the two HowNet semantic primitives, the smaller the word similarity. The difference formula is as follows:
[0087] dis J (c1,c2)=IC(c1)+IC(c2)-2IC(LCS(c1,c2)) (8)
[0088] Calculating similarity by differences and adding commonalities to similarity calculations is more in line with the definition of similarity calculations between concepts. The similarity between two concepts is related to their commonalities. The more commonalities, the more similar they are. The similarity between two concepts is related to their differences. The more differences, the less similar they are. When two concepts are exactly the same, the similarity between them reaches the maximum value. Therefore, the following formula can be used to calculate the similarity between concepts:
[0089]
[0090] In formula (9), the denominator represents all the information required to describe the word pair, and the numerator represents the common information between the concepts of the word pair. The similarity calculation formula of the first word similarity calculation model in this embodiment is as follows:
[0091]
[0092] Among them, the function LCS(w1, w2) represents the nearest common node of the semantic nodes corresponding to the word pair w1 and w2, IC(LCS(w1, w2)) represents the common information of the semantic nodes corresponding to the word pair, and IC(w1) and IC(w2) respectively represent the semantic information content of the corresponding words in HowNet.
[0093] According to the formula, the similarity between the two words is calculated by the information content IC values of the two semantic primitives obtained above and formula (10), which is the word similarity calculation result of HowNet.
[0094] The process of calculating the similarity of the word pair to be tested by using the first word similarity calculation model includes:
[0095] According to formula (6), the HowNet semantic information content of the two words in the word pair in the corresponding semantic node in the HowNet semantic hierarchy tree is calculated respectively, and the corresponding HowNet semantic information content is obtained; then, according to the common information of the two HowNet semantic information content contents, the similarity of the word pair is calculated using formula (10).
[0096] In step S4, the process of calculating the similarity of the word pair to be tested by using the second word similarity calculation model is as follows:
[0097] According to the extended version of the "Synonym Cilin" Cilin topology tree, the Cilin topology tree is divided from the root node downward into major categories, medium categories, minor categories, word groups and atomic word groups, and some abstract concepts in the atomic word groups are placed in the corresponding upper structure;
[0098] Obtain the path information of the concept corresponding to each word in the tested word pair from the Cilin topological tree, and calculate the Cilin semantic original information content corresponding to the concept according to the concept depth information in the path information of each word corresponding to the concept;
[0099] The similarity of the word pair to be tested is calculated based on the information content of the concepts corresponding to the two words in the word pair to be tested and the depth information between the corresponding concepts.
[0100] The topological structure of the extended version of Harbin Institute of Technology's "Synonym Dictionary" has an unreasonable way. The "Synonym Dictionary" includes five categories, namely large categories, medium categories, small categories, word groups and atomic word groups. Each word has an independent word coding table, in which the code for large categories is an uppercase English letter, the code for medium categories is a lowercase English letter, the code for small categories is two Arabic numerals, the code for word groups is an uppercase English letter, and the code for atomic word groups is two Arabic numerals. Unlike HowNet, Cilin only has concepts at the atomic word group level, while each node level of the semantic primitive tree of HowNet has semantic primitive nodes. The semantic primitive nodes of abstract concepts are close to the root node, while the semantic primitive nodes of concrete concepts are far from the root node. Therefore, based on the above-mentioned Cilin, it is impossible to distinguish between abstract concepts and concrete concepts. This embodiment uses the revised topological structure of the Synonymous Cilin. The revised structure is similar to the idea of the semantic primitive hierarchical tree of HowNet, which puts the abstract concepts in the atomic word group into the level of large categories, medium categories, small categories, or word groups. The information content IC1(C) of the revised Cilin concept in this embodiment is calculated by formula (11). Figure 2 As shown, an example of a Cilin topology tree is illustrated. The structure of the Cilin revised in this embodiment is a tree structure. The connection path between two words is a factor that affects the similarity. Therefore, path information is introduced into the revised Cilin topology structure to calculate the word similarity.
[0101]
[0102] Among them, max_depth represents the maximum depth of the Cilin topological tree, depth(C) represents the depth of the currently calculated concept node, function hypo(C) represents the number of subordinate nodes corresponding to the current concept node in the Cilin topological tree, max_nodes represents the total number of concept nodes in the Cilin topological tree, k represents the influence weight of the path information, and k is set to 0.5.
[0103] Correspondingly, based on the information content of Cilin, the path information is taken into account in the Cilin similarity calculation method to calculate the word similarity, and the similarity calculation formula of the second word similarity calculation model is obtained as follows:
[0104]
[0105] Among them, α represents an adjustable parameter, p represents the weight parameter used to adjust the path information and information content between the corresponding concepts of the tested word pair w1 and w2, N represents the length of the reachable path between the corresponding concepts, level(i) represents the level of the i-th path in the Cilin topological tree, and the function weight is used to calculate the weight value of the i-th path. According to the Cilin topological tree, it can be known that Figure 2As shown, there are 4 results for level(i). When the value of i is 1, 2, 3, and 4, the corresponding weight(level(i)) is 8, 5, 3, and 1 respectively. Then, the similarity between the two words can be obtained by formula (12).
[0106] In step S6, the calculation formula for the final word similarity of the word pair to be tested is obtained by combining the calculated values of the similarity between the two words in the above formulas (10) and (12):
[0107] sim(w1,w2)=λsim1(w1,w2)+(1-λ)sim2(w1,w2), where λ represents the distribution weight of the tested word pair w1 and w2 in HowNet and its extended version Synonymous Dictionary when selecting the corresponding calculation model, sim1 represents the calculation result of the first word similarity calculation model, and sim2 represents the calculation result of the second word similarity calculation model.
[0108] The distribution of words is as follows Figure 3 As shown in the figure, when a word is included in both HowNet and the extended version of Tongyici Cilin, it is represented by B, when a word is only included in HowNet, it is represented by A, and when a word is only included in the extended version of Tongyici Cilin, it is represented by C. The distribution of the word pairs to be tested in HowNet and the extended version of Tongyici Cilin includes the following situations:
[0109] Case 1: When w1∈B and w2∈B, it means that w1 and w2 are both included in CNKI and Cilin. At this time, the results are calculated by formula (10) and formula (12) of the present invention, and λ is set to 0.5;
[0110] Case 2: When w1∈A and w2∈B, determine whether w2 has a synonym in the extended version of the Synonymous Cilin. If so, set λ to 0.6; if not, set λ to 1. Specifically, first calculate the word similarity of HowNet by formula (10) and record it as sim1. Then find the synonym of w2 in Cilin and calculate the similarity of w1 with HowNet. The maximum value is recorded as sim2. At this time, λ is 0.6. If w2 has no synonym in Cilin, then λ is 1 and sim2 is 0.
[0111] Case 3: When w1∈B and w2∈C, determine whether w1 has a synonym in the extended version of the Synonymous Cilin. If so, set λ to 0.4; if not, set λ to 0. Specifically, first calculate the similarity of w1 and w2 in Cilin, and record the result as sim2. Then find the synonym of w2 in Cilin and calculate the similarity of w1 with it, and record the maximum result as sim1. At this time, λ is 0.4. If w2 has no synonym in Cilin, then λ is 0 and sim1 is 0.
[0112] Case 4: When w1∈A and w2∈C, determine whether w2 has a synonym in the extended version of "Synonym Cilin". If so, select the maximum value as the final word similarity of the tested word pair based on the calculation results of sim1 and sim2. If not, the final word similarity of the tested word pair is 0.1. Find the synonym of w2 in Cilin and perform similarity calculation with w1 in "HowNet", and take the maximum value as the final similarity. If w2 has no synonym in Cilin, then the word similarity is 0.1;
[0113] Case 5: When w1∈A and w2∈A, the similarity of HowNet or CiLin is calculated separately as the final similarity of the word, and λ is set to 1. When w1∈C and w2∈C, λ is set to 0.
[0114] The accuracy of calculating word similarity in this embodiment can use the MC30 word pair set and its published manual judgment value as a standard, and perform performance testing by comparing the calculation method in this embodiment with the Pearson correlation coefficient of other methods on this data set. The test process is as follows: Figure 4 As shown, according to the test results, the word similarity calculated by this embodiment has a higher Pearson correlation coefficient, which means that it is more consistent with the result of human subjective judgment, and the scope of word calculation is expanded to obtain stronger robustness.
[0115] Example 2
[0116] This embodiment 2 provides a system for obtaining word similarity by combining HowNet and Cilin, including:
[0117] HowNet information content calculation module, used to calculate the HowNet semantic content according to the HowNet semantic hierarchy tree and the path information in the semantic hierarchy tree;
[0118] HowNet similarity calculation module, used to construct a first word similarity calculation model according to the HowNet semantic information content, and calculate the similarity sim1 of the word pair to be tested;
[0119] The Cilin similarity calculation module is used to construct a second word similarity calculation model based on the path information in the Cilin topological tree of the extended version of "Synonymous Cilin" and calculate the similarity sim2 of the word pair to be tested;
[0120] The similarity acquisition module for the word pair to be tested is used to combine the calculation results output by the HowNet similarity calculation module and the CiLin similarity calculation module according to the distribution of the word pair to be tested in HowNet and the extended version of Synonymous CiLin, so as to obtain the final word similarity of the word pair to be tested.
[0121] The calculation process of obtaining the final word similarity of sim1, sim2 and the word pair to be tested in this embodiment 2 is consistent with the method in embodiment 1, and therefore, it will not be repeated in this embodiment.
[0122] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.
[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0124] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0126] A person of ordinary skill in the art can understand that all or part of the steps in realizing the above-mentioned facts and methods can be completed by instructing the relevant hardware through a program, and the program involved or the program described can be stored in a computer-readable storage medium. When the program is executed, it includes the following steps: At this time, the corresponding method steps are derived, and the storage medium can be ROM / RAM, a disk, an optical disk, etc.
[0127] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for obtaining word similarity by combining HowNet and Cilin, characterized in that: The following steps are involved: According to the semantic primitive hierarchy tree of HowNet and the path information in the semantic primitive hierarchy tree, the information content of HowNet semantic primitives is calculated; According to the information content of the semantic source in HowNet, a first word similarity calculation model is constructed; Construct a second word similarity calculation model based on the path information in the extended version of "Synonym Cilin" Cilin topology tree; Obtain a word pair to be tested, and calculate the similarity of the word pair to be tested using the first word similarity calculation model and the second word similarity calculation model respectively according to the distribution of the word pair to be tested in HowNet and the extended version of Synonyms Cilin; The word similarities calculated by the two calculation models are combined to obtain the final word similarity of the word pair to be tested; The process of obtaining the information content of HowNet semantics includes: According to the total number of nodes in the semantic hierarchy tree of HowNet and the number of subordinate nodes corresponding to the semantic nodes in the semantic hierarchy tree, the first information content of the semantic original is calculated; According to the semantic density information and semantic depth information in the semantic hierarchy tree path information of the current semantic node, the node sum of the current semantic node and its sibling nodes is calculated according to the semantic density information; the second information content of the semantic original is calculated; Combining the first information content content of the sememe and the second information content content, the information content content of the HowNet sememe is obtained; The process of calculating the similarity of the word pair to be tested by using the first word similarity calculation model includes: Calculate the HowNet semantic information content of the two words in the word pair at the corresponding semantic nodes in the HowNet semantic hierarchy tree, and obtain two HowNet semantic information content contents; According to the common information of the two semantic primitives in HowNet, the similarity of the word pair is calculated. The calculation process is as follows: Among them, the function LCS(w1, w2) represents the nearest common node of the semantic nodes corresponding to the word pair w1 and w2, IC(LCS(w1, w2)) represents the common information of the semantic nodes corresponding to the word pair, and IC(w1) and IC(w2) represent the semantic information content of the corresponding words in HowNet, respectively. Among them, the calculation formula for obtaining the information content IC(C) of HowNet semantic source is as follows: Among them, max_nodes represents the total number of nodes in the semantic primitive hierarchy tree, function hypo(C) represents the number of lower nodes corresponding to the semantic primitive node in the semantic primitive hierarchy tree, function f(C) represents the density information of the tree where the current semantic primitive node is located, c1 represents the weight factor that weighs the influence of semantic primitive depth information and semantic primitive density information on the information content, k represents the influence weight of path information, k is set to 0.5, c1 is set to 0.6; The process of calculating the similarity of the word pair to be tested by using the second word similarity calculation model is as follows: According to the extended version of the "Synonym Cilin" Cilin topology tree, the Cilin topology tree is divided from the root node downward into major categories, medium categories, minor categories, word groups and atomic word groups, and the abstract concepts of the atomic word groups are placed in the corresponding upper structure; Obtain the path information of the concept corresponding to each word in the tested word pair from the Cilin topological tree, and calculate the information content of the concept according to the concept depth information in the path information of the concept corresponding to each word; Calculate the similarity of the word pair to be tested based on the information content of the concepts corresponding to the two words in the word pair to be tested and the depth information between the corresponding concepts; The process of calculating the information content IC1(C) of concepts in Cilin is as follows: Among them, max_depth represents the maximum depth of the Cilin topological tree, depth(C) represents the depth of the currently calculated concept node, function hypo(C) represents the number of subordinate nodes corresponding to the current concept node in the Cilin topological tree, max_nodes represents the total number of concept nodes in the Cilin topological tree, k represents the influence weight of the path information, and k is set to 0.5; The similarity calculation process of the second word similarity calculation model is as follows: Among them, α represents an adjustable parameter, p represents a weight parameter used to adjust the path information and information content between the corresponding concepts of the tested word pair w1 and w2, N represents the length of the reachable path between the corresponding concepts, level(i) represents the level of the i-th path in the Cilin topological tree, and the function weight is used to calculate the weight value of the i-th path; Among them, the calculation formula for obtaining the final word similarity of the word pair to be tested is: sim(w1,w2)=λsim1(w1,w2)+(1-λ)sim2(w1,w2), where λ represents the weight assigned when selecting the corresponding calculation model according to the distribution of the tested word pair w1 and w2 in HowNet and the extended version of Synonymous Cilin, sim1 represents the calculation result of the first word similarity calculation model, and sim2 represents the calculation result of the second word similarity calculation model; Among them, according to the distribution of the word pair to be tested in "HowNet" and the extended version "Tongyi Cilin", when the word is included in both "HowNet" and the extended version "Tongyi Cilin", it is represented by B, when the word is only included in "HowNet", it is represented by A, and when the word is only included in the extended version "Tongyi Cilin", it is represented by C. The process of obtaining the final word similarity of the word pair to be tested is: When w1∈B and w2∈B, set λ to 0.5; When w1∈A and w2∈B, determine whether w2 has a synonym in the extended version of the Synonymous Dictionary. If so, set λ to 0.6; if not, set λ to 1. When w1∈B and w2∈C, determine whether w1 has a synonym in the extended version of the Synonymous Dictionary. If so, set λ to 0.4; if not, set λ to 0. When w1∈A and w2∈C, determine whether w2 has a synonym in the extended version of "Synonym Cilin". If so, select the maximum value as the final word similarity of the word pair to be tested based on the calculation results of sim1 and sim2. If not, the final word similarity of the word pair to be tested is 0.
1. When w1∈A and w2∈A, set λ to 1, and when w1∈C and w2∈C, set λ to 0.
2. A system for obtaining word similarity by combining HowNet and Cilin, characterized in that: The method for obtaining word similarity based on claim 1 by combining HowNet and CiLin comprises: HowNet information content calculation module, used to calculate the HowNet semantic content according to the HowNet semantic hierarchy tree and the path information in the semantic hierarchy tree; HowNet similarity calculation module, used to construct a first word similarity calculation model according to the HowNet semantic information content, and calculate the similarity sim1 of the word pair to be tested; The Cilin similarity calculation module is used to construct a second word similarity calculation model based on the path information in the Cilin topological tree of the extended version of "Synonymous Cilin" and calculate the similarity sim2 of the word pair to be tested; The similarity acquisition module for the word pair to be tested is used to combine the calculation results output by the HowNet similarity calculation module and the CiLin similarity calculation module according to the distribution of the word pair to be tested in HowNet and the extended version of Synonymous CiLin, so as to obtain the final word similarity of the word pair to be tested.
Citation Information
Patent Citations
Text similarity determination method and device and storage medium
CN111737997A
