Small-sample knowledge graph question answering method and system based on large model enhancement
By generating model scoring and deductive verification methods, a multi-hop logical reasoning path is constructed, which solves the problems of retrieval noise and insufficient reasoning ability of the knowledge graph question answering system, and realizes efficient and low-cost knowledge graph question answering.
Patent Information
- Application Number
- CN202510892312.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing knowledge graph question-answering systems, when faced with large-scale knowledge graphs, suffer from problems such as high retrieval noise, limited reasoning capabilities, and high demand for labeled data, resulting in low answer accuracy and efficiency.
Generative model scoring is used to retrieve relevant relationships, and multi-hop logical reasoning paths are constructed in combination with the knowledge graph context. The optimal path is screened through deductive verification to generate answers, and the reasoning ability of large models is used to perform small-sample question answering.
It significantly improves the question-answering performance in small-sample scenarios, reduces manual labeling costs and computing resource overhead, and ensures high-accuracy answer generation.
Smart Images

Figure CN120745828A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph question answering in natural language processing, and specifically to a few-sample knowledge graph question answering method and system based on large model enhancement. Background Art
[0002] Knowledge-Based Question Answering (KBQA) has become a key technology that enables intelligent systems to answer natural language questions by leveraging structured knowledge stored in large-scale knowledge graphs (KGs). With the exponential growth of information and the growing demand for accurate and efficient information retrieval, KBQA systems are becoming increasingly important in various fields. These systems bridge the gap between human natural language queries and structured knowledge representation, enabling end users to access large amounts of structured knowledge through an intuitive question-answering interface.
[0003] In recent years, the emergence of large language models (LLMs) has revolutionized the field of KBQA. These models, with their exceptional natural language understanding and generation capabilities, have shown great potential in handling complex question-answering tasks. Traditional KBQA methods typically rely on semantic parsing and information retrieval methods, which struggle to cope with natural language variations and complex reasoning patterns. In contrast, LLM-based methods demonstrate superior ability to understand question semantics and generate natural responses, significantly improving KBQA performance.
[0004] However, despite the powerful capabilities of LLM, current KBQA systems still face significant challenges that limit their practical effectiveness.
[0005] The first major challenge is that retrieving relevant paths from knowledge graphs often generates a significant amount of noise, which introduces irrelevant or misleading information and severely impacts the reasoning process. This problem is particularly severe in large-scale knowledge graphs, where multiple potential paths between entities make it difficult to identify the most relevant information for answering a specific question. The noise in the retrieved paths not only increases computational overhead but also confuses the reasoning process of the LLM, resulting in reduced accuracy and reliability of answer generation.
[0006] The second major challenge lies in the inherent limitations of LLMs when reasoning about graph-structured data. While LLMs excel at processing sequential text data, they often struggle to effectively capture and leverage the complex relationships and structural information encoded in knowledge graphs. This limitation becomes particularly pronounced when questions require multi-hop reasoning or understanding complex relationships between multiple entities. The gap between LLMs' natural language processing capabilities and their ability to reason about graph structures creates a significant bottleneck in achieving state-of-the-art KBQA performance.
[0007] The third major challenge is the need for large amounts of labeled data to train the model, which results in high human and material costs. Because KBQA tasks involve complex semantic understanding and knowledge base mapping, the annotation process requires not only precise parsing of natural language questions by professionals but also accurate matching of these questions with entities, relationships, and attributes in the knowledge base. This highly complex annotation process is time-consuming and labor-intensive. Furthermore, training high-performance models typically requires a large number of high-quality question-answer pairs, further increasing the demand for large-scale annotation. This makes data annotation a resource-intensive task in KBQA system development, posing significant challenges to project timelines and budgets.
[0008] Patent application document CN119271784A discloses a method and system for enhancing the accuracy of large-scale model answers based on a knowledge graph. The method includes: obtaining a text dataset, preprocessing the text dataset, and extracting entities and relationships in the text dataset; establishing an entity connection graph based on the entities and relationships in the text dataset, fusing the entity nodes in the entity connection graph, and creating a knowledge graph based on the fused entity nodes and relationships; obtaining a user's query question, determining matching nodes for the user's query question based on the user's query question; identifying the user's question intent based on the user's query question, determining a prompt template based on the user's question intent and the matching nodes corresponding to the user's query question, and inputting the prompt template into the large-scale model to obtain a credible answer to the user's query question. However, this patent cannot completely solve the existing technical problems and cannot meet the requirements of the present invention. Summary of the Invention
[0009] In response to the defects in the existing technology, the purpose of the present invention is to provide a small-sample knowledge graph question answering method and system based on large model enhancement.
[0010] The method for answering a few-sample knowledge graph question based on large model enhancement provided by the present invention includes:
[0011] Step 1: Use a generative model to score the relevance between questions and relations, and retrieve a set of relations related to the question semantics from the knowledge graph;
[0012] Step 2: Based on the retrieved set of relations related to the question semantics, combined with the question's subject entities and their contextual information in the knowledge graph, a multi-hop logical reasoning path is gradually constructed through the dynamic combination of entities and relations;
[0013] Step 3: Convert the question and the multi-hop logical reasoning path into a proposition description with premises and conclusions. Utilize the reasoning ability of the large model to screen and verify the multi-hop logical reasoning path in a deductive verification manner, determine the optimal reasoning path that matches the semantics of the question, and generate the final answer.
[0014] Preferably, the step 1 comprises:
[0015] Use prompt template X to express both the question and the factual relationship in text form;
[0016] Take the prompt template X as the input of the pre-trained generative model and maximize the <i Under the condition that the real category k is labeled t i The likelihood probability, the objective function is:
[0017]
[0018] Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k.
[0019] Preferably, a training method based on the confidence advantage of the positive sample set is introduced to reduce the sensitivity of the model during the learning process. The expression is:
[0020]
[0021] Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set, s is the similarity score; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; i Indicates the similarity score of label i belonging to the negative sample set, s j It represents the similarity score that the tag j belongs to the positive sample set.
[0022] Preferably, step 2 includes: based on the retrieved relationship set R, taking the subject entity e as the starting point, traversing all relations r∈R and their corresponding directions d through the function retrieve(·), and retrieving related triples; if the subject entity e is not adjacent to the relationship r, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid and filtering is performed.
[0023] Preferably, the step 3 includes:
[0024] Given an input question q, a subject entity set E = {e1, e2, ...e n} and the relationship path P={p1,p2,…p n}, convert the question into a declarative sentence, where the path tail entity is the answer;
[0025] Based on the preset prompt template, the large language model is called to perform deductive reasoning verification on the proposition;
[0026] Filter logically consistent reasoning paths and use their tail entities as the final answers to the questions.
[0027] The few-sample knowledge graph question answering system based on large model enhancement proposed in the present invention includes:
[0028] Enhanced Retriever Module: This module uses a generative model to score the relevance between questions and relations, and retrieves a set of relations that are semantically relevant to the question from the knowledge graph.
[0029] Context transformation module: Based on the retrieved relationship set related to the question semantics, combined with the question's subject entity and its contextual information in the knowledge graph, it gradually constructs a multi-hop logical reasoning path through the dynamic combination of entities and relationships;
[0030] Deductive Verification Module: This module converts the problem and multi-hop logical reasoning path into a proposition description with premises and conclusions. Utilizing the reasoning capability of the large model, it screens and verifies the multi-hop logical reasoning path in a deductive verification manner, determines the optimal reasoning path that matches the semantics of the problem, and generates the final answer.
[0031] Preferably, the enhanced retriever module comprises:
[0032] Use prompt template X to express both the question and the factual relationship in text form;
[0033] Take the prompt template X as the input of the pre-trained generative model and maximize the <i Under the condition that the real category k is labeled t i The likelihood probability, the objective function is:
[0034]
[0035] Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k.
[0036] Preferably, a training method based on the confidence advantage of the positive sample set is introduced to reduce the sensitivity of the model during the learning process. The expression is:
[0037]
[0038] Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set, s is the similarity score; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; i Indicates the similarity score of label i belonging to the negative sample set, s jIt represents the similarity score that the tag j belongs to the positive sample set.
[0039] Preferably, the context conversion module includes: based on the retrieved relationship set R, taking the subject entity e as the starting point, traversing all relationships r∈R and their corresponding directions d through the function retrieve(·), and retrieving related triples; if the subject entity e is not adjacent to the relationship r, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid and filtering is performed.
[0040] Preferably, the deductive verification module includes:
[0041] Given an input question q, a subject entity set E = {e1, e2, ...e n} and the relationship path P={p1,p2,…p n}, convert the question into a declarative sentence, where the path tail entity is the answer;
[0042] Based on the preset prompt template, the large language model is called to perform deductive reasoning verification on the proposition;
[0043] Filter logically consistent reasoning paths and use their tail entities as the final answers to the questions.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] (1) The proposed large-model enhanced few-shot knowledge graph question answering system includes three core modules: an enhanced retriever, a context conversion module, and a deductive verification module. By combining the reasoning capabilities of the large model with the structured information of the knowledge graph, the system significantly improves the question answering performance in the few-shot scenario.
[0046] (2) By introducing a large model for few-sample knowledge graph question answering, the present invention can guide the system to achieve high-quality reasoning on the knowledge graph without additional training of the large model when labeled data is scarce. This not only significantly reduces the cost of manual labeling, but also reduces the time and computing resource overhead required for large model training. At the same time, its robust design framework ensures the high accuracy of the knowledge graph question answering system in answer retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0048] Figure 1 This is a schematic diagram of the overall framework of the large-model enhanced few-sample knowledge graph question answering system proposed in the present invention;
[0049] Figure 2 To enhance the structure and working principle of the retriever module;
[0050] Figure 3 It is the implementation mechanism of the context conversion module;
[0051] Figure 4 To deductively verify the workflow of the module;
[0052] Figure 5 This is a flow chart of the few-shot knowledge graph question answering method based on large model enhancement. DETAILED DESCRIPTION
[0053] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0054] Example 1
[0055] The large model enhanced few-sample knowledge graph question answering system proposed in this paper consists of three core modules: Figure 1 shown.
[0056] i) Enhanced Retriever Module: This module uses a generative model to score the relevance between questions and relations, efficiently retrieves a set of relations that are semantically relevant to the question from the knowledge graph, and provides high-quality relation candidates for subsequent reasoning.
[0057] ii) Context Transformation Module: This module is based on the relationship set output by the enhanced retriever, combined with the subject entities of the question and their contextual information in the knowledge graph. Through the dynamic combination of entities and relationships, it gradually constructs a multi-hop logical reasoning path, providing structured support for solving complex problems.
[0058] iii) Deductive Verification Module: This module converts the question and reasoning path into a proposition description with premises and conclusions. It uses the reasoning ability of the large model to screen and verify the reasoning path through deductive verification, and ultimately determines the optimal path that matches the semantics of the question and generates an accurate answer.
[0059] The large model-enhanced few-sample knowledge graph question answering method of the present invention is as follows:
[0060] 1. Enhanced retriever module
[0061] like Figure 2In this study, we use a generative model T5 to achieve a detailed understanding of facts, which can quickly adapt to and filter information from different knowledge graphs (KGs). Specifically, we use a prompt template X = Question:q,Fact:r to simultaneously represent the question q and the fact relation r in text form. Subsequently, this prompt template X is used as the input of the pre-trained generative model. Our learning goal is to maximize the probability that the prompt template X and the generated token t <i Under the condition that the real category k∈K={yes,no} is marked t i The likelihood probability of , its objective function is as follows:
[0062]
[0063] Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k. Using the special mark "<extra id 0> yes<extra id 1> "or"<extra id 0> no<extra id 1> ” to represent the category k, making it easier to extract the label yes or no from the generated content. In addition, we propose a training method based on the confidence advantage of the positive sample set to reduce the sensitivity of the model during the learning process. Specifically, we ensure that the probability of the positive sample set outputting yes exceeds the probability of the negative sample set outputting no.
[0064]
[0065] Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; i Indicates the similarity score of the tag t belonging to the negative sample set, s j It represents the similarity score that the label t belongs to the positive sample set.
[0066] 2. Context Transformation Module
[0067] like Figure 3 , based on the retrieved relation set R, we search for all related triples Τ in each hop, with e top1 Starting with the subject entity, we retrieve the entity using retrieve(·) to form a triplet t tri , traverse all relations r∈R and their corresponding directions d∈d plist Then, we get ξ retieved It will be used as the starting entity for the next hop iteration. retievedIf the subject entities e and r are not adjacent, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid. This mechanism ensures that semantically similar but irrelevant candidate relations are filtered out.
[0068] 3. Deductive Verification Module
[0069] Deductive reasoning is a method of reasoning that uses logical reasoning to derive necessary conclusions from known premises. Its hallmark is the determinism of the reasoning process—that is, if the premises are true, then the conclusion must be true. In the field of artificial intelligence, deductive reasoning is often used for factual deduction and logical relationship analysis. LLMs, benefiting from the powerful language understanding and knowledge transfer capabilities of large language models, are able to capture underlying logical relationships and semantic structures from massive amounts of text. This enables them to quickly utilize known knowledge for accurate deductions when faced with reasoning tasks. Furthermore, due to the limited reasoning capabilities of LLMs on graph structures, and inspired by the fact that LLMs are better at fact-based deductive reasoning, we designed a prompt template that enables LLMs to perform deductive reasoning based on the relationship paths provided during the retrieval phase.
[0070] Given an input question q and its identified subject entities E = {e1, e2, ...e n} and the relationship path P={p1,p2,…p n} to deduce the target answer a. For example, for the query question “Who plays Ken Barlow in Coronation Street”, a reasoning path for question q can be expressed as: Coronation Street->tv.tv_program.regular_cast->Danny Baldwin>……->Bradley Walsh.
[0071] Based on the input question q and reasoning path p iWe use the large model to convert the question into a declarative sentence, where the tail entity is the answer to the declarative sentence, i.e., "Ken Barlow in Coronation Street is played by Bradley Walsh.". Subsequently, we combine the reasoning path with the converted declarative sentence and further transform it into a propositional form: "Given the premise: Coronation Street->tv.tv_program.regular_cast->Danny Baldwin->...->Bradley Walsh, its conclusion is Ken Barlow in Coronation Street is played by Bradley Walsh." Finally, by designing prompt words (such as Figure 4 As shown in the figure, the large model is guided to perform deductive reasoning on the proposition to verify its correctness. Based on the correct reasoning paths screened by the large model, we take the tail entities of these paths as the final answer to the question. Figure 4 , the specific steps are as follows:
[0072] (1) Based on question q and subject entity e, the enhanced retriever module is used to determine the relation r∈R related to question q from the knowledge graph. Then, with subject entity e as the head entity, the reasoning path for reasoning is constructed according to the position of relation r in the knowledge graph: for example, CoronationStreet->tv.tv_program.regular_cast->Danny Baldwin>……->Bradley Walsh;
[0073] (2) Based on the question q, the subject entity E, and the retrieved reasoning path P, the large model is used to convert the question into a declarative sentence, where the tail entity serves as the answer to the declarative sentence, i.e., “Ken Barlow in Coronation Street is played by Bradley Walsh.”. Subsequently, we combine the reasoning path with the converted declarative sentence and further convert it into a propositional form: “Given the premise: Coronation Street->tv.tv_program.regular_cast->Danny Baldwin->...->Bradley Walsh, its conclusion is Ken Barlow in Coronation Street is played by Bradley Walsh.”
[0074] (3) Based on the question q and the constructed reasoning path P, adopt Figure 4 The prompt template shown is used as input, and deductive reasoning is performed by calling a closed-source large language model. The specific implementation process includes two key steps: first, verifying the logical consistency of the reasoning path to filter out the reasoning chain that conforms to the logical rules; then, generating the final answer based on the valid reasoning path. This method can achieve knowledge graph question answering in small sample scenarios without fine-tuning the model, significantly reducing the cost of domain adaptation.
[0075] Example 2
[0076] like Figure 5 The present invention provides a large-model-enhanced few-sample knowledge graph question-answering method, comprising: step 1: using a generative model to score the correlation between questions and relationships, and retrieving a set of relationships related to the question semantics from the knowledge graph; step 2: based on the retrieved set of relationships related to the question semantics, combined with the subject entity of the question and its contextual information in the knowledge graph, a multi-hop logical reasoning path is gradually constructed through the dynamic combination of entities and relationships; step 3: converting the question and the multi-hop logical reasoning path into a proposition description with premises and conclusions, and using the reasoning ability of the large model to screen and verify the multi-hop logical reasoning path in a deductive verification manner, determine the optimal reasoning path that matches the question semantics, and generate the final answer.
[0077] The step 1 includes: using a prompt template X to simultaneously represent the question and the fact relationship in text form; using the prompt template X as the input of the pre-trained generative model, maximizing the <i Under the condition that the real category k is labeled t i The likelihood probability, the objective function is:
[0078]
[0079] Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k.
[0080] A training method based on the confidence advantage of the positive sample set is introduced to reduce the sensitivity of the model during the learning process. The expression is:
[0081]
[0082] Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set, s is the similarity score; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; iIndicates the similarity score of label i belonging to the negative sample set, s j It represents the similarity score that the tag j belongs to the positive sample set.
[0083] The step 2 includes: based on the retrieved relationship set R, starting from the subject entity e, traversing all relations r∈R and their corresponding directions d through the function retrieve(·), and retrieving related triples; if the subject entity e is not adjacent to the relationship r, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid and filtering is performed.
[0084] The step 3 includes: given an input question q, a subject entity set E={e1, e2, ...e n} and the relationship path P={p1,p2,…p n}, convert the question into a declarative sentence, with the end entity of the path as the answer; based on the preset prompt template, call the large language model to perform deductive reasoning verification on the proposition; screen the logically consistent reasoning path, and use its end entity as the final answer to the question.
[0085] Those skilled in the art will appreciate that, in addition to implementing the system, device, and various modules provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, and the like by logically programming the method steps. Therefore, the system, device, and various modules provided by the present invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; the modules for implementing various functions can also be considered both software programs for implementing the method and structures within the hardware component.
[0086] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A small sample knowledge graph question answering method based on large model enhancement, characterized by: include: Step 1: Use a generative model to score the relevance between questions and relations, and retrieve a set of relations related to the question semantics from the knowledge graph; Step 2: Based on the retrieved set of relations related to the question semantics, combined with the question's subject entities and their contextual information in the knowledge graph, a multi-hop logical reasoning path is gradually constructed through the dynamic combination of entities and relations; Step 3: Convert the question and the multi-hop logical reasoning path into a proposition description with premises and conclusions. Utilize the reasoning ability of the large model to screen and verify the multi-hop logical reasoning path in a deductive verification manner, determine the optimal reasoning path that matches the semantics of the question, and generate the final answer.
2. The method for answering a few-sample knowledge graph based on large model enhancement according to claim 1 is characterized in that: The step 1 comprises: Use prompt template X to express both the question and the factual relationship in text form; Take the prompt template X as the input of the pre-trained generative model and maximize the <i Under the condition that the real category k is labeled t i The likelihood probability, the objective function is: Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k.
3. The method for answering a few-sample knowledge graph based on large model enhancement according to claim 2 is characterized in that: A training method based on the confidence advantage of the positive sample set is introduced to reduce the sensitivity of the model during the learning process. The expression is: Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set, s is the similarity score; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; i Indicates the similarity score of label i belonging to the negative sample set, s j It represents the similarity score that the tag j belongs to the positive sample set.
4. The method for answering a few-sample knowledge graph based on large model enhancement according to claim 1 is characterized in that: The step 2 includes: based on the retrieved relationship set R, starting from the subject entity e, traversing all relations r∈R and their corresponding directions d through the function retrieve(·), and retrieving related triples; if the subject entity e is not adjacent to the relationship r, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid and filtering is performed.
5. The method for answering a few-sample knowledge graph based on large model enhancement according to claim 1 is characterized in that: The step 3 includes: Given an input question q, a subject entity set E = {e1, e2, ...e n } and the relationship path P={p1,p2,…p n }, convert the question into a declarative sentence, where the path tail entity is the answer; Based on the preset prompt template, the large language model is called to perform deductive reasoning verification on the proposition; Filter logically consistent reasoning paths and use their tail entities as the final answers to the questions.
6. A small sample knowledge graph question answering system based on large model enhancement, characterized by: include: Enhanced Retriever Module: This module uses a generative model to score the relevance between questions and relations, and retrieves a set of relations that are semantically relevant to the question from the knowledge graph. Context transformation module: Based on the retrieved relationship set related to the question semantics, combined with the question's subject entity and its contextual information in the knowledge graph, it gradually constructs a multi-hop logical reasoning path through the dynamic combination of entities and relationships; Deductive Verification Module: This module converts the problem and multi-hop logical reasoning path into a proposition description with premises and conclusions. Utilizing the reasoning capability of the large model, it screens and verifies the multi-hop logical reasoning path in a deductive verification manner, determines the optimal reasoning path that matches the semantics of the problem, and generates the final answer.
7. The large model-enhanced few-sample knowledge graph question answering system according to claim 1 is characterized in that: The enhanced retriever module includes: Use prompt template X to express both the question and the factual relationship in text form; Take the prompt template X as the input of the pre-trained generative model and maximize the <i Under the condition that the real category k is labeled t i The likelihood probability, the objective function is: Among them, P(t i |t <i ,X) represents the log-likelihood probability of the i-th label in the true category k.
8. The large model-enhanced few-sample knowledge graph question answering system according to claim 7, characterized in that: A training method based on the confidence advantage of the positive sample set is introduced to reduce the sensitivity of the model during the learning process. The expression is: Among them, λ is the marginal value, Ω neg represents the negative sample set, Ω pos represents the positive sample set, s is the similarity score; l con represents the contrast loss, which is used to measure the relative similarity difference between positive and negative sample pairs; i Indicates the similarity score of label i belonging to the negative sample set, s j It represents the similarity score that the tag j belongs to the positive sample set.
9. The large model-enhanced few-sample knowledge graph question answering system according to claim 6, characterized in that: The context conversion module includes: based on the retrieved relationship set R, starting from the subject entity e, traversing all relations r∈R and their corresponding directions d through the function retrieve(·) to retrieve related triples; if the subject entity e is not adjacent to the relationship r, then retrieve(e,r,d)=φ, indicating that the entity retrieval is invalid and filtering is performed.
10. The large model-enhanced few-sample knowledge graph question answering system according to claim 6, characterized in that: The deductive verification module includes: Given an input question q, a subject entity set E = {e1, e2, ...e n } and the relationship path P={p1,p2,…p n }, convert the question into a declarative sentence, where the path tail entity is the answer; Based on the preset prompt template, the large language model is called to perform deductive reasoning verification on the proposition; Filter logically consistent reasoning paths and use their tail entities as the final answers to the questions.
Citation Information
Patent Citations
Knowledge graph-based large model answer accuracy enhancement method and system
CN119271784A