Intelligent question-answering system for cyclic utilization of traditional Chinese medicine resources based on knowledge graph and RAG technology

By combining knowledge graphs with retrieval enhancement generation technology, the performance of the Q&A system in complex reasoning tasks and in-depth semantic analysis is improved, and the problem of insufficient accuracy and reliability of traditional Q&A systems is solved, and more efficient knowledge acquisition of Chinese medicine resources is achieved.

CN119988556APending Publication Date: 2025-05-13NANJING UNIV OF TRADITIONAL CHINESE MEDICINE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510100668.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Traditional Q&A systems perform poorly in dealing with complex inference tasks and in-depth semantic analysis, resulting in low accuracy and reliability of answers.

Method used

A generative question-and-answer system based on knowledge graph (KG) and search enhanced generation (RAG) is adopted to combine knowledge graph and RAG technology to improve the system's performance in complex inference tasks and in-depth semantic analysis.

Benefits of technology

It enhances the reasoning and semantic understanding ability of the Q&A system, improves the accuracy and breadth of the Q&A system, and can obtain knowledge on recycling traditional Chinese medicine resources more quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988556A_ABST
    Figure CN119988556A_ABST
Patent Text Reader

Abstract

The invention discloses a traditional Chinese medicine resource recycling intelligent question-answering system based on a knowledge graph and an RAG technology. Relates to the technical field of natural language processing. Generating candidate responses based on the constructed retrieval structure of the knowledge graph; performing answer template matching on the generated candidate response, generating a final response after matching succeeds, returning the final response to the user, and generating the final response by using an RAG-based retrieval structure after matching fails; and returning the final response to the user. According to the method, the knowledge graph is combined with the RAG, so that the convenience of acquiring contents by the user and the efficiency of acquiring the traditional Chinese medicine resource recycling knowledge by the user are improved, the application practice in the field of traditional Chinese medicine resource recycling is realized, the working efficiency of traditional Chinese medicine resource recycling researchers is improved, and the researchers are helped to acquire required information more quickly; therefore, innovation and development in the field of traditional Chinese medicine resource recycling are promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to an intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology. Background Art

[0002] As the recognition of traditional Chinese medicine continues to increase around the world, the demand for Chinese medicine resources is also increasing year by year. However, the production of most Chinese medicine companies still belongs to the traditional production method of mass production, mass consumption and mass waste. Its resource utilization efficiency and industrial economic benefits are both low. A huge amount of by-products and scraps are discharged as waste or simply converted into low value-added products. Therefore, building an intelligent question-and-answer system for the recycling of Chinese medicine resources is of vital importance to achieving the sustainable development of the Chinese medicine industry.

[0003] Traditional question-answering systems only use a single retrieval structure and cannot deeply understand the semantic information and domain knowledge of the question, resulting in low accuracy and reliability of the answer. In order to improve the performance of intelligent question-answering systems, researchers have begun to explore the construction of complex question-answering systems, using technologies such as knowledge graphs and retrieval-augmented generation (RAG) to enhance the understanding and reasoning capabilities of question-answering systems. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a generative question-answering system based on knowledge graph KG and retrieval enhancement generation RAG to address the shortcomings of the single retrieval system in the background technology. The knowledge graph and retrieval enhancement generation are combined to improve the system's performance in complex reasoning tasks and deep semantic analysis, enhance the reasoning and semantic understanding capabilities, and improve the accuracy and breadth of the question-answering system.

[0005] The present invention adopts the following technical solutions to solve the above technical problems:

[0006] The intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology specifically includes the following steps:

[0007] Step a: receiving a query input by a user;

[0008] Step b: Generate candidate responses based on the constructed knowledge graph retrieval structure;

[0009] Step c: Perform answer template matching on the generated candidate responses. If the match is successful, the final response is generated and returned to the user. If the match fails, the final response is generated using the RAG-based retrieval structure.

[0010] Step d: Return the final response to the user.

