Knowledge graph question and answer method and system based on large language model

By combining large language models and knowledge graphs, the limitations of intelligent question-answer systems in dealing with complex and variable questions are solved, and a more accurate, flexible and cross-domain adaptability is achieved.

CN119829720APending Publication Date: 2025-04-15SUZHOU CANCRIEAS AVIAVTION TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411946618.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Existing intelligent question-and-answer systems have limitations in dealing with complex, variable questions, especially in scenarios where cross-domain reasoning and background knowledge support are difficult to provide accurate and flexible answers.

Method used

An innovative solution combining large language model with knowledge graph is adopted, by building a large language model framework and performing LoRA fine-tuning, combining knowledge graph database and vector library, the fine-tuning of large language model and answer generation is achieved.

Benefits of technology

It significantly improves the accuracy, flexibility and reasoning capabilities of the system, can handle complex and changeable problems, provide more accurate and traceable answers, and has stronger cross-domain adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829720A_ABST
    Figure CN119829720A_ABST
Patent Text Reader

Abstract

The invention relates to a knowledge graph question-answering method and system based on a large language model. The method comprises the following steps: constructing a large language model framework and finely adjusting training data; finely adjusting the large language model based on LoRA; sub-graph retrieval and knowledge graph database construction; and large language model reasoning and answer generation. By using an innovative scheme of combining the large language model and the knowledge graph, the accuracy, flexibility and reasoning ability of the system can be remarkably improved by combining the strong semantic understanding ability of the large language model and the structured knowledge of the knowledge graph, the limitation of the intelligent question-answering system in processing complex and changeable problems is solved, and the intelligent question-answering system is more intelligent. Especially in scenes needing cross-domain reasoning and background knowledge support, the method can adapt to wider fields and application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a knowledge graph question-answering method and system based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence (AI) and natural language processing (NLP) technologies, intelligent question answering (QA) systems have become a core tool for obtaining information and solving problems. Intelligent question answering systems are widely used in daily life and various professional fields, such as medicine, law, finance, and education, by accurately understanding the questions input by users and interacting effectively. These systems help users quickly obtain the answers they need by improving the efficiency and accuracy of information processing.

[0003] The core task of intelligent question answering system: The core task of intelligent question answering system is to understand the semantic structure of user questions and generate appropriate answers. As the complexity of system processing tasks increases, especially in situations involving deep semantic understanding and multi-level reasoning, how to improve the performance of the system has become a research focus.

[0004] Technical features: The intelligent question-answering system has the ability to conduct multiple rounds of dialogues, understand the context and make precise adjustments in multiple rounds of dialogues, provide personalized and flexible services, and thus enhance the user experience. The system also uses pre-trained models such as BERT and GPT, which are highly efficient in understanding complex semantics and generating reasonable answers, and can quickly adapt to new tasks, reduce training time and data requirements, and improve generalization capabilities. In addition, the knowledge graph represents information in a structured form in the form of triples (entity-relationship-entity), which enhances the system's ability to understand and reason about complex domain knowledge.

[0005] Advantages of knowledge graphs: Knowledge graphs represent the relationships between entities in the form of triples (entity-relationship-entity), provide clear semantic relationship chains, and help systems better understand and process complex knowledge. Knowledge graphs can efficiently extract and integrate knowledge from different fields, provide more comprehensive and accurate knowledge representation, and help systems better handle cross-domain complex problems. Knowledge graphs use technologies such as graph databases to provide efficient query and reasoning mechanisms to help systems quickly find relevant information and answers. Knowledge graphs reduce the search and analysis burden on large-scale data sets by indexing and optimizing query paths, helping systems respond to user queries faster. Knowledge graphs support high-level reasoning processes through predefined relationship networks and known knowledge, provide effective reasoning support, and help systems better handle complex knowledge. Knowledge graphs support multi-level information integration, comprehensively consider various relevant factors, provide more comprehensive and accurate knowledge representation, and help systems better handle complex knowledge. Knowledge graphs flexibly represent cross-domain information, whether structured data or semi-structured data, can be effectively integrated, provide flexible knowledge representation, and help systems better handle cross-domain complex knowledge. Summary of the invention

