Graph-based information question and answer method and device, storage medium and electronic device

By dividing the scientific research project application into text blocks, extracting knowledge elements to build a knowledge graph and identifying the community for summary, the problem of accuracy and efficiency of extracting information of scientific research project application application is solved, and efficient information retrieval and question answering is achieved.

CN119250202APending Publication Date: 2025-01-03HUANENG CLEAN ENERGY RES INST
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411310306.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The information extraction of professional scientific research project applications is not accurate and has low processing efficiency, and traditional document retrieval methods cannot meet the needs of in-depth understanding and comprehensive analysis.

Method used

The graph-based information Q&A method is used to divide the source document into text blocks of preset sizes, extract knowledge elements to build a knowledge graph, identify the community with weighted undirected graph for layer-by-layer summary, and conduct information Q&A based on the summary results.

Benefits of technology

It improves the efficiency of document information retrieval and question-solving, and ensures the accuracy and processing efficiency of information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250202A_ABST
    Figure CN119250202A_ABST
Patent Text Reader

Abstract

The invention discloses a graph-based information question and answer method and device, a storage medium and an electronic device, and the method comprises the steps: segmenting a source document into a plurality of text blocks with preset sizes, and carrying out the extraction of knowledge elements from the plurality of text blocks, so as to obtain an element set; wherein the knowledge elements at least comprise one of an entity corresponding to each text block, a relationship between different text blocks and an event corresponding to each text block; the element set is used for constructing a knowledge graph and a relation graph, and nodes and edges of the knowledge graph are described through a natural language; identifying communities conforming to the weighted undirected graph in the knowledge graph, and summarizing the communities layer by layer to obtain a target summarizing result; and performing information question answering on the question input by the target object based on the target summary result. By adopting the technical scheme, the problem of how to deeply understand the whole document set and generate comprehensive answers for the whole document set is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a graph-based information question-answering method and device, a storage medium, and an electronic device. Background Art

[0002] As one of the important ways for the group's science and technology department to approve projects and obtain research funding support, the quality of scientific research project applications is directly related to the success of project applications. Such documents usually have the following characteristics: first, the content is rich and complex, covering multiple aspects such as project background, goals, methodology, budget, etc.; second, the length is long, often containing a lot of professional terms and technical details; third, the degree of structure is not high, and there is a lack of simple, easy-to-understand and clear logical connections between different parts.

[0003] Due to the above characteristics, reviewers often encounter some challenges when facing a large number of applications, such as information overload and difficulty in quickly locating key information. At present, the review process mainly relies on manual reading and understanding, which is inefficient and prone to errors. In addition, although traditional document retrieval methods such as keyword search can provide some help, their functions are relatively single and cannot meet the needs of in-depth understanding and comprehensive analysis of documents.

[0004] Regarding the related technologies, professional document information extraction has the problems of low accuracy and low processing efficiency, and no effective solution has been proposed yet.

[0005] Therefore, it is necessary to improve the existing related technologies to overcome the above-mentioned defects in the related technologies and meet the needs of current actual production. Summary of the invention

[0006] The embodiments of the present application provide a graph-based information question and answer method and device, a storage medium, and an electronic device to at least solve the problems of low accuracy and low processing efficiency in professional document information extraction.

[0007] According to one aspect of an embodiment of the present application, a graph-based information question and answer method is provided, comprising: dividing a source document into multiple text blocks of preset sizes, extracting knowledge elements from the multiple text blocks to obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block; using the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described in natural language; identifying communities in the knowledge graph that conform to a weighted undirected graph, summarizing the communities layer by layer, and obtaining a target summary result; and performing information question and answer on questions input by a target object based on the target summary result.

[0008] In an exemplary embodiment, information questioning is performed on questions input by a target object based on a target summary result, including: randomly breaking up the target summary result and dividing it into question and answer text blocks of specified length; generating an intermediate answer for each question and answer text block in parallel, and evaluating the matching degree between the intermediate answer and the question to obtain multiple scoring values; selecting a target intermediate answer that satisfies a context window corresponding to the question based on the multiple scoring values; and using the target intermediate answer to perform information questioning on questions input by the target object.

