Time sequence mapping knowledge domain question and answer method based on multilevel semantic reasoning

By introducing multi-level semantic inference and step-by-step reasoning methods of large language models in the timing knowledge graph question and answer system, the problem of insufficient accuracy and robustness of the system under multi-time granularity and multi-time constraints is solved, and more efficient and accurate handling of complex timing problems is achieved.

CN119760061APending Publication Date: 2025-04-04BEIJING INST OF COMP TECH & APPL
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411726651.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The timing knowledge graph question and answer system is not accurate and robust in dealing with multi-time granularity and multi-time constraints, making it difficult to effectively deal with complex timing problems.

Method used

The time series knowledge graph question-and-answer method based on multi-level semantic inference is adopted to gradually reason and generate answers through the combination of problem decomposition, semantic understanding and large language models, so as to reduce the dependence on entity link information.

Benefits of technology

It significantly improves the system's inference ability and accuracy on multi-time granularity problems, and enhances the robustness and applicability of Q&A under multi-time constraints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760061A_ABST
    Figure CN119760061A_ABST
Patent Text Reader

Abstract

The invention relates to a time sequence knowledge graph question answering method based on multilevel semantic reasoning, and belongs to the technical field of artificial intelligence, natural language processing and knowledge graphs. According to the method, multi-level module design including question decomposition, correlation sorting and semantic understanding is introduced, so that the question and answer ability of the system on complex time sequence questions is effectively improved. According to the method, an accurate question and answer result can be provided in a complex scene with multiple time granularities by utilizing strong semantic understanding and reasoning capabilities of a large language model without depending on extra entity link information. By adopting the question decomposition and prompt fine tuning technology, the performance of the question-answering system is improved, the processing capacity for the complex time sequence reasoning problem is enhanced, and the accuracy and robustness of the system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of artificial intelligence, natural language processing and knowledge graph technology, and specifically relates to a temporal knowledge graph question-answering method based on multi-level semantic reasoning. Background Art

[0002] Time series knowledge graph question answering is a type of knowledge question answering task based on time context. Its goal is to understand natural language questions, locate relevant time information and entities, and provide accurate answers based on a given time series knowledge graph. This type of task is widely used in scenarios such as financial market trend analysis, historical event reasoning, future prediction, and social media event tracking. In this task, the system needs to infer the correct answer based on the time constraints in the time series knowledge graph. Traditional knowledge graph question answering systems are mostly based on static data, which makes it difficult to handle complex problems involving time evolution, and therefore cannot meet the reasoning needs of time series problems. Summary of the invention

[0003] 1. Technical issues to be resolved

[0004] The present invention proposes a temporal knowledge graph question and answering method, which mainly solves the following two problems: First, it aims to address the problem of insufficient understanding of multiple time granularities in temporal question and answering, and improve the system's ability to capture and reason about complex time information; second, it aims to address the problem that traditional question and answer systems rely on a large amount of entity link information, and ensure the accuracy and robustness of the system's question and answering under multiple time constraints.

[0005] (II) Technical solution

[0006] In order to solve the above technical problems, the present invention provides a temporal knowledge graph question answering method based on multi-level semantic reasoning, comprising the following steps:

[0007] Step 1: Recall and sort: First, based on the input natural language question, the BM25 algorithm is used to preliminarily retrieve a set of four-tuple candidate answers related to the question from the temporal knowledge graph. The candidate answer set consists of candidate answers. Then, the candidate answers are sorted using the trained semantic retrieval model to select a set of four-tuple candidate answers that has a higher degree of semantic match with the question.

[0008] Step 2: Problem decomposition and step-by-step reasoning: After obtaining the sorted set of highly relevant candidate answers in step 1, the complex time series problem is decomposed to generate multiple sub-problems with clear time constraints. Then, the large language model is used to gradually answer these sub-problems, and the answer results of the sub-problems are gradually combined based on the reasoning relationship to obtain a complete answer.

[0009] Step 3: Semantic question answering and generation: After completing the question decomposition and step-by-step reasoning, based on the information obtained in the first two steps, the large language model is optimized through prompt fine-tuning technology to finally generate the correct answer.

[0010] The present invention also provides a system for implementing the method.

[0011] (III) Beneficial effects

[0012] The present invention discloses a temporal knowledge graph question answering method based on multi-level semantic reasoning, the advantages of which are mainly reflected in the following aspects:

[0013] (1) The present invention designs a multi-level semantic reasoning framework, which significantly improves the system's reasoning ability on multi-time granularity problems through question decomposition and semantic understanding modules, enabling the system to handle complex time-series question-answering tasks more accurately and improving reasoning efficiency and accuracy.

