Knowledge graph dynamic generation method, system, equipment and medium
By obtaining multiple data sources and user interest words, using preset integrated models for cross-domain inference classification and entity merging, dynamically generate knowledge graphs, and real-time updates through incremental and interactive templates, the traditional knowledge graph construction method is solved. The problems of poor generation results and changes in the data environment have achieved efficient knowledge graph generation and data mining capabilities.
Patent Information
- Application Number
- CN202411251705.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-20
AI Technical Summary
Traditional knowledge graph construction methods rely on manual annotation and static data sources, making it difficult to cope with rapidly changing data environments, resulting in poor generation results and inaccurate data mining. Moreover, there are bias and format uniformity problems in large language models in applications.
By obtaining the interest words of multiple data sources and users, using preset integrated models for cross-domain inference classification, merging entity type lists, building vector lists of nodes and edges, dynamically generating knowledge graphs, and performing them through increments and interactive templates Real-time update.
It improves the generation effect and accuracy of the knowledge graph, adapts to knowledge representation and reasoning tasks in specific fields, realizes rapid information acquisition and data mining of cross-domain literature, and supports application scenarios such as intelligent question-and-answer, semantic search.
Smart Images

Figure CN119168046A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graphs, and in particular to a method, system, device and medium for dynamically generating a knowledge graph. Background Art
[0002] With the development of big data and artificial intelligence technology, knowledge graph, as an important way of knowledge representation, has shown great potential in the fields of intelligent question answering, semantic search, recommendation system, etc. Knowledge graph is a structured representation of knowledge in the form of a graph. It can intuitively and clearly show the relationship between target entities, quickly retrieve key information, show logical relationships from multiple paths, and complete tasks such as path search, relationship reasoning, and attribute inference. It has shown great potential and value in many fields.
[0003] Text language is abstract, and different people have different perspectives and ways of understanding. The design and construction steps of traditional knowledge graphs include a series of professional operation steps, such as defining concepts, relationships and attributes, cleaning, aligning and merging data, extracting entities, relationships and attributes, and structured annotation. Generative large language models represented by OpenAI's ChatGPT, Meta's Llama, Alibaba's Qwen, and Zhipu Huazhang's ChatGLM have multiple capabilities such as text dialogue, classification, summarization, extraction, rewriting, and text generation.
[0004] However, traditional knowledge graph construction methods mostly rely on manual annotation or static data sources, which are difficult to cope with rapidly changing data environments. The introduction of large language models has made a leap forward in the generation of knowledge graphs.
[0005] However, the actual application of large language models is still insufficient. In fact, it requires continuous questioning by users to finally give a result that still has deviations, which increases the workload of users. Especially when users need to quickly obtain information of different dimensions from a large number of cross-domain documents, the results generated by large models alone often have omissions. At the same time, the knowledge graphs come from different data sources during the generation and construction process, which will lead to the inability to unify the format. The existing knowledge graph templates cannot be updated in real time, and there will be no interaction with the staff. The staff cannot optimize the results of the generated knowledge graphs based on their own experience or proprietary data, resulting in poor knowledge graph generation and inability to accurately mine data. Summary of the invention
[0006] In order to solve one or more of the above-mentioned technical problems, the present invention proposes a method for dynamically generating a knowledge graph, including: Obtaining multiple data sources and user's interest words, filling the interest words into a preset list template, and obtaining an entity type list; By using a preset integrated large model, cross-domain reasoning and classification are performed on the entity type list in the multiple data sources to obtain entities corresponding to the entity type list; Merging the interest words in the entity type list, and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities; A knowledge graph is generated according to the vector list of nodes and edges through preset incremental and interactive knowledge graph templates.
[0007] In some embodiments, the format of the preset list template is [entity type, ..., entity type].
[0008] In some embodiments, the step of obtaining the interest words of multiple data sources and users, filling the interest words into a preset list template, and obtaining an entity type list includes: Obtain multiple data sources and user's interest words; Building a prompt word template based on the multiple data sources; All the interest words are filled into the preset list template in the prompt word template, so as to replace the content in the preset list template with the interest words according to the format, and obtain an entity type list.
[0009] In some embodiments, the training process of the preset integrated large model includes the following steps: Collect text data from different source fields and perform data annotation and preprocessing; Load the large language model, input the processed data into the large language model, and obtain the output entity and relationship information; Loading and integrating a word vector model, inputting the entity and relationship information into the word vector model, and marking domain codes of different source domains in the relationship information; The cross-domain relationship between entities is captured based on the domain coding, and the cross-domain relationship is fed back into the relationship information for correction to obtain the final relationship between the entities. The large language model is adjusted based on the final relationship and the relationship information.
[0010] In some embodiments, the step of performing cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list includes: using the multiple data sources as target domain data; Fine-tuning the preset integrated large model based on the target domain data to adjust the domain encoding of the target domain; Based on the fine-tuned model, the entity type list is inferred and classified, and the corresponding entities are identified and encoded.
[0011] In some embodiments, the step of merging the interest words in the entity type list and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities includes: Calculating similarities between the interest words, merging interest words whose similarities exceed a preset threshold into new interest words as new entity types in the entity type list; The entity and the new entity type are taken as nodes; The preset integrated large model extracts the relationships between the nodes as edges based on the merged entity type list and the corresponding entities, and constructs a vector list of nodes and edges.
[0012] In some embodiments, the process of generating the preset incremental and interactive knowledge graph templates includes the following steps: Knowledge is extracted through a preset integrated large model, and the extracted knowledge is integrated with the existing knowledge graph template to obtain an incremental knowledge graph template; The annotation data fed back by the experts is obtained, and the incremental knowledge graph template is updated in an interactive manner to obtain the preset incremental and interactive knowledge graph template.
[0013] The present invention proposes a system for dynamically generating a knowledge graph, comprising: an acquisition unit configured to acquire interest words from multiple data sources and users, and fill the interest words into a preset list template to obtain an entity type list; an identification unit configured to perform cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list; a vector unit configured to merge the interest words in the entity type list and construct a vector list of nodes and edges based on the merged entity type list and the corresponding entities; A generating unit is configured to generate a knowledge graph according to the vector list of nodes and edges through preset incremental and interactive knowledge graph templates.
[0014] The present invention provides a computer device, comprising: At least one processor; and a memory, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps of the method for dynamically generating a knowledge graph are performed.
[0015] The present invention proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it performs the steps of the method for dynamically generating a knowledge graph.
[0016] The present invention has at least the following beneficial technical effects: The present invention proposes a method, system, device and medium for dynamically generating a knowledge graph, the method comprising: obtaining interest words from multiple data sources and users, filling the interest words into a preset list template to obtain an entity type list; performing cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list; merging the interest words in the entity type list, and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities; generating a knowledge graph according to the vector list of nodes and edges through a preset incremental and interactive knowledge graph template.
[0017] The present invention fine-tunes the large language model to make it more suitable for knowledge representation and reasoning tasks in specific fields, and improves the model's knowledge extraction capabilities in related fields. A dynamic update mechanism for the knowledge graph template is established, and new data is input into the template for processing in a timely manner according to changes in the data source, thereby optimizing and adjusting the results of the generated knowledge graph, and displaying the dynamically generated knowledge graph to the user in a visual way, quickly generating information of different dimensions for cross-domain documents, and users can obtain the required information from different dimensions according to their own habits, which can be applied to document retrieval, legal consultation, historical research, character analysis, text analysis, value data mining, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart of a method for dynamically generating a knowledge graph provided by the present invention; Figure 2 A system module diagram for dynamically generating a knowledge graph provided by the present invention; Figure 3 A flowchart of an embodiment of a method for dynamically generating a knowledge graph provided by the present invention; Figure 4 A graph of inference results of an embodiment of a method for dynamically generating a knowledge graph provided by the present invention; Figure 5 A knowledge graph diagram of an embodiment of a method for dynamically generating a knowledge graph provided by the present invention; Figure 6 A schematic diagram of the structure of an embodiment of a computer device provided by the present invention; Figure 7 A schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0020] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0021] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0022] This invention proposes a method for dynamically generating a knowledge graph. Figure 1 and Figure 3 ,include: S1: Obtain multiple data sources and user's interest words, fill the interest words into a preset list template, and obtain an entity type list; S2: performing cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list; S3: merging the interest words in the entity type list, and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities; S4: Generate a knowledge graph according to the vector list of nodes and edges through a preset incremental and interactive knowledge graph template, for example, displaying it using a browser.
[0023] The present invention uses the user's interest words as the entity type for constructing the knowledge graph, and based on the large language model, performs entity recognition and relationship extraction on the text to ensure the accuracy and completeness of knowledge extraction. The large model is called to classify the text according to the entity type specified by the user, and the dynamically generated entity types and entity relationships are arranged according to the node and edge of the knowledge graph, written into an HTML file through a program, and viewed using a web browser. It can be used independently without relying on a graph database.
[0024] The present invention combines the powerful language processing capabilities of large language models with the rigorous structure of knowledge graphs, achieving a significant improvement in the ability to understand and reason about complex data. The dynamically generated knowledge graph is displayed to users in a visual way to support user queries. At the same time, the knowledge graph is applied to practical application scenarios such as intelligent question and answer, semantic search, and recommendation systems to provide users with more accurate and efficient services.
[0025] In some embodiments, see Figure 1 and Figure 4 , the format of the preset list template is [entity type, …, entity type].
[0026] In some embodiments, see Figure 1 and Figure 4 The step of obtaining the interest words of multiple data sources and users, and filling the interest words into a preset list template to obtain an entity type list includes: Obtain multiple data sources and user's interest words; Building a prompt word template based on the multiple data sources; All the interest words are filled into the preset list template in the prompt word template, so as to replace the content in the preset list template with the interest words according to the format, and obtain an entity type list.
[0027] By filling the user's interest words into the preset list template, a personalized entity type list can be generated based on each user's unique interests. This personalization helps meet the user's specific needs and improve the user experience.
[0028] Preset list templates can be adjusted and optimized according to actual needs to suit different scenarios and purposes.
[0029] In some embodiments, see Figure 1 The training process of the preset integrated large model includes the following steps: Collect text data from different source fields and perform data annotation and preprocessing; Load the large language model, input the processed data into the large language model, and obtain the output entity and relationship information; Loading and integrating a word vector model, inputting the entity and relationship information into the word vector model, and marking domain codes of different source domains in the relationship information; The cross-domain relationship between entities is captured based on the domain coding, and the cross-domain relationship is fed back into the relationship information for correction to obtain the final relationship between the entities. The large language model is adjusted based on the final relationship and the relationship information.
[0030] During the correction process, the deviation value between the final relationship and the relationship information is obtained. When the deviation value exceeds a preset threshold, the final relationship replaces the corresponding relationship information, and the large language model is retrained until there is no deviation value exceeding the preset threshold in the training results. The training is then terminated, and the large language model and the word vector model obtained in this training are serially integrated to obtain an integrated large model.
[0031] Collect unstructured or semi-structured data from multiple data sources, such as web pages, databases, social media, etc. Use natural language processing technology to pre-process the data, including word segmentation, part-of-speech tagging, etc. Use the collected data to train the pre-trained large language model to make it more suitable for knowledge representation and reasoning tasks in specific fields, and improve the model's knowledge extraction ability in related fields to extract potential entity and relationship information.
[0032] The generative large language models represented by OpenAI's ChatGPT, Meta's Llama, Alibaba's Qwen, and Zhipu Huazhang's ChatGLM are selected. The present invention can be applied to all large language models, and only the Qianwen model is used as an implementation reference.
[0033] Large language models have powerful contextual understanding and generation capabilities, and can capture complex semantic relationships in texts; while word vector models such as Word2Vec and GloVe are good at representing words as continuous vectors and capturing semantic similarities between words. The combination of the two can make full use of their respective advantages and improve the accuracy of cross-domain entity recognition. Entity recognition tasks in different fields often have unique language characteristics and rules. Large language models can learn general knowledge across fields by training on large-scale text data, while word vector models can capture vocabulary features in specific fields. The integration of the two helps the model better adapt to entity recognition tasks in different fields.
[0034] A single model may be affected by the bias of training data during training, resulting in poor performance in entity recognition in certain fields. By integrating the large language model and the word vector model, the differences between different models can be used to reduce this bias and improve the fairness and objectivity of entity recognition. The large language model has the ability to self-learn and optimize, and can be dynamically adjusted based on real-time feedback and new data. In an integrated system, this ability can be further used to correct the recognition bias of the word vector model in specific fields or situations, and improve the stability and reliability of the overall system.
[0035] Through a reasonable model integration strategy, the allocation and utilization of computing resources can be optimized. Use a large language model to preliminarily process the text and extract entities and relationships; then use the word vector model to perform fine correction and recognition of entities in specific fields. This division of labor and cooperation can further improve computing efficiency. Achieve comprehensive coverage of entity recognition in multiple fields. Whether in science and technology, medicine, law or finance, this integrated system can be used to improve the accuracy and efficiency of entity recognition.
[0036] In some embodiments, see Figure 1 and Figure 4The steps of performing cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list include: using the multiple data sources as target domain data; Fine-tuning the preset integrated large model based on the target domain data to adjust the domain encoding of the target domain; Based on the fine-tuned model, the entity type list is inferred and classified, and the corresponding entities are identified and encoded.
[0037] In practical applications, only the domain coding of the target domain needs to be modified, and the integrated large model after fine-tuning can better adapt to the language characteristics and entity recognition tasks of the target domain, which enables the present invention to adapt and optimize faster when facing new domains. By fine-tuning the domain coding, the model can more accurately identify and understand entities when processing texts in the domain, thereby improving the accuracy of entity recognition. This difference between domains can be reduced, so that the model has better generalization ability between different domains, and the model is adapted to the data distribution in the domain, thereby accelerating the convergence process of the model.
[0038] In cross-domain entity recognition, entities in different source domains have different granularities and hierarchical structures. Therefore, the recognition of multi-granular entities is processed through word vector models to more accurately identify entity information in texts. The present invention requires less computing resources to fine-tune the domain encoding of the integrated large model during use, which not only saves time and cost, but also reduces the risk of overfitting.
[0039] In some embodiments, see Figure 1 and Figure 4 The steps of merging the interest words in the entity type list and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities include: Calculating similarities between the interest words, merging interest words whose similarities exceed a preset threshold into new interest words as new entity types in the entity type list; The entity and the new entity type are taken as nodes; The preset integrated large model extracts the relationships between the nodes as edges based on the merged entity type list and the corresponding entities, and constructs a vector list of nodes and edges.
[0040] The attributes of each node include Class, Label and ID, and the attributes of each edge include fromID, toID and Label.
[0041] By merging these similar interest words, the complexity of the constructed vector list due to vocabulary diversity can be reduced, thereby ensuring the consistency of the final generated vector list.
[0042] In order to ensure the simplicity of the final generated knowledge graph, it is necessary to reduce the confusion of synonyms and unify the entity representation. When linking entities, it is easier to map the merged terms to the corresponding entities in the knowledge graph, reducing the complexity of the mapping process and improving the efficiency and accuracy of the link. In the knowledge graph, a more accurate and complete entity network is constructed to support more complex query and reasoning operations.
[0043] In some embodiments, see Figure 1 and Figure 5 , the process of generating the preset incremental and interactive knowledge graph template includes the following steps: Knowledge is extracted through a preset integrated large model, and the extracted knowledge is integrated with the existing knowledge graph template to obtain an incremental knowledge graph template; The annotation data fed back by the experts is obtained, and the incremental knowledge graph template is updated in an interactive manner to obtain the preset incremental and interactive knowledge graph template.
[0044] Through incremental updates, knowledge graph templates can continuously absorb new data and information, thereby maintaining the timeliness and accuracy of their content. This is particularly important in the fields of finance, news, and e-commerce. Interactive updates allow the system to directly modify and supplement knowledge graph templates, and with the help of expert feedback data, further improve the flexibility and accuracy of data updates. New entities, relationships, or attributes can be added in a timely manner, or incorrect information can be corrected according to actual needs.
[0045] Compared with full updates, incremental updates can significantly reduce computing costs and time consumption. It only processes new or changed data, avoiding repeated calculations of existing data. Through interactive updates, knowledge graph templates can be personalized based on feedback and needs, providing recommendations that better meet user expectations.
[0046] As the knowledge graph template is continuously updated and improved, the query capability is continuously improved. Incremental updates and interactive updates enable the knowledge graph to support more complex and precise query requirements. Through interactive updates, the knowledge graph template can continuously supplement and improve its relationship network, thereby enhancing its reasoning ability. This enables the knowledge graph template to more accurately generate knowledge graphs for answering users' questions and provide more valuable information.
[0047] This invention proposes a system for dynamically generating knowledge graphs. Figure 2 ,include: An acquisition unit 100 is configured to acquire multiple data sources and user's interest words, fill the interest words into a preset list template, and obtain an entity type list; The identification unit 200 is configured to perform cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list; A vector unit 300, configured to merge the interest words in the entity type list, and construct a vector list of nodes and edges based on the merged entity type list and the corresponding entities; The generation unit 400 is configured to generate a knowledge graph according to the vector list of nodes and edges through a preset incremental and interactive knowledge graph template.
[0048] The present invention fine-tunes the large language model to make it more suitable for knowledge representation and reasoning tasks in specific fields, and improves the model's knowledge extraction capabilities in related fields. A dynamic update mechanism for the knowledge graph template is established, and new data is input into the template for processing in a timely manner according to changes in the data source, thereby optimizing and adjusting the results of the generated knowledge graph, and displaying the dynamically generated knowledge graph to the user in a visual way, quickly generating information of different dimensions for cross-domain documents, and users can obtain the required information from different dimensions according to their own habits, which can be applied to document retrieval, legal consultation, historical research, character analysis, text analysis, value data mining, etc.
[0049] In some embodiments, see Figure 1 , Figure 3 , Figure 4 and Figure 5 , below, we take chapters 1 to 20 of the novel "Journey to the West" as an example as the input text, and explain each step in detail: Construct a prompt word template, such as Figure 3 As shown: "List of known entity types: ["xx", "xx"], please extract possible entities from the input text based on the list of entity types and answer in the format of [entity, entity type]".
[0050] In the prompt word template, "xx" is replaced with the interest word, such as Figure 3 As shown: fill in the four interest words of magic weapon, treasure, fairy, and monster into the prompt word template, and the full text to be entered into the large model is, "Known entity type list: ["magic weapon", "baby", "fairy", "monster"], please extract possible entities from the input text according to the entity type list, and answer in the format of [entity, entity type]".
[0051] Call the large model for inference and get the following Figure 4 result.
[0052] The data format of the knowledge graph is a triple structure of entity, relationship, and attribute. Each entity is a node, and the relationship between nodes is an edge. Write a program to structure the text output by the large model according to the data format of the knowledge graph. The attributes of each node are: Class, Label, ID; the attributes of each edge are: fromID, toID, Label; in the interest words selected in this article, "magic weapon" and "baby" are merged into "treasure", "fairy" and "monster" are merged into "monster", and the class in the node attribute after the merger is consistent.
[0053] Write the structured node and edge data list into the HTML knowledge graph template and execute the JavaScript script, which defines the display style of the nodes and edges, such as color, shape, etc.
[0054] Select and save the HTML file, open it with a browser, and you can see the following, as shown in 5, according to the knowledge graph of the four entity types of "spirits", "places", "people", and "treasures" set previously. Here we can see that the node entities related to "people" are the most and they are all positive, and the nodes related to "spirits" are the least. It can be roughly judged that Tang Seng and his disciples have not yet started the mission of obtaining scriptures.
[0055] Based on the same inventive concept, according to another aspect of the present invention, Figure 6 As shown, an embodiment of the present invention further provides a computer device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can be run on the processor. When the processor 310 executes the program, the steps of the above method are performed.
[0056] Based on the same inventive concept, according to another aspect of the present invention, Figure 7 As shown, an embodiment of the present invention further provides a computer-readable storage medium 40, which stores a computer program 410 for executing the above method when executed by a processor.
[0057] The embodiment of the present invention may also include a corresponding computer device. The computer device includes a memory, at least one processor, and a computer program stored in the memory and executable on the processor, and the processor executes any one of the above methods when executing the program.
[0058] The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules in the embodiments of the present application. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, implementing the above method.
[0059] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In an embodiment, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0060] Finally, it should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.
[0061] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0062] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0063] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0064] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for dynamically generating a knowledge graph, characterized in that: include: Obtaining multiple data sources and user's interest words, filling the interest words into a preset list template, and obtaining an entity type list; By using a preset integrated large model, cross-domain reasoning and classification are performed on the entity type list in the multiple data sources to obtain entities corresponding to the entity type list; Merging the interest words in the entity type list, and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities; A knowledge graph is generated according to the vector list of nodes and edges through preset incremental and interactive knowledge graph templates.
2. A method for dynamically generating a knowledge graph according to claim 1, characterized in that: The step of obtaining multiple data sources and user's interest words, and filling the interest words into a preset list template to obtain an entity type list includes: Obtain multiple data sources and user's interest words; Building a prompt word template based on the multiple data sources; All the interest words are filled into the preset list template in the prompt word template, so as to replace the content in the preset list template with the interest words according to the format, and obtain an entity type list.
3. A method for dynamically generating a knowledge graph according to claim 1, characterized in that: The training process of the preset integrated large model includes the following steps: Collect text data from different source fields and perform data annotation and preprocessing; Load the large language model, input the processed data into the large language model, and obtain the output entity and relationship information; Loading and integrating a word vector model, inputting the entity and relationship information into the word vector model, and marking domain codes of different source domains in the relationship information; The cross-domain relationship between entities is captured based on the domain coding, and the cross-domain relationship is fed back into the relationship information for correction to obtain the final relationship between the entities. The large language model is adjusted based on the final relationship and the relationship information.
4. A method for dynamically generating a knowledge graph according to claim 3, characterized in that: The step of performing cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list includes: using the multiple data sources as target domain data; Fine-tuning the preset integrated large model based on the target domain data to adjust the domain encoding of the target domain; Based on the fine-tuned model, the entity type list is inferred and classified, and the corresponding entities are identified and encoded.
5. A method for dynamically generating a knowledge graph according to claim 4, characterized in that: The step of merging the interest words in the entity type list and constructing a vector list of nodes and edges based on the merged entity type list and the corresponding entities includes: Calculating similarities between the interest words, merging interest words whose similarities exceed a preset threshold into new interest words as new entity types in the entity type list; The entity and the new entity type are taken as nodes; The preset integrated large model extracts the relationships between the nodes as edges based on the merged entity type list and the corresponding entities, and constructs a vector list of nodes and edges.
6. A method for dynamically generating a knowledge graph according to claim 1, characterized in that: The process of generating the preset incremental and interactive knowledge graph template includes the following steps: Knowledge is extracted through a preset integrated large model, and the extracted knowledge is integrated with the existing knowledge graph template to obtain an incremental knowledge graph template; The annotation data fed back by the experts is obtained, and the incremental knowledge graph template is updated in an interactive manner to obtain the preset incremental and interactive knowledge graph template.
7. A method for dynamically generating a knowledge graph according to claim 1, characterized in that: The format of the preset list template is [entity type, ..., entity type].
8. A system for dynamically generating a knowledge graph, characterized in that: include: an acquisition unit configured to acquire interest words from multiple data sources and users, and fill the interest words into a preset list template to obtain an entity type list; an identification unit configured to perform cross-domain reasoning and classification on the entity type list in the multiple data sources through a preset integrated large model to obtain entities corresponding to the entity type list; a vector unit configured to merge the interest words in the entity type list and construct a vector list of nodes and edges based on the merged entity type list and the corresponding entities; A generating unit is configured to generate a knowledge graph according to the vector list of nodes and edges through preset incremental and interactive knowledge graph templates.
9. A computer device comprising: at least one processor; and a memory storing a computer program executable on the processor, wherein the processor executes the steps of a method for dynamically generating a knowledge graph as described in any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for dynamically generating a knowledge graph as described in any one of claims 1 to 7 are performed.
Citation Information
Patent Citations
Multi-domain knowledge graph construction method and device, electronic equipment and storage medium
CN117033661A
Large model prompt generation method based on knowledge graph
CN117591663A
Dynamic adaptation question answering system and method based on hierarchical structure and retrieval enhancement
CN118193714A
Cross-domain data recommendation method and apparatus, and computer device and medium
WO2023173550A1
Cited By
Question answering method based on knowledge base and knowledge question answering system
CN120653750A
Software system development method based on multi-modal AI large model
CN120762638A
