High-quality noise detection method and device based on rule information
By extracting and instantiating rules in the knowledge graph and calculating confidence to screen out high-quality noise, it solves the problem of failing to effectively detect high-quality noise in the existing technology and improves the accuracy and noise detection capabilities of the knowledge graph representation learning model.
Patent Information
- Application Number
- CN202210135548.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing knowledge graph representation learning models fail to effectively detect high-quality noise when dealing with noise, especially triples with the same entity type but errors, resulting in insufficient model training accuracy and noise detection capabilities.
By building a knowledge graph, extracting and instantiating rules, calculating the global path confidence and rule confidence of the target triplet, calculating the target confidence based on hyperparameters, filtering and removing high-quality noise, and then training the representation learning model to improve model accuracy. and noise detection capabilities.
It achieves fast and accurate detection and reduces the negative impact of high-quality noise on the modeling process, and improves the accuracy and noise detection capabilities of the knowledge graph representation learning model.
Smart Images

Figure CN114860945B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graphs, and in particular to a high-quality noise detection method and device based on rule information. Background Art
[0002] The goal of knowledge representation learning is to use dense low-dimensional vectors to represent entities and relations in knowledge graphs. Currently, translation models and bilinear models are representative models of knowledge representation learning, which can well obtain the semantic connection between entities and relations. However, since most knowledge representation learning methods assume that the knowledge in the existing knowledge graph is completely correct and ignore the large amount of potential noise in real life, this will cause most traditional representation learning models to bring potential errors in the process of understanding the semantic connection of noisy knowledge graphs, and then cause errors in the vector representation of entities and relations; although some work has considered the noise in knowledge graphs, these works use entity description information, global path triple confidence and other information for noise detection, but the existing noise detection methods have not considered the factors that the rules have rich semantic information that can be used for noise detection.
[0003] Most existing translation rule-based models do not consider the potential high-quality noise in the automatic construction of knowledge graphs, so most models do not have the ability to detect high-quality noise. When building representation learning models, there are two problems to be solved:
[0004] (1) High-quality noise problem
[0005] When constructing the knowledge graph of the real world, low-quality noise such as entity type errors may appear, and most of the noise such as misunderstandings between similar entities may also appear. This type of data can be called high-quality noise. High-quality noise is more likely to be generated and difficult to detect during the automatic construction of the knowledge graph. Figure 1 is a schematic diagram of different types of noise according to the prior art, such as Figure 1 As shown in the figure, given a correct triple (China, capital, Beijing), two different types of noise triple data are given. One of the triples is (China, capital, computer). Since computer is not a place type entity, this triple is a low-quality noise with the wrong entity type. The other triple is (China, capital, Nanjing). Nanjing and Beijing are both place type entities, but they are wrong in this triple. This triple with the same entity type but still wrong is a high-quality noise.
[0006] (2) Rules contain semantic information
[0007] The traditional Web Ontology Language (OWL) method can only detect noise by layer through the category to which the entity belongs, and cannot detect high-quality noise of the same entity type.
[0008] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0009] The embodiments of the present invention provide a high-quality noise detection method and device based on rule information, so as to at least solve the technical problem that high-quality noise exists in the knowledge graph during the modeling process and the high-quality noise cannot be effectively detected.
[0010] According to one aspect of an embodiment of the present invention, there is provided a high-quality noise detection method based on rule information, comprising: constructing a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is a triple with the same entity type but erroneous; instantiating the rules extracted from the knowledge graph to obtain a target triple of the knowledge graph; determining a target confidence of the target triple; and determining the high-quality noise in the knowledge graph based on the target confidence.
[0011] Optionally, the rules extracted from the knowledge graph are instantiated to obtain target triples of the knowledge graph, including: obtaining triples and an entity set of the knowledge graph; extracting rules based on the triples to obtain the rules of the knowledge graph; and instantiating the rules based on the entity set to obtain the target triples.
[0012] Optionally, determining the target confidence of the target triplet includes: acquiring a global path confidence and a rule confidence of the target triplet; and determining the target confidence according to the global path confidence and the rule confidence.
[0013] Optionally, obtaining the rule confidence of the target triplet includes: obtaining the weight associated between the rule body and the rule head in the target triplet; respectively calculating the score of the rule body and the score of the rule head in the target triplet; and obtaining the rule confidence based on the weight, the score of the rule body and the score of the rule head.
[0014] Optionally, the target confidence is determined according to the global path confidence and the rule confidence, and is expressed in the following manner: C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t), wherein C(h,r,t) is the target triplet, C(h,r,t) is the target confidence of the target triplet, LT(h,r,t) is the global path confidence of the target triplet, RC(h,r,t) is the rule confidence of the target triplet, λ1 is the first hyperparameter corresponding to the target triplet, and λ2 is the second hyperparameter corresponding to the target triplet.
[0015] Optionally, determining the high-quality noise in the knowledge graph based on the target confidence includes: judging whether the target confidence is less than a confidence threshold; and filtering out the high-quality noise in the knowledge graph when the target confidence is less than the confidence threshold.
[0016] Optionally, after determining the high-quality noise in the knowledge graph according to the target confidence, the method further includes: deleting the high-quality noise in the knowledge graph to obtain a target knowledge graph; training a representation learning model according to the triples in the target knowledge graph and the target confidence corresponding to the triples, wherein the representation learning model includes an objective function of a pairwise ranking loss function.
[0017] According to another aspect of an embodiment of the present invention, a high-quality noise detection device based on rule information is also provided, including: a construction module, used to construct a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is a triple with the same entity type but incorrect; a processing module, used to instantiate the rules extracted from the knowledge graph to obtain a target triple of the knowledge graph; a first determination module, used to determine the target confidence of the target triple; and a second determination module, used to determine the high-quality noise in the knowledge graph according to the target confidence.
[0018] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned high-quality noise detection methods based on rule information.
[0019] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program executes any one of the above-mentioned high-quality noise detection methods based on rule information when running.
[0020] In an embodiment of the present invention, a knowledge graph is constructed based on text data, wherein the knowledge graph includes at least high-quality noise, which is a triple with the same entity type but incorrect; the rules for knowledge graph extraction are instantiated to obtain a target triple of the knowledge graph; the target confidence of the target triple is determined; based on the target confidence, the high-quality noise in the knowledge graph is determined, and the high-quality noise in the knowledge graph is detected by the target confidence of the target triple, thereby achieving the purpose of quickly and accurately detecting the high-quality noise in the knowledge graph, thereby achieving the technical effect of reducing the negative impact of high-quality noise on the modeling process, improving the accuracy of modeling and the efficiency of model training, and further solving the technical problem that high-quality noise exists in the knowledge graph during the modeling process and cannot be effectively detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a schematic diagram of different types of noise according to the prior art;
[0023] Figure 2 is a flow chart of a high-quality noise detection method based on rule information according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of a rule and triplet scores of its parts according to an optional embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of a knowledge graph automatic construction and noise detection framework according to an optional embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of a high-quality noise detection device based on rule information according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Example 1
[0030] According to an embodiment of the present invention, an embodiment of a high-quality noise detection method based on rule information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] Figure 2 is a flow chart of a high-quality noise detection method based on rule information according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0032] Step S202, constructing a knowledge graph based on the text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is a triple with the same entity type but an error;
[0033] The above-mentioned text data includes but is not limited to text data obtained from the Internet through a predetermined tool; the above-mentioned knowledge graph is used to describe multiple entities and the relationship between each entity, wherein two entities and the relationship between the two entities constitute a triple. Therefore, the knowledge graph may include multiple triples. It should be noted that according to the type of triples, they can be divided into correct triples, low-quality noise and high-quality noise, wherein low-quality noise is a triple with the wrong entity type, and high-quality noise is a triple with the same entity type as the correct triple but the entity type is wrong.
[0034] Step S204, instantiate the rules extracted from the knowledge graph to obtain target triples of the knowledge graph;
[0035] The above target triples include but are not limited to rule body, rule head, etc.
[0036] In an optional implementation, the rules extracted from the knowledge graph are instantiated to obtain target triples of the knowledge graph, including: obtaining triples and entity sets of the knowledge graph; extracting rules based on the triples to obtain rules of the knowledge graph; and instantiating the rules based on the entity set to obtain target triples. Through the above implementation, the rules can be instantiated using the entity set to obtain the corresponding target triples.
[0037] Step S206, determining the target confidence of the target triplet;
[0038] In an optional implementation, determining the target confidence of the target triplet includes: obtaining the global path confidence and rule confidence of the target triplet; and determining the target confidence according to the global path confidence and the rule confidence. Optionally, in order to obtain the rule confidence of the target triplet, the following implementation may be adopted, firstly, the weight associated between the rule body and the rule head in the target triplet is obtained, and then the score of the rule body and the score of the rule head in the target triplet are calculated respectively, and finally the rule confidence is obtained according to the weight, the score of the rule body and the score of the rule head.
[0039] It should be noted that, according to the semantic information between the triples contained in the rule, the approximate relationship between the triples constrained by the rule is obtained, and the quality function of the translation model is redefined using the confidence based on the rule triples, thereby improving the accuracy of the representation learning model and the noise detection ability. The above translation model can use the translation vector and the hyperplane normal vector to represent the relationship.
[0040] In addition, rules contain rich semantic information. Triples linked by rules have a close connection. Using this connection, we can find errors in high-quality noise, use rules to improve the distance between entities and relations in triples, and then adjust the embedding representation of the representation learning model. For example, the rules extracted from the YAGO37 dataset using the AMIE+ tool There is a high-quality noise triple (Kobe Bean Bryant, isMarriedTo, Tracy McGrady) in the noisy knowledge graph. The instantiation of the above rule can get the triple (Tracy McGrady, isMarriedTo, Kobe Bean Bryant). After dynamically adjusting the confidence of local triples in the CKRL model capable of noise processing, it can be seen that the scores of the two triples (Kobe Bean Bryant, isMarriedTo, Tracy McGrady) and (Tracy McGrady, isMarriedTo, Kobe Bean Bryant) are both low. The approximate relationship between triples constrained by rules can more effectively reduce the confidence of erroneous triples.
[0041] In an optional embodiment, the target confidence is determined according to the global path confidence and the rule confidence, and is expressed in the following manner: C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t), wherein C(h,r,t) is the target triplet, C(h,r,t) is the target confidence of the target triplet, LT(h,r,t) is the global path confidence of the target triplet, RC(h,r,t) is the rule confidence of the target triplet, λ1 is the first hyperparameter corresponding to the target triplet, and λ2 is the second hyperparameter corresponding to the target triplet.
[0042] It should be noted that the first hyperparameter and the second hyperparameter mentioned above can be flexibly set according to the needs of the application scenario.
[0043] Step S208, determining high-quality noise in the knowledge graph based on the target confidence.
[0044] In an optional implementation, high-quality noise in the knowledge graph is determined based on the target confidence, including: determining whether the target confidence is less than a confidence threshold; if the target confidence is less than the confidence threshold, high-quality noise in the knowledge graph is screened out. In addition, if the target confidence is greater than or equal to the confidence threshold, high-quality noise does not exist in the knowledge graph, and there is no need to screen high-quality noise in the knowledge graph.
[0045] Through the above steps, high-quality noise in the knowledge graph can be detected by the target confidence of the target triplet, thereby achieving the purpose of quickly and accurately detecting high-quality noise in the knowledge graph, thereby achieving the technical effect of reducing the negative impact of high-quality noise on the modeling process and improving the accuracy of modeling and the efficiency of model training, and thus solving the technical problem that high-quality noise exists in the knowledge graph during the modeling process and cannot be effectively detected.
[0046] In an optional embodiment, after determining the high-quality noise in the knowledge graph based on the target confidence, the above method also includes: deleting the high-quality noise in the knowledge graph to obtain the target knowledge graph; training the representation learning model based on the triples in the target knowledge graph and the target confidence corresponding to the triples, wherein the representation learning model includes an objective function of the pairwise ranking loss function.
[0047] In order to make the representation learning model more accurate, the high-quality noise in the knowledge graph can be deleted during the training of the representation learning model to generate the target knowledge graph. Since the goal is to have no high-quality noise in the graph, the representation learning model can be trained by using the triples in the target knowledge graph and the target confidence corresponding to the triples, which can more effectively reduce the adverse effects of high-quality noise on the representation learning model, thereby improving the accuracy of the representation learning model and the noise detection capability.
[0048] In addition, the triplets in the knowledge graph used as training data can be divided into positive sample sets and negative sample sets, and then the positive sample sets and negative sample sets can be used to train the representation learning model, thereby continuously updating the representation learning model to improve the accuracy of the representation learning model and the noise detection capability.
[0049] It should be noted that the above representation learning model has noise detection capabilities and can be used to detect high-quality noise in knowledge graphs.
[0050] An optional implementation manner of the present invention is described in detail below.
[0051] In an optional embodiment of the present invention, rule information can be used to complete the screening of high-quality noise in the knowledge graph, and then the RCKRL algorithm is proposed. The main idea of the algorithm is that, first, there is an approximate relationship between the triples constrained by the rules, and there is a semantic connection between the triples linked by the rules. Through this connection, the distance represented by the vector between the entity and the relationship can be guided. Then, based on the concept of rule triple confidence, the correctness of the triples in the knowledge graph is measured to reduce the confidence of the wrong or conflicting triples. Subsequently, the objective function is updated, and the confidence based on the rule triples is added to improve the efficiency of the training process. It should be noted that the performance of the RCKRL model in the link prediction task has been significantly improved, which provides a feasible modeling idea for high-quality noise detection through rules.
[0052] In the specific implementation process, we first initialize the rule confidence of the triples based on the approximate relationship between the rule-constrained triplets. The algorithm corresponding to the high-quality noise detection method based on rule confidence can effectively deal with the negative impact of high-quality noise on the training process of the representation learning model.
[0053] The specific algorithm is described as follows:
[0054]
[0055] Furthermore, the approximate relationship between the triples of rule constraints refers to a set of ordered relations contained in a rule, and the relations in the rule body are similar to those in the rule header. For example, there is a rule "?b born in?a=>?a nationality?b", which contains two relations "birthplace" and "nationality". This rule states that a person born in a certain country is likely to have the nationality of that country. Each such relation pair (r body ,r head ) are associated with a weight φ, which is the confidence of the rule, which can be expressed as “r body =>r head φ". A higher weight means a higher credibility of the rule. If a rule is correct, the rule head score should be greater than or equal to the rule body score. Therefore, the approximate implication relationship between the relations rbody and rhead for a rule with a confidence of φ can be expressed as:
[0056] f(h,r head ,t)≥Φ·f(h,r body ,t)
[0057] Among them, f(h,r,t) represents the score of the triple after the rule is instantiated, and φ is the confidence of the rule. Using the approximate relationship guided by the rule, if the rule body is a noise triple, then the rule head is also likely to be a noise triple. According to the above content, the triple confidence guided by the rule is defined as follows:
[0058] RC(h,r,t)=[Φ·f(RBODY)-f(RHEAD)] +
[0059] Since the vector representation of entities and relations changes dynamically during the calculation process, the confidence of rule triples uses the score of translation model triples. Therefore, the triple confidence guided by rules changes with the model training process. This change can better obtain the status of entities and relations in the current knowledge graph. When the rule length is 2, f(RBODY) is the score of the triple in the rule body, and the rule confidence of the triple in the rule body can be initialized or updated; when the rule length is greater than 2, the rule body cannot be directly calculated by the score function. The PSL method is used to convert the symbolic representation of the rule body into a vector representation, and the confidence of each triple in the rule body can be updated. The calculation method is as follows:
[0060] f(RBODY)=f(T1∧T2)=max{0,f(h1,r1,t1)+f(h2,r2,t2)-1}
[0061] The rule "?b / film / film / written_by?a=>?a / film / writer / film?b 0.93" was extracted through external tools. This rule means that if the script of movie B is written by A, then the probability that A wrote the script of B is 0.93. After instantiating the rule through the entity set, the rule body (Harry Potter, written_by, Jacob) and the rule head (Jacob, writer, Harry Potter) were obtained respectively. Both triples are noise triples. The global path confidence of the CKRL model leads to a low score for the triple. Further calculation shows that the rule confidence score of the triple is also low, which further proves that the triple is a high-quality noise triple, reducing its influence in the training process.
[0062] It should be noted that probabilistic soft logic (PSL) is a framework for collective probabilistic reasoning in relational domains. It can use simple logical syntax to define models and perform operations through fast convex optimization. PSL has a wide range of applications in many fields such as natural language processing, social network analysis, knowledge graphs, recommendation systems, and computational biology. The advantages of PSL are:
[0063] (1) PSL uses first-order logic, which can concisely represent complex relationships. Unlike the Markov logic network (MLN) which uses extreme value 0 (false) and 1 (true) logic, PSL uses soft truth values between [0, 1] as operation values.
[0064] (2)PSL is a probabilistic graphical model that can capture the uncertainty and incompleteness of data in real-world knowledge.PSL uses “soft” logic as its logical component and Markov networks as its statistical model.
[0065] PSL uses first-order logic rules to capture the dependency structure of the domain and builds a joint probability model on all atoms based on this. Each rule has an associated non-negative weight that captures the relative importance of the rule, which is the corresponding confidence of the rule. In order to determine the degree to which the basic rules are satisfied, PSL uses the Lukasiewiczt normal form and its corresponding co-normal form as relaxations of logical AND and OR, respectively. These relaxations are precise in specific cases and can provide a consistent mapping. In the field of knowledge graph applications, given a triple T n , logical conjunction (∧), disjunction (∨) and negation The true value calculation formula is as follows:
[0066] d(T1∧T2)=max{0,f(T1)+f(T2)-1}
[0067] d(T1∨T2)=min{f(T1)+f(T2),1}
[0068]
[0069] Applying the PSL method to representation learning, we can calculate the overall score of the rule body. For example, given a rule and its partial triples, the score calculated by the translation model. Figure 3 is a schematic diagram of a rule and its triplet scores according to an optional embodiment of the present invention, such as Figure 3 As shown, the overall score of the rule body is: d(r body )=max{0,1.9-1}=0.9.
[0070] Furthermore, according to the translation hypothesis, after training, the vector representation of each triple (h, r, t) in the knowledge graph must satisfy h+rt=0. Due to the large number of complex relationships and noise in the knowledge graph, even if the impact of constraints is reduced, it is impossible to ensure that all triples meet the conditions after training. As the model is trained, semantically similar entities may form clusters near the same spatial location. Since similar entities are close in distance, the calculated scores are close, and high-quality noise will greatly affect the distance between entities and relationships. Noisy or conflicting triplets should have lower confidence. Using rule-guided approximate relationships to penalize triplets that violate translation rules can reduce the confidence of noisy triplets and reduce the impact of high-quality noise in the model training process.
[0071] It should be noted that the CKRL model utilizes both local and global structural information, and designs local triple confidence and global triple confidence respectively. Referring to the NCKRL model for generating high-quality negative samples, only the confidence of the local triple is considered, while the overall confidence of the present invention is updated to a combination of the two confidences, and the overall confidence is expressed as follows:
[0072] C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t)
[0073] Among them, λ1 and λ2 are hyperparameters, LT(h,r,t) is the global path confidence of the triple, and RC(h,r,t) is the rule confidence of the triple. On the basis of the NCKRL model generating high-quality negative samples, the rule-guided triple confidence is added to assist model training. The objective function of the pairwise ranking loss function is as follows:
[0074]
[0075] Among them, f(h,r,t) is the score of the triplet, and f(h',r',t') is the score of the negative sample triplet. γ>0 is the hyperparameter of the boundary, C(h,r,t) guides the model to pay more attention to those more convincing facts, and S' represents the generated negative sample set, which is expressed as:
[0076] S'={(h',r,t)|h'∈E}∪{(h,r,t')|t'∈E}∪{(h,r',t)|r'∈R}
[0077] Figure 4 is a schematic diagram of a knowledge graph automatic construction and noise detection framework according to an optional embodiment of the present invention, such as Figure 4 As shown in the figure, high-quality noise is generated in the process of automatic construction of knowledge graphs. The RCKRL model guided by rule confidence is proposed to detect high-quality noise. Such noise is ignored during the representation learning and training process, which can improve the quality of embedding representation of noisy knowledge graphs. This method has a wide range of applications in the fields of knowledge graph construction and knowledge reasoning, namely knowledge graph completion, intelligent question-answering systems, and other issues.
[0078] Optionally, according to the method flow proposed above, for the application of the knowledge question answering system, the specific implementation process is as follows:
[0079] 1) Automatic construction of knowledge graphs. Using the knowledge graph automatic construction tool, text data is constructed into a knowledge graph. The constructed knowledge graph contains a certain amount of noise and erroneous data. For example Figure 4 High quality noise in (Hawaii, Indonesia).
[0080] 2) Extract rules and instantiate them. Extract rules from the triple data in the current knowledge graph and instantiate the rules using the data in the graph.
[0081] 3) Initialize the rule-based confidence of the triple. Through the calculation of the above method, initialize the rule-based confidence of the triple.
[0082] 4) Model training. The above rule-based high-quality noise detection method is applied to the representation model based on translation rules (such as TransE, etc.) for training, and the knowledge graph is represented by vectors. Through training, (Hawaii, belongs to, Indonesia) can be screened out as high-quality noise, its influence can be weakened, and the edge between Hawaii and Indonesia can be removed.
[0083] 5) Knowledge question answering: When a user asks the question “Where does Hawaii belong to?”, natural language processing can be used to simplify the question into a connection prediction problem, that is, predicting the tail entity of the triple (Hawaii, belongs to,?).
[0084] 6) Link prediction. (Hawaii, belongs to,?), the tail entity of this triple is missing. The vectors of the head entity and the relationship are brought into the translation rule of the model for calculation. After calculation, the tail entity "United States" is obtained to complete the knowledge graph and add a directed edge between the two nodes of Hawaii and United States.
[0085] Example 2
[0086] According to another aspect of the embodiment of the present invention, a high-quality noise detection device based on rule information is also provided. Figure 5 is a schematic diagram of a high-quality noise detection device based on rule information according to an embodiment of the present invention. Figure 5 As shown, the high-quality noise detection device based on rule information includes: a construction module 52, a processing module 54, a first determination module 56 and a second determination module 58. The high-quality noise detection device based on rule information is described in detail below.
[0087] A construction module 52 is used to construct a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, which is a triple with the same entity type but incorrect; a processing module 54 is connected to the above-mentioned construction module 52, and is used to instantiate the rules of knowledge graph extraction to obtain target triples of the knowledge graph; a first determination module 56 is connected to the above-mentioned processing module 54, and is used to determine the target confidence of the target triples; a second determination module 58 is connected to the above-mentioned first determination module 56, and is used to determine the high-quality noise in the knowledge graph according to the target confidence.
[0088] It should be noted that the above-mentioned modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above-mentioned modules can be located in the same processor; and / or the above-mentioned modules are located in different processors in any combination.
[0089] In the above embodiment, the high-quality noise detection device based on rule information can detect high-quality noise in the knowledge graph through the target confidence of the target triplet, thereby achieving the purpose of quickly and accurately detecting high-quality noise in the knowledge graph, thereby achieving the technical effect of reducing the negative impact of high-quality noise on the modeling process and improving the accuracy of modeling and the efficiency of model training, and thus solving the technical problem that high-quality noise exists in the knowledge graph during the modeling process and cannot be effectively detected.
[0090] It should be noted here that the above-mentioned construction module 52, processing module 54, first determination module 56 and second determination module 58 correspond to steps S202 to S108 in Example 1, and the examples and application scenarios implemented by the above-mentioned modules are the same as those of the corresponding steps, but are not limited to the contents disclosed in the above-mentioned Example 1.
[0091] Optionally, the above-mentioned processing module 54 includes: a first acquisition unit, used to obtain triples and entity sets of the knowledge graph; an extraction unit, used to extract rules based on triples to obtain rules of the knowledge graph; and a processing unit, used to instantiate the rules according to the entity set to obtain target triples.
[0092] Optionally, the first determination module 56 includes: a second acquisition unit, used to acquire a global path confidence and a rule confidence of a target triple; and a determination unit, used to determine a target confidence according to the global path confidence and the rule confidence.
[0093] Optionally, the above-mentioned second acquisition unit includes: an acquisition subunit, used to obtain the weight associated between the rule body and the rule head in the target triplet; a calculation subunit, used to respectively calculate the score of the rule body and the score of the rule head in the target triplet; and an obtaining subunit, used to obtain the rule confidence based on the weight, the score of the rule body and the score of the rule head.
[0094] Optionally, the target confidence in the above determination unit is expressed in the following manner: C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t), wherein C(h,r,t) is the target triplet, C(h,r,t) is the target confidence of the target triplet, LT(h,r,t) is the global path confidence of the target triplet, RC(h,r,t) is the rule confidence of the target triplet, λ1 is the first hyperparameter corresponding to the target triplet, and λ2 is the second hyperparameter corresponding to the target triplet.
[0095] Optionally, the second determination module 58 includes: a judgment unit for judging whether the target confidence is less than a confidence threshold; and a screening unit for screening out high-quality noise in the knowledge graph when the target confidence is less than the confidence threshold.
[0096] Optionally, the above-mentioned device also includes: a deletion module, which is used to delete the high-quality noise in the knowledge graph after determining the high-quality noise in the knowledge graph according to the target confidence, so as to obtain the target knowledge graph; a training module, which is used to train the representation learning model according to the triples in the target knowledge graph and the target confidences corresponding to the triples, wherein the representation learning model includes an objective function of a pairwise ranking loss function.
[0097] Example 3
[0098] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned high-quality noise detection methods based on rule information.
[0099] In this embodiment, the computer-readable storage medium may be located in any computer terminal in a computer terminal group in a computer network, and / or located in any mobile terminal in a mobile terminal group, and the computer-readable storage medium includes a stored program.
[0100] Optionally, when the program is running, the device where the computer-readable storage medium is located is controlled to perform the following functions: construct a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is triples with the same entity type but incorrect; instantiate the rules extracted from the knowledge graph to obtain target triples of the knowledge graph; determine the target confidence of the target triples; and determine the high-quality noise in the knowledge graph based on the target confidence.
[0101] Optionally, the rules extracted from the knowledge graph are instantiated to obtain target triples of the knowledge graph, including: obtaining triples and entity sets of the knowledge graph; extracting rules based on the triples to obtain rules of the knowledge graph; and instantiating the rules based on the entity set to obtain target triples.
[0102] Optionally, determining the target confidence of the target triplet includes: acquiring a global path confidence and a rule confidence of the target triplet; and determining the target confidence according to the global path confidence and the rule confidence.
[0103] Optionally, obtaining the rule confidence of the target triplet includes: obtaining the weight associated between the rule body and the rule head in the target triplet; respectively calculating the score of the rule body and the score of the rule head in the target triplet; and obtaining the rule confidence according to the weight, the score of the rule body and the score of the rule head.
[0104] Optionally, the target confidence is determined according to the global path confidence and the rule confidence, and is expressed in the following manner: C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t), wherein C(h,r,t) is the target triplet, C(h,r,t) is the target confidence of the target triplet, LT(h,r,t) is the global path confidence of the target triplet, RC(h,r,t) is the rule confidence of the target triplet, λ1 is the first hyperparameter corresponding to the target triplet, and λ2 is the second hyperparameter corresponding to the target triplet.
[0105] Optionally, high-quality noise in the knowledge graph is determined based on the target confidence, including: judging whether the target confidence is less than a confidence threshold; if the target confidence is less than the confidence threshold, filtering out high-quality noise in the knowledge graph.
[0106] Optionally, after determining the high-quality noise in the knowledge graph based on the target confidence, the above method also includes: deleting the high-quality noise in the knowledge graph to obtain the target knowledge graph; training the representation learning model based on the triples in the target knowledge graph and the target confidence corresponding to the triples, wherein the representation learning model includes an objective function of the pairwise ranking loss function.
[0107] Example 4
[0108] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein when the program is run, any one of the above-mentioned high-quality noise detection methods based on rule information is executed.
[0109] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: constructing a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is triples with the same entity type but errors; instantiating the rules extracted from the knowledge graph to obtain target triples of the knowledge graph; determining the target confidence of the target triples; and determining the high-quality noise in the knowledge graph based on the target confidence.
[0110] Optionally, the rules extracted from the knowledge graph are instantiated to obtain target triples of the knowledge graph, including: obtaining triples and entity sets of the knowledge graph; extracting rules based on the triples to obtain rules of the knowledge graph; and instantiating the rules based on the entity set to obtain target triples.
[0111] Optionally, determining the target confidence of the target triplet includes: acquiring a global path confidence and a rule confidence of the target triplet; and determining the target confidence according to the global path confidence and the rule confidence.
[0112] Optionally, obtaining the rule confidence of the target triplet includes: obtaining the weight associated between the rule body and the rule head in the target triplet; respectively calculating the score of the rule body and the score of the rule head in the target triplet; and obtaining the rule confidence according to the weight, the score of the rule body and the score of the rule head.
[0113] Optionally, the target confidence is determined according to the global path confidence and the rule confidence, and is expressed in the following manner: C(h,r,t)=λ1·LT(h,r,t)+λ2·RC(h,r,t), wherein C(h,r,t) is the target triplet, C(h,r,t) is the target confidence of the target triplet, LT(h,r,t) is the global path confidence of the target triplet, RC(h,r,t) is the rule confidence of the target triplet, λ1 is the first hyperparameter corresponding to the target triplet, and λ2 is the second hyperparameter corresponding to the target triplet.
[0114] Optionally, high-quality noise in the knowledge graph is determined based on the target confidence, including: judging whether the target confidence is less than a confidence threshold; if the target confidence is less than the confidence threshold, filtering out high-quality noise in the knowledge graph.
[0115] Optionally, after determining the high-quality noise in the knowledge graph based on the target confidence, the above method also includes: deleting the high-quality noise in the knowledge graph to obtain the target knowledge graph; training the representation learning model based on the triples in the target knowledge graph and the target confidence corresponding to the triples, wherein the representation learning model includes an objective function of the pairwise ranking loss function.
[0116] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0117] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0120] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0121] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0122] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A high-quality noise detection method based on rule information, It is characterized in that include: Constructing a knowledge graph according to the text data, wherein the knowledge graph includes at least high-quality noise, wherein the high-quality noise is a triple with the same entity type but an error; Instantiate the rules extracted from the knowledge graph to obtain target triples of the knowledge graph; Determine the target confidence of the target triplet, wherein determining the target confidence of the target triplet includes: obtaining the global path confidence and the rule confidence of the target triplet; determining the target confidence according to the global path confidence and the rule confidence; the target confidence is expressed in the following manner: , is the target confidence of the target triplet, is the global path confidence of the target triplet, is the rule confidence of the target triple, is the first hyperparameter corresponding to the target triplet, is a second hyperparameter corresponding to the target triple; According to the target confidence, the high-quality noise in the knowledge graph is determined.
2. The method according to claim 1, It is characterized in that The rules extracted from the knowledge graph are instantiated to obtain target triples of the knowledge graph, including: Obtaining triples and entity sets of the knowledge graph; Extract rules according to the triples to obtain the rules of the knowledge graph; The rule is instantiated according to the entity set to obtain the target triple.
3. The method according to claim 1, It is characterized in that Obtaining the rule confidence of the target triplet, including: Obtaining the weight associated between the rule body and the rule head in the target triple; Calculate the score of the rule body and the score of the rule head in the target triple respectively; The rule confidence is obtained according to the weight, the score of the rule body and the score of the rule head.
4. The method according to claim 1, It is characterized in that Determining the high-quality noise in the knowledge graph according to the target confidence includes: Determining whether the target confidence is less than a confidence threshold; When the target confidence is less than the confidence threshold, the high-quality noise in the knowledge graph is filtered out.
5. The method according to any one of claims 1 to 4, It is characterized in that After determining the high-quality noise in the knowledge graph according to the target confidence, the method further includes: Deleting the high-quality noise in the knowledge graph to obtain a target knowledge graph; A representation learning model is trained according to the triples in the target knowledge graph and the target confidences corresponding to the triples, wherein the representation learning model includes an objective function of a pairwise ranking loss function.
6. A high-quality noise detection device based on rule information, It is characterized in that include: A construction module, used to construct a knowledge graph based on text data, wherein the knowledge graph includes at least high-quality noise, and the high-quality noise is a triple with the same entity type but an error; A processing module, used for instantiating the rules extracted from the knowledge graph to obtain target triples of the knowledge graph; A first determination module is used to determine the target confidence of the target triplet, wherein the first determination module includes: a second acquisition unit, used to acquire the global path confidence and the rule confidence of the target triplet; a determination unit, used to determine the target confidence according to the global path confidence and the rule confidence; the target confidence in the determination unit is expressed in the following manner: , is the target confidence of the target triplet, is the global path confidence of the target triplet, is the rule confidence of the target triplet, is the first hyperparameter corresponding to the target triplet, is the second hyperparameter corresponding to the target triplet; The second determination module is used to determine the high-quality noise in the knowledge graph according to the target confidence.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the high-quality noise detection method based on rule information as described in any one of claims 1 to 5.
8. A processor, It is characterized in that The processor is used to run a program, wherein the program executes the high-quality noise detection method based on rule information as described in any one of claims 1 to 5 when running.
