Entity portrait construction method based on graph rules
By using graph rule-based methods to perform entity recognition and association inference in graphs, the problem of graph quality affecting entity portraits is solved, the interaction between entity recognition and association inference is realized, and the quality and accuracy of entity portraits are improved.
Patent Information
- Application Number
- CN202410747842.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-15
AI Technical Summary
When mapping entities in a graph, the quality problem of the graph causes the entity recognition and association inference tasks to be carried out separately, making it impossible to carry out entity recognition and association inference at the same time, and the association inference is mostly focused on completing missing links, lacking interaction.
Adopt an entity portrait construction method based on graph rules, by initializing the maximum heap, using rules to calculate matching and infer equivalent entities or associated information, updating the graph and partial matching sets, calculating active rule weights, and extracting through forward and backward inference processes Active rules realize the interaction of entity recognition and association inference.
It realizes simultaneous entity recognition and association inference in the picture, provides more comprehensive entity portrait information, and improves the quality and accuracy of entity portraits.
Smart Images

Figure CN118779386A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data processing method, and in particular to a method for constructing an entity portrait based on graph rules. Background Art
[0002] Entity profiling aims to present a comprehensive portrait of an entity by collecting, integrating and analyzing the attributes, relationships and behaviors of the entity. In the field of relational data, the research on entity profiling is very mature and has many practical applications, such as personalized recommendation, talent recommendation, social media analysis and risk management. In recent years, research on entity profiling on graphs has also been a hot topic, because graphs can intuitively and clearly show the relationships between entities. To obtain a portrait of an entity in a graph, it is necessary to identify the entity from the input data and extract all the associations about the given entity. However, the quality of the graph is an important factor restricting entity profiling, because there are multiple entities in the graph that refer to the same entity, and the entity is missing some attributes or links. Therefore, to perform entity profiling, it is necessary to extract equivalent entities and complete the missing attributes and links through association inference. In current research, entity recognition and association inference tasks are usually performed separately, that is, either only entity recognition or only association inference is performed, and most of the association inference tasks focus on completing missing links. In fact, there is an interaction between entity recognition and association inference tasks, that is, the results of entity recognition can promote association inference, and at the same time, the results of association inference can also promote entity recognition. Therefore, this patent defines a class of graph entity portrait rules, which can simultaneously perform entity recognition and association inference through rich expression capabilities, thereby providing more comprehensive portrait information for the entity. Summary of the invention
[0003] The purpose of the present invention is to provide a method for constructing an entity portrait based on graph rules to solve the above problems.
[0004] In order to achieve the above object, the present invention provides the following technical solution: a method for constructing an entity portrait based on graph rules, comprising:
[0005] Step 1: Initialize the maximum heap according to the partial order of the rules in Σ
[0006] Step 2: When the Heap is not empty, pop up the root element and use the rule Compute matching and inference on graph G;
[0007] Step 3: The generated inference information includes equivalent entities or association information, as well as partial matching sets PC set ;
[0008] Step 4: If an equivalent entity is inferred, a node is designated as an anchor node, and all attributes and edges are added to the anchor node;
[0009] Step 5: If the information is inferred to be related and contains an identified equivalent entity, the information is added to the specified anchor node;
[0010] Step 6: Update the PC using the inferred results set and Figure G;
[0011] Step 7: Normalize the inference results into node labels and extract active rules based on the results;
[0012] Step 8: Calculate the weight of active rules according to the formula and update the Heap;
[0013] Step 9: Extract PC set Find the highest ranked rule and update the Heap;
[0014] Step 10: If the Heap is not empty, repeat steps 2 to 9; otherwise, the iterative process ends.
[0015] As a preferred embodiment, the step S01 provides a specific definition of the graph entity portrait rule EPR, based on a graph entity portrait rule Defined as: in For graph mode, X and Y are connection of predicates in;
[0016] The user of graph mode Q identifies entities in the graph, and the dependency X→Y applies to these entities. X represents the premise of the rule and Y represents the result.
[0017] The predicates in X and Y can take many forms:
[0018] (a) A constant predicate xA=c, where x represents an entity, A represents an attribute, and c is the attribute value;
[0019] (b) variable predicate xA=yB, where x and y are entities, and A and B are attributes (non-id attributes);
[0020] (c) key predicate x.id = y.id, x, y are entities;
[0021] (d) edge predicate ι(x, y), where x, y are entities and ι is the edge label connecting x and y;
[0022] (e) Link prediction edge predicate M(x, y, ι), which means that if the link prediction model predicts the existence of such an edge (x, y, ι), then the value of M(x, y, ι) is true, otherwise it is false;
[0023] (f) Entity recognition key predicate M(x, y), which means that if the entity recognition model predicts that x and y are the same entity, then M(x, y) is true, otherwise it is false.
[0024] Preferably, in step S02, the graph entity portrait rule EPR is applied to the graph G by using the chase process. It is known that the graph G = (V, E, L, FA) and the finite EPR rule set Where V is the set of nodes on the graph, E is the set of edges, L is the set of labels of nodes and edges, FA is the set of attributes of entities on the graph, a chase graph Gc = (V, E', L, FA'), where V and L are the set of nodes and labels on the graph G, respectively, E' contains E and the new edge set ΔE obtained after applying the graph entity portrait rule, FA' is FA and the set of attributes ΔFA newly added to the entity after applying the graph entity portrait rule;
[0025] Define a chase step of Σ on graph Gc as:
[0026]
[0027] in is a rule in Σ, is a matching of Q on the graph Gc and If the predicate but Then you can Add to Gc to get Gc';
[0028] If you want to add To go to Gc, one of the following conditions must be met:
[0029] if is inferred from xA=c, then (a) if h(x) does not contain attribute A, then add attribute A to ΔFA(h(x)) and let h(x).A=c; (b) for those entities that have been identified as equivalent to h(x), add the attribute to each equivalent entity and let the attribute value be c;
[0030] if is inferred from xA=yB, then (a) if h(x) does not contain attribute A and h(y) does not contain attribute B, then add attribute A to ΔFA(h(x)) and attribute B to ΔFA(h(y)), and let h(x).A=h(y).B; (b) for the identified nodes equivalent to h(x) and h(y), add attribute A to each equivalent node and let its value be h(y).B;
[0031] if From ι(x,y), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for each node that has been identified as equivalent to h(x), add an edge with label ι to h(y);
[0032] if It can be inferred from x.id = y.id that if h(x) and h(y) have the same label and there is no conflict in the attribute values of the common attributes, then h(x) and h(y) can be considered to be the same entity;
[0033] if is inferred from M(x, y, ι), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for the identified nodes equivalent to h(x), add edges with label ι to h(y), which means that the prediction result M(x, y, ι) of the link prediction model is true.
[0034] As a preference, the predicate When adding to the graph, if the following situation occurs, then the chase step is invalid: (a) xA=c, but h(x).A=d (the value of attribute A of all discovered equivalent entities of h(x) is equal to d), and c≠d; (b) xA=yB, but h(x).A=c (the value of attribute A of all discovered equivalent entities of h(x) is equal to c), h(y).B=d, and c≠d; (c) It is x.id=y.id or M(x,y), h(x).A=c, h(y).A=d, and c≠d.
[0035] Preferably, the chase process in step S02 has a Church-Rosser property, including:
[0036] S21. The chase sequence is finite. If the graph is changed only once in each chase step, the maximum length of the chase sequence is (4|G|2*|Σ|+|V|).
[0037] S21. All chase sequences terminate at the same result. If there are two chase sequences ρ1 = (Gc0, Gc1, ..., Gck) and ρ2 = (Gc0, Gc1', ..., Gcl'), these two sequences terminate at different results, where:
[0038] If Gc0 is valid (Gc0 = G at the beginning), otherwise both ρ1 and ρ2 are invalid;
[0039] If Gc0 is valid, but Gck and Gcl' are different, then Gck\Gcl'≠ or Gcl'\Gck≠, then ρ1 or ρ2 is not terminating, or both ρ1 and ρ2 are invalid.
[0040] As a preferred embodiment, in step S03, according to the partially ordered set Pset, we can set a maximum heap In each iteration, a rule with the largest weight is popped from the max heap. It is used for inference first, and the rules associated with the inference results are updated in the maximum heap.
[0041] Preferably, the forward detection process designed in step S03 mainly extracts active rules according to the currently generated inference results, and calculates the weights of the active rules according to the partial order between the active rules, including:
[0042] A. The new attributes, attribute values, and edge information generated by the direct application of rules to the graph, as well as the attributes, attribute values, and edge information added after the fusion of equivalent entities;
[0043] B. The added attributes, attribute values or side information make some of the partial matching sets PCset match Ability to expand to full matches and generate new inferences;
[0044] Among them, some matches Refers to the matching of nodes in X and Y that are mapped to the key rule (referring to the rule whose Y condition contains x.id=y.id or M(x,y)) Its due to The constraints in X are not satisfied, or it satisfies the X conditions but cannot be expanded to a complete match due to the lack of a pattern edge, so the inference cannot be completed.
[0045] For the inference results obtained from A and B, this information is normalized into their labels to collect different templates, and active rules are extracted based on these templates. If the association result ΔAc contains n different templates, ΔAdd1, ..., ΔAddn, and these templates are associated with m active rules, then the weight of each active rule can be calculated according to the following formula:
[0046]
[0047] in, for The frequencies associated with different templates, For the m active rules The number of partially ordered pairs with a partially ordered relation in Pset. The key rule is the rule that contains x.id=y.id or M(x, y) in the condition of rule Y. The weight of the key rule is strengthened by multiplying the frequency by 2 to speed up their application, because the fusion of equivalent entities usually adds edges and attribute information to each node in the equivalence class. The active rules and their weight information are added to the max heap for updating.
[0048] As a preference, the backward inference process aims to extract the partial matches that are most favorable in the partial match set PCset The rules that are expanded to complete matches and inferred, for each match in the partial match set PCset Set up a To record the extension The rules that need to be used can be expanded Active rules that provide possible edges and attributes for complete matching and satisfying inference requirements, select the rule with the highest ranking and add it to the max heap. If there are m rules with the same ranking, select the rule with the maximum out-degree according to the partial order in Pset, where: the weight of the rule is set to 1, and then add it to the max heap.
[0049] In the above technical solution, the present invention provides a method for constructing entity portraits based on graph rules, which has the following beneficial effects: firstly, the partial order relationship of each pair of rules in the rule set Σ is analyzed and the partial order set PCset is constructed, and then each rule is calculated. Weight And update the maximum heap. When the element in the Heap is not empty, pop the maximum heap element and use the rules in it Perform inference. During the inference process, there will be equivalent entities identified by key rules (referring to rules containing x.id=y.id or M(x,y) in Y) and a partial candidate rule set PCset generated; or associated information inferred by non-key rules. For equivalent entities, all information needs to be added to the specified anchor node, and PCset is updated based on this information; if the associated information contains equivalent entities, all information needs to be added to the specified anchor node and PCset is updated. For the obtained inference results, they are normalized to their labels to collect different templates, and active rules are extracted based on these templates. Then, using forward inference, the weights of active rules are calculated according to the formula and the Heap is updated. At the same time, according to backward inference, the highest ranked rule in PCset is extracted and the Heap is updated. If the Heap is not empty, repeat steps S02 to S09; otherwise, the whole process ends. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0051] Figure 1 A schematic structural diagram of a pipe clamp provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0053] like Figure 1 As shown, a method for constructing an entity portrait based on graph rules includes:
[0054] Step 1: Initialize the maximum heap according to the partial order of the rules in the rule set Σ
[0055] Step 2: When the Heap is not empty, pop up the root element and use the rule Compute matching and inference on graph G;
[0056] Step 3: The generated inference information includes equivalent entities or association information, as well as partial matching sets PC set ;
[0057] Step 4: If an equivalent entity is inferred, a node is designated as an anchor node, and all attributes and edges are added to the anchor node;
[0058] Step 5: If the information is inferred to be related and contains an identified equivalent entity, the information is added to the specified anchor node;
[0059] Step 6: Update the PC using the inferred results set and Figure G;
[0060] Step 7: Normalize the inference results into node labels and extract active rules based on the results;
[0061] Step 8: Calculate the weight of active rules according to the formula and update the Heap;
[0062] Step 9: Extract PC set Find the highest ranked rule and update the Heap;
[0063] Step 10: If the Heap is not empty, repeat steps 2 to 9; otherwise, the iterative process ends.
[0064] As an embodiment further provided by the present invention, a specific definition of the graph entity portrait rule EPR is given in step S01. Defined as: in For graph mode, X and Y are connection of predicates in;
[0065] The user of graph mode Q identifies entities in the graph, and the dependency X→Y applies to these entities. X represents the premise of the rule and Y represents the result.
[0066] The predicates in X and Y can take many forms:
[0067] (a) A constant predicate xA=c, where x represents an entity, A represents an attribute, and c is the attribute value;
[0068] (b) variable predicate xA=yB, where x and y are entities, and A and B are attributes (non-id attributes);
[0069] (c) key predicate x.id = y.id, x, y are entities;
[0070] (d) edge predicate ι(x, y), where x, y are entities and ι is the edge label connecting x and y;
[0071] (e) Link prediction edge predicate M(x, y, ι), which means that if the link prediction model predicts the existence of such an edge (x, y, ι), then the value of M(x, y, ι) is true, otherwise it is false;
[0072] (f) Entity recognition key predicate M(x, y), which means that if the entity recognition model predicts that x and y are the same entity, then M(x, y) is true, otherwise it is false.
[0073] As another embodiment further provided by the present invention, in step S02, the graph entity portrait rule EPR is applied to the graph G by using the chase process. It is known that the graph G = (V, E, L, FA) and the finite EPR rule set Where V is the set of nodes on the graph, E is the set of edges, L is the set of labels of nodes and edges, FA is the set of attributes of entities on the graph, a chase graph Gc = (V, E', L, FA'), where V and L are the set of nodes and labels on the graph G, respectively, E' contains E and the new edge set ΔE obtained after applying the graph entity portrait rule, FA' is FA and the set of attributes ΔFA newly added to the entity after applying the graph entity portrait rule;
[0074] Define a chase step of Σ on graph Gc as:
[0075]
[0076] in is a rule in Σ, is a matching of Q on the graph Gc and If the predicate but Then you can Add to Gc to get Gc';
[0077] If you want to add To go to Gc, one of the following conditions must be met:
[0078] if is inferred from xA=c, then (a) if h(x) does not contain attribute A, then add attribute A to ΔFA(h(x)) and let h(x).A=c; (b) for those entities that have been identified as equivalent to h(x), add the attribute to each equivalent entity and let the attribute value be c;
[0079] if is inferred from xA=yB, then (a) if h(x) does not contain attribute A and h(y) does not contain attribute B, then add attribute A to ΔFA(h(x)) and attribute B to ΔFA(h(y)), and let h(x).A=h(y).B; (b) for the identified nodes equivalent to h(x) and h(y), add attribute A to each equivalent node and let its value be h(y).B;
[0080] if From ι(x,y), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for each node that has been identified as equivalent to h(x), add an edge with label ι to h(y);
[0081] if It can be inferred from x.id = y.id that if h(x) and h(y) have the same label and there is no conflict in the attribute values of the common attributes, then h(x) and h(y) can be considered to be the same entity;
[0082] if is inferred from M(x, y, ι), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for the identified nodes equivalent to h(x), add edges with label ι to h(y), which means that the prediction result M(x, y, ι) of the link prediction model is true.
[0083] As another embodiment further provided by the present invention, the predicate When adding to the graph, if the following situation occurs, then the chase step is invalid: (a) xA=c, but h(x).A=d (the value of attribute A of all discovered equivalent entities of h(x) is equal to d), and c≠d; (b) xA=yB, but h(x).A=c (the value of attribute A of all discovered equivalent entities of h(x) is equal to c), h(y).B=d, and c≠d; (c) It is x.id=y.id or M(x,y), h(x).A=c, h(y).A=d, and c≠d.
[0084] As another embodiment further provided by the present invention, the chase process in step S02 has the Church-Rosser property, including:
[0085] S21. The chase sequence is finite. If the graph is changed only once in each chase step, the maximum length of the chase sequence is (4|G|2*|Σ|+|V|).
[0086] S21. All chase sequences terminate at the same result. If there are two chase sequences ρ1 = (Gc0, Gc1, ..., Gck) and ρ2 = (Gc0, Gc1', ..., Gcl'), these two sequences terminate at different results, where:
[0087] If Gc0 is valid (Gc0 = G at the beginning), otherwise both ρ1 and ρ2 are invalid;
[0088] If Gc0 is valid, but Gck and Gcl' are different, then Gck\Gcl'≠ or Gcl'\Gck≠, then ρ1 or ρ2 is not terminating, or both ρ1 and ρ2 are invalid.
[0089] As another embodiment further provided by the present invention, in step S03, according to the partial ordered set Pset, we can set a maximum heap In each iteration, a rule with the largest weight is popped from the max heap. It is used for inference first, and the rules associated with the inference results are updated in the maximum heap.
[0090] As another embodiment further provided by the present invention, the forward detection process designed in step S03 mainly extracts active rules according to the currently generated inference results, and calculates the weights of the active rules according to the partial order between the active rules, including
[0091] A. The new attributes, attribute values, and edge information generated by the direct application of rules to the graph, as well as the attributes, attribute values, and edge information added after the fusion of equivalent entities;
[0092] B. The added attributes, attribute values or side information make some of the partial matching sets PCset match Ability to expand to full matches and generate new inferences;
[0093] Among them, some matches Refers to the matching of nodes in X and Y that are mapped to the key rule (referring to the rule whose Y condition contains x.id=y.id or M(x,y)) Its due to The constraints in X are not satisfied, or it satisfies the X conditions but cannot be expanded to a complete match due to the lack of a pattern edge, so the inference cannot be completed.
[0094] For the inference results obtained from A and B, this information is normalized into their labels to collect different templates, and active rules are extracted based on these templates. If the association result ΔAc contains n different templates, ΔAdd1, ..., ΔAddn, and these templates are associated with m active rules, then the weight of each active rule can be calculated according to the following formula:
[0095]
[0096] in, for The frequencies associated with different templates, For the m active rules The number of partially ordered pairs with a partially ordered relation in Pset. The key rule is the rule that contains x.id=y.id or M(x, y) in the condition of rule Y. The weight of the key rule is strengthened by multiplying the frequency by 2 to speed up their application, because the fusion of equivalent entities usually adds edges and attribute information to each node in the equivalence class. The active rules and their weight information are added to the max heap for updating.
[0097] As another embodiment further provided by the present invention, the backward inference process is intended to extract the partial matches in the partial match set PCset that are most favorable. The rules that are expanded to complete matches and inferred, for each match in the partial match set PCset Set up a To record the extension The rules that need to be used can be expanded Active rules that provide possible edges and attributes for complete matching and satisfying inference requirements, select the rule with the highest ranking and add it to the max heap. If there are m rules with the same ranking, select the rule with the maximum out-degree according to the partial order in Pset, where: the weight of the rule is set to 1, and then add it to the max heap.
[0098] In the above technology, we first analyze the partial order relationship of each pair of rules in the rule set Σ and construct the partial order set PCset, and then calculate each rule Weight And update the maximum heap. When the element in the Heap is not empty, pop the maximum heap element and use the rules in it Perform inference. During the inference process, there will be equivalent entities identified by key rules (referring to rules containing x.id=y.id or M(x,y) in Y) and a partial candidate rule set PCset generated; or associated information inferred by non-key rules. For equivalent entities, all information needs to be added to the specified anchor node, and PCset is updated based on this information; if the associated information contains equivalent entities, all information needs to be added to the specified anchor node and PCset is updated. For the obtained inference results, they are normalized to their labels to collect different templates, and active rules are extracted based on these templates. Then, using forward inference, the weights of active rules are calculated according to the formula and the Heap is updated. At the same time, according to backward inference, the highest ranked rule in PCset is extracted and the Heap is updated. If the Heap is not empty, repeat steps S02 to S09; otherwise, the whole process ends.
[0099] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0100] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of 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 produce 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.
[0101] 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.
[0102] 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.
[0103] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0104] The embodiments of the present application also provide a specific implementation of an electronic device capable of implementing all the steps of the method in the above embodiments, and the electronic device specifically includes the following contents:
[0105] Processor, memory, communications interface and bus;
[0106] Wherein, the processor, memory, and communication interface communicate with each other via the bus;
[0107] The processor is used to call the computer program in the memory, and when the processor executes the computer program, all the steps in the method in the above embodiment are implemented.
[0108] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps of the method in the above embodiments are implemented.
[0109] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Although the embodiment of this specification provides the method operation steps described in the embodiment or flow chart, more or less operation steps can be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same one or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The present invention is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process 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.
[0110] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. In the description of this specification, the description of the reference term "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification.
[0111] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradicting each other. The above is only an embodiment of the embodiment of this specification and is not intended to limit the embodiment of this specification. For those skilled in the art, the embodiment of this specification may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiment of this specification shall be included in the scope of the claims of the embodiment of this specification.
Claims
1. A method for constructing an entity portrait based on graph rules, characterized in that: include: Step 1: Initialize the maximum heap according to the partial order of the rules in the rule set Σ Step 2: When the Heap is not empty, pop up the root element and use the rule Compute matching and inference on graph G; Step 3: The generated inference information includes equivalent entities or association information, as well as partial matching sets PC set ; Step 4: If an equivalent entity is inferred, a node is designated as an anchor node, and all attributes and edges are added to the anchor node; Step 5: If the information is inferred to be related and contains an identified equivalent entity, the information is added to the specified anchor node; Step 6: Update the PC using the inferred results set and Figure G; Step 7: Normalize the inference results into node labels and extract active rules based on the results; Step 8: Calculate the weight of active rules according to the formula and update the Heap; Step 9: Extract PC set Find the highest ranked rule and update the Heap; Step 10: If the Heap is not empty, repeat steps 2 to 9; Otherwise, the iteration process ends.
2. The method for constructing an entity portrait based on graph rules according to claim 1, characterized in that: The step S01 gives a specific definition of the graph entity portrait rule EPR. Defined as: in For graph mode, X and Y are connection of predicates in; The graph pattern Q is used to identify entities in the graph. Dependency relations X→Y apply to these entities. X represents the premise of the rule and Y represents the result. The predicates in X and Y can take many forms: (a) A constant predicate xA=c, where x represents an entity, A represents an attribute, and c is the attribute value; (b) variable predicate xA=yB, where x and y are entities, and A and B are attributes (non-id attributes); (c) key predicate x.id = y.id, x, y are entities; (d) edge predicate ι(x, y), where x, y are entities and ι is the edge label connecting x and y; (e) Link prediction edge predicate M(x, y, ι), which means that if the link prediction model predicts the existence of such an edge (x, y, ι), then the value of M(x, y, ι) is true, otherwise it is false; (f) Entity recognition key predicate M(x, y), which means that if the entity recognition model predicts that x and y are the same entity, then M(x, y) is true, otherwise it is false.
3. The method for constructing an entity portrait based on graph rules according to claim 1, characterized in that: In step S02, the graph entity portrait rule EPR is applied to the graph G by using the chase process. It is known that the graph G = (V, E, L, FA) and the finite EPR rule set Where V is the set of nodes on the graph, E is the set of edges, L is the set of labels of nodes and edges, FA is the set of attributes of entities on the graph, a chase graph Gc = (V, E', L, FA'), where V and L are the set of nodes and labels on the graph G, respectively, E' contains E and the new edge set ΔE obtained after applying the graph entity portrait rule, FA' is FA and the set of attributes ΔFA newly added to the entity after applying the graph entity portrait rule; Define a chase step of Σ on graph Gc as: in is a rule in Σ, is a matching of Q on the graph Gc and If the predicate but Then you can Add to Gc to get Gc'; If you want to add To go to Gc, one of the following conditions must be met: if is inferred from xA=c, then (a) if h(x) does not contain attribute A, then add attribute A to ΔFA(h(x)) and let h(x).A=c; (b) for those entities that have been identified as equivalent to h(x), add the attribute to each equivalent entity and let the attribute value be c; if is inferred from xA=yB, then (a) if h(x) does not contain attribute A and h(y) does not contain attribute B, then add attribute A to ΔFA(h(x)) and attribute B to ΔFA(h(y)), and let h(x).A=h(y).B; (b) for the identified nodes equivalent to h(x) and h(y), add attribute A to each equivalent node and let its value be h(y).B; if From ι(x,y), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for each node that has been identified as equivalent to h(x), add an edge with label ι to h(y); if It can be inferred from x.id = y.id that if h(x) and h(y) have the same label and there is no conflict in the attribute values of the common attributes, then h(x) and h(y) can be considered to be the same entity; if is inferred from M(x, y, ι), then (a) add an edge (h(x), ι, h(y)) to ΔE; (b) for the identified nodes equivalent to h(x), add edges with label ι to h(y), which means that the prediction result M(x, y, ι) of the link prediction model is true.
4. The method for constructing an entity portrait based on graph rules according to claim 3, characterized in that: The predicate When adding to the graph, if the following situation occurs, then the chase step is invalid: (a) xA=c, but h(x).A=d (the value of attribute A of all discovered equivalent entities of h(x) is equal to d), and c≠d; (b) xA=yB, but h(x).A=c (the value of attribute A of all discovered equivalent entities of h(x) is equal to c), h(y).B=d, and c≠d; (c) x.id=y.id or M(x,y), h(x).A=c, h(y).A=d, and c≠d.
5. The method for constructing an entity portrait based on graph rules according to claim 4, characterized in that: The chase process in step S02 has the Church-Rosser property, including: S21. The chase sequence is finite. If the graph is changed only once in each chase step, the maximum length of the chase sequence is (4|G|2*|Σ|+|V|). S21. All chase sequences terminate at the same result. If there are two chase sequences ρ1 = (Gc0, Gc1, ..., Gck) and ρ2 = (Gc0, Gc1', ..., Gcl'), these two sequences terminate at different results, where: If Gc0 is valid (Gc0 = G at the beginning), otherwise both ρ1 and ρ2 are invalid; If Gc0 is valid, but Gck and Gcl' are different, then Gck\Gcl'≠ or Gcl'\Gck≠, then ρ1 or ρ2 is not terminating, or both ρ1 and ρ2 are invalid.
6. The method for constructing an entity portrait based on graph rules according to claim 1, characterized in that: In step S03, according to the partially ordered set Pset, we can set a maximum heap In each iteration, a rule with the largest weight is popped from the max heap. It is used for inference first, and the rules associated with the inference results are updated in the maximum heap.
7. The method for constructing an entity portrait based on graph rules according to claim 1, characterized in that: The forward detection process designed in step S03 mainly extracts active rules based on the currently generated inference results, and calculates the weights of the active rules based on the partial order between the active rules, including A. The new attributes, attribute values, and edge information generated by the direct application of rules to the graph, as well as the attributes, attribute values, and edge information added after the fusion of equivalent entities; B. The added attributes, attribute values or side information make some of the partial matching sets PCset match Ability to expand to full matches and generate new inferences; Among them, some matches Refers to the matching of nodes in X and Y that are mapped to the key rule (referring to the rule whose Y condition contains x.id=y.id or M(x,y)) Its due to The constraints in X are not satisfied, or it satisfies the X conditions but cannot be expanded to a complete match due to the lack of a pattern edge, so the inference cannot be completed. For the inference results obtained from A and B, this information is normalized into their labels to collect different templates, and active rules are extracted based on these templates. If the association result ΔAc contains n different templates, ΔAdd1, ..., ΔAddn, and these templates are associated with m active rules, then the weight of each active rule can be calculated according to the following formula: in, for The frequencies associated with different templates, For the m active rules The number of partially ordered pairs with a partially ordered relation in Pset. The key rule is the rule that contains x.id=y.id or M(x, y) in the condition of rule Y. The weight of the key rule is strengthened by multiplying the frequency by 2 to speed up their application, because the fusion of equivalent entities usually adds edges and attribute information to each node in the equivalence class. The active rules and their weight information are added to the max heap for updating.
8. The method for constructing an entity portrait based on graph rules according to claim 1, characterized in that: The backward inference process aims to extract the partial matches that are most favorable in the partial match set PCset The rules that are expanded to complete matches and inferred are, for each match in the partial match set PCset Set up a To record the extension The rules that need to be used can be expanded Active rules that provide possible edges and attributes for complete matching and satisfying inference requirements, select the rule with the highest ranking and add it to the max heap. If there are m rules with the same ranking, select the rule with the maximum out-degree according to the partial order in Pset, where: the weight of the rule is set to 1, and then add it to the max heap.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for constructing an entity portrait based on graph rules as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for constructing an entity portrait based on graph rules as described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Financial risk reasoning method and system based on forward and negative association, electronic equipment and computer readable storage medium
CN122656736A
Financial risk reasoning methods, systems, electronic devices, and computer-readable storage media based on positive and negative correlations
CN122656736B