[0014] (2) The present invention proposes a question-answering technology that does not rely on additional entity linking information. By introducing question decomposition and prompt fine-tuning strategies, it ensures that the system can still efficiently answer complex timing problems in the absence of entity annotations, reduces the error accumulation caused by entity linking errors, and enhances the applicability and stability of the system in practical applications.

[0015] (3) This paper uses a large language model combined with prompt fine-tuning technology to optimize the reasoning process and semantic understanding ability of the question-answering model, effectively improving the accuracy and robustness of the system in multiple time-constrained scenarios. In particular, when dealing with question-answering tasks involving complex timing constraints, the system demonstrates higher answer accuracy and stronger adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is the overall framework diagram of the model of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0018] The present invention proposes a temporal knowledge graph question and answer method based on multi-level semantic reasoning, which mainly solves the following two problems: First, in view of the problem of insufficient understanding ability of multiple time granularities in temporal question and answering, the multi-level semantic reasoning mechanism is studied to improve the system's ability to capture and reason about complex time information; Second, in view of the problem that traditional question and answer systems rely on a large amount of entity link information, question and answering technology that does not require additional entity links is studied, and by introducing question decomposition and prompt fine-tuning strategies, the accuracy and robustness of the system's question and answering under multiple time constraints are ensured.

[0019] The present invention effectively improves the system's question-answering capabilities for complex time-series problems by introducing a multi-level module design, including question decomposition, relevance ranking, and semantic understanding. The method utilizes the powerful semantic understanding and reasoning capabilities of large language models, without relying on additional entity link information, and can provide accurate question-answering results in complex scenarios with multiple time granularities. By adopting question decomposition and prompt fine-tuning technology, the present invention improves the performance of the question-answering system while enhancing the ability to handle complex time-series reasoning problems, which can improve the accuracy and robustness of the system.

[0020] The overall framework of the present invention is as follows Figure 1 As shown in the figure, it mainly includes three steps: recall sorting, question reasoning, and semantic question answering:

[0021] Step 1: Recall and sorting: First, based on the input natural language question, the BM25 algorithm is used to preliminarily retrieve a set of four-tuple candidate answers related to the question from the temporal knowledge graph. The candidate answer set consists of candidate answers. Then, the candidate answers are sorted through the trained semantic retrieval model to screen out the four-tuple candidate answer set with a higher degree of semantic match with the question, providing more accurate basic data input for the subsequent reasoning process.

[0022] Step 2: Problem decomposition and step-by-step reasoning: After obtaining the sorted, highly relevant candidate sets, the system decomposes the complex time series problem into multiple sub-problems with clear time constraints; then, it uses the large language model to gradually answer these sub-problems, and gradually combines the answer results of the sub-problems based on the reasoning relationship to obtain a complete answer. This process relies on the high-quality candidate sets generated in step 1, which helps improve the accuracy of reasoning.

[0023] Step 3: Semantic question answering and generation: After completing the problem decomposition and step-by-step reasoning, the system optimizes the large language model through prompt fine-tuning technology, thereby further improving the ability to understand and answer complex time series questions. Combining the information obtained in the first two steps, the system finally generates accurate answers and gives detailed answers to questions involving multiple time granularities.

[0024] The three steps are introduced in detail below.

[0025] Step 1: Recall and sort

[0026] In order to efficiently retrieve candidate answers related to the question from the huge temporal knowledge graph, this paper first designs a phased recall and sorting mechanism to select a set of candidate answers highly related to the question from the temporal knowledge graph to narrow the search space. It involves two parts, training and reasoning, and can be mainly divided into the following four sub-steps:

[0027] (1) <Question, quadruple> data construction: In the preparation stage of training data, we first preprocess the known question-answering dataset (including questions expressed in natural language and quadruple candidate answer data in the time series knowledge graph), pair the natural language questions with the corresponding quadruple candidate answers, and construct the <question, quadruple> dataset (quadruple refers to quadruple candidate answers) for use in subsequent model training.

[0028] (2) Training the semantic retrieval model: Based on the constructed <question, quadruple> dataset, the semantic retrieval model is trained using a large pre-trained language model. This step aims to enable the semantic retrieval model to learn the deep semantic correlation between questions and quadruple, thereby ensuring that the correct quadruple in the temporal knowledge graph can be accurately matched with the question in the actual question-answering scenario. By optimizing the parameters of the semantic retrieval model, it is able to handle multiple time granularities and complex semantic reasoning, thereby improving the retrieval accuracy of the system.