[0006] The purpose of the present invention is to overcome the problems existing in the prior art and provide a knowledge graph question answering method and system based on a large language model. The innovative solution of combining a large language model with a knowledge graph can significantly improve the accuracy, flexibility and reasoning ability of the system by combining the powerful semantic understanding ability of the large language model and the structured knowledge of the knowledge graph, and solve the limitations of the intelligent question answering system in dealing with complex and changeable problems, especially in scenarios that require cross-domain reasoning and background knowledge support.

[0007] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:

[0008] A knowledge graph question answering method based on a large language model, the method comprising the following steps:

[0009] Step S1: Build a large language model framework and fine-tune the training data;

[0010] Step S2: fine-tune the large language model based on LoRA;

[0011] Step S3: subgraph retrieval and knowledge graph database construction;

[0012] Step S4: Large language model reasoning and answer generation.

[0013] Furthermore, the step S1 specifically consists of the following steps:

[0014] Step S1.1: BERT model construction and training: including data preprocessing, model architecture design, parameter adjustment and training process;

[0015] Step S1.2: Question set and answer set construction: Obtain triple data in the domain knowledge graph, use the self-trained BERT model in step S1.1 to generate single-hop question sets and multi-hop question sets in the graph, and annotate their corresponding answers in the dataset;

[0016] Step S1.3: Prompt sentence construction: Annotate the entities and their relationships in the knowledge graph and convert them into instance data suitable for model training.

[0017] Furthermore, the step S2 specifically consists of the following steps:

[0018] Step S2.1: Adopt LoRA fine-tuning mechanism: LoRA represents the weight change of fine-tuning through low-rank matrix, and only saves the low-rank matrix part during the fine-tuning process;

[0019] Step S2.2: Fine-tuning process: After loading the preprocessed training data, the Llama3.1 model is fine-tuned using the LoRA method, and the best model weights are saved after each training iteration.

[0020] Furthermore, the step S3 specifically consists of the following steps:

[0021] Step S3.1: Knowledge graph database and vector library construction:

[0022] Knowledge graph database construction: First, collect and integrate data from multiple sources. Second, perform data cleaning and preprocessing to remove duplicates, errors, and inconsistent data. Next, use named entity recognition (NER) tools to identify entities in the data and link the identified entities to the corresponding entities in the knowledge graph to establish relationships between entities. At the same time, extract the relationships between entities from the text. Finally, store the constructed knowledge graph in a high-performance database.

[0023] Vector library construction: First, data preprocessing is performed. Then, feature extraction technology is used to convert text into vector representation. Then, the generated vectors are stored in the database and indexed to improve query efficiency. Finally, the constructed vector library is used for various applications.

[0024] Step S3.2: Multi-model integration: Use the multi-model integration method to train multiple different models, and use the diversity and robustness of the models to achieve the fusion and optimization of the prediction results, including:

[0025] Model training: Select multiple different models, including models based on graph neural networks (GNNs), recurrent neural networks (RNNs), and Transformers, and train them using different datasets and parameter settings to achieve model diversity and robustness;

[0026] Model fusion: Use corresponding fusion and voting strategies to fuse and optimize the prediction results to achieve comprehensiveness and robustness of the prediction results;

[0027] Performance evaluation: Use multiple indicators to evaluate the performance of the model and select the model or fusion strategy with the best performance to achieve model optimization and selection.

[0028] Furthermore, the step S4 specifically consists of the following steps:

[0029] Step S4.1: Question parsing: When the user enters a question, the subgraph information provided in step S3 is first used to generate a question-answering prompt suitable for processing by a large language model to help the model understand the background and context of the question;

[0030] Step S4.2: Generate answer: The parsed question and subgraph information are input into the large language model fine-tuned by LoRA. The model will perform reasoning analysis based on the provided knowledge graph data to generate the final answer.

[0031] A knowledge graph question answering system based on a large language model, the system comprising:

[0032] Building module: This module is responsible for generating the training data required for fine-tuning the large language model, including question sets, answer sets, and prompt sentences. By extracting triple data from the knowledge graph, the building module converts the triples into actual question-answer forms and constructs relevant prompt sentences to provide high-quality input data for fine-tuning the model.

[0033] Fine-tuning module: This module uses LoRA technology to fine-tune the large language model and adjusts the parameters of the pre-trained model through a low-rank matrix to reduce computational overhead while maintaining the model's semantic understanding ability;