[0009] In an exemplary embodiment, a target intermediate answer that satisfies a context window corresponding to a question is selected based on multiple scoring values, including: removing the first category of intermediate answers with a score of zero from the multiple scoring values, and arranging the remaining intermediate answers in descending order according to the scores to obtain a target sorting result; placing the remaining intermediate answers into a new context window in sequence based on the target sorting result; and determining the current remaining intermediate answer as the target intermediate answer when the current remaining intermediate answer meets the length limit and has the highest score.

[0010] In an exemplary embodiment, information questions are answered using a target intermediate answer for a question input by a target object, including: identifying the contextual intent corresponding to the question; generating a global answer based on the contextual intent and the target intermediate answer; and answering the question based on the global answer.

[0011] In an exemplary embodiment, a community is summarized layer by layer to obtain a target summary result, including: determining the node levels included in the community and the description text of each graph node existing in each node level to obtain multiple description texts; sorting the multiple description texts according to preset text importance, and generating sub-summaries in sequence based on the sorting results; and aggregating multiple sub-summaries corresponding to the community to obtain a target summary result.

[0012] In an exemplary embodiment, after conducting information Q&A on the question input by the target object based on the target summary result, the method further includes: obtaining a Q&A score for the target object, wherein the Q&A score is determined by the target object based on the degree of association between the Q&A result of the information Q&A and the question; when the Q&A score is less than a preset score threshold, determining that the current information Q&A is invalid and waiting for the target summary result to be updated; when the Q&A score is greater than or equal to the preset score threshold, determining that the current information Q&A is valid, and associating the target summary result with the question.

[0013] According to another aspect of an embodiment of the present application, a graph-based information question and answer device is also provided, including: an extraction module, used to divide a source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block; a construction module, used to use the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described in natural language; an identification module, used to identify communities in the knowledge graph that conform to a weighted undirected graph, summarize the communities layer by layer, and obtain a target summary result; a question and answer module, used to perform information question and answer on questions input by the target object based on the target summary result.

