Heterogeneous network reasoning method and device, equipment, storage medium and product
By employing a heterogeneous network reasoning method, this approach utilizes heterogeneous hypergraphs and pre-defined large text models to predict entity relationships, thus solving the problem of low reliability in existing entity relationship prediction technologies and achieving more efficient and accurate entity relationship reasoning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIHOOD TECHNOLOGY CO LTD
- Filing Date
- 2024-11-01
- Publication Date
- 2026-05-08
AI Technical Summary
Existing knowledge graph forms based on triple representations have low reliability in entity association prediction. They mainly rely on fitting the objective function and utilizing the single-hop information of triples, resulting in inaccurate entity association prediction results.
A heterogeneous network reasoning method is adopted. By detecting the hyperedge information of the entity to be reasoned in the heterogeneous hypergraph, the system performs retrieval and reasoning using a pre-set retrieval library and a pre-set text large model to obtain candidate relationship information. The system then combines the hyperedge information and entity path to perform entity relationship reasoning.
It improves the accuracy and efficiency of entity relationship reasoning, enhances the credibility of association prediction by utilizing the various types of entities and hyperedge information of heterogeneous hypergraphs, and improves the efficiency of entity relationship reasoning.
Smart Images

Figure CN121998067A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to heterogeneous network inference methods, devices, equipment, storage media and products. Background Technology
[0002] Graph reasoning is mainly used to solve reasoning tasks in graphs. For example, given two entities, it is necessary to determine whether there is a relationship between the two entities (yes or no), and what kind of relationship exists (give a specific name of the relationship). These tasks all rely on knowledge graph technology for support.
[0003] However, traditional knowledge graphs based on triple representations are insufficient in characterizing entity features. For example, for predicting the association between two entities, they mainly rely on fitting the objective function, such as the TransE translation model, which actually utilizes the single-hop information of the triple, resulting in low reliability of entity association prediction results. Summary of the Invention
[0004] The main purpose of this application is to provide a heterogeneous network reasoning method, apparatus, device, storage medium and product, which aims to solve the technical problem of low reliability of existing entity association prediction results.
[0005] To achieve the above objectives, this application proposes a heterogeneous network reasoning method, which includes: when an association is detected between entities to be reasoned, determining the hyperedge information of the entities to be reasoned based on the heterogeneous hypergraph in which the entities to be reasoned are located, wherein the heterogeneous hypergraph is a graph structure including multiple types of entities and multiple types of hyperedges;
[0006] Based on the hyperedge information, a search is performed in a preset search library to obtain candidate relationship information between the entities to be inferred. The preset search library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0007] The candidate relationship information is input into a preset text model to obtain the entity relationship reasoning result.
[0008] Optionally, before the step of retrieving candidate relationship information between the entities to be inferred from a preset retrieval database based on the hyperedge information, the method further includes:
[0009] Analyze the relationships between entities in a heterogeneous hypergraph;
[0010] Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0011] A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
[0012] Optionally, the step of constructing a preset retrieval database based on the entity hyperedge information and the target relationship includes:
[0013] The entity hyperedge information is vectorized to obtain the entity hyperedge vector;
[0014] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0015] Optionally, the step of retrieving candidate relationship information between the entities to be inferred from a preset retrieval database based on the hyperedge information includes:
[0016] Based on the hyperedge information, a search is performed in a preset search database to obtain similar entity hyperedge information that is similar to the hyperedge information.
[0017] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0018] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0019] Optionally, before the step of determining the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph where the entities to be inferred are located when an association is detected between them, the method further includes:
[0020] Query the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned are located;
[0021] If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0022] Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
[0023] Optionally, the step of determining whether there is a relationship between the entities to be inferred based on the first hyperedge information and the preset text big model includes:
[0024] Get the preset prompt template;
[0025] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0026] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0027] Optionally, after the step of querying the path information between the entities to be inferred in the heterogeneous hypergraph where the entity to be inferred is located, the method further includes:
[0028] If the path information is found, it is determined that there is a relationship between the entities to be inferred.
[0029] Optionally, the step of determining the hyperedge information of the entity to be inferred based on the heterogeneous hypergraph where the entity to be inferred is located includes:
[0030] Query all hyperedge information of the entity to be inferred in the heterogeneous hypergraph in which it resides;
[0031] By concatenating all the hyperedge information, the hyperedge information of the entity to be inferred is obtained.
[0032] Optionally, the step of concatenating all the hyperedge information to obtain the hyperedge information of the entity to be inferred includes:
[0033] When an image exists in all the hyperedge information, an image description text is generated for the image, and the image is replaced according to the image description text to obtain text information;
[0034] By concatenating the text information, the hyperedge information of the entity to be inferred is obtained.
[0035] Optionally, the step of inputting the candidate relationship information into a preset text model to obtain entity relationship reasoning results includes:
[0036] Determine the entity information corresponding to the candidate relationship information, wherein the entity information includes entity relationship and entity path;
[0037] Determine relationship description information based on the entity relationship and the entity path;
[0038] The relationship description information is input into a preset text model to obtain the entity relationship reasoning result.
[0039] Optionally, after the step of inputting the candidate relationship information into a preset text model to obtain the entity relationship reasoning result, the method further includes:
[0040] Based on the entity relationship reasoning results, determine the entity relationship, judgment reason, and ranking result of the entity to be reasoned;
[0041] The entity relationships and the reasons for the determination are displayed based on the sorting results.
[0042] Furthermore, to achieve the above objectives, this application also proposes a heterogeneous network inference device, which includes:
[0043] The determination module is used to determine the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which the entities to be inferred are located when an association is detected between the entities to be inferred. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges.
[0044] The retrieval module is used to perform a retrieval in a preset retrieval library based on the hyperedge information to obtain candidate relationship information between the entities to be inferred. The preset retrieval library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0045] The prediction module is used to input the candidate relationship information into a preset text model to obtain entity relationship reasoning results.
[0046] Optionally, the retrieval module is also used to statistically analyze the relationship information between entities in the heterogeneous hypergraph;
[0047] Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0048] A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
[0049] Optionally, the retrieval module is further configured to vectorize the entity hyperedge information to obtain entity hyperedge vectors;
[0050] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0051] Optionally, the retrieval module is further configured to perform a retrieval in a preset retrieval database based on the hyperedge information to obtain similar entity hyperedge information that is similar to the hyperedge information;
[0052] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0053] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0054] Optionally, the determining module is further configured to query path information between the entities to be inferred in the heterogeneous hypergraph where the entity to be inferred is located;
[0055] If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0056] Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
[0057] Optionally, the determining module is further configured to obtain a preset prompt template;
[0058] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0059] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0060] Optionally, the determining module is further configured to determine, if the path information is found, that there is a relationship between the entities to be inferred.
[0061] Optionally, the determining module is further configured to query all hyperedge information of the entity to be inferred in the heterogeneous hypergraph in which it resides;
[0062] By concatenating all the hyperedge information, the hyperedge information of the entity to be inferred is obtained.
[0063] Optionally, the determining module is further configured to, when an image exists in all the hyperedge information, generate image description text for the image, and replace the image with the image description text to obtain text information;
[0064] By concatenating the text information, the hyperedge information of the entity to be inferred is obtained.
[0065] Optionally, the prediction module is further configured to determine the entity information corresponding to the candidate relationship information, wherein the entity information includes entity relationship and entity path;
[0066] Determine relationship description information based on the entity relationship and the entity path;
[0067] The relationship description information is input into a preset text model to obtain the entity relationship reasoning result.
[0068] Optionally, the prediction module is further configured to determine the entity relationship, judgment reason and ranking result of the entity to be inferred based on the entity relationship reasoning result;
[0069] The entity relationships and the reasons for the determination are displayed based on the sorting results.
[0070] In addition, to achieve the above objectives, this application also proposes a heterogeneous network inference device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the heterogeneous network inference method as described above.
[0071] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the heterogeneous network inference method described above.
[0072] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the heterogeneous network inference method described above.
[0073] When this application detects a relationship between entities to be inferred, it determines the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which the entities are located. The heterogeneous hypergraph is a graph structure including multiple types of entities and multiple types of hyperedges. Based on the hyperedge information, it searches a preset retrieval database to obtain candidate relationship information between the entities to be inferred. The preset retrieval database includes the relationships between entities in the heterogeneous hypergraph and the corresponding hyperedge information of the entities. The candidate relationship information is then input into a preset text big model to obtain the entity relationship inference result. Because this application determines the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which they are located when a relationship exists, searches a preset retrieval database based on the hyperedge information to obtain candidate relationship information between the entities to be inferred, and obtains the entity relationship inference result based on the preset text big model and the candidate relationship information, compared to existing methods that predict relationships between entities based on single-hop information from triples in knowledge graphs, the above method of this application utilizes retrieval enhancement and the predictive capabilities of a big model, which can improve the efficiency of entity relationship inference. Attached Figure Description
[0074] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0075] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0076] Figure 1This is a flowchart illustrating an embodiment of the heterogeneous network inference method of this application.
[0077] Figure 2 This is a flowchart illustrating Embodiment 2 of the heterogeneous network inference method of this application;
[0078] Figure 3 A flowchart illustrating the heterogeneous network inference method of this application, provided in Embodiment 3.
[0079] Figure 4 This is a schematic diagram of the module structure of the heterogeneous network inference device according to an embodiment of this application;
[0080] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the heterogeneous network inference method in the embodiments of this application.
[0081] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0082] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0083] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0084] The main solution of this application embodiment is as follows: when a relationship is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined according to the heterogeneous hypergraph in which the entities to be inferred are located. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges. Based on the hyperedge information, a search is performed in a preset search library to obtain candidate relationship information between the entities to be inferred. The preset search library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities. The candidate relationship information is input into a preset text big model to obtain the entity relationship inference result.
[0085] This application, when there are relationships between entities to be reasoned about, determines the hyperedge information of the entities to be reasoned about based on the heterogeneous hypergraph in which they reside. It then searches a pre-defined retrieval database based on this hyperedge information to obtain candidate relationship information between the entities. Finally, it obtains the entity relationship reasoning result based on a pre-defined large text model and the candidate relationship information. Compared to existing methods that predict relationships between entities based on single-hop information from triples in knowledge graphs, this application's method utilizes retrieval enhancement and the predictive capabilities of a large model, thereby improving the efficiency of entity relationship reasoning.
[0086] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or heterogeneous network inference device capable of performing the above functions. The following description uses a heterogeneous network inference device as an example to illustrate this embodiment and the subsequent embodiments.
[0087] Based on this, embodiments of this application provide a heterogeneous network inference method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the heterogeneous network inference method of this application.
[0088] In this embodiment, the heterogeneous network inference method includes steps S10 to S30:
[0089] Step S10: When an association is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined according to the heterogeneous hypergraph in which the entities to be inferred are located. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges.
[0090] It should be noted that the entities to be inferred include at least two entities, which can be entities whose relationships need to be determined. For example, it is necessary to determine the relationship between entities entity1 and entity2, where entities entity1 and entity2 can be the entities to be inferred. The existence of a relationship between the entities to be inferred can be determined by querying the heterogeneous hypergraph to see if a connection path exists between them. For example, if a connection path can be found between the entities to be inferred in the heterogeneous hypergraph, it indicates that a relationship exists between them. Determining the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which they reside can be achieved by searching for all the hyperedge information of the entities to be inferred in the heterogeneous hypergraph.
[0091] It should be understood that a heterogeneous hypergraph is a concept in graph theory and network science, an extension of the traditional graph, capable of better representing and modeling complex and diverse relationships in the real world. It is a complex network graph composed of multiple types of nodes and multiple types of hyperedges. A heterogeneous hypergraph can be defined as a graph structure containing multiple types of nodes and multiple types of hyperedges. Specifically, a heterogeneous hypergraph G can be represented as G = {V, E, T_v, T_e}, where: V is the set of vertices (nodes); E is the set of hyperedges. A hyperedge connects two or more nodes; unlike edges in a traditional graph that can only connect two nodes, a hyperedge can connect any number of nodes; T_v is the set of vertex types, indicating that there are multiple types of nodes in the graph; T_e is the set of hyperedge types, indicating that there are multiple types of hyperedges in the graph. When the sum of the number of vertex types |T_v| and the number of hyperedge types |T_e| is greater than 2, the hypergraph is considered heterogeneous.
[0092] Its characteristics include: heterogeneous hypergraphs allow for multiple types of nodes and hyperedges, enabling more detailed representation of complex real-world relational networks; they possess high-order relationships: hyperedges can connect more than two nodes, thus representing higher-order relationships than traditional graphs. This is extremely useful in many real-world scenarios, such as group relationships in social networks and user-item-tag relationships in recommendation systems; and they have rich expressive power: because heterogeneous hypergraphs can simultaneously contain multiple types of nodes and edges, and allow complex high-order relationships between nodes, they possess very rich expressive power, enabling more accurate modeling of complex real-world networks, such as social networks, recommendation systems, and knowledge graphs. In these scenarios, heterogeneous hypergraphs provide a powerful tool for modeling and analyzing these complex relationships. Heterogeneous hypergraphs include multiple multimodal information of the same entity, entity attribute information, and relational information, stored using databases including, but not limited to, MySQL and Neo4j. In this embodiment, the entity to be reasoned about, as well as other entities, can all be understood as nodes in the heterogeneous hypergraph.
[0093] Furthermore, to improve the accuracy of relational reasoning, the step of determining the hyperedge information of the entity to be reasoned based on the heterogeneous hypergraph where the entity to be reasoned resides includes:
[0094] Query all hyperedge information of the entity to be inferred in the heterogeneous hypergraph in which it resides;
[0095] By concatenating all the hyperedge information, the hyperedge information of the entity to be inferred is obtained.
[0096] It should be noted that the entity to be inferred may contain multiple hyperedges in the heterogeneous hypergraph. In order to accurately predict the relationships between the entities to be inferred, all hyperedge information of the entity to be inferred in the heterogeneous hypergraph can be queried. For example, if the entities to be inferred include entity 1 and entity 2, all hyperedge information all1 of entity 1 can be queried, and all hyperedge information all2 of entity 2 can be queried. Then, all1 and all2 are concatenated to obtain the hyperedge information of entity 1 and entity 2.
[0097] Furthermore, to avoid the presence of images in the hyperedge information, which could affect the model's prediction efficiency, the step of concatenating all the hyperedge information to obtain the hyperedge information of the entity to be inferred includes:
[0098] When an image exists in all the hyperedge information, an image description text is generated for the image, and the image is replaced according to the image description text to obtain text information;
[0099] By concatenating the text information, the hyperedge information of the entity to be inferred is obtained.
[0100] It should be noted that when images are present in all the hyperedge information, a multimodal language model (which can be a large multimodal model capable of processing image information, such as GPT4-O) can be used to generate image description text for the image. The image is then replaced with this image description text to obtain the text information corresponding to all hyperedge information. The text information is then concatenated to obtain the hyperedge information of the entity to be inferred.
[0101] Step S20: Based on the hyperedge information, a search is performed in a preset search library to obtain candidate relationship information between the entities to be inferred. The preset search library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0102] It should be noted that the candidate relationship information can be entity information corresponding to hyperedge information similar to the hyperedge information in a preset retrieval database. For example, if the preset retrieval database includes a relationship r between entity 1 and entity 2, and hyperedge information a corresponding to entity 1 and entity 2, and a is similar to the hyperedge information of the entity to be inferred, then the relationship r between entity 1 and entity 2 can be used as a candidate relationship between the entities to be inferred. The candidate relationship information can be the hyperedge information corresponding to entity 1 and entity 2, as well as the relationship between entity 1 and entity 2.
[0103] Furthermore, in order to improve the inference efficiency of heterogeneous networks, step S20 may include: searching in a preset search library based on the hyperedge information to obtain similar entity hyperedge information that is similar to the hyperedge information;
[0104] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0105] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0106] In specific implementation, the heterogeneous network inference device retrieves similar entity hyperedge information from the preset retrieval database. The similar entity hyperedge information is then sorted according to its similarity to the hyperedge information. To avoid returning too much hyperedge information, only a preset number of similar entity hyperedge information with high similarity can be returned as target entity hyperedge information; for example, the top 5 most similar target entity hyperedge information are returned based on the sorting result. Then, the relationship information of the entities corresponding to the target entity hyperedge information is determined according to the preset retrieval database, i.e., the candidate relationship information between the entities to be inferred. When the preset retrieval database includes a determination reason for the relationship between entities, the candidate relationship information includes the relationship information of the entities corresponding to the target entity hyperedge information and the determination reason.
[0107] Step S30: Input the candidate relationship information into the preset text big model to obtain the entity relationship reasoning result.
[0108] It should be noted that the preset text model can be a large text language model capable of processing text information, such as chattpt or gpt4. The step of inputting the candidate relationship information into the preset text model to obtain the entity relationship reasoning result can be achieved by sorting the candidate relationship information according to the similarity to the hyperedge information of the entity to be reasoned, inputting the sorting result and the hyperedge information of the entity to be reasoned into the preset text model, and obtaining the entity relationship reasoning result output by the preset text model. The entity relationship reasoning result can include the relationship between the entities to be reasoned predicted by the preset text model. There is at least one relationship between the entities to be reasoned. When there are multiple relationships between the entities to be reasoned, the entity relationship reasoning result also includes the multiple possible relationships between the entities to be reasoned, their corresponding probabilities, and the reasons for judgment.
[0109] Furthermore, to enable the pre-defined text model to more efficiently predict the entity relationships of the entities to be inferred, step S30 may include:
[0110] Determine the entity information corresponding to the candidate relationship information, wherein the entity information includes entity relationship and entity path;
[0111] Determine relationship description information based on the entity relationship and the entity path;
[0112] The relationship description information is input into a preset text model to obtain the entity relationship reasoning result.
[0113] It should be noted that the entity information may be the entity relationship and entity path corresponding to the candidate relationship information stored in the preset retrieval database. For example, the candidate relationships in the candidate relationship information are a and b, the entities corresponding to candidate relationship a are entities a1 and a2, the entities corresponding to candidate relationship b are entities b1 and b2, and the entity path includes the connection path between entities a1 and a2 and the connection path between entities b1 and b2.
[0114] The step of determining the relationship description information based on the entity relationship and the entity path can be achieved by inputting the entity relationship and the entity path into a preset text model, and obtaining the reason for the determination of the relationship between entities based on the entity relationship and the entity path analysis by the preset text model, i.e., the relationship description information. If the relationship description information between entities is pre-stored in the preset retrieval library, it can be directly searched from the preset retrieval library. To simplify the process, the step of determining the relationship description information based on the entity relationship and the entity path can be omitted, and the entity relationship, the entity path, and the hyperedge information of the entity to be recommended can be directly input into the preset text model to obtain the entity relationship reasoning result.
[0115] Furthermore, the entity relationship reasoning results output by the preset text big model may include multiple entity relationships predicted by the preset text big model, as well as the corresponding similarity and judgment reasons. After step S30, it may include: determining the entity relationship, judgment reason and ranking result of the entity to be reasoned based on the entity relationship reasoning results.
[0116] The entity relationships and the reasons for the determination are displayed based on the sorting results.
[0117] It should be noted that the ranking result can be obtained by ranking the predicted entity relationships based on the similarity of the entity relationships predicted by the preset text model. For example, the entity relationship inference results predicted by the preset text model are: Relation 1, similarity 80%, judgment reason XX; Relation 2, similarity 90%, judgment reason XX; Relation 3, similarity 99%, judgment reason XX. The ranking result is based on the similarity of the entity relationship inference results predicted by the preset text model. Then, the top N entity relationships and judgment reasons can be selected for display according to the ranking result, or the entity relationships and judgment reasons with similarity greater than a preset threshold can be displayed.
[0118] In this embodiment, when a relationship is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined based on the heterogeneous hypergraph in which the entities are located. The heterogeneous hypergraph is a graph structure including multiple types of entities and multiple types of hyperedges. Based on the hyperedge information, a search is performed in a preset retrieval database to obtain candidate relationship information between the entities to be inferred. The preset retrieval database includes the relationships between entities in the heterogeneous hypergraph and the corresponding hyperedge information. The candidate relationship information is then input into a preset text model to obtain the entity relationship inference result. Because this embodiment determines the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which they are located when a relationship exists, searches the preset retrieval database based on the hyperedge information to obtain candidate relationship information between the entities to be inferred, and obtains the entity relationship inference result based on the preset text model and the candidate relationship information, compared to existing methods that predict relationships between entities based on single-hop information from triples in knowledge graphs, this embodiment utilizes retrieval enhancement and the predictive capabilities of a large model to improve the efficiency of entity relationship inference.
[0119] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating the heterogeneous network inference method embodiment two of this application. Before step S10, the following steps are also included:
[0120] Step S001: Query the path information between the entities to be reasoned in the heterogeneous hypergraph where the entity to be reasoned is located;
[0121] It should be noted that the path information can be the connection path information of the entity to be inferred in the heterogeneous hypergraph, that is, whether there is a path connecting the entity to be inferred in the heterogeneous hypergraph.
[0122] In practice, a heterogeneous hypergraph query statement can be constructed to perform path lookup for the entities to be inferred in the heterogeneous hypergraph. If path information is found, it is determined that there is an association between the entities to be inferred, and the relationship between the entities to be inferred is determined based on the path information found.
[0123] Step S002: If the path information is not found, query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0124] It should be noted that the first hyperedge information can be various types of hyperedge information corresponding to the entity to be inferred.
[0125] Step S003: Determine whether there is a relationship between the entities to be inferred based on the first hyperedge information and the preset text big model.
[0126] It should be noted that determining whether there is a relationship between the entities to be reasoned based on the first hyperedge information and the preset text model can involve inputting the first hyperedge information into the preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned and the reason for the judgment. (When the first hyperedge information includes an image, text conversion of the image is also involved. For details, please refer to the above embodiment, which will not be repeated here.)
[0127] Furthermore, in order to improve the prediction accuracy of the preset text model, step S003 may include: obtaining a preset prompt template;
[0128] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0129] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0130] It should be noted that the preset prompt template can be a pre-set AI prompt. For example, the first hyperedge information includes hyperedge information 1 of entity 1 to be reasoned and hyperedge information 2 of entity 2 to be reasoned. The input template constructed based on the preset prompt template and the first hyperedge information is: "Please determine whether there is a relationship between the two entities based on the following two entity information. If there is no relationship, reply directly that there is no relationship and give the reason for the determination; if there is a relationship, also give the reason for the determination. The entity information is: hyperedge information 1 of entity 1 to be reasoned and hyperedge information 2 of entity 2 to be reasoned."
[0131] In practice, the entities to be inferred can be labeled as entity1 and entity2 respectively. A hypergraph query statement is constructed to search for a path between entity1 and entity2 in the heterogeneous hypergraph. If a path exists, "A relationship exists" is returned directly, and the existing relationship is recorded as evidence. Otherwise, all hyperedge information for entities entity1 and entity2 are found in the heterogeneous hypergraph, denoted as kg_entity1 and kg_entity2 respectively. kg_entity1 and kg_entity2 are then traversed, and queries are performed on kg_entity1 and kg_entity2 respectively. If an image exists in y2, input the image into a multimodal language model (which can be a pre-trained model capable of processing image information, such as GPT4-O) to generate image description text, replace the corresponding image, and then assemble it with other hyper-edge information to form two assembled texts, clue_entity1 and clue_entity2. Concatenate the assembled texts clue_entity1 and clue_entity2, and then send the concatenation result into a preset text model. Obtain the return result from the preset text model. If a correlation exists, the preset text model will return "correlation exists" and the corresponding reason for the judgment. Concatenate the existing correlation and the reason for the judgment and record it as evidence. If no correlation exists, directly return "no correlation exists" and record the reason for the judgment as evidence.
[0132] This embodiment queries the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned reside. If no path information is found, the first hyperedge information of the entities to be reasoned in the heterogeneous hypergraph is queried. Based on the first hyperedge information and a preset text model, it is determined whether there is a relationship between the entities to be reasoned. This embodiment first queries the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned reside. If no path information is found, it determines whether there is a relationship between the entities to be reasoned in the first hyperedge information and a preset text model. Compared to existing methods that only determine the relationship between entities based on the existence of connecting paths in the knowledge graph, the above method in this embodiment improves the efficiency of entity relationship determination.
[0133] Based on the above embodiments of this application, in the third embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating the heterogeneous network inference method of this application in Embodiment 3. Before step S20, the following steps are also included:
[0134] Step S101: Calculate the relationship information between entities in the heterogeneous hypergraph;
[0135] It should be noted that the relationship information between entities in the statistical heterogeneous hypergraph can be all the relationships and attribute information that exist between entities in the heterogeneous hypergraph.
[0136] Step S102: Traverse the relationship information, determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0137] It should be noted that the target relationship can be one of the relationships traversed. The target entity can be at least two entities that satisfy the target relationship. Then, the entity hyperedge information corresponding to the target entity is determined according to the heterogeneous hypergraph. Specifically, the hyperedge information of each entity in the target entity in the heterogeneous hypergraph can be determined separately, and then the hyperedge information of each entity is concatenated to obtain the entity hyperedge information.
[0138] Step S103: Construct a preset retrieval library based on the entity hyperedge information and the target relationship, and return to the step of traversing the relationship information.
[0139] It should be noted that the construction of the preset retrieval library based on the entity hyperedge information and the target relationship can be achieved by associating and storing the entity hyperedge information and its corresponding target relationship to obtain the preset retrieval library.
[0140] Furthermore, in order to improve the efficiency of subsequent retrieval, step S103 may include: vectorizing the entity hyperedge information to obtain the entity hyperedge vector;
[0141] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0142] It should be noted that the entity hyperedge information can be vectorized to obtain entity hyperedge vectors. The vectorized entity hyperedge vectors and their corresponding target relationships are then stored to obtain a preset search library. Vectorization can be performed using methods such as text2vec.
[0143] In the specific implementation, firstly, all relations and attributes in the heterogeneous hypergraph are counted and denoted as r1; then, r1 is traversed to determine the traversed relation r, and N (which can be customized according to the size of the heterogeneous hypergraph) two entities with relation r are randomly sampled. The hyperedge information of these two entities is determined according to the heterogeneous hypergraph (when the hyperedge information includes images, text conversion of the images is also involved, which can be referred to the above embodiment, and will not be repeated here). The hyperedge information of the two entities is concatenated to obtain the concatenated hyperedge information. The concatenated hyperedge information and relation r are stored in a preset retrieval database, where the key can be the concatenated hyperedge information. Then, other relations in r1 are traversed again until all relations in r1 are traversed.
[0144] Furthermore, to make the entity relationship reasoning results predicted by the preset text big model in step S30 more accurate, when constructing the preset retrieval library, the entity hyperedge information and the target relationship can be input into the preset text big model to obtain the judgment reason output by the preset text big model based on the entity hyperedge information and the target relationship. The judgment reason can be the reasoning reason for determining the relationship between entities based on the entity hyperedge information of the entities. The preset retrieval library is constructed based on the judgment reason, the entity hyperedge information, and the target relationship.
[0145] This embodiment statistically analyzes the relationship information between entities in a heterogeneous hypergraph; it traverses the relationship information to determine the target entity corresponding to the target relationship, and determines the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph; it constructs a preset retrieval library based on the entity hyperedge information and the target relationship, and returns to the step of traversing the relationship information. This embodiment constructs a preset retrieval library based on the relationship information between entities in the heterogeneous hypergraph and the entity hyperedge information. When subsequently determining the relationship between entities to be inferred, the preset retrieval library can be used for enhanced retrieval, improving the inference efficiency of relationships between entities.
[0146] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the heterogeneous network inference method of this application. Any simple transformations based on this technical concept are within the protection scope of this application.
[0147] This application also provides a heterogeneous network inference device; please refer to [reference needed]. Figure 4 The heterogeneous network inference device includes:
[0148] The determination module 10 is used to determine the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph where the entities to be inferred are located when an association is detected between the entities to be inferred. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges.
[0149] The retrieval module 20 is used to perform a retrieval in a preset retrieval library based on the hyperedge information to obtain candidate relationship information between the entities to be inferred. The preset retrieval library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0150] The prediction module 30 is used to input the candidate relationship information into a preset text model to obtain entity relationship reasoning results.
[0151] In this embodiment, when a relationship is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined based on the heterogeneous hypergraph in which the entities are located. The heterogeneous hypergraph is a graph structure including multiple types of entities and multiple types of hyperedges. Based on the hyperedge information, a search is performed in a preset retrieval database to obtain candidate relationship information between the entities to be inferred. The preset retrieval database includes the relationships between entities in the heterogeneous hypergraph and the corresponding hyperedge information. The candidate relationship information is then input into a preset text model to obtain the entity relationship inference result. Because this embodiment determines the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which they are located when a relationship exists, searches the preset retrieval database based on the hyperedge information to obtain candidate relationship information between the entities to be inferred, and obtains the entity relationship inference result based on the preset text model and the candidate relationship information, compared to existing methods that predict relationships between entities based on single-hop information from triples in knowledge graphs, this embodiment utilizes retrieval enhancement and the predictive capabilities of a large model to improve the efficiency of entity relationship inference.
[0152] Based on the above-described heterogeneous network inference device embodiments of this application, a second embodiment of the heterogeneous network inference device of this application is proposed.
[0153] In this embodiment, the retrieval module 20 is also used to statistically analyze the relationship information between entities in the heterogeneous hypergraph;
[0154] Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0155] A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
[0156] Furthermore, the retrieval module 20 is also used to vectorize the entity hyperedge information to obtain the entity hyperedge vector;
[0157] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0158] Furthermore, the retrieval module 20 is also used to perform a retrieval in a preset retrieval database based on the hyperedge information to obtain similar entity hyperedge information that is similar to the hyperedge information;
[0159] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0160] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0161] Furthermore, the determining module 10 is also used to query path information between the entities to be inferred in the heterogeneous hypergraph where the entity to be inferred is located;
[0162] If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0163] Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
[0164] Furthermore, the determining module 10 is also used to obtain a preset prompt template;
[0165] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0166] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0167] Furthermore, the determining module 10 is also used to determine that there is a relationship between the entities to be inferred if the path information is found.
[0168] Furthermore, the determining module 10 is also used to query all hyperedge information of the entity to be inferred in the heterogeneous hypergraph in which it resides;
[0169] By concatenating all the hyperedge information, the hyperedge information of the entity to be inferred is obtained.
[0170] Furthermore, the determining module 10 is also used to generate image description text for the image when an image exists in all the hyperedge information, and replace the image with the image description text to obtain text information;
[0171] By concatenating the text information, the hyperedge information of the entity to be inferred is obtained.
[0172] Furthermore, the prediction module 30 is also used to determine the entity information corresponding to the candidate relationship information, wherein the entity information includes entity relationship and entity path;
[0173] Determine relationship description information based on the entity relationship and the entity path;
[0174] The relationship description information is input into a preset text model to obtain the entity relationship reasoning result.
[0175] Furthermore, the prediction module 30 is also used to determine the entity relationship, judgment reason and ranking result of the entity to be reasoned based on the entity relationship reasoning result;
[0176] The entity relationships and the reasons for the determination are displayed based on the sorting results.
[0177] The heterogeneous network inference device provided in this application, employing the heterogeneous network inference method in the above embodiments, can solve the technical problem of low reliability of existing entity association prediction results. Compared with the prior art, the beneficial effects of the heterogeneous network inference device provided in this application are the same as those of the heterogeneous network inference method provided in the above embodiments, and other technical features in the heterogeneous network inference device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0178] This application provides a heterogeneous network inference device, which 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 to enable the at least one processor to execute the heterogeneous network inference method in the above embodiment 1.
[0179] The following is for reference. Figure 5 This document illustrates a structural diagram suitable for implementing heterogeneous network inference devices according to embodiments of this application. The heterogeneous network inference devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The heterogeneous network inference device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0180] like Figure 5As shown, the heterogeneous network inference device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the heterogeneous network inference device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the heterogeneous network inference device to communicate wirelessly or wiredly with other devices to exchange data. Although heterogeneous network inference devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0181] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0182] The heterogeneous network inference device provided in this application, employing the heterogeneous network inference method in the above embodiments, can solve the technical problem of low reliability of existing entity association prediction results. Compared with the prior art, the beneficial effects of the heterogeneous network inference device provided in this application are the same as those of the heterogeneous network inference method provided in the above embodiments, and other technical features in this heterogeneous network inference device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0183] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0184] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0185] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the heterogeneous network inference method in the above embodiments.
[0186] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0187] The aforementioned computer-readable storage medium may be included in a heterogeneous network inference device; or it may exist independently and not assembled into a heterogeneous network inference device.
[0188] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the heterogeneous network inference device, cause the heterogeneous network inference device to perform the aforementioned heterogeneous network inference method.
[0189] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0191] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0192] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described heterogeneous network inference method, which can solve the technical problem of low reliability of existing entity association prediction results. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the heterogeneous network inference method provided in the above embodiments, and will not be repeated here.
[0193] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the heterogeneous network inference method described above.
[0194] The computer program product provided in this application can solve the technical problem of low reliability of existing entity association prediction results. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the heterogeneous network inference method provided in the above embodiments, and will not be repeated here.
[0195] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
[0196] This application discloses A1. A heterogeneous network inference method, the method comprising the following steps:
[0197] When an association is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined based on the heterogeneous hypergraph in which the entities to be inferred are located. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges.
[0198] Based on the hyperedge information, a search is performed in a preset search library to obtain candidate relationship information between the entities to be inferred. The preset search library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0199] The candidate relationship information is input into a preset text model to obtain the entity relationship reasoning result.
[0200] A2. The heterogeneous network reasoning method as described in A1, prior to the step of retrieving candidate relationship information between the entities to be reasoned from a preset retrieval database based on the hyperedge information, further includes:
[0201] Analyze the relationships between entities in a heterogeneous hypergraph;
[0202] Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0203] A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
[0204] A3. The heterogeneous network reasoning method as described in A2, wherein the step of constructing a preset retrieval library based on the entity hyperedge information and the target relationship includes:
[0205] The entity hyperedge information is vectorized to obtain the entity hyperedge vector;
[0206] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0207] A4. The heterogeneous network reasoning method as described in A1, wherein the step of retrieving candidate relationship information between the entities to be reasoned from a preset retrieval database based on the hyperedge information includes:
[0208] Based on the hyperedge information, a search is performed in a preset search database to obtain similar entity hyperedge information that is similar to the hyperedge information.
[0209] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0210] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0211] A5. The heterogeneous network inference method as described in A1, before the step of determining the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph where the entities to be inferred are located when an association is detected between them, further includes:
[0212] Query the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned are located;
[0213] If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0214] Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
[0215] A6. The heterogeneous network reasoning method as described in A5, wherein the step of determining whether there is a relationship between the entities to be reasoned based on the first hyperedge information and the preset large text model includes:
[0216] Get the preset prompt template;
[0217] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0218] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0219] A7. The heterogeneous network reasoning method as described in A5, after the step of querying the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned reside, further includes:
[0220] If the path information is found, it is determined that there is a relationship between the entities to be inferred.
[0221] A8. The heterogeneous network inference method as described in any one of A1-A7, wherein the step of determining the hyperedge information of the entity to be inferred based on the heterogeneous hypergraph in which the entity to be inferred is located includes:
[0222] Query all hyperedge information of the entity to be inferred in the heterogeneous hypergraph in which it resides;
[0223] By concatenating all the hyperedge information, the hyperedge information of the entity to be inferred is obtained.
[0224] A9. The heterogeneous network inference method as described in A8, wherein the step of concatenating all the hyperedge information to obtain the hyperedge information of the entity to be inferred includes:
[0225] When an image exists in all the hyperedge information, an image description text is generated for the image, and the image is replaced according to the image description text to obtain text information;
[0226] By concatenating the text information, the hyperedge information of the entity to be inferred is obtained.
[0227] A10. The heterogeneous network reasoning method as described in any one of A1-A7, wherein the step of inputting the candidate relation information into a preset large text model to obtain the entity relation reasoning result includes:
[0228] Determine the entity information corresponding to the candidate relationship information, wherein the entity information includes entity relationship and entity path;
[0229] Determine relationship description information based on the entity relationship and the entity path;
[0230] The relationship description information is input into a preset text model to obtain the entity relationship reasoning result.
[0231] A11. The heterogeneous network reasoning method as described in any one of A1-A7, after the step of inputting the candidate relation information into a preset large text model to obtain the entity relation reasoning result, further includes:
[0232] Based on the entity relationship reasoning results, determine the entity relationship, judgment reason, and ranking result of the entity to be reasoned;
[0233] The entity relationships and the reasons for the determination are displayed based on the sorting results.
[0234] This application discloses B12. A heterogeneous network inference device, the heterogeneous network inference device comprising:
[0235] The determination module is used to determine the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which the entities to be inferred are located when an association is detected between the entities to be inferred. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges.
[0236] The retrieval module is used to perform a retrieval in a preset retrieval library based on the hyperedge information to obtain candidate relationship information between the entities to be inferred. The preset retrieval library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities.
[0237] The prediction module is used to input the candidate relationship information into a preset text model to obtain entity relationship reasoning results.
[0238] B13. The heterogeneous network inference device as described in B12, wherein the retrieval module is further used to statistically analyze the relationship information between entities in the heterogeneous hypergraph;
[0239] Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph;
[0240] A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
[0241] B14. The heterogeneous network inference device as described in B13, wherein the retrieval module is further configured to vectorize the entity hyperedge information to obtain the entity hyperedge vector;
[0242] A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
[0243] B15. The heterogeneous network inference device as described in B12, wherein the retrieval module is further configured to perform a retrieval in a preset retrieval database based on the hyperedge information to obtain similar entity hyperedge information that is similar to the hyperedge information;
[0244] The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information;
[0245] Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
[0246] B16. The heterogeneous network inference apparatus as described in B12, wherein the determining module is further configured to query path information between the entities to be inferred in the heterogeneous hypergraph where the entities to be inferred are located;
[0247] If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph;
[0248] Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
[0249] B17. The heterogeneous network inference device as described in B16, wherein the determining module is further configured to obtain a preset prompt template;
[0250] An input template is constructed based on the preset prompt template and the first hyperedge information;
[0251] The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
[0252] This application discloses C18. A heterogeneous network inference device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the heterogeneous network inference method as described in any one of A1 to A11.
[0253] This application discloses D19. A storage medium, which is a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the heterogeneous network inference method as described in any one of A1 to A11.
[0254] This application discloses E20. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the heterogeneous network inference method as described in any one of A1 to A11.
Claims
1. A heterogeneous network inference method, characterized in that, The method includes the following steps: When an association is detected between entities to be inferred, the hyperedge information of the entities to be inferred is determined based on the heterogeneous hypergraph in which the entities to be inferred are located. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges. Based on the hyperedge information, a search is performed in a preset search library to obtain candidate relationship information between the entities to be inferred. The preset search library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities. The candidate relationship information is input into a preset text model to obtain the entity relationship reasoning result.
2. The heterogeneous network inference method as described in claim 1, characterized in that, Before the step of retrieving candidate relationship information between the entities to be inferred from a preset retrieval database based on the hyperedge information, the method further includes: Analyze the relationships between entities in a heterogeneous hypergraph; Traverse the relationship information to determine the target entity corresponding to the traversed target relationship, and determine the entity hyperedge information corresponding to the target entity based on the heterogeneous hypergraph; A preset retrieval library is constructed based on the entity hyperedge information and the target relationship, and the process returns to the step of traversing the relationship information.
3. The heterogeneous network inference method as described in claim 2, characterized in that, The step of constructing a preset retrieval library based on the entity hyperedge information and the target relationship includes: The entity hyperedge information is vectorized to obtain the entity hyperedge vector; A preset retrieval library is constructed based on the entity hyperedge vector and the target relationship.
4. The heterogeneous network inference method as described in claim 1, characterized in that, The step of retrieving candidate relationship information between the entities to be inferred from a preset retrieval database based on the hyperedge information includes: Based on the hyperedge information, a search is performed in a preset search database to obtain similar entity hyperedge information that is similar to the hyperedge information. The similar entity hyperedge information is sorted according to its similarity to the hyperedge information to obtain the target entity hyperedge information; Candidate relationship information between the entities to be inferred is determined based on the target entity hyperedge information and the preset retrieval database.
5. The heterogeneous network inference method as described in claim 1, characterized in that, Before the step of determining the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph where the entities to be inferred are located when an association is detected between the entities to be inferred, the method further includes: Query the path information between the entities to be reasoned in the heterogeneous hypergraph where the entities to be reasoned are located; If the path information is not found, then query the first hyperedge information of the entity to be inferred in the heterogeneous hypergraph; Based on the first hyperedge information and the preset text big model, determine whether there is a relationship between the entities to be inferred.
6. The heterogeneous network inference method as described in claim 5, characterized in that, The step of determining whether there is a relationship between the entities to be inferred based on the first hyperedge information and the preset text big model includes: Get the preset prompt template; An input template is constructed based on the preset prompt template and the first hyperedge information; The input template is input into a preset text model to obtain the judgment result output by the preset text model. The judgment result includes whether there is a relationship between the entities to be reasoned.
7. A heterogeneous network inference device, characterized in that, The heterogeneous network inference device includes: The determination module is used to determine the hyperedge information of the entities to be inferred based on the heterogeneous hypergraph in which the entities to be inferred are located when an association is detected between the entities to be inferred. The heterogeneous hypergraph is a graph structure that includes multiple types of entities and multiple types of hyperedges. The retrieval module is used to perform a retrieval in a preset retrieval library based on the hyperedge information to obtain candidate relationship information between the entities to be inferred. The preset retrieval library includes the relationship between entities in the heterogeneous hypergraph and the hyperedge information corresponding to the entities. The prediction module is used to input the candidate relationship information into a preset text model to obtain entity relationship reasoning results.
8. A heterogeneous network inference device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the heterogeneous network inference method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the heterogeneous network inference method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the heterogeneous network inference method as described in any one of claims 1 to 6.