[0011] As a further preferred solution of the intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology of the present invention, in step b, the knowledge graph retrieval specifically includes:

[0012] Data processing: read literature data such as patents on recycling of traditional Chinese medicine resources and remove content irrelevant to this field;

[0013] Knowledge graph construction: Based on the data processed in the previous step, design and construct a knowledge graph and store it in the Neo4j graph database;

[0014] Question named entity recognition: Use BERT+BIGRU+CRF and other models to perform named entity recognition on user questions;

[0015] Question intent recognition: Use models such as BERT to recognize the intent of user questions;

[0016] Template matching: A corresponding Cypher query template is written based on the intent type of the question; the entities extracted by the BERT+BIGRU+CRF model and the intent categories extracted by BERT are filled into the template in sequence; after the Cypher statement is generated, the Neo4j graph database is queried, and the query results are matched with the existing answer templates; if the match is successful, the final answer is generated, and if the match fails, the search is transferred to RAG search.

[0017] As a further preferred solution of the intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology of the present invention, in step c, RAG retrieval specifically includes the following steps:

[0018] Construct a knowledge base for recycling of traditional Chinese medicine resources: embed the processed data in step b into multi-granularity vectors, and select the vector database as the retrieval medium for recycling of traditional Chinese medicine resources RAG;

[0019] Question text vector embedding: Use the text embedding model to recycle the input Chinese medicine resources into sentences to generate word vectors, sentence vectors, and topic vectors;

[0020] Multi-granularity feature similarity matching: Retrieve similar texts from the TCM resource recycling vector library using vector index;

[0021] Result output: Sort by cosine similarity in descending order to find the most similar k texts as the retrieval results;

[0022] Multi-granularity text generation: The retrieval results are sent to a large language model for multi-granularity question and answer generation.

[0023] The construction of the knowledge base for recycling Chinese medicine resources described in step c is characterized in that a multi-granularity vector database is generated, specifically comprising the following steps:

[0024] Word granularity vector extraction: The word vector of each word in the text is obtained through model learning, and the word vectors corresponding to each word in the text are spliced ​​together in order to obtain the word vector matrix z of the text 1:m =[z1,z2,……,z p ,……,z m ] T ∈R m×r , where m is the number of words in the text, r represents the dimension of the word vector, and z p The word vector representing the p-th word;

[0025] Sentence granularity vector extraction: By constructing the context of the current sentence, the clauses are represented as low-dimensional sentence vectors with the same granularity; the vectors corresponding to each clause are concatenated in the order of the text to obtain the sentence vector matrix X of the current text 1:n =[x1,x2,……,x i , ..., x n ] T ∈R n*t , where n represents the number of clauses in the text, t represents the dimension of the clause vector, and x i The vector representing the i-th clause;

[0026] Topic granularity vector extraction: concatenate the word-topic vectors corresponding to each word in the text according to the order in the text to obtain the word-topic matrix y of the text 1:n =[y1,y2,……,y j ,……,y n ] T ∈R n×k , where n is the number of words in the text, k is the number of topics, and y j Represents the word-topic vector of the jth word;

[0027] Multi-granularity vector storage: Multi-granularity vectors of words, sentences, and topics are stored in the vector database.

[0028] The multi-granularity feature similarity matching described in step c specifically includes the following steps:

[0029] Create index types: Create word, sentence, and topic index types, and add vectors of three granularities to the corresponding index types;

[0030] Similarity search: Calculate the distance between the query vector and the corresponding vector in the database at the word, sentence, and topic granularity, and return the top k most similar results;

[0031] Search result saving: the constructed index will be saved to disk for research and application;

[0032] The multi-granularity text generation described in step c specifically includes the following steps:

[0033] Generate prompt: Based on the search results, use the prompt word template to generate the prompt string prompt.

[0034] Generate answers: Send the prompt to the large language model to generate sentence-level text first, and then generate paragraph-level text. The specific generation principle is as follows:

[0035] G(x)=G n (G n-1 (……G1(x)……)

[0036] Among them, G(x) represents the process of text generation, G n ,G n-1 ,...,G1 represents the generating functions at different levels;

[0037] As a further preferred solution of the intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology of the present invention, in step d, two functions are included:

[0038] The first is result display: the final generated results are presented to the user in text form through the output module;

[0039] The second is logging: recording user queries and system responses to provide data for subsequent analysis and optimization.

[0040] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0041] 1. This paper proposes a generative question-answering method that integrates knowledge graph (KG) and retrieval-augmented generation (RAG). This method cleverly combines the structured knowledge of the knowledge graph with the flexibility of the retrieval-augmented generation model to improve the system's performance in dealing with complex reasoning tasks and deep semantic analysis, thereby enhancing its reasoning and semantic understanding capabilities. In addition, by introducing the retrieval-augmented generation (RAG) mechanism, the accuracy of the question-answering system is improved, covering the diversity and complexity of problems in this field more comprehensively.

[0042] 2. The present invention combines knowledge graph with retrieval enhanced generation (RAG) technology to obtain knowledge on the recycling of traditional Chinese medicine resources more quickly and accurately, improve the convenience of users in obtaining information, improve the work efficiency of researchers, and provide strong support for researchers in the field of recycling of traditional Chinese medicine resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Schematic diagram of the overall architecture of the intelligent question-answering system for recycling of traditional Chinese medicine resources of the present invention. DETAILED DESCRIPTION

[0044] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] The present invention aims to solve the shortcomings of the single retrieval system in the prior art, and proposes a generative question-answering method and system based on knowledge graph (KG) and retrieval-augmented generation (RAG), which combines knowledge graph and retrieval-augmented generation to improve the system's performance in complex reasoning tasks and deep semantic analysis, and enhances reasoning and semantic understanding capabilities. That is, the accuracy and extensiveness of the question-answering system are enhanced through retrieval-augmented generation (RAG).

[0047] Example 1

[0048] This embodiment provides an intelligent question-answering method for recycling Chinese medicine resources based on knowledge graph and RAG. Figure 1 As shown, the following steps are included:

[0049] Step a, receiving a query input by a user;

[0050] Step b: Query based on the knowledge graph retrieval system: Perform entity recognition and intent recognition on the question text through the knowledge graph retrieval layer to obtain entities and intents. Use the query template to generate Cypher statements based on the obtained entities and intents, and use the generated Cypher statements to query the Neo4j graph database. Select the answer template to organize the query results. If the organization is successful, the final answer is output. If the organization fails, it will be transferred to the RAG retrieval layer.

[0051] Specifically, knowledge graph retrieval includes:

[0052] S1. Data processing: Use Python programming library (e.g. pdfplumber) to read literature data such as patents on recycling of traditional Chinese medicine resources and remove content not related to this field.

[0053] S2. Knowledge graph construction: Based on the data processed in the previous step, design and construct a knowledge graph and store it in the Neo4j graph database.

[0054] S3. Named entity recognition for questions: Use a deep learning model (such as BERT+BIGRU+CRF) to perform named entity recognition on user questions. First, obtain the semantic representation of the input through the BERT pre-trained language model, obtain the vector representation of each word in the sentence, then input the word vector sequence into BIGRU, and finally output the label sequence with the highest probability through the CRF layer.

[0055] S4. Question intent recognition: Use a deep learning model (such as BERT) to identify the intent of the user's question. First, initialize a BERT model, and use multiple stacked self-attention heads and feedforward neural layers in the BERT model to better capture the language structure, contextual information, and semantic information of the sentence. Then, the original semantic vector output by the neural network is input into the Softmax layer. The score value of each intent category is transformed by an exponential function and then normalized to obtain the probability of each intent category, and the intent category with the highest probability is selected.