[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned graph-based information question and answer method when running.

[0015] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the graph-based information question and answer method through the computer program.

[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned graph-based information question and answer method is implemented.

[0017] Through this application, the source document is divided into multiple text blocks of preset sizes, and knowledge elements are extracted from the multiple text blocks to obtain an element set; wherein the knowledge elements include at least one of the following: the entity corresponding to each text block, the relationship between different text blocks, and the event corresponding to each text block; the element set is used to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described in natural language; the communities in the knowledge graph that conform to the weighted undirected graph are identified, and the communities are summarized layer by layer to obtain the target summary results; based on the target summary results, information questions and answers are performed for the questions input by the target object. The above technical solution solves the problems of low accuracy and low processing efficiency in professional document information extraction. Furthermore, by extracting knowledge elements from documents in blocks to construct a knowledge graph, identifying communities for summarization and answering questions, the efficiency of document information retrieval and question answering is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a graph-based information question and answer method according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of a graph-based information question and answer method according to an embodiment of the present application;

[0022] Figure 3 It is a flow chart of a method for intelligent question and answer of key information of a scientific research project application based on RAG according to an embodiment of the present application;

[0023] Figure 4 It is a structural block diagram of a graph-based information question and answer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a mobile terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 11 is a hardware structure block diagram of a computer terminal according to an information question and answer method based on a graph according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or N ( Figure 1 The computer terminal includes a processor 102 (only one is shown) (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, CPU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the adjustment method of the monitoring network point in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or N magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 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.

[0028] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0029] In this embodiment, a graph-based information question-answering method is provided. Figure 2is a flowchart of a graph-based information question and answer method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps S202-S208:

[0030] Step S202: dividing the source document into a plurality of text blocks of a preset size, extracting knowledge elements from the plurality of text blocks to obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block;

[0031] For example, a scientific research project application includes project background, research objectives, research methods, expected results and other contents. First, the application is divided into multiple text blocks according to the preset size, such as each chapter as a text block. Then, knowledge elements are extracted for each text block, and elements such as entities, relationships and events are extracted. Taking the "research objectives" text block as an example, the entities, relationships and events involved in the research objectives can be obtained through knowledge element extraction. For example, entities can be specific problems or concepts involved in the research objectives, relationships can be the logical relationships between these problems or concepts, and events can be specific actions or plans required to achieve these research objectives. In this way, the content of the research objectives text block can be converted into structured data, which is convenient for subsequent analysis and processing.

[0032] It should be noted that the size of the text block needs to balance efficiency and quality. A text block that is too long will lead to a decrease in the extraction capability of the Large Language Model (LLM), while a text block that is too short will require more computational overhead.

[0033] Step S204: constructing a knowledge graph and a relationship graph using the element set, wherein the nodes and edges of the knowledge graph are described by natural language;

[0034] Optionally, in graph theory, a node is a basic element of a graph, representing an entity or object in the graph. A node is usually used to represent a concept, entity or data point, and can contain various attributes and associations. An edge is a line segment connecting different nodes in a graph, used to represent the association or connection between nodes. Edges can have different attributes, such as weight, direction, etc., to describe specific relationships between nodes. Through the combination of nodes and edges, a complete knowledge graph can be constructed to help better understand and utilize the associations between knowledge.

[0035] Step S206: Identify the communities in the knowledge graph that conform to the weighted undirected graph, summarize the communities layer by layer, and obtain a target summary result;

[0036] Optionally, a weighted undirected graph is a data structure in graph theory, in which each edge has a weight value and the edges are undirected. In a weighted undirected graph, the strength of the connection between nodes is represented by the weight of the edge, which can be a real number or an integer.

[0037] Alternatively, a community refers to a set of nodes in a graph neural network that has a large number of internal edge connections and few external edge connections (to the rest of the network).

[0038] For example, there is a knowledge graph of a scientific research project application, which contains multiple nodes and edges. The community discovery algorithm identifies three communities that conform to the weighted undirected graph. These three communities are summarized layer by layer:

[0039] The first level summary: Analyze the theme and key content of each community as a whole, and understand the overall structure and characteristics of each community.

[0040] Second level summary: Based on the first level summary, we further analyzed the relationship and connection between nodes within each community and found out the key nodes and core contents.

[0041] The third level of summary: Finally, a detailed summary and generalization of each community was conducted to obtain a comprehensive understanding and summary of the community, including information such as its innovations, research directions, and future development directions.

[0042] Optionally, a community discovery algorithm is a method for identifying groups of closely related nodes in a graph, i.e., partitioning the nodes into communities such that connections within communities are stronger than connections between communities.

[0043] Through the above implementation methods, the information in the knowledge graph of scientific research project applications can be better understood and analyzed, thereby providing a more accurate and comprehensive reference for project review and decision-making.

[0044] Step S208: conducting information questioning and answering for questions input by the target object based on the target summary result.

[0045] The above steps divide the source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge elements include at least one of the following: entities corresponding to each text block, relationships between different text blocks, and events corresponding to each text block; use the element set to build a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described in natural language; identify communities in the knowledge graph that conform to the weighted undirected graph, summarize the communities layer by layer, and obtain the target summary results; and answer questions for the questions input by the target object based on the target summary results. The above technical solution solves the problems of low accuracy and low processing efficiency in professional document information extraction. Furthermore, by extracting knowledge elements from documents in blocks to build a knowledge graph, identifying communities for summarization and answering questions, the efficiency of document information retrieval and question answering is improved.

[0046] In an exemplary embodiment, information questioning is performed on questions input by a target object based on a target summary result, including: randomly breaking up the target summary result and dividing it into question and answer text blocks of specified length; generating an intermediate answer for each question and answer text block in parallel, and evaluating the matching degree between the intermediate answer and the question to obtain multiple scoring values; selecting a target intermediate answer that satisfies a context window corresponding to the question based on the multiple scoring values; and using the target intermediate answer to perform information questioning on questions input by the target object.

[0047] Optionally, the research project application summary results include the following question-and-answer text blocks: Q: What is the research goal? A: The research goal is to solve XXX problem. Q: What methods were used? A: XXX method was used. Q: What are the experimental results? A: The experimental results show XXX. Randomly break up these question-and-answer text blocks and divide them into question-and-answer text blocks of 100 words in length, generate intermediate answers in parallel, and evaluate the matching degree to obtain multiple scoring values. Then select the intermediate answer with the highest matching degree, such as "The research goal is to solve XXX problem" as the final answer to answer the question entered by the user. This can answer user questions more accurately and improve the effectiveness of the question-and-answer system and user satisfaction.

[0048] In an exemplary embodiment, a target intermediate answer that satisfies a context window corresponding to a question is selected based on multiple scoring values, including: removing the first category of intermediate answers with a score of zero from the multiple scoring values, and arranging the remaining intermediate answers in descending order according to the scores to obtain a target sorting result; placing the remaining intermediate answers into a new context window in sequence based on the target sorting result; and determining the current remaining intermediate answer as the target intermediate answer when the current remaining intermediate answer meets the length limit and has the highest score.

[0049] Optionally, if there are three intermediate answers A, B, and C, their scores are 8, 0, and 10 respectively. The first step is to remove the intermediate answers with a score of zero, and the remaining intermediate answers are A and C, and then sort them in descending order by score, and get the target sorting results of C and A. Then put the intermediate answers into a new context window in turn, and select the intermediate answer with the highest score according to the length limit. At this time, the intermediate answer C has the highest score, so the final intermediate answer is determined to be C.

[0050] In an exemplary embodiment, information questions are answered using a target intermediate answer for a question input by a target object, including: identifying the contextual intent corresponding to the question; generating a global answer based on the contextual intent and the target intermediate answer; and answering the question based on the global answer.

[0051] Optionally, if the question input by the user is: "What is the research objective of the project?" Based on the question raised by the user, the system can recognize that the user wants to know the research objective of the project, and then determine that the contextual intent corresponding to the question is "research objective". The system generates a global answer based on the contextual intent "research objective" of the question and the relevant information in the project application: "The research objective of the project is to solve a specific problem or achieve a certain goal, including XXX, YYY, ZZZ, etc.". The system gives a complete and accurate answer based on the generated global answer: "The research objective of the project is to solve a specific problem or achieve a certain goal, including XXX, YYY, ZZZ, etc.". Through the above steps, the system can accurately understand the questions raised by the user, generate answers related to the entire context, and finally give complete and accurate answers, which improves the efficiency and accuracy of the question-answering system.

[0052] In an exemplary embodiment, a community is summarized layer by layer to obtain a target summary result, including: determining the node levels included in the community and the description text of each graph node existing in each node level to obtain multiple description texts; sorting the multiple description texts according to preset text importance, and generating sub-summaries in sequence based on the sorting results; and aggregating multiple sub-summaries corresponding to the community to obtain a target summary result.

[0053] In an exemplary embodiment, after conducting information Q&A on the question input by the target object based on the target summary result, the method further includes: obtaining a Q&A score for the target object, wherein the Q&A score is determined by the target object based on the degree of association between the Q&A result of the information Q&A and the question; when the Q&A score is less than a preset score threshold, determining that the current information Q&A is invalid and waiting for the target summary result to be updated; when the Q&A score is greater than or equal to the preset score threshold, determining that the current information Q&A is valid, and associating the target summary result with the question.

[0054] It is understandable that the preset scoring threshold is set to 70 points to evaluate the information questions in the research project book. Each information question is scored, and the scoring result is 60 points. Based on the scoring result, it is judged that this information question is less than the preset scoring threshold, and the information question is considered invalid. The invalid information question is eliminated and the target summary result is updated. Another information question is scored, and the scoring result is 80 points. Based on the scoring result, it is judged that this information question is greater than or equal to the preset scoring threshold, and the information question is considered valid. Associate the valid information questions with the questions to better understand and explain the purpose and significance of the research project.

[0055] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:

[0056] An optional embodiment of the present application provides a RAG-based intelligent question-and-answer method for key information of scientific research project applications to solve the problems of low accuracy and low processing efficiency in professional document information extraction. This method divides source documents such as scientific research project applications into text blocks of appropriate sizes, uses a large language model to prompt the extraction of knowledge elements, summarizes multiple instances, constructs a weighted undirected graph and applies a community discovery algorithm, hierarchically summarizes the community, and progressively generates the final answer based on the user's question. By means of hierarchical summarization and progressive generation of answers, the extraction and integration efficiency of knowledge elements is improved, making the processing of documents such as research project applications more efficient and accurate.

[0057] Alternatively, RAG is a method that combines retrieval techniques and generative models, which can retrieve relevant pieces of information from external knowledge sources given a query and use this information to generate answers. Compared with traditional retrieval methods, RAG can better handle open domain questions and generate coherent natural language responses.

[0058] As an optional implementation, Figure 3 This is a flow chart of a method for intelligent question and answer of key information of a scientific research project application based on RAG according to an embodiment of the present application. The specific steps are as follows:

[0059] Step 1: Document segmentation. Divide source documents such as scientific research project applications into text blocks of appropriate size so that knowledge elements can be extracted from each text block later. The size of the text block needs to balance efficiency and quality. Too long text blocks will lead to a decrease in LLM extraction capabilities, while too short text blocks require more computing overhead.

[0060] Step 2: Extraction of knowledge graph elements such as entities, relationships, and events. For each text block, LLM prompts with few-shot learning are used to extract the contained entities, relationships, events, and other knowledge graph elements. LLM prompts consist of two parts: general and domain-related. The former is responsible for extracting general entities such as names, places, and organizations, while the latter is optimized for specific areas of scientific research project applications, such as key information such as scientific research problems, technical methods, and innovations.

[0061] Step 3: Summarize across instances. The knowledge element instances extracted by LLM already contain general descriptions, but for multiple instances of the same element, further summarization across instances is required. The knowledge description generated here is different from the triple representation of the knowledge graph. It focuses on using longer text to describe nodes and edges, without forcing the consistency of entity names. This is more in line with the natural language-based characteristics of LLM and is more suitable for subsequent global summary questions and answers.

[0062] Step 4: Construct a weighted undirected graph. The extracted and summarized knowledge elements such as entity nodes and relationship edges are constructed into a weighted undirected graph, where the edge weight is the normalized count of the relationship instance. The community discovery algorithm can be applied to this graph to divide the nodes into several communities so that the connections within the community are stronger than the connections between communities.

[0063] Step 5: Summarize the hierarchical communities layer by layer. For the bottom-level community, first sort the descriptive texts of all the knowledge elements (nodes, edges, events, etc.) it contains by importance: consider each relationship edge in turn, add the importance (degree) of the entity nodes at both ends as the importance of the edge, and then take out the relationship edges and their related elements in turn until the context length limit of LLM is reached.

[0064] Optionally, for the upper community, if the description text of all its knowledge elements can be loaded into the context window of LLM, it will be summarized in the same way as the lower community; otherwise, the subcommunities are sorted in descending order according to the text length of the knowledge elements they contain, and the corresponding element text is replaced with the summary of the subcommunity until the context length meets the requirement. In this way, hierarchical community summaries corresponding to different granularities are obtained. These summaries can be used to browse the global structure and semantic themes of scientific research project applications. It is a fast reading method for large-scale data sets, and the text context can be sorted out without pre-set questions.

[0065] Step 6: Generate the final answer progressively. When a user asks a question, the above community summary is used to progressively generate the final answer. Due to the hierarchical structure of the community, community summaries of different granularities can be used to answer questions.

[0066] Optionally, randomly break up the community summary and divide it into several text blocks of specified length. This allows relevant information to be dispersed into different blocks, reducing the risk of being missed by appearing in only one block. Generate an intermediate answer for each text block in parallel, and ask the LLM to give a matching score (0-100) for the answer to the target question. After removing the answer with a score of 0, sort the intermediate answers in descending order by score and put them into a new context window in turn until the length limit is reached. Finally, generate a global answer under this context and return it to the user.

[0067] In summary, the optional embodiments of the present application achieve a deep understanding and comprehensive analysis of the scientific research project application by constructing a knowledge graph and a hierarchical community summary. Using the large language model (LLM) prompt containing few-sample learning, knowledge graph elements such as entities, relationships, and events are extracted from the text block of the scientific research project application. The prompt consists of two parts: general and domain-related, and key information is extracted in a targeted manner. Multiple instances of the same knowledge element are summarized across instances to generate longer descriptive texts to characterize nodes and edges, which is more in line with the natural language-based characteristics of LLM and is more suitable for subsequent global summary-style questions and answers. The extracted and summarized knowledge elements are constructed into a weighted undirected graph, and the community discovery algorithm is applied to divide the nodes so that the connection within the community is stronger than the connection between communities. The hierarchical communities are summarized layer by layer, and the importance of the knowledge elements and the context length limit of the LLM are comprehensively considered. Community summaries of different granularities are generated in a recursive manner for quick reading and combing of the text context. The final answer is generated progressively using the community summary, the summary is randomly broken up and cut into text blocks, the intermediate answers are generated in parallel and their matching degree with the target question is evaluated, and finally the answer is reorganized according to the score, ensuring the comprehensiveness and accuracy of the answer. In short, the above technical solution provides a complete end-to-end process, covering the key steps from source documents to question answers, emphasizing the core design considerations such as the trade-off of text block size, community discovery and hierarchical summarization, intermediate result scoring and answer reorganization.

[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0069] In the present embodiment, a graph-based information question-and-answer device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0070] Figure 4 : is a structural block diagram of a graph-based information question and answer device according to an embodiment of the present application, the device comprising:

[0071] The extraction module 42 is used to divide the source document into a plurality of text blocks of a preset size, extract knowledge elements from the plurality of text blocks, and obtain an element set; wherein the knowledge element includes at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block;

[0072] A construction module 44 is used to construct a knowledge graph and a relationship graph using the element set, wherein the nodes and edges of the knowledge graph are described by natural language;

[0073] An identification module 46 is used to identify communities in the knowledge graph that conform to the weighted undirected graph, summarize the communities layer by layer, and obtain a target summary result;

[0074] The question-answering module 48 is used to answer questions input by the target object based on the target summary result.

[0075] The above device divides the source document into multiple text blocks of preset sizes, extracts knowledge elements from the multiple text blocks, and obtains an element set; wherein the knowledge elements include at least one of the following: entities corresponding to each text block, relationships between different text blocks, and events corresponding to each text block; uses the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described in natural language; identifies communities in the knowledge graph that conform to the weighted undirected graph, summarizes the communities layer by layer, and obtains the target summary result; and performs information questioning and answering on questions input by the target object based on the target summary result. The above technical solution solves the problems of low accuracy and low processing efficiency in professional document information extraction. Furthermore, by extracting knowledge elements from documents in blocks to construct a knowledge graph, identifying communities for summarization and answering questions, the efficiency of document information retrieval and question answering is improved.

[0076] In an exemplary embodiment, the above-mentioned question and answer module is also used to randomly break up the target summary results and divide them into question and answer text blocks of specified length; generate an intermediate answer in parallel for each question and answer text block, and evaluate the matching degree between the intermediate answer and the question to obtain multiple scoring values; select the target intermediate answer that meets the context window corresponding to the question based on the multiple scoring values; and use the target intermediate answer to answer information questions input by the target object.

[0077] In an exemplary embodiment, the above-mentioned question and answer module is also used to remove the first type of intermediate answers with a score of zero from multiple scoring values, and sort the remaining intermediate answers in descending order according to the scores to obtain a target sorting result; based on the target sorting result, the remaining intermediate answers are placed into a new context window in sequence; when the current remaining intermediate answer meets the length limit and has the highest score, the current remaining intermediate answer is determined as the target intermediate answer.

[0078] In an exemplary embodiment, the above-mentioned question-and-answer module is also used to identify the contextual intent corresponding to the question; generate a global answer based on the contextual intent and the target intermediate answer; and perform information question-and-answer on the question based on the global answer.

[0079] In an exemplary embodiment, the above-mentioned identification module is also used to determine the node levels included in the community and the description text of each graph node existing in each node level to obtain multiple description texts; sort the multiple description texts according to the preset text importance, and generate sub-summaries in sequence based on the sorting results; summarize the multiple sub-summaries corresponding to the community to obtain the target summary result.

[0080] In an exemplary embodiment, the above-mentioned device also includes: an acquisition module, which is used to obtain a question and answer score of the target object after conducting information questions and answers on the questions input by the target object based on the target summary result, wherein the question and answer score is determined by the target object based on the degree of association between the question and answer results of the information question and answer and the question; when the question and answer score is less than a preset score threshold, it is determined that the current information question and answer is invalid, and the target summary result is to be updated; when the question and answer score is greater than or equal to the preset score threshold, it is determined that the current information question and answer is valid, and the target summary result is associated with the question.

[0081] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0082] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0083] S1. Divide a source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block;