[0034] Providing module: This module provides structured knowledge graph information for the large language model through subgraph retrieval strategy. When a user asks a question, the system first obtains the knowledge graph nodes and their relationships related to the question through subgraph retrieval. These subgraphs will become reference materials in the reasoning process of the large language model, ensuring that the model can obtain support from the graph and generate accurate answers.

[0035] Generation module: Based on the fine-tuned large language model, this module is responsible for generating the final question answer. When a user asks a question, after being processed by the aforementioned modules, the generation module will combine the question text with the knowledge graph subgraph information and use the large language model to generate the answer to the question.

[0036] The beneficial effects of the present invention are:

[0037] A more accurate and traceable answer:

[0038] The present invention constructs knowledge graph data and questions together as model prompt statements to ensure that the generated answers are more accurate and traceable. Users can trace the source of the answers and understand the logic and basis behind the answers, which increases the transparency and credibility of the system.

[0039] Stronger problem generalization ability:

[0040] The present invention has stronger generalization ability than the traditional knowledge graph question and answer method. In terms of question understanding, the large language model has stronger semantic understanding ability than the traditional graph question and answer system, and can handle more colloquial and natural questions to meet the complex questions in users' daily lives. In terms of the types of questions that can be answered, the system breaks through the limitations of the graph structure and supports users to ask questions about all nodes, relationships and attributes in the knowledge graph, greatly improving the scope of application and flexibility of the system.

[0041] Stronger reasoning and statistical analysis capabilities:

[0042] Compared with traditional graph question-answering systems, the present invention has stronger reasoning and statistical analysis capabilities. Traditional systems can usually only handle simple single-hop or multi-hop questions and answers, while the large language model of the present invention can perform multi-level reasoning, inference across entity relationship chains, and even support complex reasoning tasks such as statistical analysis. This enhanced reasoning capability enables the system to handle more complex queries and help users get accurate answers that conform to contextual logic.

[0043] Cross-domain adaptability:

[0044] Through LoRA fine-tuning, the present invention can quickly adapt to knowledge graphs in different fields, thereby possessing strong generalization capabilities. The system can achieve accurate question and answer in multiple fields or tasks and adapt to a wide range of application scenarios. This cross-domain adaptability enables the system to efficiently generate relevant answers when facing tasks in different fields, thereby meeting the needs of diverse application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flowchart of the overall steps of the present invention;

[0046] Figure 2This is a diagram of the BERT self-training structure of the present invention;

[0047] Figure 3 It is a training process diagram of the BERT model of the present invention;

[0048] Figure 4 BERT training flow chart of the present invention;

[0049] Figure 5 4 is a flowchart of the question-answering system of the present invention. DETAILED DESCRIPTION

[0050] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0051] like Figure 1 and Figure 5 As shown, a knowledge graph question answering method based on a large language model comprises the following steps:

[0052] Step S1: Build a large language model framework and fine-tune the training data;

[0053] Step S2: fine-tune the large language model based on LoRA;

[0054] Step S3: subgraph retrieval and knowledge graph database construction;

[0055] Step S4: Large language model reasoning and answer generation.

[0056] The step S1 specifically consists of the following steps:

[0057] Step S1.1: BERT model construction and training: including data preprocessing, model architecture design, parameter adjustment and training process; specifically, Figure 3 As shown in , the input text is firstly segmented by BertTokenizer and special tags [CLS] and [SEP] are added. Then the long text is segmented into multiple segments to process the super long sequence. A certain overlap is maintained between each segment to ensure that the answer is completely retained in at least one segment. Then, as shown in Figure 2As shown in the figure, the pre-trained DistilBERT model is used to extract the semantic representation of each fragment, and the understanding of the sequence context is enhanced through the bidirectional LSTM layer. The output layer predicts the probability distribution of the starting position and the ending position of each token, and selects the answer range with the highest possibility through argmax. During the training process, the SQuAD 2.0 dataset is used for fine-tuning. The maximum sequence length is determined to be 384 through experiments to filter irrelevant information, and the embedding layer of DistilBERT is frozen to reduce training parameters. At the same time, a low learning rate and a smaller batch size (such as 16) are used to adapt to computing resource constraints. The optimization strategy also includes limiting the number of training rounds (such as 3 epochs) and using the sliding window method and H00 GPU acceleration to save resources and time. Finally, by evaluating and adjusting the model parameters, it is ensured that the model has good performance on the question-answering task.