[0056] S5. Query template matching: This patent writes a certain number of Cypher query templates based on the intent type. The named entities extracted by S3 and the intent categories extracted by S4 are filled in the templates in sequence to generate Cypher statements, and then the Neo4j graph database is queried. The query results will be matched with the compiled answer templates.

[0057] Step c: Query based on the RAG retrieval system:

[0058] Specifically, RAG searches include:

[0059] Construct a knowledge base for recycling of traditional Chinese medicine resources: embed the processed text in step b into a multi-granularity vector, and select the vector database as the retrieval medium for recycling of traditional Chinese medicine resources RAG;

[0060] Question text vector embedding: Use the text embedding model to recycle the input Chinese medicine resources into sentences to generate word vectors, sentence vectors, and topic vectors;

[0061] Multi-granularity feature similarity matching: Retrieve similar texts from the TCM resource recycling vector library using vector index;

[0062] Result output: Sort by cosine similarity in descending order to find the most similar k texts as the retrieval results;

[0063] Multi-granularity text generation: The retrieval results are sent to a large language model for multi-granularity question and answer generation.

[0064] S1. Generate multi-granularity vectors from the input sentences: Use a text embedding model (such as ROBERTA) to recycle the input Chinese medicine resources into sentences to generate word vectors, sentence vectors, and topic vectors as query queries.

[0065] S2. Multi-granularity feature similarity matching: Input the query vector and use the index to retrieve similar texts from the FAISS vector database. Calculate the cosine similarity between the query vector and all vectors in the database, sort the k texts most similar to the search text in descending order, select the k texts with the highest cosine value (i.e., the highest similarity) as the retrieval results, extract the text content based on the retrieved ID, and connect them through the prompt word template to generate a prompt string.

[0066] Prompt string prompt:

[0067] "'

[0068] Information

[0069] "'

[0070] Query

[0071] Information is the text content retrieved by FAISS, and Query is the user question;

[0072] Reply to the question by quoting the content separated by "'. If you cannot find any quotable content in the provided content, simply reply "Sorry, no answer found".

[0073] For example:

[0074] Prompt string prompt:

[0075] "'

[0076] As a commonly used Chinese medicinal material, Salvia miltiorrhiza produces a large amount of waste during its planting and processing, including Salvia miltiorrhiza stems and leaves, Salvia miltiorrhiza flowers, and Salvia miltiorrhiza fibrous roots during harvesting and processing, as well as residual sediment and residues after extraction during deep processing.

[0077] "'

[0078] Question: What are the specific waste products of Salvia miltiorrhiza?

[0079] Answer: The waste products of Salvia miltiorrhiza include the stems and leaves, flowers and fibrous roots of Salvia miltiorrhiza during harvesting and processing, as well as the precipitates and residues remaining after extraction during deep processing.

[0080] S3. Generate multi-granularity text:

[0081] Generate prompt: Based on the search results, use the prompt word template to generate the prompt string prompt.

[0082] Generate answers: Send the prompt to the large language model to generate sentence-level text first and then paragraph-level text.

[0083] Step d, output the final response: The final response is returned to the user through the output module. This step includes two parts:

[0084] The first is result display: the final generated results are presented to the user in text form through the output module;

[0085] The second is logging: recording user queries and system responses to provide data for subsequent analysis and optimization.

[0086] The present invention combines the knowledge graph and the search method of search enhancement generation, and can handle diversified queries. By combining the two question-answering technologies, it can provide users with high-quality answers in the field of recycling of traditional Chinese medicine resources.

[0087] Example 2

[0088] The present invention provides an intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG, such as Figure 1 As shown, it specifically includes the following modules:

[0089] Named Entity Recognition Module: First, the semantic representation of the input is obtained through the BERT pre-trained language model, and the vector sequence of each word in the sentence is input into BIGRU, and finally the label sequence with the maximum probability is output through the CRF layer. This model is used to extract named entities from user questions. The knowledge graph entity types and their attributes are shown in Table 1; the knowledge graph entity relationships are shown in Table 2.