[0084] S2. Use the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described by natural language;

[0085] S3, identifying communities in the knowledge graph that conform to the weighted undirected graph, summarizing the communities layer by layer, and obtaining target summary results;

[0086] S4. Based on the target summary result, information questions are answered for questions input by the target object.

[0087] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0088] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0089] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are performed.

[0090] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0091] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0092] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0093] S1. Divide a source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block;

[0094] S2. Use the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described by natural language;

[0095] S3, identifying communities in the knowledge graph that conform to the weighted undirected graph, summarizing the communities layer by layer, and obtaining target summary results;

[0096] S4. Based on the target summary result, information questions are answered for questions input by the target object.

[0097] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0098] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of N computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or N of the modules or steps can be made into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0100] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A graph-based information question answering method, characterized in that: include: Divide the source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge elements include at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block; Using the element set to construct a knowledge graph and a relationship graph, wherein the nodes and edges of the knowledge graph are described by natural language; Identify the communities in the knowledge graph that conform to the weighted undirected graph, summarize the communities layer by layer, and obtain a target summary result; Based on the target summary result, information questions are answered for questions input by the target object.

2. The graph-based information question answering method according to claim 1, characterized in that: Based on the target summary results, information questions are answered for questions input by the target object, including: Randomly breaking up the target summary results and dividing them into question-answer text blocks of specified length; Generate an intermediate answer for each question-answer text block in parallel, and evaluate the matching degree between the intermediate answer and the question to obtain multiple scoring values; Selecting a target intermediate answer that satisfies the context window corresponding to the question based on the multiple scoring values; The target intermediate answer is used to perform information questioning and answering on the question input by the target object.