[0029] (3) Semantic retrieval: First, perform a preliminary search for the question keywords based on the BM25 algorithm, and select a set of four-tuple candidate answers related to the question from the temporal knowledge graph. Based on the preliminary recalled candidate answer set, generate semantic representations of the question and each four-tuple candidate answer based on the trained semantic retrieval model. Assuming the question representation is q, the question vector obtained by vectorization of the trained semantic retrieval model is represented as h. q , the candidate set of four tuples is represented as d, and the vector of the candidate set of four tuples obtained by vectorization of the trained semantic retrieval model is represented as h d ;

[0030] (4) Relevance ranking: After completing the semantic retrieval, multiple quadruple candidate answers are ranked using a relevance ranking model: the relevance score between each quadruple candidate answer and the question is calculated by dot product. The relevance score calculation formula is:

[0031] Relevance_Score(q,d)=h q ·h d

[0032] The relevance scores of all four-tuple candidate answers and questions are normalized using softmax, and several four-tuple candidate answers with the highest scores are selected. These four-tuple candidate answers are the candidate answer sets with the highest relevance that best fits the semantics of the question. In this process, the candidate answers are optimized and sorted based on contextual information and semantic understanding capabilities to ensure that the selected answers are highly matched to the questions, thereby improving the accuracy and reliability of the question-answering system (a system implemented based on the method of the present invention).

[0033] Step 2: Problem decomposition and step-by-step reasoning

[0034] After obtaining the ranked candidate answer set, in order to solve the reasoning difficulties caused by multiple time constraints in complex time series problems, the present invention introduces a reasoning method based on problem decomposition, which can be divided into the following two sub-steps:

[0035] (1) Problem transformation: Decompose the complex time series problem into a series of simpler sub-problems according to factors such as time, entity, and relationship. Each sub-problem is solved for a specific time or entity, thereby simplifying the problem-solving process. Assume that problem q involves multiple time constraints, expressed as:

[0036] q={(t1,e1),(t2,e2),…,(t n ,e n )}

[0037] where t i and e i denote the i-th time and entity involved in problem q respectively; the converted k sub-problems are represented as a sub-problem set {q1,q2,…,q k}, where each sub-question can query the answer for a specific time or entity, such as "Who visited country A after a certain year".

[0038] (2) Step-by-step reasoning: Based on the set of highly relevant candidate answers selected in step 1, a large language model is used to gradually answer each sub-question and infer the final answer (from the set of highly relevant candidate answers selected in step 1). In this process, the logical dependencies between the reasoning steps are retained, so that the answer results of the sub-questions are gradually combined based on the reasoning relationship to obtain a complete answer. Through this "transformation-reasoning" strategy, the system can more effectively handle complex multi-time granularity problems and combine the answer results of each sub-question into a final answer, which may include multiple four-tuple candidate answers. This step makes full use of the highly relevant candidate set selected in step 1, thereby improving the overall reasoning efficiency. For example, for the question "Who visited a place for the first time after a certain time", it can be decomposed into:

[0039] q1:When did you visit l?

[0040] q2:Who visited l after t1?

[0041] Among them, e and l are the entity and location respectively, and t1 is the time obtained when answering q1. Answering each sub-question step by step and reasoning out the final answer can help improve the reasoning accuracy of complex time series problems.

[0042] Step 3: Semantic Question Answering and Generation

[0043] After completing the problem decomposition and step-by-step reasoning, in order to further improve the accuracy of the system's question-answering, the present invention adopts a question-answering process based on semantic understanding. This step includes the following two sub-steps:

[0044] (1) Prompt construction: First, the final answer is combined with the solution results of each sub-question in step 2 to construct a question prompt, so as to better guide the large language model to generate the expected answer. Through a small number of annotated examples, complex time series questions are converted into a series of question prompts with clear reasoning steps. For the complex time series question "someone visits a place for the first time after a certain year", the reasoning steps generated by the question prompt are "find the first visit time", "get the visitors after that time", etc.

[0045] (2) Semantic question answering: Based on the constructed question prompt information, the input question together with the question prompt is input into the fine-tuned large language model for question answering. In the present invention, due to the combination of the relevant candidate answers screened in step 1 and step 2, the large language model can accurately infer the answer that meets the conditions. Finally, the system obtains "Angela Merkel" as the correct answer to the question, that is, "After February 3, 2002, the earliest visitor to country A is Zhang San."

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

Claims

1. A temporal knowledge graph question answering method based on multi-level semantic reasoning, characterized in that: The following steps are involved: Step 1: Recall and sort: First, based on the input natural language question, the BM25 algorithm is used to preliminarily retrieve a set of four-tuple candidate answers related to the question from the temporal knowledge graph. The candidate answer set consists of candidate answers. Then, the candidate answers are sorted using the trained semantic retrieval model to select a set of four-tuple candidate answers that has a higher degree of semantic match with the question. Step 2: Problem decomposition and step-by-step reasoning: After obtaining the sorted set of highly relevant candidate answers in step 1, the complex time series problem is decomposed to generate multiple sub-problems with clear time constraints. Then, the large language model is used to gradually answer these sub-problems, and the answer results of the sub-problems are gradually combined based on the reasoning relationship to obtain a complete answer. Step 3: Semantic question answering and generation: After completing the question decomposition and step-by-step reasoning, based on the information obtained in the first two steps, the large language model is optimized through prompt fine-tuning technology to finally generate the correct answer.

