Reasoning method, device and computer-readable storage medium based on knowledge graph
By searching and filtering potential edges in the knowledge graph, the problem of node association completion in heterogeneous networks is solved, efficient prediction of unconnected nodes is achieved, and code development is highly versatile and concise.
Patent Information
- Application Number
- CN202110198353.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-02-22
AI Technical Summary
The prior art is difficult to effectively complement the node associations in heterogeneous networks in the knowledge graph, and lacks general applicability.
By searching for the second connected sub-map corresponding to the first connected sub-map in the knowledge graph, the latent edges are filtered as the prediction edges, and the statistical information of the latent edges is used for screening, and the network pattern is determined to determine the predicted edges.
It realizes efficient prediction of the association between unconnected nodes in the knowledge graph, has strong utility and clear operation process, and reduces the complexity of code development.
Smart Images

Figure CN112989127B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a reasoning method, device and computer-readable storage medium based on a knowledge graph. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] To complete the knowledge graph, we need to infer whether there is a connection between two unrelated nodes in the knowledge graph based on the existing information in the knowledge graph.
[0004] Connected subgraphs are usually formed in knowledge graphs. Existing technologies mostly complete knowledge graphs based on connected subgraphs (also called isomorphic networks) composed of nodes of the same type in the knowledge graph. Connected subgraphs composed of different types of nodes in the knowledge graph are also called heterogeneous networks. Research on completing knowledge graphs based on heterogeneous networks is mostly focused on heterogeneous networks in specific scenarios and is not general. Summary of the invention
[0005] In view of the above problems in the prior art, the present application proposes a reasoning method, device and computer-readable storage medium based on a knowledge graph. The above problems can be at least partially solved by using this reasoning method and device.
[0006] The following scheme is provided in the embodiments of the present application: a reasoning method based on a knowledge graph, comprising:
[0007] Searching the knowledge graph for a second connected subgraph corresponding to the first connected subgraph, wherein any second connected subgraph and its corresponding first connected subgraph each have a node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph, and if the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph;
[0008] The potential edges are used as predicted edges, or predicted edges are screened out from the potential edges according to statistical information of the potential edges.
[0009] In some embodiments, filtering out predicted edges from the potential edges according to the statistical information of the potential edges includes:
[0010] Potential edges of the second connected subgraph corresponding to the same first connected subgraph are counted, and predicted edges are filtered according to the counting results.
[0011] In some embodiments, filtering predicted edges according to the counting results includes:
[0012] The potential edges whose repetition times are greater than the first set threshold are regarded as predicted edges.
[0013] In some embodiments, it also includes: filtering a first connected subgraph from the knowledge graph, wherein the filtered first connected subgraph has at least one network pattern, and each first connected subgraph of the same network pattern is isomorphic to each other.
[0014] In some embodiments, filtering the first connected subgraph from the knowledge graph includes:
[0015] Determine the network mode;
[0016] A first connected subgraph is filtered from the knowledge graph according to the determined network pattern.
[0017] In some embodiments, the network pattern of the first connected subgraph is randomly generated or preset.
[0018] In some embodiments, filtering the first connected subgraph from the knowledge graph includes:
[0019] Determine a first node subset from the node set of the knowledge graph;
[0020] The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
[0021] In some embodiments, filtering out predicted edges from the potential edges according to the statistical information of the potential edges includes:
[0022] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of the same network pattern are counted, and the predicted edges are filtered according to the counting results.
[0023] In some embodiments, filtering the predicted edges according to the counting results includes:
[0024] The potential edges whose repetition times are greater than the second set threshold are regarded as predicted edges.
[0025] In some embodiments, the network mode has multiple types of modes, and filtering predicted edges from the potential edges according to the statistical information of the potential edges includes:
[0026] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
[0027] In some embodiments, filtering the predicted edges according to the counting results includes:
[0028] The potential edges whose repetition times are greater than the third set threshold are regarded as predicted edges.
[0029] In some embodiments, the nodes in the knowledge graph are all nodes of the same type.
[0030] In some embodiments, there is an edge between any two nodes in the first connected subgraph.
[0031] In some embodiments, the first connected subgraph includes multiple types of nodes.
[0032] In some embodiments, the nodes in the first connected subgraph are ring-shaped.
[0033] In some embodiments, the first connected subgraph includes a cycle and branches.
[0034] The following scheme is provided in an embodiment of the present application: a reasoning device based on a knowledge graph, comprising:
[0035] A subgraph search module is used to search for a second connected subgraph corresponding to a first connected subgraph in the knowledge graph, wherein, in any second connected subgraph and its corresponding first connected subgraph, there is a node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph. If the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph;
[0036] The predicted edge screening module is used to use the potential edge as the predicted edge, or to screen the predicted edge from the potential edges according to the statistical information of the potential edge.
[0037] In some embodiments, the predicted edge screening module is specifically used to:
[0038] Potential edges of the second connected subgraph corresponding to the same first connected subgraph are counted, and predicted edges are filtered according to the counting results.
[0039] In some embodiments, the predicted edge screening module is specifically used to: take potential edges whose number of repetitions is greater than a first set threshold as predicted edges.
[0040] In some embodiments, a search range determination module is also included, which is used to: filter a first connected subgraph from the knowledge graph, wherein the filtered first connected subgraph has at least one network pattern, and each first connected subgraph of the same network pattern is isomorphic to each other.
[0041] In some embodiments, the search range determination module is specifically used to: determine a network mode;
[0042] A first connected subgraph is selected from the knowledge graph according to the determined network pattern.
[0043] In some embodiments, the network pattern of the first connected subgraph is randomly generated or preset.
[0044] In some embodiments, the search range determination module is further specifically configured to:
[0045] Determine a first node subset from the node set of the knowledge graph;
[0046] The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
[0047] In some embodiments, the predicted edge screening module is specifically used to count potential edges of the second connected subgraphs corresponding to all first connected subgraphs of the same network pattern, and screen the predicted edges according to the counting results.
[0048] In some embodiments, filtering predicted edges according to the counting results includes: taking potential edges whose number of repeated appearances is greater than a second set threshold as predicted edges.
[0049] In some embodiments, there are multiple types of network modes, and the prediction edge screening module is specifically used for:
[0050] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
[0051] In some embodiments, filtering predicted edges according to the counting results includes: taking potential edges whose number of repeated appearances is greater than a third set threshold as predicted edges.
[0052] In some embodiments, the nodes in the knowledge graph are all nodes of the same type.
[0053] In some embodiments, there is an edge between any two nodes in the first connected subgraph.
[0054] In some embodiments, the first connected subgraph includes multiple types of nodes.
[0055] In some embodiments, the nodes in the first connected subgraph are ring-shaped.
[0056] In some embodiments, the first connected subgraph includes a cycle and branches.
[0057] The following scheme is provided in an embodiment of the present application: a reasoning device based on a knowledge graph, comprising:
[0058] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the aforementioned reasoning method.
[0059] The following solution is provided in an embodiment of the present application: a computer-readable storage medium storing a program, and when the program is executed by a processor, the processor executes: the aforementioned reasoning method.
[0060] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects.
[0061] The second connected subgraph covers two unconnected nodes, which means that the shape of the second connected subgraph is very similar to that of the existing first connected subgraph, and the probability of the association between the two unconnected nodes is high. If the second connected subgraph covers two unconnected nodes multiple times, that is, the potential edge connects the two nodes multiple times, then the probability of the association between the two nodes is higher. The predicted edges are selected from the potential edges based on the statistical information of the potential edges, and the selection process has strong interpretability.
[0062] Regardless of whether the knowledge graph is a homogeneous network or a heterogeneous network, regardless of the number and types of nodes in the heterogeneous network, and regardless of the scenario of the knowledge graph, the reasoning method provided in this application can efficiently determine the prediction edge and has strong versatility.
[0063] Furthermore, the operation process of the inference method is clear and the code is simple. There is no need for complex calculation steps such as feature extraction and model optimization, and the code development workload is low.
[0064] It should be understood that the above description is only an overview of the technical solution of the present application, so that the technical means of the present application can be more clearly understood and implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are specifically described below by way of example. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The advantages and benefits described herein and other advantages and benefits will be apparent to those of ordinary skill in the art by reading the detailed description of the exemplary embodiments below. The accompanying drawings are only used for the purpose of illustrating exemplary embodiments and are not to be considered as limiting the present application. Moreover, the same reference numerals are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0066] Figure 1 A schematic diagram of a flow chart of a reasoning method based on a knowledge graph according to an embodiment of the present application;
[0067] Figure 2a to Figure 2c They are respectively examples of a knowledge graph, a first network, and a second network in an inference method according to an embodiment of the present application;
[0068] Figure 3a to Figure 3c They are respectively examples of a knowledge graph, a first network, and a second network in an inference method according to an embodiment of the present application;
[0069] Figures 4a to 4c They are respectively examples of a knowledge graph, a first network, and a second network in an inference method according to an embodiment of the present application;
[0070] Figure 5 Schematic diagram of the structure of a reasoning device based on a knowledge graph according to an embodiment of the present application;
[0071] Figure 6 It is a structural diagram of a reasoning device based on a knowledge graph according to another embodiment of the present application.
[0072] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0073] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0074] In the present application, it should be understood that terms such as “including” or “having” are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and do not exclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof.
[0075] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0076] Figure 1 This is a flow chart of a reasoning method based on a knowledge graph according to an embodiment of the present application. The method is used to infer whether there is a correlation between two unconnected nodes in a knowledge graph. In this process, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the programs installed on these electronic devices.
[0077] Figure 1 The process in may include the following steps 101 to 102.
[0078] Step 101: Search the knowledge graph for a second connected subgraph corresponding to a first connected subgraph, wherein any second connected subgraph and its corresponding first connected subgraph each have a node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph. If the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph.
[0079] Step 102: Filter out predicted edges from the potential edges according to the statistical information of the potential edges.
[0080] Isomorphic graph is a term in graph theory. Suppose G = (V, E) and G1 = (V1, E1) are two graphs. If there exists a bijection m:V→V1 such that for all x,y∈V, xy∈E is equivalent to m(x)m(y)∈E1, then G and G1 are said to be isomorphic.
[0081] The first connected subgraph and the second connected subgraph are both connected subgraphs already existing in the knowledge graph, and the degree of association between the nodes in the first connected subgraph is slightly greater than the degree of association between the nodes in the second connected subgraph.
[0082] Since the second connected subgraph is isomorphic with the corresponding first connected subgraph after adding the corresponding potential edge, that is, the two have the same network pattern, there is a certain probability that there is an association between the two nodes connected by the potential edge.
[0083] If a potential edge connects the same two nodes multiple times, it indicates that the probability of a connection between the two nodes is further increased. Therefore, the predicted edge can be filtered out from the potential edges based on the statistical information of the potential edges.
[0084] If you need to complete the knowledge graph, you can add the filtered prediction edges to the knowledge graph.
[0085] The second connected subgraph covers two unconnected nodes, which means that the shape of the second connected subgraph is very similar to that of the existing first connected subgraph, and the probability of the association between the two unconnected nodes is high. If the second connected subgraph covers two unconnected nodes multiple times, that is, the potential edge connects the two nodes multiple times, then the probability of the association between the two nodes is higher. The predicted edges are selected from the potential edges based on the statistical information of the potential edges, and the selection process has strong interpretability.
[0086] Regardless of whether the knowledge graph is a homogeneous network or a heterogeneous network, regardless of the number and types of nodes in the heterogeneous network, and regardless of the scenario of the knowledge graph, the reasoning method provided in this application can efficiently determine the prediction edge and has strong versatility.
[0087] Furthermore, the operation process of the inference method is clear and the code is simple. There is no need for complex calculation steps such as feature extraction and model optimization, and the code development workload is low.
[0088] based on Figure 1 The reasoning method of this application also provides some specific implementation plans and extended plans of the reasoning method, which are described below.
[0089] In some embodiments, filtering out predicted edges from the potential edges according to the statistical information of the potential edges includes: counting the potential edges of the second connected subgraph corresponding to the same first connected subgraph, and filtering out predicted edges according to the counting result.
[0090] That is, the scope of counting potential edges is limited to the potential edges of the second connected subgraph corresponding to the same first connected subgraph.
[0091] In some embodiments, potential edges whose repetition times are greater than a first set threshold are regarded as predicted edges.
[0092] The larger the first set threshold, the stricter the screening of the prediction edges, the fewer the predicted edges screened out, but correspondingly, the higher the accuracy. The smaller the first set threshold, the looser the screening of the prediction edges, the more the predicted edges screened out, but correspondingly, the lower the accuracy.
[0093] In extreme cases, the first set threshold may be 0.
[0094] For example, reference Figure 2b The first connected subgraph shown is Figure 2a A first connected subgraph in the knowledge graph shown in FIG. , and its corresponding second connected subgraphs refer to Figure 2c . Figure 2c The dashed lines in represent potential edges.
[0095] Nodes A1 and A2 represent merchants, nodes B1 to B4 represent commodities, and nodes C1, C2 and C3 represent users. This knowledge graph represents a purchase relationship.
[0096] After counting these potential edges, it is found that B2-C2 appears twice, B1-C3 appears once, A2-B1 appears once, and A1-B4 appears once. For example, if the first threshold is set to 1 and the number of repeated appearances of B2-C2 is greater than 1, then B2-C2 can be determined as a predicted edge. Based on the first connected subgraph, it can be inferred that user C2 is more likely to purchase product B2, and product B2 can be recommended to user C2.
[0097] From a business perspective, if user C2 has purchased two products, B1 and B3, from merchant A1, then the probability that user C2 will purchase product B2 from merchant A1 is high enough. Product B2 can be recommended to user C2.
[0098] In step 101, the first connected subgraph may be a determined first connected subgraph, or the number of the first connected subgraph may be multiple.
[0099] In some embodiments, the method may further include step 100, screening a first connected subgraph from the knowledge graph, wherein the screened first connected subgraph has at least one network pattern, and each first connected subgraph of the same network pattern is isomorphic to each other.
[0100] In some embodiments, filtering the first connected subgraph from the knowledge graph includes:
[0101] Determine the network mode;
[0102] A first connected subgraph is filtered from the knowledge graph according to the determined network pattern.
[0103] The network pattern defines the type, quantity and connection relationship between nodes in the first connected subgraph. The first connected subgraphs of the same network pattern have the same shape.
[0104] That is, the first connected subgraph is selected from the knowledge graph according to the network mode. The network mode can be one or more.
[0105] In some embodiments, the network pattern of the first connected subgraph is randomly generated or preset.
[0106] In some embodiments, filtering the first connected subgraph from the knowledge graph includes:
[0107] Determine a first node subset from the node set of the knowledge graph;
[0108] The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
[0109] That is, potential edges are searched only in local areas of the knowledge graph, which increases the specificity of potential edge search.
[0110] In some embodiments, filtering out predicted edges from the potential edges according to the statistical information of the potential edges includes:
[0111] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of the same network pattern are counted, and the predicted edges are filtered according to the counting results.
[0112] In this way, the area range of the potential edges where the number of repeated occurrences is compared is expanded, and the randomness of the prediction edge screening is reduced.
[0113] Specifically, filtering the predicted edges according to the counting result includes: taking potential edges whose number of repeated appearances is greater than a second set threshold as predicted edges.
[0114] Of course, the number of first connected subgraphs corresponding to the potential edges may also be counted. If a potential edge corresponds to more first connected subgraphs, the probability of it being judged as a predicted edge will be correspondingly greater.
[0115] In some embodiments, the network mode has multiple types of modes, and filtering predicted edges from the potential edges according to the statistical information of the potential edges includes:
[0116] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
[0117] In this way, the scope of statistics and comparison of the number of potential edge repetitions is further expanded, thereby further reducing the randomness of the predicted edge screening results.
[0118] For example, a potential edge whose number of repetitions is greater than a third set threshold is taken as a predicted edge.
[0119] The above reasoning method is applicable to homogeneous networks, that is, the nodes in the knowledge graph are all nodes of the same type.
[0120] In one example, there is an edge between any two nodes in the first connected subgraph.
[0121] refer to Figure 3a In the knowledge graph, nodes D1 to D5, for example, all represent users, and the lines between nodes represent friend relationships.
[0122] refer to Figure 3b , the first connected subgraph has 4 nodes, and there is a connection between any two nodes.
[0123] refer to Figure 3c ,according to Figure 3a The knowledge graph shown and based on Figure 3b The first connected subgraph shown can determine three second connected subgraphs and one potential edge. The potential edge is D4-D5 and is repeated three times.
[0124] If the second set threshold is 2,3 is greater than 2, it can be inferred that node D4 and node D5 are friends.
[0125] In some embodiments, the first connected subgraph includes multiple types of nodes. That is, the reasoning method provided by the present application is applicable to heterogeneous networks.
[0126] In some embodiments, the nodes in the first connected subgraph are ring-shaped.
[0127] For example Figure 2b In the first connected subgraph in , nodes A1, B1, C2, B2, and A1 are connected in sequence to form a ring.
[0128] In some embodiments, the first connected subgraph includes a cycle and branches.
[0129] For example Figure 4a In the knowledge graph shown, nodes E1 and E2 represent users, nodes F1 to F3 represent devices, nodes G1 to G3 represent payment accounts, and nodes H1 and H2 represent merchants. The knowledge graph represents a transaction information network.
[0130] Figure 4b is from Figure 4a The first connected subgraph determined in includes a ring consisting of nodes E1, E2, G2, H1, G1, and two branches E1-F2 and E2-F3.
[0131] Figure 4c is based on Figure 4a The knowledge graph shown and Figure 4b The second connected subgraph is determined by the first connected subgraph shown.
[0132] It can be inferred that nodes G1 and H2 may be associated, and nodes G3 and H1 may be associated, but the possibility is not high.
[0133] The inventors of the present application conducted tests on a transaction network (node types include users, merchants, bank cards and devices), a merchant association network (node types include enterprises, branches, executives, and registered places) and a recommendation network (node types include users, merchants and products).
[0134] First, 20% of the edges in these known knowledge graphs are randomly removed and regarded as edges that need to be completed, and the remaining 80% of the edges are used as the knowledge graph based on this method.
[0135] By using the method proposed in this scheme, the predicted AUC values in the three scenarios reached 91%, 90% and 95% respectively.
[0136] However, traditional reasoning methods based on homogeneous networks (such as random walk algorithms) can only achieve an AUC value of about 85%.
[0137] The reasoning method proposed in this application is effective.
[0138] Based on the same technical concept, an embodiment of the present application also provides a reasoning device based on a knowledge graph, which is used to execute the method provided in any of the above embodiments. Figure 5 A schematic diagram of the structure of a knowledge graph-based reasoning device provided in an embodiment of the present application.
[0139] like Figure 5 As shown, the reasoning device based on the knowledge graph includes:
[0140] Subgraph search module 2, used for searching the knowledge graph for a second connected subgraph corresponding to the first connected subgraph, wherein any second connected subgraph and its corresponding first connected subgraph each have a node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph, and if the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph;
[0141] The predicted edge screening module 3 is used to use the potential edge as the predicted edge, or to screen the predicted edge from the potential edges according to the statistical information of the potential edge.
[0142] In some embodiments, the predicted edge screening module 3 is specifically used for:
[0143] Potential edges of the second connected subgraph corresponding to the same first connected subgraph are counted, and predicted edges are filtered according to the counting results.
[0144] In some embodiments, the predicted edge screening module 3 is specifically used to: take potential edges whose number of repetitions is greater than a first set threshold as predicted edges.
[0145] In some embodiments, it also includes a search range determination module 1, which is used to: filter a first connected subgraph from the knowledge graph, wherein the filtered first connected subgraph has at least one network pattern, and each first connected subgraph of the same network pattern is isomorphic to each other.
[0146] In some embodiments, the search range determination module 1 is specifically used to: determine a network mode;
[0147] A first connected subgraph is selected from the knowledge graph according to the determined network pattern.
[0148] In some embodiments, the network pattern of the first connected subgraph is randomly generated or preset.
[0149] In some embodiments, the search range determination module 1 is further specifically used for:
[0150] Determine a first node subset from the node set of the knowledge graph;
[0151] The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
[0152] In some embodiments, the predicted edge screening module 3 is specifically used to count the potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of the same network mode, and screen the predicted edges according to the counting results.
[0153] In some embodiments, filtering predicted edges according to the counting results includes: taking potential edges whose number of repeated appearances is greater than a second set threshold as predicted edges.
[0154] In some embodiments, there are multiple types of network modes, and the prediction edge screening module 3 is specifically used for:
[0155] The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
[0156] In some embodiments, filtering predicted edges according to the counting results includes: taking potential edges whose number of repeated appearances is greater than a third set threshold as predicted edges.
[0157] In some embodiments, the nodes in the knowledge graph are all nodes of the same type.
[0158] In some embodiments, there is an edge between any two nodes in the first connected subgraph.
[0159] In some embodiments, the first connected subgraph includes multiple types of nodes.
[0160] In some embodiments, the nodes in the first connected subgraph are ring-shaped.
[0161] In some embodiments, the first connected subgraph includes a cycle and branches.
[0162] It should be noted that the reasoning device in the embodiment of the present application can implement the various processes of the embodiment of the aforementioned method and achieve the same effects and functions, which will not be repeated here.
[0163] Figure 6 A reasoning device based on a knowledge graph according to an embodiment of the present application, for executing Figure 1 The reasoning method shown, the reasoning device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the aforementioned knowledge graph-based reasoning method.
[0164] According to some embodiments of the present application, a non-volatile computer storage medium is provided, on which computer executable instructions are stored, and the computer executable instructions are configured to execute, when executed by a processor: the aforementioned knowledge graph-based reasoning method.
[0165] Each embodiment in the present application 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 device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, their descriptions are simplified, and the relevant parts can be referred to the partial description of the method embodiments.
[0166] The device and computer-readable storage medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the device and computer-readable storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the device and computer-readable storage medium will not be repeated here.
[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0169] 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.
[0170] 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.
[0171] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0172] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0173] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0174] Although the spirit and principle of the present application have been described with reference to several specific embodiments, it should be understood that the present application is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present application is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A reasoning method based on knowledge graph, characterized in that: include: Searching for a second connected subgraph corresponding to the first connected subgraph in the knowledge graph, wherein, in any second connected subgraph and its corresponding first connected subgraph, there is respectively one node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph, and if the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph; in the case where the knowledge graph represents a purchase relationship network, the nodes include users, merchants and products; in the case where the knowledge graph represents a merchant association network, the nodes include enterprises, branches, executives, and registered places; in the case where the knowledge graph represents a transaction information network, the nodes include users, merchants, bank cards and devices; Predicted edges are screened out from the potential edges according to the statistical information of the potential edges, wherein the potential edges of the second connected subgraph corresponding to the same first connected subgraph are counted, potential edges whose number of repeated appearances is greater than a first set threshold are used as predicted edges, and the knowledge graph is completed by adding the predicted edges to determine that there is a correlation between the nodes after the predicted edges are completed.
2. The method according to claim 1, characterized in that Also includes: A first connected subgraph is screened from the knowledge graph, wherein the screened first connected subgraph has at least one network pattern, and first connected subgraphs of the same network pattern are isomorphic to each other.
3. The method according to claim 2, characterized in that Filtering a first connected subgraph from the knowledge graph includes: Determine the network mode; A first connected subgraph is filtered from the knowledge graph according to the determined network pattern.
4. The method according to claim 3, characterized in that The network pattern of the first connected subgraph is randomly generated or preset.
5. The method according to claim 2, characterized in that: Filtering a first connected subgraph from the knowledge graph includes: Determine a first node subset from the node set of the knowledge graph; The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
6. The method according to claim 2, characterized in that Filtering predicted edges from the potential edges according to the statistical information of the potential edges includes: The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of the same network pattern are counted, and the predicted edges are filtered according to the counting results.
7. The method according to claim 6, characterized in that Filtering prediction edges based on count results includes: The potential edges whose repetition times are greater than the second set threshold are regarded as predicted edges.
8. The method according to claim 2, characterized in that: There are multiple types of network modes, and filtering predicted edges from the potential edges according to the statistical information of the potential edges includes: The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
9. The method according to claim 8, characterized in that Filtering predicted edges based on count results includes: The potential edges whose repetition times are greater than the third set threshold are regarded as predicted edges.
10. The method according to claim 1, characterized in that The nodes in the knowledge graph are all nodes of the same type.
11. The method according to claim 10, characterized in that There is an edge between any two nodes in the first connected subgraph.
12. The method according to claim 1, characterized in that The first connected subgraph includes nodes of multiple types.
13. The method according to claim 12, characterized in that The nodes in the first connected subgraph are ring-shaped.
14. The method according to claim 12, characterized in that The first connected subgraph includes a cycle and a branch chain.
15. A reasoning device based on knowledge graph, characterized in that: include: A subgraph search module, for searching a second connected subgraph corresponding to a first connected subgraph in a knowledge graph, wherein, in any second connected subgraph and its corresponding first connected subgraph, there is respectively one node that does not belong to the intersection of the two nodes, and the second connected subgraph has one less potential edge than the corresponding first connected subgraph, and if the second connected subgraph adds the potential edge, it is isomorphic with the corresponding first connected subgraph; in the case where the knowledge graph represents a purchase relationship network, the nodes include users, merchants and products; in the case where the knowledge graph represents a merchant association network, the nodes include enterprises, branches, executives, and registered places; in the case where the knowledge graph represents a transaction information network, the nodes include users, merchants, bank cards and devices; A predicted edge screening module is used to screen predicted edges from the potential edges according to the statistical information of the potential edges, wherein the potential edges of the second connected subgraph corresponding to the same first connected subgraph are counted, potential edges whose number of repeated appearances is greater than a first set threshold are used as predicted edges, and the knowledge graph is completed by adding the predicted edges to determine whether there is a correlation between the nodes after the predicted edges are completed.
16. The device according to claim 15, characterized in that It also includes a search range determination module, which is used to: filter a first connected subgraph from the knowledge graph, wherein the filtered first connected subgraph has at least one network pattern, and the first connected subgraphs of the same network pattern are isomorphic to each other.
17. The device according to claim 16, characterized in that The search range determination module is specifically used to: determine the network mode; A first connected subgraph is filtered from the knowledge graph according to the determined network pattern.
18. The device according to claim 17, characterized in that The network pattern of the first connected subgraph is randomly generated or preset.
19. The device according to claim 16, characterized in that The search range determination module is also specifically used for: Determine a first node subset from the node set of the knowledge graph; The first connected subgraph including the nodes in the complement of the first node subset is eliminated.
20. The device according to claim 15, characterized in that The predicted edge screening module is specifically used to count the potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of the same network mode, and screen the predicted edges according to the counting results.
21. The device according to claim 20, characterized in that Filtering the predicted edges according to the counting results includes: taking potential edges with a number of repetitions greater than a second set threshold as predicted edges.
22. The device according to claim 16, characterized in that There are multiple types of network modes, and the prediction edge screening module is specifically used for: The potential edges of the second connected subgraphs corresponding to all the first connected subgraphs of all the network patterns are counted, and the predicted edges are filtered according to the counting results.
23. The device according to claim 22, characterized in that Filtering the predicted edges according to the counting results includes: taking potential edges with a number of repetitions greater than a third set threshold as predicted edges.
24. The device according to claim 15, characterized in that The nodes in the knowledge graph are all nodes of the same type.
25. The device according to claim 24, characterized in that There is an edge between any two nodes in the first connected subgraph.
26. The device according to claim 15, characterized in that The first connected subgraph includes nodes of multiple types.
27. The device according to claim 26, characterized in that The nodes in the first connected subgraph are ring-shaped.
28. The device according to claim 26, characterized in that The first connected subgraph includes a cycle and a branch chain.
29. A reasoning device based on knowledge graph, characterized in that: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor so that at least one processor can execute: the method according to any one of claims 1 to 14.
30. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to execute: the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Learning source body matching method based on subgraph approximate isomorphism
CN107798146A
Knowledge graph relationship mining method and device, computer equipment and storage medium
CN112069249A
User interface framework for viewing large scale graphs on the web
US20090115785A1
Systems and Methods for Recommending Relationships within a Graph Database
US20140280224A1
Identifying redundant nodes in a knowledge graph data structure
US20190235961A1