3. The graph-based information question answering method according to claim 2, characterized in that: Selecting a target intermediate answer that satisfies the context window corresponding to the question based on the multiple scoring values ​​includes: Remove the first type of intermediate answers with a score of zero from the multiple score values, and sort the remaining intermediate answers in descending order according to the scores to obtain a target sorting result; Based on the target sorting result, the remaining intermediate answers are sequentially placed into a new context window; When the current remaining intermediate answer meets the length restriction and has the highest score, the current remaining intermediate answer is determined as the target intermediate answer.

4. The graph-based information question answering method according to claim 2, characterized in that: Using the target intermediate answer to answer questions input by the target object includes: Identify the contextual intent of the question; generating a global answer based on the contextual intent and the target intermediate answer; The question is answered based on the global answer.

5. The graph-based information question answering method according to claim 1, characterized in that: Summarize the communities layer by layer to obtain target summary results, including: Determine the node levels included in the community and the description text of each graph node in each node level to obtain a plurality of description texts; Sorting the multiple description texts according to preset text importance, and sequentially generating sub-summaries based on the sorting results; The multi-sub-summaries corresponding to the community are aggregated to obtain the target summary result.

6. The graph-based information question answering method according to claim 1, characterized in that: After performing information questioning and answering on the question input by the target object based on the target summary result, the method further includes: Obtaining a question-and-answer score for the target object, wherein the question-and-answer score is determined by the target object based on the degree of correlation between the question-and-answer result of the information question-and-answer and the question; When the question-and-answer score is less than a preset score threshold, the current information question-and-answer is determined to be invalid, and the target summary result is to be updated; When the question and answer score is greater than or equal to a preset score threshold, the current information question and answer is determined to be valid, and the target summary result is associated with the question.

7. A graph-based information question-answering device, characterized in that: include: An extraction module is used to divide the source document into multiple text blocks of preset sizes, extract knowledge elements from the multiple text blocks, and obtain an element set; wherein the knowledge element includes at least one of the following: an entity corresponding to each text block, a relationship between different text blocks, and an event corresponding to each text block; A construction module, used to construct a knowledge graph and a relationship graph using the element set, wherein the nodes and edges of the knowledge graph are described by natural language; An identification module is used to identify communities in the knowledge graph that conform to the weighted undirected graph, summarize the communities layer by layer, and obtain a target summary result; The question-answering module is used to answer questions input by the target object based on the target summary result.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Retrieval enhancement generation method and system based on structured document

    CN120067340A

  • Robot design knowledge recommendation method based on cross-modal comparative learning

    CN120653817A