Relationship analysis method based on knowledge graph, electronic device and readable storage medium
Through the relationship analysis method based on knowledge graph, the related entities are automatically iterated and the candidate relationship analysis report is generated, which solves the problem of inconvenient relationship analysis in the existing technology and realizes efficient and convenient relationship analysis.
Patent Information
- Application Number
- CN202411200796.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-29
AI Technical Summary
Existing relationship analysis methods require the use of objects to provide detailed event basic information, resulting in high usage threshold and inconvenient analysis.
Using a relationship analysis method based on knowledge graph, by obtaining the basic information of events, matching the initial associated entities, and expanding the new associated entities that match to the next level in the knowledge graph, generating event expansion information, automatically iterating until the output conditions are met, and candidates are generated. Relationship analysis report.
It lowers the threshold for using objects, improves the convenience of relationship analysis, and generates analysis reports with rich content and higher accuracy.
Smart Images

Figure CN118708916B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a relationship analysis method based on a knowledge graph, an electronic device, and a readable storage medium. Background Art
[0002] With the advent of the data age, how to analyze the relationship between information involved in an event has received increasing attention. Among them, existing relationship analysis methods usually require the user to provide relatively detailed basic information about the event in order to obtain relatively accurate analysis results. There is a high threshold for use. Only when the user has rich analysis experience and provides detailed basic information about the event can accurate analysis be performed, making relationship analysis extremely inconvenient. In view of this, how to improve the convenience of relationship analysis has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a relationship analysis method, electronic device and readable storage medium based on a knowledge graph, which can improve the convenience of relationship analysis.
[0004] To solve the above technical problems, the first aspect of the present application provides a relationship analysis method based on a knowledge graph, including: obtaining basic event information, determining the initial associated entity matched by the basic event information in the knowledge graph; expanding and matching the associated entities that have been matched in the knowledge graph to the newly added associated entities of the next degree, generating event expansion information; generating a candidate relationship analysis report corresponding to the initial associated entity based on the event expansion information; in response to the candidate relationship analysis report not meeting the output condition, returning to the step of expanding and matching the associated entities that have been matched in the knowledge graph to the newly added associated entities of the next degree, generating event expansion information, until the output condition is met, and using the candidate relationship analysis report as the target relationship analysis report.
[0005] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect.
[0006] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0007] The above scheme obtains the basic information of the event, determines the initial associated entity matched by the basic information of the event in the entities included in the knowledge graph, expands and matches the associated entity currently matched in the knowledge graph to the entity of the next degree to obtain the newly added associated entity, expands and matches the associated entity currently matched in the knowledge graph to the newly added associated entity of the next degree, generates event expansion information, analyzes the relationship of the initial associated entity based on the event expansion information, generates a candidate relationship analysis report corresponding to the initial associated entity, and judges whether the candidate relationship analysis report meets the output conditions. When the candidate relationship analysis report does not meet the output conditions, it expands and matches the associated entity currently matched in the knowledge graph to the newly added associated entity of the next degree, thereby expanding more newly added associated entities for updating the event expansion information, and generating the candidate relationship analysis report again, until the candidate relationship analysis report meets the output conditions, the candidate relationship analysis report is output as the target relationship analysis report. Therefore, based on the basic information of the event, the information can be intelligently expanded in the process of automatic iteration to generate an analysis report with rich content and higher accuracy, while reducing the use threshold of the user object and improving the convenience of relationship analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an implementation method of a relationship analysis method based on a knowledge graph in this application;
[0010] Figure 2 This is a schematic diagram of an application scenario of an implementation method of a knowledge graph-based relationship analysis method of the present application;
[0011] Figure 3 It is a flowchart of another implementation method of the relationship analysis method based on the knowledge graph of the present application;
[0012] Figure 4 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0013] Figure 5 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0015] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0016] The knowledge graph-based relationship analysis method provided in this application is used to analyze the relationship between information involved in an event, and its corresponding execution subject is a processing terminal that can call and process related data.
[0017] See also Figure 1 , Figure 1 This is a flow chart of an implementation method of a relationship analysis method based on a knowledge graph in this application, the method comprising:
[0018] S101: Obtain basic event information and determine the initial associated entity that matches the basic event information in the knowledge graph.
[0019] Specifically, basic event information is obtained, and the initial associated entities matched by the basic event information are determined among the entities included in the knowledge graph.
[0020] It can be understood that the knowledge graph includes multiple entities, and any entity corresponds to at least one edge connecting to other entities. The expansion match with a certain entity as the central entity corresponds to the expansion match to the entities directly connected to the central entity through the edge.
[0021] In some implementation scenarios, basic event information is obtained, keywords of the basic event information are extracted, and initial associated entities matched by the basic event information are determined from the knowledge graph based on keyword matching.
[0022] In some implementation scenarios, basic event information is obtained, the semantics of the basic event information is extracted, and the initial associated entities matched by the basic event information are determined from the knowledge graph based on semantic matching.
[0023] S102: Expand the matched related entities in the knowledge graph to the next level of newly added related entities to generate event expansion information.
[0024] Specifically, the currently matched related entities in the knowledge graph are expanded and matched to the next-level entities to obtain newly added related entities. Based on the currently matched related entities in the knowledge graph, the related entities are expanded and matched to the next-level newly added related entities to generate event expansion information.
[0025] In some implementation scenarios, currently matched related entities in the knowledge graph are obtained, and the related entities are expanded and matched to the next-level entities to obtain newly added related entities. Based on the newly added related entities and the relationship between the newly added related entities and the initial related entities, event expansion information is generated.
[0026] In some implementation scenarios, currently matched related entities in the knowledge graph are obtained, the related entities are expanded and matched to the next degree, and entities whose association relationships with the initial related entities meet the association conditions are obtained from all entities at the next degree as newly added related entities, and key entities matching the preset types are obtained from the newly added related entities, and event expansion information is generated based on the newly added related entities and the key entities.
[0027] In some implementation scenarios, the currently matched related entities in the knowledge graph are obtained, the related entities are expanded and matched to the next-level entities to obtain newly added related entities, the entity clusters corresponding to the matched related entities in the knowledge graph are obtained, and event expansion information is generated based on the newly added related entities and entity clusters.
[0028] S103: Generate a candidate relationship analysis report corresponding to the initial associated entity based on the event expansion information.
[0029] Specifically, based on the event expansion information, the relationship of the initial associated entities is analyzed to generate a candidate relationship analysis report corresponding to the initial associated entities.
[0030] In some implementation scenarios, a preset prompt template is obtained, event expansion information is filled into the prompt template to obtain report generation prompt information, and the report generation prompt information is input into a pre-fine-tuned large model to obtain a candidate relationship analysis report output by the large model.
[0031] In some implementation scenarios, the candidate relationship analysis report corresponds to a report template, and the to-be-filled information that meets the association condition with the initial associated entity is obtained from the event expansion information, and the to-be-filled information is filled into the report template to obtain the candidate relationship analysis report.
[0032] Optionally, the candidate relationship analysis report includes at least one report content, and when the event supplementary information includes at least one of a key entity and an entity cluster, the report content includes the relationship between the initial associated entity and the corresponding associated entity.
[0033] For illustration purposes, see Figure 2 , Figure 2 This is a schematic diagram of an application scenario of an implementation method of a relationship analysis method based on a knowledge graph in this application, such as Figure 2 As shown in , taking the initial associated entity as target A, and the newly added associated entities as target B, target C, target D, target E, location A and item A as an example, where target C is the key entity, after event expansion information is generated based on the newly added associated entities, the candidate relationship analysis report obtained based on the event expansion information includes the following report content: 1. Target A, target C, target B and target D belong to the same entity cluster, where target C belongs to the key entity, it can be inferred that these four targets may belong to the key cluster; 2. Since target A and target C are both associated with target B and target D, and target A and target C both appear at location A, it can be inferred that target A and target C may have a potential relationship; 3. Target A and target E are associated, it can be inferred that target A and target E may have a direct association; 4. Target A and item A appear at the same time for many times, it can be inferred that item A belongs to target A; 5. Target A appears at location A for many times, it can be inferred that location A is a place where target A frequently appears.
[0034] S104: In response to the candidate relationship analysis report not meeting the output conditions, return to the step of expanding the matched related entities in the knowledge graph to the next level of newly added related entities to generate event expansion information, until the output conditions are met, and use the candidate relationship analysis report as the target relationship analysis report.
[0035] Specifically, it is judged whether the candidate relationship analysis report meets the output conditions. When the candidate relationship analysis report does not meet the output conditions, the matching is expanded to the next level of newly added related entities based on the currently matched related entities in the knowledge graph, thereby expanding more newly added related entities to update the event expansion information, and generating the candidate relationship analysis report again until the candidate relationship analysis report meets the output conditions, and then the candidate relationship analysis report is output as the target relationship analysis report.
[0036] In some implementation scenarios, the analysis content in the candidate relationship analysis report is output row by row, and the output condition corresponds to the number of rows of the analysis content reaching a row number threshold.
[0037] In some implementation scenarios, after obtaining the candidate relationship analysis report, the process returns multiple times to the step of expanding and matching the matched related entities in the knowledge graph to the next level of newly added related entities to generate event expansion information, and the output condition corresponds to the number of expanded matches in the knowledge graph reaching a threshold number.
[0038] It is understandable that based on the basic information of the event, the information can be intelligently expanded in the process of automatic iteration to generate a content-rich and more accurate analysis report, while lowering the usage threshold of the user and improving the convenience of relationship analysis.
[0039] It should be noted that when the number of expanded matches in the knowledge graph reaches the number threshold, if the analysis content in the candidate relationship analysis report is still less than the row number threshold, it is determined that the initial associated entity is not related to any event, and the analysis content of the initial associated entity that is not related to any event is output as the target relationship analysis report.
[0040] The above scheme obtains the basic information of the event, determines the initial associated entity matched by the basic information of the event in the entities included in the knowledge graph, expands and matches the associated entity currently matched in the knowledge graph to the entity of the next degree to obtain the newly added associated entity, expands and matches the associated entity currently matched in the knowledge graph to the newly added associated entity of the next degree, generates event expansion information, analyzes the relationship of the initial associated entity based on the event expansion information, generates a candidate relationship analysis report corresponding to the initial associated entity, and judges whether the candidate relationship analysis report meets the output conditions. When the candidate relationship analysis report does not meet the output conditions, it expands and matches the associated entity currently matched in the knowledge graph to the newly added associated entity of the next degree, thereby expanding more newly added associated entities for updating the event expansion information, and generating the candidate relationship analysis report again, until the candidate relationship analysis report meets the output conditions, the candidate relationship analysis report is output as the target relationship analysis report. Therefore, based on the basic information of the event, the information can be intelligently expanded in the process of automatic iteration to generate an analysis report with rich content and higher accuracy, while reducing the use threshold of the user object and improving the convenience of relationship analysis.
[0041] See also Figure 3 , Figure 3 It is a flowchart of another implementation method of the relationship analysis method based on the knowledge graph of the present application, and the method includes:
[0042] S301: Obtain basic event information and determine the initial associated entity that matches the basic event information in the knowledge graph.
[0043] Specifically, basic event information is obtained, and the initial associated entities matched by the basic event information are determined among the entities included in the knowledge graph.
[0044] S302: Expand the matched related entities in the knowledge graph to the next level of newly added related entities to generate event expansion information.
[0045] Specifically, the matched related entities in the knowledge graph are obtained and expanded to match the next-level newly added related entities; key entities that match the preset type in the newly added related entities and the entity clusters corresponding to the matched related entities in the knowledge graph are obtained, and event expansion information is generated based on the newly added related entities, key entities and entity clusters.
[0046] It should be noted that key entities of preset types are predefined in the knowledge graph, wherein the key entities may be provided with key labels in the knowledge graph, and the preset types are related to events involved in the entities or places where the entities frequently appear.
[0047] It can be understood that the currently matched associated entities in the knowledge graph are obtained, and the matched associated entities are expanded and matched to the next degree to obtain newly added associated entities.
[0048] Furthermore, it is determined whether the newly added related entities include key entities that match the preset types, and whether the matched related entities in the knowledge graph correspond to entity clusters. When the key entity is not obtained, the current key entity corresponds to an empty set, and when the entity cluster is not obtained, the current entity cluster corresponds to an empty set. Based on the newly added related entities, key entities and entity clusters other than the initial related entities, event expansion information is jointly generated. After the newly added related entities are obtained, the key entities in the newly added related entities are intelligently mined, and it is determined whether all the matched related entities can form an entity cluster, so as to obtain richer information, jointly generate event expansion information, and improve the accuracy of event expansion information.
[0049] In some implementation scenarios, key entities matching preset types among newly added related entities and entity clusters corresponding to matched related entities in the knowledge graph are obtained, and event expansion information is generated based on the newly added related entities, key entities and entity clusters, including: obtaining key entities matching preset types among newly added related entities, determining initial related entities that form relationship pairs with the key entities, and generating reference relationship labels for the initial related entities in the relationship pairs; and, using a community discovery algorithm, determining entity clusters corresponding to matched related entities in the knowledge graph, and generating reference cluster labels for related entities in the entity cluster when at least one key entity is included in the entity cluster; generating event expansion information based on newly added related entities, key entities in relationship pairs and reference relationship labels, as well as entity clusters and their corresponding reference cluster labels.
[0050] For details, please refer again to Figure 2 , obtain the key entity that matches the preset type in the newly added related entities, take the key entity as one end of the relationship pair, and determine the initial related entity that can be directly or indirectly connected to the key entity, such as Figure 2In the example, the focus entity is target C, and the initial associated entity target A can be indirectly connected to target C to form a relationship pair, and then a reference relationship label is generated for the initial associated entity in the relationship pair, that is, a label that may be associated with the focus entity is set for the corresponding initial associated entity.
[0051] It can be understood that, by using the community discovery algorithm, cluster mining is performed on the matched associated entities in the knowledge graph to determine the entity clusters corresponding to the matched associated entities. When the entity cluster includes at least one key entity, a reference cluster label is generated for the associated entities existing in the entity cluster, for example Figure 2 In the example, the key entity is target C, while targets A, C, B, and D belong to the same entity cluster, and then reference group labels are set for targets A, C, B, and D, that is, labels that may be associated with the key entity are set for all associated entities in the entity cluster.
[0052] Furthermore, event extension information is generated based on the newly added related entities, key entities in relationship pairs and reference relationship labels, as well as entity clusters and their corresponding reference cluster labels, so that the relationship between the newly added related entities and the initial related entities is mined before generating the event extension information, and labels are generated for the initial related entities so that the relationship between the initial related entities and other entities can be analyzed with reference to the labels later.
[0053] Optionally, after obtaining the matched related entities in the knowledge graph and expanding and matching them to the next level of newly added related entities, it also includes: displaying the matched newly added related entities and their corresponding association relationships in real time on the display interface; in response to an adjustment instruction to adjust at least part of the newly added related entities obtained from the display interface, adjusting the matched newly added related entities based on the adjustment instruction to obtain updated newly added related entities.
[0054] Specifically, the newly matched related entities in this round and their corresponding related relationships are displayed in real time on the display interface to provide a logical chain of the analysis process and increase the credibility of the analysis results.
[0055] Furthermore, when an adjustment instruction for the user to adjust at least part of the newly added related entities is obtained from the display interface, the matched newly added related entities are adjusted based on the content indicated by the adjustment instruction, thereby satisfying the user's need to make autonomous adjustments to the newly added related entities, wherein the adjustment instruction at least includes deleting the newly added related entities, adding the newly added related entities, and modifying the edges between the related entities.
[0056] S303: Generate a candidate relationship analysis report corresponding to the initial associated entity based on the event expansion information.
[0057] Specifically, based on the event expansion information, the relationship of the initial associated entities is analyzed to generate a candidate relationship analysis report corresponding to the initial associated entities.
[0058] In some implementation scenarios, a candidate relationship analysis report corresponding to the initial associated entity is generated based on the event expansion information, including: determining a reference association relationship between the initial associated entity and at least part of the newly added associated entities based on the event expansion information; generating a candidate relationship analysis report corresponding to the initial associated entity based on the reference association relationship, reference relationship label and reference cluster label.
[0059] For details, please refer again to Figure 2 , based on the event expansion information, determine the reference association relationship between the initial association entity and at least part of the newly added association entities, such as Figure 2 In the example, the reference association relationships between target A and location A, item A, and between target B, target D, and target E are determined. That is, for non-key entities in the newly added associated entities, the reference association relationships between at least some of the non-key entities and the initial associated entities are determined to obtain richer information.
[0060] Furthermore, the relationship between the initial associated entity and the non-key entity is analyzed based on the reference association relationship, the relationship between the initial associated entity and the key entity is analyzed based on the reference relationship label, and the relationship between the initial associated entity and other entities in the entity cluster is analyzed based on the reference cluster label to generate a comprehensive candidate relationship analysis report for the initial associated entity.
[0061] In some implementation scenarios, the candidate relationship analysis report is generated using a large model. The candidate relationship analysis report corresponds to a prompt template. When the event expansion information is filled into the prompt template, the report generation prompt information is obtained. After the report generation prompt information is input into the large model, the candidate relationship analysis report output by the large model is obtained.
[0062] Specifically, the candidate relationship analysis report is generated using the big model after obtaining the event expansion information. The candidate relationship analysis report corresponds to a prompt template. When the event expansion information is filled into the prompt template, the report generation prompt information is obtained, and the report generation prompt information is input into the big model. The self-generation and orchestration capabilities of the big model are used to obtain the candidate relationship analysis report, thereby improving the efficiency and accuracy of the candidate relationship analysis report.
[0063] In a specific implementation scenario, the prompt template includes guiding instructions and event extension information filling area. The prompt template is specifically: You are a professional report generation assistant. Your task is to generate a relationship analysis report based on the provided content. You must follow the following instructions: First, you must ensure that the generated report is consistent with the given input semantic information, and do not make it up at random. Second, the answer you output will be strictly reviewed and must be logically rigorous, accurate in data, and fluent in sentences. Third, you have the ability to think, and there are potential hidden relationships in the input data, which need to be output together. Fourth, the content you output must be organized and generate a judgment report from multiple angles. Please analyze and think deeply and step by step on the input content, and then output a professional judgment report. Start now! The content to be analyzed is: {xxxx}. Among them, the event extension information is filled in the content to be analyzed, so as to obtain the report generation prompt information.
[0064] Optionally, the large model is a generative large language model, which may include but is not limited to deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), long short-term memory networks (LSTM), and generative pre-trained Transformer models, etc. No specific restrictions are made on the specific construction and deployment of the generative large language model.
[0065] S304: In response to the candidate relationship analysis report not meeting the output conditions, return to the step of expanding the matched related entities in the knowledge graph to the next level of newly added related entities, and generating event expansion information, until the output conditions are met, and use the candidate relationship analysis report as the target relationship analysis report.
[0066] Specifically, it is judged whether the candidate relationship analysis report meets the output conditions. When the candidate relationship analysis report does not meet the output conditions, the matching is expanded to the next level of newly added related entities based on the currently matched related entities in the knowledge graph, thereby expanding more newly added related entities to update the event expansion information, and generating the candidate relationship analysis report again until the candidate relationship analysis report meets the output conditions, and then the candidate relationship analysis report is output as the target relationship analysis report.
[0067] It should be noted that the candidate relationship analysis report includes at least one line of analysis content corresponding to the initial associated entity, and each line of analysis content corresponds to one of the reference associated relationship, the reference relationship label and the reference cluster label; wherein the output conditions include: the number of lines of analysis content reaches the line number threshold, or the number of expanded matches in the knowledge graph reaches the number threshold.
[0068] Specifically, when at least one of a reference association relationship, a reference relationship label and a reference cluster label is obtained, analysis content is generated line by line, and each line of analysis content corresponds to a reference association relationship, or a reference relationship label, or a reference cluster label, thereby obtaining a more clearly organized candidate relationship analysis report.
[0069] Furthermore, the output conditions for the candidate relationship analysis report include: the number of lines of the analysis content reaches the line number threshold or the number of expansion matches in the knowledge graph reaches the number threshold. In other words, any one of the conditions can be met, thereby avoiding excessive expansion in the knowledge graph and obtaining a more accurate analysis report.
[0070] S305: Display the target relationship analysis report on the display interface.
[0071] Specifically, the target relationship analysis report is displayed on a display interface of the front end so as to output the target relationship analysis report in a timely manner.
[0072] S306: In response to obtaining an editing instruction for editing the target relationship analysis report from the display interface, generating report adjustment prompt information based on the editing instruction and the report generation prompt information.
[0073] Specifically, after obtaining an editing instruction for editing the target relationship analysis report from the user object on the display interface, report adjustment prompt information is generated based on the content indicated by the editing instruction and the existing report generation prompt information.
[0074] It can be understood that the report generation prompt information is generated based on the prompt template, which includes the guidance instruction content and the event extension information filling area, and the editing instructions include at least adding related entities, deleting related entities and adjusting the wording of the analysis report, among which the editing instructions related to adding related entities and deleting related entities are used to adjust the content in the event extension information filling area, and the editing instructions related to adjusting the wording of the analysis report are used to modify the guidance instruction content, thereby adjusting the wording of the target relationship analysis report.
[0075] S307: Input the report adjustment prompt information into the big model, obtain the adjusted target relationship analysis report output by the big model and display it on the display interface.
[0076] Specifically, the report adjustment prompt information is input into the big model, and the self-generation and editing capabilities of the big model are used to obtain an updated target relationship analysis report and display it on the display interface, so that the updated target relationship analysis report is displayed again, and the target relationship analysis report can continue to be edited and adjusted to obtain a target relationship analysis report that matches the needs of the user.
[0077] In this embodiment, the newly added associated entities matched in this round and their corresponding associated relationships are displayed in real time on the display interface to provide a logical chain of the analysis process and increase the credibility of the analysis results. Event extension information is jointly generated based on the newly added associated entities, key entities and entity clusters other than the initial associated entities. After the newly added associated entities are obtained, the key entities in the newly added associated entities are intelligently mined, and it is judged whether all the matched associated entities can form an entity cluster to obtain richer information, jointly generate event extension information, and improve the accuracy of the event extension information. Based on the event extension information, the relationship of the initial associated entities is analyzed to generate a candidate relationship analysis report corresponding to the initial associated entities. When the candidate relationship analysis report meets the output conditions, the candidate relationship analysis report is displayed as a target relationship analysis report on the front-end display interface to facilitate timely output of the target relationship analysis report, and supports the user to edit the target relationship analysis report as needed to obtain a target relationship analysis report that matches the needs of the user.
[0078] See also Figure 4 , Figure 4 It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 40 includes a memory 401 and a processor 402 coupled to each other, wherein the memory 401 stores program data (not shown), and the processor 402 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0079] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 50 stores program data 500. When the program data 500 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0080] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0083] The above description is only an implementation method of the present application, and does not limit the protection scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the protection scope of the present application.
Claims
1. A relationship analysis method based on knowledge graph, characterized in that: The method comprises: Obtaining basic event information, and determining an initial associated entity that matches the basic event information in the knowledge graph; Generate event expansion information based on the expansion of the matched associated entities in the knowledge graph to the newly added associated entities of the next level; specifically including: obtaining the expansion of the matched associated entities in the knowledge graph to the newly added associated entities of the next level; obtaining key entities matching a preset type in the newly added associated entities, and entity clusters corresponding to the matched associated entities in the knowledge graph, and generating the event expansion information based on the newly added associated entities, the key entities and the entity clusters; Based on the event expansion information, generating a candidate relationship analysis report corresponding to the initial associated entity; In response to the candidate relationship analysis report not meeting the output condition, returning to the step of expanding the matched related entities in the knowledge graph to the next-level newly added related entities to generate event expansion information, until the output condition is met, and the candidate relationship analysis report is used as the target relationship analysis report; Among them, obtaining key entities matching a preset type from the newly added associated entities and entity clusters corresponding to the matched associated entities in the knowledge graph, and generating the event expansion information based on the newly added associated entities, the key entities and the entity clusters, includes: obtaining key entities matching a preset type from the newly added associated entities, determining an initial associated entity that forms a relationship pair with the key entity, and generating a reference relationship label for the initial associated entity in the relationship pair; and, using a community discovery algorithm, determining the entity cluster corresponding to the matched associated entities in the knowledge graph, and generating a reference cluster label for the associated entities in the entity cluster when at least one of the key entities is included in the entity cluster; generating the event expansion information based on the newly added associated entities, the key entities in the relationship pair and the reference relationship label, and the entity cluster and its corresponding reference cluster label.
2. The method according to claim 1, characterized in that The generating, based on the event expansion information, a candidate relationship analysis report corresponding to the initial associated entity includes: Based on the event expansion information, determining a reference association relationship between the initial association entity and at least part of the newly added association entities; Based on the reference association relationship, the reference relationship label and the reference cluster label, a candidate relationship analysis report corresponding to the initial association entity is generated.
3. The method according to claim 2, characterized in that The candidate relationship analysis report includes at least one line of analysis content corresponding to the initial associated entity, and each line of the analysis content corresponds to one of the reference associated relationship, the reference relationship label, and the reference cluster label; Among them, the output conditions include: the number of lines of the analysis content reaches a line number threshold, or the number of expanded matches in the knowledge graph reaches a number threshold.
4. The method according to claim 1, characterized in that: After the matched associated entities in the knowledge graph are obtained and expanded to match the newly added associated entities of the next level, the method further includes: Displaying the newly matched associated entities and their corresponding associated relationships in real time on the display interface; In response to obtaining an adjustment instruction for adjusting at least part of the newly added associated entities from the display interface, the matched newly added associated entities are adjusted based on the adjustment instruction to obtain updated newly added associated entities.
5. The method according to claim 1, characterized in that The candidate relationship analysis report is generated using a large model. The candidate relationship analysis report corresponds to a prompt template. When the event extension information is filled into the prompt template, report generation prompt information is obtained. After the report generation prompt information is input into the large model, the candidate relationship analysis report output by the large model is obtained.
6. The method according to claim 5, characterized in that After taking the candidate relationship analysis report as the target relationship analysis report, the method further includes: Displaying the target relationship analysis report on a display interface; In response to obtaining an editing instruction for editing the target relationship analysis report from the display interface, generating report adjustment prompt information based on the editing instruction and the report generation prompt information; The report adjustment prompt information is input into the large model, and the adjusted target relationship analysis report output by the large model is obtained and displayed on the display interface.
7. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Social relationship analysis method, device and apparatus based on knowledge graph
CN110390039A
Interest search method based on knowledge graph visualization
CN111695022A
Federal knowledge graph construction method, system and device and storage medium
CN114780752A
Multi-hop reasoning question and answer method and system based on food safety cognitive map
CN115964459A
Risk identification method and device, computer equipment and storage medium
CN117196846A