[0058] Step S1.2: Question set and answer set construction: obtain triple data in the domain knowledge graph, use the self-trained BERT model in step S1.1 to generate single-hop question sets and multi-hop question sets in the graph, and annotate their corresponding answers in the data set; each triple (for example, [Mid-Autumn Festival, Lunar Calendar, August 15th]) can generate a corresponding question, such as "When is the Mid-Autumn Festival in the lunar calendar?" and annotate its corresponding answer "August 15th" in the data set; this process can automatically generate a large amount of high-quality training data, covering various types of questions and their correct answers; in this way, not only can the application scope of the knowledge graph be effectively expanded, but also a rich corpus can be provided for the large language model to improve the performance of the model in the fine-tuning stage;

[0059] Step S1.3: Prompt sentence construction: Annotate the entities and their relationships in the knowledge graph and convert them into instance data suitable for model training; these annotated data will help build question prompt templates and provide support for the generation of training instances; in this way, the entities and their relationships in the knowledge graph can be closely integrated with specific question-answering tasks to form a training data set with high semantic density to help the model better understand and generate accurate answers.

[0060] The step S2 specifically consists of the following steps:

[0061] Step S2.1: Adopt LoRA fine-tuning mechanism: LoRA (Low-Rank Adaptation) is an efficient fine-tuning method. By combining the weights of the pre-trained model with the fine-tuning incremental weights, the computational overhead required for model fine-tuning is significantly reduced. LoRA represents the fine-tuning weight changes through a low-rank matrix, and only saves the low-rank matrix part during the fine-tuning process. This allows the model to maintain the advantages of the pre-trained model when processing complex tasks, while achieving fast and efficient task adaptation;

[0062] Step S2.2: Fine-tuning process: After loading the preprocessed training data, use the LoRA method to fine-tune the Llama3.1 model and save the best model weights after each training iteration; during the fine-tuning process, the system will evaluate the accuracy of the model and determine whether the fine-tuning effect meets expectations by comparing the performance before and after training; this process ensures the accuracy and reliability of the model when dealing with domain-specific problems and improves its performance in intelligent question-answering tasks.

[0063] The step S3 specifically consists of the following steps:

[0064] Step S3.1: Knowledge graph database and vector library construction:

[0065] Knowledge graph database construction: Knowledge graph database construction is a complex process involving multiple steps. First, collect and integrate data from multiple sources, including public data sets, web pages, literature, etc., to ensure the richness and diversity of the data. In the process of data collection, the quality, completeness and consistency of the data need to be considered to avoid data noise and errors. Secondly, perform data cleaning and preprocessing to remove duplicates, errors and inconsistent data to ensure data quality. In the process of data cleaning, various technologies need to be used, including data standardization, data conversion and data verification, to ensure data consistency and accuracy. Next, use the named entity recognition (NER) tool to identify entities in the data and link the identified entities to knowledge The corresponding entities in the graph are used to establish the relationship between entities. NER tools can automatically identify entities in text, including names of people, places, and organizations, and classify them into different entity types. At the same time, rule extraction or natural language processing (NLP) tools can be used to extract the relationship between entities from the text. Various techniques can be used in the process of relationship extraction, including dependency analysis, semantic role labeling, and relationship classification, to ensure the accuracy and consistency of the relationship. Finally, the constructed knowledge graph is stored in a high-performance database, such as a graph database or a relational database, and an index is established to improve query efficiency. The design of the knowledge graph database needs to consider the structure, storage, and query efficiency of the data to support efficient data retrieval and analysis.

[0066] Vector library construction: First, data preprocessing is performed, including word segmentation and stop word removal, to ensure that the text data is clean and standardized. Various techniques can be used in the data preprocessing process, including word segmentation, part-of-speech tagging, and named entity recognition, to ensure the consistency and accuracy of the data. Next, feature extraction technology is used to convert the text into a vector representation. Common methods include TF-IDF, Word2Vec, BERT, etc. Various techniques can be used in the feature extraction process, including bag-of-words model, word vector model, and deep learning model, to ensure the validity and accuracy of the features. Then, the generated vectors are stored in the database and indexes are established to improve query efficiency. The design of the vector library needs to consider the structure, storage, and query efficiency of the data to support efficient data retrieval and analysis. Finally, the constructed vector library is used for various applications, such as text classification, question-answering systems, etc. The application of the vector library needs to consider the characteristics of the data, the selection of the model, and the tuning of the parameters to ensure the validity and accuracy of the application.

