Question and answer method based on large language model and improved knowledge graph

By improving the combination of knowledge graphs and large language models, the accuracy problem of intelligent question answering systems in handling fuzzy expressions and professional terms has been solved, and the logical coherence and timeliness of knowledge in multi-hop question answering have been improved, making it particularly suitable for real-time question answering in the medical and legal fields.

CN121561111APending Publication Date: 2026-02-24ZHONGBEI UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511812115.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing intelligent question answering systems suffer from low accuracy in entity recognition and relationship matching when dealing with ambiguous expressions, ambiguous sentence structures, and domain-specific terminology. Furthermore, knowledge graphs struggle to carry multi-dimensional related information and make dynamic adjustments, resulting in low efficiency in multi-hop question answering.

Method used

By combining improved knowledge graphs and large language models, and through entity recognition, dynamic retrieval, a reinforcement learning-driven retrieval planner, and a fact verification module, a super-relational quadruple knowledge graph is constructed. Noise removal and relevance ranking are performed, and structured prompt text is used to enhance the generation mechanism. Double verification is also performed to ensure the accuracy and timeliness of the answers.

Benefits of technology

It improves the logical coherence and accuracy of multi-hop question answering, reduces the factual error rate, and enhances the speed of knowledge updates and model reasoning efficiency, making it particularly suitable for real-time question answering needs in the medical and legal fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121561111A_ABST
    Figure CN121561111A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language data processing, in particular to a question and answer method based on a large language model and an improved knowledge graph. The method comprises the following steps: 1, acquiring a natural language question input by a user, and preprocessing the natural language question to obtain a standardized question; 2, processing the standardized question based on an entity recognition module of an improved knowledge graph, positioning a core entity and a field to which the core entity belongs, and generating an entity-field associated pair; according to the question and answer method based on the large language model and the improved knowledge graph, structured fact support is provided by improving the knowledge graph, dual verification of an initial question and answer result is achieved in combination with a fact verification module, authoritative data in the knowledge graph is matched firstly, then an external authoritative data source is linked for supplementary verification, and fact consistency of output answers is ensured; compared with a pure large language model question-answering scheme, the method has the advantages that the fact error rate is greatly reduced, and the method is particularly suitable for the fields such as medical treatment and law which have strict requirements on fact accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language data processing technology, specifically to a question-answering method based on large language models and improved knowledge graphs. Background Technology

[0002] With the rapid development of natural language processing technology, intelligent question answering systems have been widely used in many fields such as financial consulting, medical assistance, and government services, becoming the core carrier of human-computer interaction. Currently, intelligent question answering technology is mainly divided into two technical paths: one is generative question answering based on large language models (LLM), and the other is structured question answering based on knowledge graphs. Both technical paths have inherent defects that are difficult to avoid, which restrict the performance improvement of question answering systems.

[0003] Generative question answering based on large language models, with its powerful natural language understanding and context modeling capabilities, can generate fluent answers that conform to human expression habits. However, its core reliance on massive parameterized knowledge learned in the pre-training stage presents three significant problems: First, the phenomenon of knowledge "illusion" is prominent, and the model may generate content that does not conform to the facts, especially in professional domain question answering, where this problem may lead to serious consequences; Second, the timeliness of knowledge is poor, as the model's knowledge boundary is limited by the time range of the pre-training data and cannot be updated in a timely manner with newly emerging entities, relationships, and dynamic domain information; Third, the reasoning process is uncontrollable, and for complex problems such as multi-hop reasoning and conditional constraints, the model struggles to guarantee the coherence and accuracy of reasoning logic. In contrast, structured question answering based on knowledge graphs organizes knowledge in the form of "entity-relationship-attribute" triples, possessing the advantages of clear knowledge expression and accurate fact retrieval, and can effectively avoid the problem of knowledge "illusion".

[0004] However, traditional knowledge graphs also have significant shortcomings in question-answering applications: on the one hand, their semantic parsing capabilities are weak, making it difficult to accurately understand vague expressions, ambiguous sentence structures, and domain-specific terms in user questions, resulting in low accuracy in entity recognition and relationship matching; on the other hand, their knowledge structures are rigid, and traditional triples are unable to carry multi-dimensional relational information between entities, such as time constraints and attribute conditions, and the retrieval process lacks dynamic adjustment capabilities, easily leading to over- or under-retrieval of information, especially in multi-hop question-answering scenarios, where it is difficult to efficiently locate complete reasoning paths. To address these issues, we propose a question-answering method based on a large language model and an improved knowledge graph. Summary of the Invention