[0090] Table 1

[0091]

[0092] Table 2

[0093]

[0094] Intent recognition module: First, a BERT model is initialized, and multiple stacked self-attention heads and feedforward neural layers in the BERT model are used to better capture the language structure, contextual information, and semantic information of the sentence. Then, the original semantic vector output by the neural network is input into the Softmax layer. The score value of each intent category is transformed by an exponential function and then normalized to obtain the probability of each intent category.

[0095] Construction of Neo4j graph database: Use Python programming library (such as pdfplumber) to read literature data such as patents on recycling of traditional Chinese medicine resources, and remove content irrelevant to this field. Then, use Python programming library (such as py2neo) to build node and relationship objects to import the organized knowledge into Neo4j graph database. The entity types and attributes are shown in Table 1; the entity relationship types are shown in Table 2.

[0096] Construction of multi-granularity vector database: In order to fully extract the semantic information in the text, this patent starts from the granularity of "word", "sentence" and "topic":

[0097] Word granularity vector extraction: The word vector of each word in the text is obtained through model learning, and the word vectors corresponding to each word in the text are spliced ​​together in order to obtain the word vector matrix z of the text 1:m =[z1,z2,……,z p ,……,z m ] T ∈R m×r , where m is the number of words in the text, r represents the dimension of the word vector, and z p The word vector representing the p-th word;

[0098] Sentence granularity vector extraction: By constructing the context of the current sentence, the clauses are represented as low-dimensional sentence vectors with the same granularity; the vectors corresponding to each clause are concatenated in the order of the text to obtain the sentence vector matrix X of the current text 1:n =[x1,x2,……,x i , ..., x n ] T ∈R n*t , where n represents the number of clauses in the text, t represents the dimension of the clause vector, and x i The vector representing the i-th clause;

[0099] Topic granularity vector extraction: concatenate the word-topic vectors corresponding to each word in the text according to the order in the text to obtain the word-topic matrix y of the text 1:n =[y1,y2,……,y j ,……,y n ] T ∈R n×k , where n is the number of words in the text, k is the number of topics, and y j Represents the word-topic vector of the jth word;

[0100] Multi-granularity vector storage: Multi-granularity vectors of words, sentences, and topics are stored in the vector database.

[0101] Multi-granularity generation module:

[0102] Generate prompt: Based on the search results, use the prompt word template to generate the prompt string prompt.

[0103] Generate answers: Send the prompt to the large language model to generate sentence-level text first and then paragraph-level text.

[0104] Output module: responsible for displaying the final generated response to the user. Specifically, the output module presents the final response result to the user in the form of text, and records the user query and system response data for subsequent analysis and optimization.

[0105] In this embodiment, the functions of each functional module correspond to the steps in Embodiment 1, and the undescribed parts will not be repeated.

[0106] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the present invention in any form. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention fall within the protection scope of the present invention.

[0107] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention should be included in the protection scope of the invention. All technical features in this embodiment can be freely combined according to actual needs.

[0108] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology, characterized by: The specific steps include: Step a: receiving a query input by a user; Step b: Generate candidate responses based on the constructed knowledge graph retrieval structure; Step c: Perform answer template matching on the generated candidate responses. If the match is successful, the final response is generated and returned to the user. If the match fails, the final response is generated using the RAG-based retrieval structure. Step d: Return the final response to the user.

2. The intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology according to claim 1 is characterized in that: In step b, the knowledge graph retrieval specifically includes: Data processing: read literature data such as patents on recycling of traditional Chinese medicine resources and remove content irrelevant to this field; Knowledge graph construction: Based on the data processed in the previous step, design and construct a knowledge graph and store it in the Neo4j graph database; Question named entity recognition: Use BERT+BIGRU+CRF and other models to perform named entity recognition on user questions; Question intent recognition: Use models such as BERT to recognize the intent of user questions; Template matching: A corresponding Cypher query template is written based on the intent type of the question; the entities extracted by the BERT+BIGRU+CRF model and the intent categories extracted by BERT are filled into the template in sequence; after the Cypher statement is generated, the Neo4j graph database is queried, and the query results are matched with the existing answer templates; if the match is successful, the final answer is generated, and if the match fails, the search is transferred to RAG search.