[0067] Step S3.2: Multi-model integration: Use the multi-model integration method to train multiple different models, and use the diversity and robustness of the models to achieve the fusion and optimization of the prediction results to improve the construction efficiency and accuracy of the knowledge graph database and vector library, including:

[0068] Model training: Select multiple different models, including models based on graph neural networks (GNNs), recurrent neural networks (RNNs), and Transformers, and train them using different data sets and parameter settings to achieve model diversity and robustness, and improve the accuracy and reliability of prediction results;

[0069] Model fusion: Use corresponding fusion and voting strategies, such as weighted average and majority voting, to fuse and optimize the prediction results to achieve comprehensiveness and robustness of the prediction results and improve the performance and efficiency of the overall system;

[0070] Performance evaluation: Use multiple indicators to evaluate the performance of the model, such as accuracy, recall, F1 score, etc., and select the model or fusion strategy with the best performance to achieve model optimization and selection, and improve the performance and efficiency of the overall system.

[0071] The step S4 specifically consists of the following steps:

[0072] Step S4.1: Question parsing: When the user enters a question, the subgraph information provided in step S3 is first used to generate a question-answering prompt suitable for processing by a large language model to help the model understand the background and context of the question and provide necessary contextual support for subsequent answer generation;

[0073] Step S4.2: Generate answers: The parsed question and subgraph information are input into the large language model that has been fine-tuned by LoRA. The model will perform reasoning and analysis based on the provided knowledge graph data to generate the final answer. In this way, the model can make full use of the structured information in the knowledge graph and the semantic understanding ability of the pre-trained model to provide users with accurate and logical answers. The large language model can handle complex problems that traditional graph question-answering systems find difficult to deal with through multi-hop reasoning, extraction of background knowledge, and analysis of complex problems.

[0074] A knowledge graph question answering system based on a large language model, the system comprising:

[0075] Building module: This module is responsible for generating the training data required for fine-tuning the large language model, including question sets, answer sets, and prompt sentences. By extracting triple data from the knowledge graph, the building module converts the triples into actual question-answering forms and constructs relevant prompt sentences to provide high-quality input data for fine-tuning the model. This process ensures that the training data is highly relevant to the knowledge graph, which can help the model effectively understand and handle domain-specific question-answering tasks.

[0076] Fine-tuning module: This module uses LoRA technology to fine-tune the large language model. LoRA (Low-Rank Adaptation) is a method to optimize fine-tuning efficiency. It adjusts the parameters of the pre-trained model through a low-rank matrix to reduce computational overhead while maintaining the model's semantic understanding ability. This module fine-tunes specific domain knowledge to optimize the performance of the large language model in processing question-answering in that domain, thereby improving its accuracy and usability.

[0077] Providing module: This module provides structured knowledge graph information for the large language model through subgraph retrieval strategy. When a user asks a question, the system first obtains the knowledge graph nodes and their relationships related to the question through subgraph retrieval. These subgraphs will become reference materials in the reasoning process of the large language model, ensuring that the model can obtain support from the graph and generate accurate answers.

[0078] Generation module: Based on the fine-tuned large language model, this module is responsible for generating the final answer to the question. When a user asks a question, after being processed by the aforementioned modules, the generation module will combine the question text with the knowledge graph subgraph information and use the large language model to generate the answer to the question. This module ensures that the generated answer is not only accurate but also logical and can handle complex reasoning tasks.

[0079] Through the collaborative work of the above modules, the system of the present invention can efficiently handle complex problems, break through the limitations of traditional question-answering systems, has strong cross-domain application capabilities, and provides innovative solutions for the further development of intelligent question-answering technology.