[0005] The purpose of this invention is to provide a question-answering method based on a large language model and an improved knowledge graph, to solve the problem mentioned in the background art of difficulty in accurately understanding ambiguous expressions, ambiguities, and domain-specific terminology in user questions, leading to low accuracy in entity recognition and relation matching. To achieve the above objective, this invention provides the following technical solution, wherein the method includes: Step 1: Obtain the natural language question input by the user, preprocess the natural language question to obtain a standardized question; Step 2: The entity recognition module based on the improved knowledge graph processes the standardized question, locates the core entity and its domain, and generates entity-domain association pairs; Step 3: Based on the entity-domain association pairs, obtain the basic association knowledge of core entities from the improved knowledge graph through a dynamic retrieval engine, and expand the scope of association knowledge based on a reinforcement learning-driven retrieval planner to form a candidate knowledge set; Step 4: The candidate knowledge set is subjected to noise removal and relevance ranking through the knowledge filtering module to obtain the core knowledge subset; Step 5: Transform the core knowledge subset into structured prompt text, which includes entity attributes, relationships, and domain constraint information, and is arranged in descending order of relevance to the standardized question. Step Six: Input the standardized question and structured prompt text into the pre-trained large language model to trigger the model's knowledge enhancement generation mechanism and obtain the initial question-answering results; Step 7: Verify the authenticity of the initial question-and-answer results through the fact verification module. The fact verification module queries the improved knowledge graph and authoritative data sources to compare the consistency between the verification results and the initial question-and-answer results. Step 8: If the verification result is consistent with the initial question and answer result, the initial question and answer result is output. If they are inconsistent, the verification difference information is fed back to the dynamic retrieval engine, and steps S3-S7 are re-executed until the final question and answer result that conforms to the facts is obtained and output. Preferably, the construction process of the improved knowledge graph includes: collecting multi-source domain data, including structured databases, unstructured text, and semi-structured tables; extracting entity information from the data using an entity extraction model, identifying relationships between entities using a relation extraction model, and constructing basic triples; expanding the triples into super-relation quadruples based on domain requirements, wherein the super-relation quadruples contain subject entities, object entities, relation types, and attribute constraint information; and performing deduplication, conflict resolution, and quality assessment on the constructed super-relation set to form the final improved knowledge graph.

[0006] Preferably, the process of generating the entity-domain association pair includes: the entity recognition module first improves the entity dictionary of the knowledge graph by matching the word segmentation results to obtain a set of candidate entities; then, by combining the domain feature words in the question with the domain classification system of the knowledge graph, the domain to which each candidate entity belongs is determined; finally, the confidence score of the candidate entity is calculated, and the entity with the highest score is selected as the core entity, forming an entity-domain association pair with the corresponding domain.

[0007] Preferably, the reinforcement learning-driven retrieval planner includes a state module, an action module, and a reward module. The state module uses the matching degree between the currently retrieved knowledge set and the question as its state feature. The action module includes three actions: knowledge expansion, retrieval termination, and scope adjustment. The reward module uses information gain, retrieval efficiency, and redundancy as reward indicators to dynamically adjust the retrieval strategy.

[0008] Preferably, the training process of the self-supervised training relevance scorer includes: constructing a simulated question-knowledge pair dataset using entity-relation pairs in the improved knowledge graph as samples; training the scorer using a contrastive learning method so that the scores of relevant knowledge samples and questions are higher than those of irrelevant samples; optimizing the scorer parameters through gradient descent until the classification accuracy of the model on the validation set reaches a preset threshold.

[0009] Preferably, the method for constructing the structured prompt text includes extracting entity attribute fields, relationship types, and domain constraint tags from a subset of core knowledge; organizing the text according to a hierarchical structure of "entity-relationship-attribute-constraint"; and adding semantic tags to the content at each level, wherein the semantic tags include entity tags. <ent>Relationship markers <rel>Attribute tags <att>and constraint marks <con>The cosine similarity algorithm is used to calculate the relevance between each level of content and the standardized question, and the content is arranged in descending order of relevance to form the final structured prompt text.

[0010] Preferably, the domain knowledge fine-tuning process of the large language model includes: extracting core domain knowledge from the improved knowledge graph and constructing a domain fine-tuning dataset; using an incremental fine-tuning method to freeze the underlying parameters of the large language model and only update the parameters of the top attention layer and output layer; and controlling the fine-tuning process through a learning rate decay strategy to avoid model overfitting.