2. The method according to claim 1, characterized in that Step 1 includes the following four sub-steps: (1) <Question, quadruple> data construction: In the training data preparation stage, we first preprocess the known question-answering dataset (including questions expressed in natural language and quadruple candidate answer data in the time series knowledge graph), pair the natural language questions with the corresponding quadruple candidate answers, and construct the <question, quadruple> dataset. The quadruple is the quadruple candidate answer. (2) Training the semantic retrieval model: Based on the constructed <question, quadruple> dataset, the semantic retrieval model is trained using a pre-trained language model. Through training, the semantic retrieval model learns the semantic correlation between the question and the quadruple. (3) Semantic retrieval: First, perform a preliminary search on the question keywords based on the BM25 algorithm, and select a set of four-tuple candidate answers related to the question from the temporal knowledge graph; then generate semantic representations of the question and each four-tuple candidate answer based on the trained semantic retrieval model. Assuming the question representation is q, the question vector obtained by vectorization using the trained semantic retrieval model is represented as h q , the candidate set of four tuples is represented as d, and the vector of the candidate set of four tuples obtained by vectorization of the trained semantic retrieval model is represented as h d ; (4) Relevance ranking: After completing the semantic retrieval, multiple quadruple candidate answers are ranked using a relevance ranking model: the relevance score between each quadruple candidate answer and the question is calculated by dot product. The relevance score calculation formula is: Relevance_Score(q,d)=h q ·h d Use softmax to normalize the relevance scores of all four-tuple candidate answers to the question, and select several four-tuple candidate answers with the highest scores. These four-tuple candidate answers are the candidate answer set with the highest relevance that best matches the semantics of the question.

3. The method according to claim 2, characterized in that Step 1 (2) optimizes the parameters of the semantic retrieval model so that it has the ability to handle multiple time granularities and complex semantic reasoning.

4. The method according to claim 2, characterized in that In step 1 (4), the candidate answers are optimized and ranked based on contextual information and semantic understanding capabilities to ensure that the selected answer is highly matched with the question.

5. The method according to claim 2, characterized in that Step 2 includes the following two sub-steps: (1) Problem transformation: Decompose the complex time series problem into a series of simpler sub-problems according to factors such as time, entity, and relationship. Each sub-problem is answered for a specific time or entity. Suppose problem q involves multiple time constraints, which can be expressed as: q={(t1,e1),(t2,e2),…,(t n ,e n )} Among them, t i and e i denote the i-th time and entity involved in problem q respectively; the converted k sub-problems are represented as a sub-problem set {q1,q2,…,q k }, where each sub-question can query the answer for a specific time or entity; (2) Step-by-step reasoning: Based on the set of highly relevant candidate answers selected in step 1, a large language model is used to gradually answer each sub-question and infer the final answer. In this process, the logical dependencies between the reasoning steps are retained, so that the solution results of the sub-questions are gradually combined based on the reasoning relationship to obtain a complete answer.

6. The method according to claim 5, characterized in that Step 2 uses the highly relevant candidate set selected in step 1 to improve the overall reasoning efficiency.

7. The method according to claim 5, characterized in that Step 3 includes the following two sub-steps: (1) Prompt construction: First, the final answer is combined with the solution results of each sub-question in step 2 to construct a question prompt, guiding the large language model to generate an answer that meets the expectations. By annotating examples, complex time-series problems are converted into a series of question prompts with clear reasoning steps. (2) Semantic question answering: Based on the constructed question prompt information, the input question together with the question prompt is input into a fine-tuned large language model for question answering, and the large language model infers the qualified answer.

8. The method according to any one of claims 1 to 7, characterized in that This method is used in the fields of artificial intelligence, natural language processing, and knowledge graph technology.

9. A system for implementing the method according to any one of claims 1 to 8.

10. The system according to claim 9, characterized in that The system is used in the fields of artificial intelligence, natural language processing, and knowledge graph technology.

Citation Information

Cited By

  • Innovation and entrepreneurship coaching question and answer matching method and system based on semantic understanding

    CN120256590A

  • Rainwater condition intelligent interaction service platform based on large language model

    CN120596642A

  • Excel data knowledge question-answering method based on table structure semantic collaboration

    CN122390090A