Apparatus and computer-implemented method for providing, testing, validating or verifying facts, learning weights, or providing weights
Through linear regression learning weights and using symbolic rules to predict facts in database structure, the problem of verifying the facts of database structure in the prior art is solved, and a more efficient and accurate verification process is achieved.
Patent Information
- Application Number
- CN202411501044.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-25
- Filing Date
- 2024-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to effectively verify and verify facts in database structures, especially in the knowledge graph, and there is a lack of efficient methods to determine the accuracy and completeness of facts.
By using linear regression to learn weights, provide symbolic rules to predict facts in the database structure and determine the scores of facts based on the weights, thereby verifying or verifying facts in the database structure.
The accuracy and efficiency of fact verification in the database structure are improved, and the evaluation and verification process of database structure facts is improved through the learning dynamics of linear regression.
Smart Images

Figure CN119884383A_ABST
Abstract
Description
Background Art
[0001] The present description relates to apparatus and computer-implemented methods for providing, testing, verifying or validating facts in a database structure, computer-implemented methods for learning weights using linear regression to provide, test, verify or validate facts in a database structure, and computer-implemented methods for providing the learned weights to a database management system. Summary of the invention
[0002] A computer-implemented method for providing, testing, verifying or validating a fact in a database structure (particularly a knowledge graph stored in the database) using linear regression, wherein the database structure (particularly the knowledge graph) comprises entities and relationships, wherein the fact comprises two entities and a relationship, wherein the method comprises: providing a symbolic rule, wherein the symbolic rule is configured to predict a fact based on one of the two entities and the relationship, or based on the two entities, wherein the symbolic rule is associated with a corresponding weight; determining a score for the fact based on the weight using a linear function, wherein the linear function is used to determine the score based on the weight, wherein the score indicates whether the fact belongs to the database structure; and providing, testing, verifying or validating the fact in the database structure based on the score. The score that depends on the linear function of the weight has better learning dynamics than the score that depends on the nonlinear function of the confidence associated with the symbolic rule.
[0003] The method may include determining scores for multiple facts of a database structure (in particular, a knowledge graph), wherein each of the multiple facts respectively includes two entities and a relationship of the database structure, wherein the multiple facts include facts, and wherein the method includes: selecting a fact from the multiple facts based on the scores determined for the multiple facts, wherein the score determined for the selected fact indicates a higher probability that the fact belongs to the database structure, or a higher probability that the fact does not belong to the database structure, compared to the score determined for at least one other fact of the multiple facts, and in particular indicates the highest probability determined for each of the multiple facts.
[0004] Providing a fact may comprise adding said fact to a database structure, in particular when the score determined for said fact indicates that said fact belongs to the database structure. Testing, verifying or validating a fact may comprise searching for said fact in a database structure and, if said fact is found, confirming said fact in the database structure, in particular when the score determined for said fact indicates that said fact belongs to the database structure, or invalidating said fact in the database structure or removing said fact from the database structure, in particular when the score determined for said fact indicates that said fact does not belong to the database structure.
[0005] A computer-implemented method for learning weights using linear regression in order to provide, test, verify or validate facts in a database structure, in particular a knowledge graph, wherein the database structure, in particular a knowledge graph, comprises entities and relations, wherein the fact comprises two entities and a relation, wherein the method comprises: providing a symbolic rule, the symbolic rule being configured to predict the fact from one of the two entities and the relation or from the two entities, wherein the symbolic rule is associated with a corresponding weight; and learning the weights from a loss, wherein the loss comprises a linear function for determining a score from the weights, wherein the score indicates whether the fact belongs to the database structure. The weights can be learned directly using linear regression due to a simple linear scoring function.
[0006] The method for learning may include: providing a plurality of symbolic rules, the plurality of symbolic rules being configured to map entities and relations of a database structure to entities of the database structure, or to map two entities of the database structure to relations of the database structure, wherein each of the plurality of symbolic rules is associated with a corresponding weight; determining a selected symbolic rule that predicts a fact from the plurality of symbolic rules; and learning the weight associated with the selected symbolic rule according to a loss, wherein a function in the loss depends on the corresponding weight associated with the selected symbolic rule. The selected symbolic rule actually predicts the fact. The rule set including the plurality of symbolic rules is improved according to the weights of the rules that actually predict the fact. Symbolic rules that do not predict the fact are ignored.
[0007] The method for learning may include providing a reference for at least one function in the loss, wherein the reference indicates whether a fact belongs to a database structure, wherein the loss depends on the reference of the at least one function. The reference provides supervised learning.
[0008] The loss may comprise a corresponding function for a plurality of facts, or in that the method comprises providing a reference for a plurality of facts, wherein the loss comprises a corresponding function for a plurality of facts and depends on the reference for the plurality of facts.
[0009] A computer-implemented method for providing a database management system to manage a database structure, wherein the method for providing a database management system comprises: learning weights in order to provide, test, verify or validate facts in a database structure (in particular, a knowledge graph), in particular utilizing the method for learning weights in order to provide, test, verify or validate facts in a database structure; and providing the learned weights to the database management system, and providing a device for providing, testing, verifying or validating facts in a database structure utilizing the method for providing, testing, verifying or validating facts in a database structure.
[0010] A device includes at least one processor and at least one memory, wherein the at least one processor is configured to execute instructions, and when the instructions are executed by the at least one processor, the instructions cause the device to perform the following methods: a method for providing, testing, confirming or verifying facts in a database structure, a method for learning weights in order to provide, test, confirm or verify facts in a database structure, and a method for providing a database management system to manage a database structure, wherein the at least one memory stores the instructions.
[0011] A database structure (particularly a knowledge graph) stored in a database comprises entities and relationships and facts, wherein a fact comprises two entities and a relationship, wherein the database structure comprises symbolic rules, wherein the symbolic rules are configured to predict facts based on one of the two entities and the relationship or based on the two entities, wherein the database structure comprises weights, and wherein the symbolic rules are associated with corresponding weights, wherein the database structure comprises a loss for learning the weights, wherein the loss comprises a linear function for determining a score based on the weights, wherein the score indicates whether a fact belongs to the database structure.
[0012] The computer program comprises computer readable instructions which, when executed by a computer, cause the computer to perform a method for providing, testing, verifying or validating facts in a database structure, a method for learning and / or a method for providing a database management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Further exemplary embodiments emerge from the following description and the accompanying drawings. In the drawings:
[0014] Figure 1 The device is schematically depicted,
[0015] Figure 2 The database structure is schematically described.
[0016] Figure 3 depicts a flowchart comprising the steps of a method for providing, testing, verifying or validating facts in a database structure,
[0017] Figure 4 depicts a flowchart comprising the steps of a method for learning weights for providing, testing, verifying or validating facts in a database structure,
[0018] Figure 5 A flow chart comprising the steps of a method for providing a database management system is depicted. DETAILED DESCRIPTION
[0019] Figure 1 The device 100 is schematically depicted.
[0020] The device 100 includes at least one processor 102 and at least one memory 104 .
[0021] The at least one processor 102 is configured to execute instructions.
[0022] When executed by the at least one processor 102, the instructions may cause the device 100 to perform a method for providing, testing, verifying, or validating facts in a database structure.
[0023] When executed by at least one processor 102, the instructions may cause the device 100 to perform a method for learning weights to provide, test, verify, or validate facts in a database structure.
[0024] When the instructions are executed by the at least one processor 102, the instructions may cause the device 100 to perform a method for providing a database management system.
[0025] The at least one memory 104 stores the instructions.
[0026] Figure 2 An example 200 of a portion of a database structure is schematically depicted.
[0027] The database structure in Example 200 includes a knowledge graph As in the signature<C,P> The set of ground atoms or facts defined above, where C is the set of constants (i.e., entities) and P is the set of predicates (i.e., relations), and where the fact t=p(s,o) comprises two entities (i.e., subject s and object o) and a relation (i.e., predicate p).
[0028] The database structure (eg, knowledge graph) in the example is stored in a database. The at least one memory 104 in the example includes a database.
[0029] Figure 2 Exemplary entities 202 and relationships 204, or database structures, are schematically depicted.
[0030] Figure 2 Depicted are exemplary relationships 204 labeled Citizen, Birth, Job, City, Capital, Married and exemplary entities 202 labeled Monica, Paul, Sarah, Tom, Camilla, John, Switzerland, Germany, Austria, United States, Geneva, Bern, Vienna, Chicago, Washington. Figure 2 An exemplary fact is depicted:
[0031] Work (Monika, Geneva),
[0032] City (Geneva, Switzerland),
[0033] Citizen (Paul, Switzerland),
[0034] Born (Paul, Switzerland),
[0035] Married (Paul, Sarah),
[0036] Citizen (Sarah, Switzerland),
[0037] Born (Sarah, Switzerland),
[0038] Work (Sarah, Bern),
[0039] City (Bern, Switzerland),
[0040] Capital (Bern, Switzerland),
[0041] Work (Tom, Bern),
[0042] Work (Tom, Vienna),
[0043] Born (Tom, Germany),
[0044] Married (Tom, Camilla),
[0045] Citizen (Camilla, Austria),
[0046] Born (Camilla, Austria),
[0047] Capital (Vienna, Austria),
[0048] Work (Camilla, Vienna),
[0049] Work (Camilla, Chicago),
[0050] Jobs(John, Chicago),
[0051] Citizen(John,USA),
[0052] Born (John, USA),
[0053] City(Chicago, United States),
[0054] City(Washington, USA),
[0055] Capital (Washington, USA),
[0056] Job (John, Washington).
[0057] The database structure may be incomplete. For example, the knowledge graph is incomplete. Figure 2 In , the dashed edges correspond to the following examples of missing facts:
[0058] Citizen(Tom, Austria),
[0059] Citizen (Tom, Germany),
[0060] City (Vienna, Austria).
[0061] The problem of knowledge graph completeness involves defining an automated procedure for finding missing facts simply by analyzing the statistical distribution and regularity of a given knowledge graph.
[0062] Missing facts can be found using a query that includes an entity and a relationship or using a query that includes two entities. In the example described in this article, missing facts are found using a query that includes a relationship and an entity. A query that includes two entities can be used accordingly.
[0063] For example, missing facts are found using queries p(s, ?) (eg, such as citizen(Tom, ?)) and / or queries p(?, o) (eg, such as citizen(?, Austria)), where "?" is a placeholder for the entity of the missing fact.
[0064] The model can be used to predict answers in the form of candidate facts p(s, o) (e.g., such as citizen(Tom, Germany) or citizen(Tom, Switzerland)) and assign plausibility scores to the answers. A rating can be formed for each candidate fact, and the highest-rated candidate fact can be used as the missing fact. For example, the model predicts scores for rating each candidate fact such that the higher the score of a candidate fact, the more likely the candidate fact is to be a missing fact.
[0065] Each candidate fact may be found based on a symbolic rule R. The symbolic rule R is configured to predict each candidate fact t based on two entities 202 .
[0066] The symbolic rule r∈R in the example is configured to map a first entity 202 and a relationship 204 of the database structure to a second entity 202 of the database structure. According to the example, the symbolic rule r includes a condition, and when the first entity 202, the second entity 202 and the relationship 204 satisfy the condition, the first entity 202 and the relationship 204 are mapped to the second entity 202.
[0067] The symbol rule r may be configured to map two entities 202 of the database structure to a relationship 202 of the database structure. The symbol rule r may be configured to map multiple entities 202 and / or multiple relationships 204 to the entity 202. The symbol rule r may include a condition, and when the first entity 202, the second entity 202, and the relationship 204 satisfy the condition, the first entity 202 and the second entity 202 are mapped to the relationship 204.
[0068] Rules can be determined based on a database structure (e.g., a knowledge graph). Examples for determining rules are disclosed in Christian Meilicke, Melisachew Wudage Chekol, Daniel Ruffinelli, and Heiner Stuckenschmidt, “Anytime bottom-up rule learning for knowledge graph completion,” Proceedings of the 28th International Joint Conference on Artificial Intelligence, pp. 3137-3143, Ijcai.org, 2019 (AnyBURL). Examples for determining rules are disclosed in Luis Galárraga, Christina Teflioudi, Katja Hose, and Fabian M Suchanek, “Fast rule mining in ontological knowledge bases with AMIE+,” VLDB Journal, Vol. 24, No. 6: pp. 707-730, 2015 (AMIE).
[0069] According to the example, four rules r1, r2, r3, r4 are defined
[0070] r1: a(X, Y)←b(X, Y)
[0071] r2: a(X, Y)←c(X, A), d(A, Y)
[0072] r3: a(X, Y)←c(X, A), e(A, Y)
[0073] r4: a(X, Y)←f(X, A), a(A, Y)
[0074] Where a, b, c, d, e, f are relations 204, and X, Y, A are variables representing entities 202. Rule r i The rule r includes a head, for example, a predicted fact t, which includes the first entity 202, the second entity 202, and the relationship 204 on the left. i Including the right tail. In the case of finding entity 202 for each variable, rule r i Map the tail to the head so that the relations in the tail exist in the database structure.
[0075] An example of four rules r1, ..., r4 for example 200 may be:
[0076] r1: Citizen(X,Y)←Birth(X,Y)
[0077] r2: Citizen(X,Y)←Job(X,A),City(A,Y)
[0078] r3: Citizen(X,Y)←Work(X,A),Capital(A,Y)
[0079] r4: Citizen(X, Y) ← Married(X, A), Citizen(A, Y)
[0080] Where a = citizen, b = birth, c = work, d = city, e = capital, and f = married.
[0081] Rules i and the corresponding confidence c i Associated, the confidence c i Indicated by the corresponding rule r i ∈R predicted fact t i Whether it belongs to the database structure. According to the example, using the confidence c i ∈[0,1]. Confidence c i can be defined on a set of values other than [0, 1]. i With the corresponding score s i Associated, the score s i Indicated by the corresponding rule r i Whether the predicted fact belongs to the database structure. j ∈R’s confidence level c j To determine the corresponding fact t i Score of i .
[0082] According to the example, in the training data Learning rules j The confidence level c j , where N is the fact t predicted by the rules in R i The number of, where if fact t is seen in the training data D i , then the variable y i =1, otherwise y i = 0, and x i =(x i1 , ..., x ij , ..., x iK ) is a binary vector, where if the rule r j Predicted the fact i , then x ij =1, otherwise x ij =0.
[0083] According to this example, the corresponding fact t i Score of i Depends on the corresponding confidence cj :
[0084]
[0085] in
[0086] This means that using z = x ij c j and a monotonically increasing function -log(-z+1) for z<1 to reparameterize x ij c j .
[0087] According to this example, the weights have been learned using the loss Instead of learning the confidence c j .
[0088]
[0089] loss Include Function
[0090]
[0091] This function is used to directly determine the weight Where σ is the sigmoid function. For example, using the weight And the optimization of the bias term w0 to learn the weights A bias term w0=0 may be used.
[0092] loss Depends on the corresponding function The corresponding reference yi.
[0093] The loss in this example is smooth and scales with respect to the parameter is differentiable. This learning can use gradient-based optimization techniques on the loss.
[0094] For example, the model includes the parameters and is configured to predict the score s i .
[0095] Figure 3 Methods for providing, testing, verifying or validating facts in a database structure, particularly a knowledge graph, are described.
[0096] The method includes step 302 .
[0097] Step 302 includes providing a method for predicting facts {t1, ..., t N For example, AnyBURL or AMIE is used to determine the symbol rule R on a database structure (e.g., a knowledge graph).
[0098] The corresponding symbol rule r i ∈R is configured to predict the corresponding fact t∈{t1,...,t N}. The corresponding symbol rule r i ∈R and the corresponding weight Associated.
[0099] The method includes step 304 .
[0100] Step 304 includes using the corresponding symbol rule r i ∈R to determine multiple facts {t1, ..., t N}, and determine the corresponding facts t i The corresponding score s i .
[0101] For example, the fact that i Score of i is determined using a linear function that is used to predict the fact t i The rules of j Weight To determine the score s i :
[0102]
[0103] where x i =(x i1 , ..., x ij , ..., x iK ) is a binary vector, where if the rule r j Predicted the fact i , then x ij =1, otherwise x ij =0.
[0104] Weights in the example is the learned weight According to the example, according to the learned weights Use the model to determine the score s i .
[0105] Score i Indicative fact i Whether it belongs to the database structure.
[0106] The method includes step 306 .
[0107] Step 306 includes providing, testing, verifying or validating facts in the database structure based on the scores. i .
[0108] Provide the facts imay include selecting a fact t from the plurality of facts based on scores determined for the plurality of facts i .
[0109] Provide the facts i This may include selecting the fact with the highest score t i . Provide the facts i This may include selecting a fact t that has a higher score than other facts in the plurality of facts. i . Provide the facts i This may include selecting the fact having the highest score or having a higher score than other facts in the plurality of facts.
[0110] In this example, the score determined for the selected fact indicates a higher probability that the fact belongs to the database structure than the score determined for at least one other fact in the plurality of facts.
[0111] Providing a fact may include adding the fact to the database structure, particularly when the score determined for the fact indicates that the fact belongs in the database structure. According to this example, one or more facts associated with the highest score or with a higher score than other facts are added.
[0112] This example is not limited to the case where a higher probability indicates that the fact belongs to the database structure. According to an example, a higher probability may indicate that the fact does not belong to the database structure. Therefore, one or more facts associated with the lowest score or a score lower than other facts may be added.
[0113] Testing, verifying or validating a fact may comprise searching for the fact in a database structure and, if the fact is found, confirming the fact in the database structure, in particular when a score determined for the fact indicates that the fact belongs to the database structure, or invalidating the fact in the database structure or removing the fact from the database structure, in particular when a score determined for the fact indicates that the fact does not belong to the database structure.
[0114] Figure 4 Depicts the inclusion of components for learning weights Flowchart of the steps of a computer-implemented method for providing, testing, verifying or validating facts in a database structure.
[0115] The method includes step 402 .
[0116] Step 402 includes providing a symbol rule R.
[0117] For example, a symbol rule R is provided as described in step 302. The symbol rule R and the re-parameterized corresponding confidence c i The corresponding weight Associated.
[0118] Step 402 includes providing a fraction s i Provide corresponding reference i .
[0119] Reference i Regarding the facts i Indicates the fact i Whether it belongs to the database structure.
[0120] For example, training data D is provided.
[0121] For example, if we see fact t in the training data D i , then refer to y i Yes i =1, otherwise refer to y i Yes i =0.
[0122] The method includes step 404 .
[0123] Step 404 includes determining a selected symbolic rule r from a plurality of symbolic rules that predicts the fact j .
[0124] For example, using the binary vector x i =(x i1 , ..., x ij , ..., x iK ) to identify the selected symbol rule, where if the rule r j Predicted the fact i , then x ij =1, otherwise x ij =0.
[0125] The method includes step 406 .
[0126] Step 406 includes: To learn the confidence c i .
[0127] Step 406 includes: (i.e., using linear regression with a linear function that depends on the score) to learn the probability distribution with the chosen sign rule r j The associated weight
[0128] The loss depends on the chosen sign rule r j The loss depends on the selected sign rule r j The corresponding weight associated
[0129] For example, the learning loss Use gradient-based optimization techniques. For example, determine the minimum loss Weight
[0130] Figure 5 A method for providing a database management system for managing a database structure is schematically depicted.
[0131] The method for providing a database management system includes step 502 .
[0132] Step 502 includes learning weights In particular, using method.
[0133] The method for providing a database management system includes step 504 .
[0134] Step 504 includes providing the learned weights to the database management system
[0135] Step 504 includes providing a database management system with means for providing, testing, verifying or validating facts in a database structure, the means utilizing methods for providing, testing, verifying or validating facts in a database structure.
[0136] The apparatus for providing, testing, verifying or validating facts in a database structure may include at least one processor 102 and at least one memory 104 .
Claims
1. A computer-implemented method for providing, testing, verifying or validating facts in a database structure, in particular a knowledge graph stored in the database, using linear regression, characterized in that The database structure, in particular the knowledge graph, comprises entities and relationships, wherein the fact comprises two entities and a relationship, wherein the method comprises: providing (302) a symbolic rule, wherein the symbolic rule is configured to predict a fact based on one of the two entities and the relationship, or based on the two entities, wherein the symbolic rule is associated with a corresponding weight; determining (304) a score of the fact based on the weight using a linear function, wherein the linear function is used to determine the score based on the weight, wherein the score indicates whether the fact belongs to the database structure; and providing, testing, confirming or verifying (306) the fact in the database structure based on the score.
2. The method according to claim 1, characterized in that Determine (304) the scores of multiple facts of the database structure, in particular the knowledge graph, wherein each fact of the multiple facts respectively includes two entities and a relationship of the database structure, wherein the multiple facts include the fact, and wherein the method comprises: selecting (306) the fact from the multiple facts according to the scores determined for the multiple facts, wherein the score determined for the selected fact indicates a higher probability that the fact belongs to the database structure, or a higher probability that the fact does not belong to the database structure, compared to the score determined for at least one other fact of the multiple facts, in particular indicating the highest probability determined for each fact of the multiple facts.
3. The method according to any one of the preceding claims, characterized in that Providing (306) the fact comprises adding the fact to the database structure, in particular when the score determined for the fact indicates that the fact belongs to the database structure, or is characterized in that testing, verifying or validating (306) the fact comprises searching for the fact in the database structure and, if the fact is found, confirming the fact in the database structure, in particular when the score determined for the fact indicates that the fact belongs to the database structure, or invalidating the fact in the database structure or removing the fact from the database structure, in particular when the score determined for the fact indicates that the fact does not belong to the database structure.
4. A computer-implemented method for learning weights using linear regression in order to provide, test, verify or validate facts in a database structure, in particular a knowledge graph, characterized in that The database structure, in particular the knowledge graph, comprises entities and relations, wherein the fact comprises two entities and a relation, wherein the method comprises: providing (404) a symbolic rule, wherein the symbolic rule is configured to predict the fact based on one of the two entities and the relation or based on the two entities, wherein the symbolic rule is associated with a corresponding weight; and learning (406) the weight according to a loss, wherein the loss comprises a linear function for determining a score according to the weight, wherein the score indicates whether the fact belongs to the database structure.
5. The method according to claim 4, characterized in that The method comprises: providing (402) a plurality of symbolic rules, the plurality of symbolic rules being configured to map entities and relations of the database structure to entities of the database structure, or being configured to map two entities of the database structure to relations of the database structure, wherein each symbolic rule of the plurality of symbolic rules is associated with a corresponding weight; determining (404) a selected symbolic rule for predicting the fact from the plurality of symbolic rules; and learning (406) the weight associated with the selected symbolic rule based on the loss, wherein the function in the loss depends on the corresponding weight associated with the selected symbolic rule.
6. The method according to claim 4 or 5, characterized in that The method includes providing (402) a reference for at least one function in the loss, wherein the reference indicates whether the fact belongs to the database structure, wherein the loss depends on the reference of the at least one function.
7. The method according to any one of claims 4 to 6, characterized in that The loss comprises a corresponding function for a plurality of facts, or is characterized in that the method comprises providing the reference for the plurality of facts, wherein the loss comprises a corresponding function for the plurality of facts and depends on the reference for the plurality of facts.
8. A computer-implemented method for providing a database management system for managing a database structure, characterized in that The method comprises: learning (502) weights in order to provide, test, verify or validate facts in the database structure, in particular a knowledge graph, in particular using a method for learning according to one of claims 4 to 7; and providing (504) the learned weights to the database management system, and providing a device for providing, testing, verifying or validating the facts in the database structure using a method for providing, testing, verifying or validating the facts in the database structure according to one of claims 1 to 3.
9. A device (100), characterized in that The device (100) comprises at least one processor (102) and at least one memory (104), wherein the at least one processor (102) is configured to execute instructions, which, when executed by the at least one processor (102), cause the device (100) to perform the method according to one of claims 1 to 8, wherein the at least one memory (104) stores the instructions.
10. The database structure stored in the database, especially the knowledge graph, is characterized by The database structure comprises entities and relationships and facts, wherein the fact comprises two entities and a relationship, wherein the database structure comprises a first symbolic rule, the first symbolic rule being configured to predict the fact based on one of the two entities and the relationship or based on the two entities, wherein the database structure comprises weights, and wherein the symbolic rules are associated with corresponding weights, wherein the database structure comprises a loss for learning the weights, wherein the loss comprises a linear function for determining a score based on the weights, wherein the score indicates whether the fact belongs to the database structure.
11. A computer program characterized in that The computer program comprises computer-readable instructions which, when executed by a computer, cause the computer to perform the method according to one of claims 1 to 8 .