3. According to the intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology as claimed in claim 1, it is characterized in that: In step c, RAG retrieval specifically includes the following steps: Constructing a knowledge base for recycling of traditional Chinese medicine resources: embedding the processed data in claim 2 into multi-granularity vectors, and selecting a vector database as a retrieval medium for recycling of traditional Chinese medicine resources RAG; Question text vector embedding: Use the text embedding model to recycle the input Chinese medicine resources into sentences to generate word vectors, sentence vectors, and topic vectors; Multi-granularity feature similarity matching: Retrieve similar texts from the TCM resource recycling vector library using vector index; Result output: Sort by cosine similarity in descending order to find the most similar k texts as the retrieval results; Multi-granularity text generation: The retrieval results are sent to a large language model for multi-granularity question and answer generation.

4. The method for constructing a knowledge base for recycling Chinese medicine resources according to claim 3, characterized in that: The generation of a multi-granularity vector database includes the following steps: Word granularity vector extraction: The word vector of each word in the text is obtained through model learning, and the word vectors corresponding to each word in the text are spliced ​​together in order to obtain the word vector matrix z of the text 1:m =[z1,z2,……,z p ,……,z m ] T ∈R m×r , where m is the number of words in the text, r represents the dimension of the word vector, and z p The word vector representing the p-th word; Sentence granularity vector extraction: By constructing the context of the current sentence, the clauses are represented as low-dimensional sentence vectors with the same granularity; the vectors corresponding to each clause are concatenated in the order of the text to obtain the sentence vector matrix X of the current text 1:n =[x1,x2,……,x i , ..., x n ] T ∈R n*t , where n represents the number of clauses in the text, t represents the dimension of the clause vector, and x i The vector representing the i-th clause; Topic granularity vector extraction: concatenate the word-topic vectors corresponding to each word in the text according to the order in the text to obtain the word-topic matrix y of the text 1:n =[y1,y2,……,y j ,……,y n ] T ∈R n×k , where n is the number of words in the text, k is the number of topics, and y j Represents the word-topic vector of the jth word; Multi-granularity vector storage: Multi-granularity vectors of words, sentences, and topics are stored in the vector database.

5. The intelligent question-answering method for recycling Chinese medicine resources based on knowledge graph and RAG technology according to claim 3 is characterized in that: Multi-granularity feature similarity matching includes the following steps: Create index types: Create word, sentence, and topic index types, and add vectors of three granularities to the corresponding index types; Similarity search: Calculate the distance between the query vector and the corresponding vector in the database at the word, sentence, and topic granularity, and return the top k most similar results; Search results saved: The constructed index will be saved to disk for research and application.

6. The intelligent question-answering method for recycling Chinese medicine resources based on knowledge graph and RAG technology according to claim 3 is characterized in that: Multi-granularity text generation includes the following steps: Generate prompt: Based on the search results, use the prompt word template to generate the prompt string prompt. Generate answers: Send the prompt to the large language model to generate sentence-level text first, and then generate paragraph-level text. The specific generation principle is as follows: G(x)=G n (G n-1 (……G1(x)……) Among them, G(x) represents the process of text generation, G n ,G n-1 ,...,G1 represents the generating functions at different levels.

7. The intelligent question-answering system for recycling Chinese medicine resources based on knowledge graph and RAG technology according to claim 1 is characterized in that: In step d, there are two functions: The first is result display: the final generated results are presented to the user in text form through the output module; The second is logging: recording user queries and system responses to provide data for subsequent analysis and optimization.