[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A knowledge graph question answering method based on a large language model, characterized in that: The method comprises the following steps: Step S1: Build a large language model framework and fine-tune the training data; Step S2: fine-tune the large language model based on LoRA; Step S3: subgraph retrieval and knowledge graph database construction; Step S4: Large language model reasoning and answer generation.

2. The knowledge graph question answering method based on a large language model according to claim 1, characterized in that: The step S1 specifically consists of the following steps: Step S1.1: BERT model construction and training: including data preprocessing, model architecture design, parameter adjustment and training process; Step S1.2: Question set and answer set construction: Obtain triple data in the domain knowledge graph, use the self-trained BERT model in step S1.1 to generate single-hop question sets and multi-hop question sets in the graph, and annotate their corresponding answers in the dataset; Step S1.3: Prompt sentence construction: Annotate the entities and their relationships in the knowledge graph and convert them into instance data suitable for model training.

3. The knowledge graph question answering method based on a large language model according to claim 2 is characterized in that: The step S2 specifically consists of the following steps: Step S2.1: Adopt LoRA fine-tuning mechanism: LoRA represents the weight change of fine-tuning through low-rank matrix, and only saves the low-rank matrix part during the fine-tuning process; Step S2.2: Fine-tuning process: After loading the preprocessed training data, the Llama3.1 model is fine-tuned using the LoRA method, and the best model weights are saved after each training iteration.

4. The knowledge graph question answering method based on a large language model according to claim 3 is characterized in that: The step S3 specifically consists of the following steps: Step S3.1: Knowledge graph database and vector library construction: Knowledge graph database construction: First, collect and integrate data from multiple sources. Second, perform data cleaning and preprocessing to remove duplicates, errors, and inconsistent data. Next, use named entity recognition (NER) tools to identify entities in the data and link the identified entities to the corresponding entities in the knowledge graph to establish relationships between entities. At the same time, extract the relationships between entities from the text. Finally, store the constructed knowledge graph in a high-performance database. Vector library construction: First, data preprocessing is performed. Then, feature extraction technology is used to convert text into vector representation. Then, the generated vectors are stored in the database and indexed to improve query efficiency. Finally, the constructed vector library is used for various applications. Step S3.2: Multi-model integration: Use the multi-model integration method to train multiple different models, and use the diversity and robustness of the models to achieve the fusion and optimization of the prediction results, including: Model training: Select multiple different models, including models based on graph neural networks (GNNs), recurrent neural networks (RNNs), and Transformers, and train them using different datasets and parameter settings to achieve model diversity and robustness; Model fusion: Use corresponding fusion and voting strategies to fuse and optimize the prediction results to achieve comprehensiveness and robustness of the prediction results; Performance evaluation: Use multiple indicators to evaluate the performance of the model and select the model or fusion strategy with the best performance to achieve model optimization and selection.

5. The knowledge graph question answering method based on a large language model according to claim 4 is characterized in that: The step S4 specifically consists of the following steps: Step S4.1: Question parsing: When the user enters a question, the subgraph information provided in step S3 is first used to generate a question-answering prompt suitable for processing by a large language model to help the model understand the background and context of the question; Step S4.2: Generate answer: The parsed question and subgraph information are input into the large language model fine-tuned by LoRA. The model will perform reasoning analysis based on the provided knowledge graph data to generate the final answer.

6. A knowledge graph question answering system based on a large language model, characterized in that: The system includes: Building module: This module is responsible for generating the training data required for fine-tuning the large language model, including question sets, answer sets, and prompt sentences. By extracting triple data from the knowledge graph, the building module converts the triples into actual question-answer forms and constructs relevant prompt sentences to provide high-quality input data for fine-tuning the model. Fine-tuning module: This module uses LoRA technology to fine-tune the large language model and adjusts the parameters of the pre-trained model through a low-rank matrix to reduce computational overhead while maintaining the model's semantic understanding ability; Providing module: This module provides structured knowledge graph information for the large language model through subgraph retrieval strategy. When a user asks a question, the system first obtains the knowledge graph nodes and their relationships related to the question through subgraph retrieval. These subgraphs will become reference materials in the reasoning process of the large language model, ensuring that the model can obtain support from the graph and generate accurate answers. Generation module: Based on the fine-tuned large language model, this module is responsible for generating the final question answer. When a user asks a question, after being processed by the aforementioned modules, the generation module will combine the question text with the knowledge graph subgraph information and use the large language model to generate the answer to the question.

Citation Information

Cited By

  • Government affair hotline service knowledge graph construction method and system based on large language model

    CN120354923A

  • Well drilling abnormal working condition analysis method based on large language model and knowledge graph

    CN120410769A

  • Insurance planning question and answer method and system

    CN120952150A

  • Conversational business intelligent analysis method based on natural language

    CN121456020A

  • Map enhanced question-answering method and system based on multi-level retrieval optimization

    CN121960680A