[0011] Preferably, the verification process of the fact verification module includes: extracting factual assertions from the initial question-and-answer results and breaking them down into triples to be verified; matching the triples to be verified with the corresponding triples in the improved knowledge graph and calculating semantic similarity; if the similarity is greater than a first threshold, it is determined to be true; if the similarity is less than a second threshold, it is determined to be false; if it is between the two thresholds, it is further queried from an authoritative data source to complete the verification, wherein the first threshold is greater than the second threshold.

[0012] Preferably, the improved knowledge graph update mechanism includes periodically collecting new domain data and update information of existing entities, updating entities and relationships through an incremental extraction model, and using a knowledge fusion algorithm to resolve the conflict between new and old knowledge. The knowledge fusion algorithm combines entity attribute similarity and relationship consistency for dual judgment. After the update is completed, the entity dictionary and domain tag library of the entity recognition module are updated synchronously to ensure the timeliness of knowledge in the question answering method.

[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: In this invention, structured factual support is provided by improving the knowledge graph, and a fact verification module is used to achieve dual verification of the initial question-and-answer results. First, authoritative data in the knowledge graph is matched, and then external authoritative data sources are linked to supplement the verification to ensure the factual consistency of the output answer. Experimental data show that compared with the pure large language model question-and-answer scheme, the factual error rate of this method is significantly reduced, and it is especially suitable for fields such as medicine and law where the accuracy of facts is strictly required.

[0014] In this invention, a hyper-relationship knowledge graph is used to store multi-dimensional association information between entities. Combined with a reinforcement learning-driven retrieval planner, it can accurately locate the association knowledge required for multi-hop reasoning. At the same time, through hierarchical and structured prompts of "entity-relationship-attribute-constraint", it provides clear reasoning path guidance for large language models, improving the logical coherence of multi-hop question answering by 45% and improving the EM score on multi-hop question answering datasets such as HotpotQA by 8.3% compared with existing fusion solutions.

[0015] This invention designs an improved incremental update mechanism for knowledge graphs. By periodically collecting data from new domains, incrementally extracting entity relationships, and using conflict resolution algorithms, the timeliness of the knowledge graph is ensured. At the same time, the dictionary and tag library of the entity recognition module are updated synchronously, enabling the system to quickly adapt to newly emerging entities and concepts. Compared with traditional fixed knowledge graph solutions, the knowledge update response speed is improved to the hour level, meeting the real-time requirements of hot topic question answering, etc.

[0016] In this invention, a self-supervised training relevance scorer and a dual-module optimization mechanism are used to achieve accurate screening and denoising of candidate knowledge. Core knowledge is input into the large language model in the form of structured prompts, which reduces the interference of redundant information on model generation. At the same time, an incremental fine-tuning method is used to adapt domain knowledge. Performance improvement can be achieved by updating only the top-level parameters of the model. Compared with the full fine-tuning scheme, the training cost is reduced by 70%, and the model inference speed is improved by more than 20%. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the process structure of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1 This invention provides a technical solution: a question-answering method based on a large language model and an improved knowledge graph, the method comprising: Step 1: Obtain the natural language question input by the user, preprocess the natural language question to obtain a standardized question; Step 2: The entity recognition module based on the improved knowledge graph processes the standardized question, locates the core entity and its domain, and generates entity-domain association pairs; Step 3: Based on the entity-domain association pairs, obtain the basic association knowledge of core entities from the improved knowledge graph through a dynamic retrieval engine, and expand the scope of association knowledge based on a reinforcement learning-driven retrieval planner to form a candidate knowledge set; Step 4: The candidate knowledge set is subjected to noise removal and relevance ranking through the knowledge filtering module to obtain the core knowledge subset; Step 5: Transform the core knowledge subset into structured prompt text, which includes entity attributes, relationships, and domain constraint information, and is arranged in descending order of relevance to the standardized question. Step Six: Input the standardized question and structured prompt text into the pre-trained large language model to trigger the model's knowledge enhancement generation mechanism and obtain the initial question-answering results; Step 7: Verify the authenticity of the initial question-and-answer results through the fact verification module. The fact verification module queries the improved knowledge graph and authoritative data sources to compare the consistency between the verification results and the initial question-and-answer results. Step 8: If the verification result is consistent with the initial question and answer result, the initial question and answer result is output. If they are inconsistent, the verification difference information is fed back to the dynamic retrieval engine, and steps S3-S7 are re-executed until the final question and answer result that conforms to the facts is obtained and output. In step one: the construction process of the improved knowledge graph includes collecting multi-source domain data, including structured databases, unstructured text, and semi-structured tables; extracting entity information from the data using an entity extraction model, identifying relationships between entities using a relation extraction model, and constructing basic triples; expanding the triples into super-relation quadruples based on domain requirements, wherein the super-relation quadruples contain subject entities, object entities, relation types, and attribute constraint information; and performing deduplication, conflict resolution, and quality assessment on the constructed super-relation set to form the final improved knowledge graph.

[0020] In step two: the generation process of the entity-domain association pair includes the following steps: the entity recognition module first improves the entity dictionary of the knowledge graph by matching the word segmentation results to obtain a set of candidate entities; then, by combining the domain feature words in the question with the domain classification system of the knowledge graph, the domain to which each candidate entity belongs is determined; finally, the confidence score of the candidate entity is calculated, and the entity with the highest score is selected as the core entity, forming an entity-domain association pair with the corresponding domain.

[0021] In step three: the reinforcement learning-driven retrieval planner includes a state module, an action module, and a reward module. The state module uses the matching degree between the currently retrieved knowledge set and the question as its state feature. The action module includes three actions: knowledge expansion, retrieval termination, and scope adjustment. The reward module uses information gain, retrieval efficiency, and redundancy as reward indicators to dynamically adjust the retrieval strategy.

[0022] In step four: the training process of the self-supervised training relevance scorer includes: constructing a simulated question-knowledge pair dataset using entity-relation pairs in the improved knowledge graph as samples; training the scorer using a contrastive learning method so that the scores of relevant knowledge samples and questions are higher than those of irrelevant samples; optimizing the scorer parameters through gradient descent until the classification accuracy of the model on the validation set reaches a preset threshold.

[0023] In step five: the method for constructing the structured prompt text includes extracting entity attribute fields, relationship types, and domain constraint tags from the core knowledge subset; organizing the text according to a hierarchical structure of "entity-relationship-attribute-constraint"; and adding semantic tags to the content at each level, the semantic tags including entity tags. <ent>Relationship markers <rel>Attribute tags <att>and constraint marks <con>The cosine similarity algorithm is used to calculate the relevance between each level of content and the standardized question, and the content is arranged in descending order of relevance to form the final structured prompt text.

[0024] In step six: the domain knowledge fine-tuning process of the large language model includes extracting core domain knowledge from the improved knowledge graph and constructing a domain fine-tuning dataset; using an incremental fine-tuning method, freezing the underlying parameters of the large language model, updating only the top attention layer and output layer parameters, and controlling the fine-tuning process through a learning rate decay strategy to avoid model overfitting.

[0025] In step seven: the verification process of the fact verification module includes: extracting factual assertions from the initial question-and-answer results and breaking them down into triples to be verified; matching the triples to be verified with the corresponding triples in the improved knowledge graph and calculating semantic similarity; if the similarity is greater than a first threshold, it is determined to be true; if the similarity is less than a second threshold, it is determined to be false; if it is between the two thresholds, it is further queried from an authoritative data source to complete the verification, where the first threshold is greater than the second threshold.

[0026] In step eight: the improved knowledge graph update mechanism includes periodically collecting new domain data and existing entity update information, updating entities and relationships through an incremental extraction model, and using a knowledge fusion algorithm to resolve conflicts between new and old knowledge. The knowledge fusion algorithm combines entity attribute similarity and relationship consistency for dual judgment. After the update is completed, the entity dictionary and domain tag library of the entity recognition module are updated synchronously to ensure the timeliness of knowledge in the question answering method.

[0027] The method of use and advantages of this invention: The question-answering method based on a large language model and an improved knowledge graph works as follows: The construction process of the improved knowledge graph includes collecting multi-source domain data, including structured databases, unstructured text, and semi-structured tables; extracting entity information from the data using an entity extraction model, identifying relationships between entities using a relation extraction model, and constructing basic triples; expanding the triples into super-relation quadruples based on domain requirements, the super-relation quadruples containing subject entity, object entity, relation type, and attribute constraint information; deduplicating, resolving conflicts, and evaluating the quality of the constructed super-relation set to form the final improved knowledge graph. The generation process of entity-domain association pairs includes: the entity recognition module first matching the entity dictionary of the improved knowledge graph with the word segmentation results to obtain a candidate entity set; then, combining the domain feature words in the question with the domain classification system of the knowledge graph to determine the domain to which each candidate entity belongs; finally, calculating the confidence score of the candidate entities, selecting the entity with the highest score as the core entity, and pairing it with the domain association pair. The entity-domain association pairs are composed of domain-specific entities. The reinforcement learning-driven retrieval planner includes a state module, an action module, and a reward module. The state module uses the matching degree between the currently retrieved knowledge set and the question as its state feature. The action module includes three actions: knowledge expansion, retrieval termination, and scope adjustment. The reward module uses information gain, retrieval efficiency, and redundancy as reward indicators to dynamically adjust the retrieval strategy. The training process of the self-supervised training relevance scorer includes: constructing a simulated question-knowledge pair dataset using entity-relation pairs in the improved knowledge graph as samples; training the scorer using a contrastive learning method to make the score of relevant knowledge samples higher than that of irrelevant samples; optimizing the scorer parameters through gradient descent until the model's classification accuracy on the validation set reaches a preset threshold. The method for constructing the structured prompt text includes: extracting entity attribute fields, association types, and domain constraint labels from the core knowledge subset; organizing the text according to a hierarchical structure of "entity-relationship-attribute-constraint"; and adding semantic tags to the content at each level, including entity tags. <ent>Relationship markers <rel>Attribute tags <att>and constraint marks <con>The relevance of each level of content to the standardized question is calculated using the cosine similarity algorithm, and the results are sorted in descending order of relevance to form the final structured prompt text. The domain knowledge fine-tuning process of the large language model includes: extracting core domain knowledge from the improved knowledge graph to construct a domain fine-tuning dataset; using incremental fine-tuning, freezing the underlying parameters of the large language model, and only updating the parameters of the top attention layer and output layer; controlling the fine-tuning process through a learning rate decay strategy to avoid model overfitting. The verification process of the fact verification module includes: extracting factual assertions from the initial question-answering results and decomposing them into triples to be verified; matching the triples to be verified with corresponding triples in the improved knowledge graph. The process involves calculating semantic similarity; if the similarity is greater than a first threshold, it is determined to be real; if the similarity is less than a second threshold, it is determined to be fake; if it is between the two thresholds, further verification is performed by querying authoritative data sources. The first threshold is greater than the second threshold. The improved knowledge graph update mechanism includes periodically collecting new domain data and update information of existing entities, updating entities and relationships through an incremental extraction model, and using a knowledge fusion algorithm to resolve the conflict between new and old knowledge. The knowledge fusion algorithm combines entity attribute similarity and relationship consistency for dual judgment. After the update is completed, the entity dictionary and domain tag library of the entity recognition module are updated synchronously to ensure the timeliness of knowledge in the question answering method.

[0028] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.< / con> < / att> < / rel> < / ent> < / con> < / att> < / rel> < / ent> < / con> < / att> < / rel> < / ent>

Claims

1. A question-answering method based on a large language model and an improved knowledge graph, characterized in that, Its features are: The method includes; Step 1: Obtain the natural language question input by the user, preprocess the natural language question to obtain a standardized question; Step 2: The entity recognition module based on the improved knowledge graph processes the standardized question, locates the core entity and its domain, and generates entity-domain association pairs; Step 3: Based on the entity-domain association pairs, obtain the basic association knowledge of core entities from the improved knowledge graph through a dynamic retrieval engine, and expand the scope of association knowledge based on a reinforcement learning-driven retrieval planner to form a candidate knowledge set; Step 4: The candidate knowledge set is subjected to noise removal and relevance ranking through the knowledge filtering module to obtain the core knowledge subset; Step 5: Transform the core knowledge subset into structured prompt text, which includes entity attributes, relationships, and domain constraint information, and is arranged in descending order of relevance to the standardized question. Step Six: Input the standardized question and structured prompt text into the pre-trained large language model to trigger the model's knowledge enhancement generation mechanism and obtain the initial question-answering results; Step 7: Verify the authenticity of the initial question-and-answer results through the fact verification module. The fact verification module queries the improved knowledge graph and authoritative data sources to compare the consistency between the verification results and the initial question-and-answer results. Step 8: If the verification result is consistent with the initial question and answer result, the initial question and answer result is output. If they are inconsistent, the verification difference information is fed back to the dynamic retrieval engine, and steps S3-S7 are re-executed until the final question and answer result that conforms to the facts is obtained and output. In step one: the construction process of the improved knowledge graph includes collecting multi-source domain data, which includes structured databases, unstructured text and semi-structured tables; Entity extraction models are used to extract entity information from the data, and relation extraction models are used to identify the relationships between entities to construct basic triples. Based on domain requirements, the triples are extended into super-relation quadruples, which contain subject entities, object entities, relation types, and attribute constraint information. The constructed super-relation set is deduplicated, conflict-resolved, and quality-evaluated to form the final improved knowledge graph.

2. The question-answering method based on a large language model and improved knowledge graph according to claim 1, characterized in that: Step 2: The process of generating the entity-domain association pair includes the entity recognition module first matching the improved entity dictionary of the knowledge graph with the word segmentation results to obtain a candidate entity set; By combining the domain feature words in the question with the domain classification system of the knowledge graph, the domain to which each candidate entity belongs is determined. Finally, the confidence score of the candidate entity is calculated, and the entity with the highest score is selected as the core entity, forming an entity-domain association pair with the corresponding domain.

3. The question-answering method based on a large language model and improved knowledge graph according to claim 2, characterized in that: Step 3: The reinforcement learning-driven retrieval planner includes a state module, an action module, and a reward module. The state module uses the matching degree between the currently retrieved knowledge set and the question as its state feature. The action module includes three actions: knowledge expansion, retrieval termination, and scope adjustment. The reward module uses information gain, retrieval efficiency, and redundancy as reward indicators to dynamically adjust the retrieval strategy.

4. The question-answering method based on a large language model and improved knowledge graph according to claim 3, characterized in that: Step 4: The training process of the self-supervised training relevance scorer includes: constructing a simulated question-knowledge pair dataset using entity-relation pairs in the improved knowledge graph as samples; training the scorer using a contrastive learning method so that the scores of relevant knowledge samples and questions are higher than those of irrelevant samples; optimizing the scorer parameters through gradient descent until the classification accuracy of the model on the validation set reaches a preset threshold.

5. The question-answering method based on a large language model and improved knowledge graph according to claim 4, characterized in that: Step 5: The method for constructing the structured prompt text includes extracting entity attribute fields, relationship types, and domain constraint tags from the core knowledge subset; organizing the text according to a hierarchical structure of "entity-relationship-attribute-constraint"; and adding semantic tags to the content at each level, including entity tags. <ent>Relationship markers <rel>Attribute tags <att>and constraint marks <con> The cosine similarity algorithm is used to calculate the relevance between each level of content and the standardized question, and the content is arranged in descending order of relevance to form the final structured prompt text.< / con> < / att> < / rel> < / ent> 6. The question-answering method based on a large language model and improved knowledge graph according to claim 5, characterized in that: Step 6: The domain knowledge fine-tuning process of the large language model includes extracting core domain knowledge from the improved knowledge graph and constructing a domain fine-tuning dataset; An incremental fine-tuning approach is adopted, freezing the underlying parameters of the large language model and updating only the parameters of the top attention layer and output layer. The fine-tuning process is controlled by a learning rate decay strategy to avoid model overfitting.

7. The question-answering method based on a large language model and improved knowledge graph according to claim 6, characterized in that: Step 7: The verification process of the fact verification module includes extracting factual assertions from the initial question-and-answer results and breaking them down into triples to be verified; The triple to be verified is matched with the corresponding triple in the improved knowledge graph, and the semantic similarity is calculated. If the similarity is greater than the first threshold, it is determined to be real. If the similarity is less than the second threshold, it is determined to be fake. If it is between the two thresholds, an authoritative data source is queried to complete the verification. The first threshold is greater than the second threshold.

8. The question-answering method based on a large language model and improved knowledge graph according to claim 7, characterized in that: Step 8: The improved knowledge graph update mechanism includes periodically collecting new domain data and existing entity update information, updating entities and relationships through an incremental extraction model, and using a knowledge fusion algorithm to solve the conflict between new and old knowledge. The knowledge fusion algorithm combines entity attribute similarity and relationship consistency for dual judgment. After the update is completed, the entity dictionary and domain tag library of the entity recognition module will be updated synchronously to ensure the timeliness of the knowledge of the question answering method.

Citation Information

Cited By

  • Intelligent legal consultation question and answer method based on knowledge graph

    CN122154951A

  • Medical large model reinforcement learning alignment method based on knowledge graph fact consistency

    CN122174911A