A novel intelligent question-answering method and system for large-scale traditional Chinese medicine course resources

Through the big model combining Neo4j knowledge graph and Elasticsearch search engine, knowledge graph and positive noun detection are dynamically built, solving the flexibility, coverage and semantic understanding of the Chinese medicine course resource Q&A system, and achieving efficient, accurate and transparent Q&A services.

CN120144706BActive Publication Date: 2025-08-26INST OF INFORMATION ON TRADITIONAL CHINESE MEDICINE CACMS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510212037.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-08-26
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

现有技术在中医药课程资源问答系统中存在灵活性不足、覆盖范围有限、语义理解局限性、适应性差、信息时效性不足以及解释性和透明度低的问题。

Method used

The large model is used to combine Neo4j knowledge graph, Elasticsearch search engine and vector search technology to dynamically construct knowledge graphs, positive noun detection and feature similarity algorithms to achieve efficient mining and accurate analysis of traditional Chinese medicine course resources, and generate professional and accurate answers.

Benefits of technology

It improves the accuracy and professionalism of the answers, enhances the flexibility and coverage of the system, improves semantic understanding capabilities, ensures the timeliness and reliability of information, increases interpretability and transparency, and optimizes the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144706B_ABST
    Figure CN120144706B_ABST
Patent Text Reader

Abstract

The present invention provides a novel large-scale model of traditional Chinese medicine course resources intelligent question-answering method and system, including: the large model converts user questions into question vectors, performs similarity search and matching in the Fass vector library to construct a first reference answer; the large model performs entity relationship and synonym mining on the questions, and performs knowledge graph filtering, analyzes the true intention of the user's questions, generates corresponding Cypher statements based on the filtered entities and relationships, and executes them in Neo4j to construct a second reference answer; the large model performs fine word segmentation on the questions using a predefined word segmenter, performs full-text search in a pre-built Elasticsearch search engine index core, sorts the search results according to a feature sorting strategy, and constructs a third reference answer; the large model summarizes and generates knowledge based on the first, second, and third reference answers, and strictly screens data reference sources through a verification mechanism to generate the most accurate comprehensive answer. The present invention can perform intelligent question-answering on traditional Chinese medicine course resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent question-answering technology for traditional Chinese medicine course resources, and in particular to a novel large-scale intelligent question-answering method and system for traditional Chinese medicine course resources. Background Art

[0002] With the advancement of the times and the continuous development and iteration of computer technology, the methods of using computers to answer specific questions about TCM course resources are also constantly innovating. Currently, there are two main solutions: a rule-based TCM course resource question-answering solution and a TCM course resource question-answering solution based on the RAG large model.

[0003] The core concept of the first rule-based Q&A solution for TCM course resources lies in the meticulous construction of a comprehensive question-answer rule base by educational experts or a team of teachers, specifically for the selected course content. However, this approach suffers from numerous issues, including limited flexibility: the questions and answers in the rule base are predefined, and the system may not be able to provide appropriate responses to unconventional or innovative user questions. This limitation is particularly pronounced with open-ended or discussion-based questions. Limited coverage: even the most comprehensive rule base cannot cover all possible questions. Users' questioning styles vary widely, and some questions may not be matched to appropriate answers due to different wordings, resulting in a poor user experience. Limitations in semantic understanding: Although the system can semantically parse user questions, misunderstandings may occur when dealing with complex or ambiguous questions, especially when users use non-standard languages ​​or dialects. Poor adaptability: For rapidly evolving disciplines such as information technology or medicine, the rule base may not be updated quickly enough to keep pace with the frequency of knowledge updates, thus impacting the system's timeliness and effectiveness.

[0004] The second TCM course resource question-answering solution, based on a large RAG model, utilizes cutting-edge Retrieval-Augmented Generation (RAG) technology. It aims to provide an efficient, accurate, and insightful mechanism for TCM course resource question-answering. However, this solution also suffers from numerous issues, including limitations in semantic understanding. While the RAG model can capture lexical meaning and contextual relationships, its semantic understanding may be insufficient when dealing with unconventional expressions, metaphors, or culturally specific content. For complex natural language phenomena, the model may not perform as well as human experts. Low explainability and transparency: The complex internal workings of large language models make their decision-making processes difficult to explain. This is particularly important in educational settings, where teachers and students may want to understand the logic and rationale behind the answers. Potential for "hallucination": Language models can produce so-called "hallucinations," generating seemingly plausible but actually false information. In such cases, the answers provided by the system may be misleading, especially when they are based on incompletely relevant or erroneous data. Summary of the Invention

[0005] In order to solve the technical problems existing in the above-mentioned prior art, the present invention provides a novel large-scale model of traditional Chinese medicine course resources intelligent question-answering method, and the technical solution is as follows:

[0006] On the one hand, a novel large-scale intelligent question-answering method for traditional Chinese medicine course resources is provided, which includes:

[0007] S1. The large model receives questions raised by users regarding TCM course resources;

[0008] S2. The large model embeds the question into a word and converts it into a question vector. The question vector is searched and matched for similarity in the Fass vector library, and a first reference answer is constructed based on the search results.

[0009] S3. The large model mines entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the distinctive synonym detection algorithm. It then filters the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships in the knowledge graph. The model analyzes the true intent of the user's question, determines the application scenario of graph query or graph computing, and automatically generates corresponding Cypher statements based on the filtered entities and relationships. The statements are executed in Neo4j, and a natural language answer is generated based on the user's question and the execution results, thereby constructing a second reference answer.

[0010] S4. The large model performs fine word segmentation on the question using a predefined word segmenter, performs a full-text search in a pre-built Elasticsearch search engine index core, sorts the search results according to the characteristic sorting strategy of traditional Chinese medicine course resources, and generates a generative answer based on the multiple data with the highest search result scores to construct a third reference answer;

[0011] S5. The large model summarizes and generates knowledge based on the first, second, and third reference answers, and strictly screens data reference sources through a verification mechanism to generate the most accurate comprehensive answer.

[0012] Optionally, the Fass vector library stores chapter-based semi-structured data generated from traditional Chinese medicine course data resources. The chapter-based semi-structured data is word-embedded by the large model and synchronously enters the Fass vector library.

[0013] Optionally, the dynamic construction process of the knowledge graph includes: a pre-construction process and a dynamic update process;

[0014] The pre-build process includes:

[0015] Performing fully structured processing on TCM course data resources. The fully structured processing includes two parts: automatic annotation of the large model and manual review. The automatic annotation is to extract TCM course data resources through the large model prompt words. The extracted content is five parts: entity, entity type, entity attribute, relationship, and relationship attribute. After the extraction is completed, manual review and verification are performed. The parts that fail the review and verification are deleted, and the fully structured data that pass the review and verification are imported into the neo4j graph database to form the knowledge graph.

[0016] The dynamic update process includes:

[0017] Conduct real-time analysis, automatic annotation and manual review of newly added traditional Chinese medicine course resources.

[0018] Optionally, the formal synonym table includes regular synonyms of entities and relationships, and is used to mine regular synonyms of entities and relationships;

[0019] The characteristic synonym detection algorithm is used to further calculate potential entity and relationship synonyms. The algorithm steps are as follows:

[0020] Construct a feature set: For each entity term and relationship term Wi, construct a basic feature set Fwi, the basic feature set Fwi including the corresponding structured attribute information, Fwi = {c1, c2, c3, ...}, c1, c2, c3 is the attribute list;

[0021] Calculation construction: Intersection: the number of features shared by two terms |Fwa∩Fwb|=Fshare; Union: the total number of all features of the two terms |Fwa∪Fwb|=Fall; Symmetric difference: the union-intersection of the two term sets, Fall-Fshare=Fsym; Total number: FWa+FWb=Fnum;

[0022] Perform the calculation: Sim(Wa,Wb) = ((2*Fshare) / Fnum) - (Fsym / Fall), where Sim(Wa,Wb) represents the similarity between the two terms. The first part ((2*Fshare) / Fnum) emphasizes the importance of common features. The more common features, the higher the similarity. The second part - (Fsym / Fall) slightly penalizes the mismatched parts, making the result more balanced. When calculating the similarity, this part of the value will be subtracted, thereby slightly reducing the similarity score. This ensures that even if two terms have many common features, their differences will be reflected in the score. At the same time, it helps to avoid misclassification or overly high similarity scores caused by ignoring differences.

[0023] Similarity normalization: normalize the similarity results of two terms: Sim(Wa,Wb)=max(0,min(1,Sim(Wa,Wb))) to ensure that the similarity score is between [0,1];

[0024] Result output: Two terms with similarity scores higher than the preset threshold are output as positive synonyms.

[0025] Optionally, the word segmenter is HanLP, which takes the entities in the knowledge graph as a custom vocabulary, sets word segmentation rules according to entity types, and dynamically adjusts word segmentation weight values ​​according to the frequency of entities appearing in traditional Chinese medicine course resources.

[0026] Optionally, the pre-construction process of the Elasticsearch search engine index core is:

[0027] Parse the outline catalog of TCM course resources to generate chapter-based semi-structured data;

[0028] Performing secondary verification and error correction on the chapter-body semi-structured data through the prompt words + large model to form new semi-structured information data;

[0029] Synchronize the new semi-structured information data into Elasticsearch to build an efficient indexing core.

[0030] Optionally, the ranking formula of the TCM course resource feature ranking strategy is as follows:

[0031]

[0032] Among them: FScore represents the score of the hit document d; TF ti,d is the entity term t i Frequency of terms in document d; IDF ti is the entity term t i Inverse document frequency, where the inverse document frequency = total number of hit documents / containing entity terms t i The number of documents; W ti is the word segmentation weight corresponding to the frequency of entity terms in traditional Chinese medicine course resources; dn is the total number of hit documents; R d It is the timeliness factor, which indicates the year since the document was stored in the database and is used to reflect the newness of the document.

[0033] Optionally, the verification mechanism includes:

[0034] The retrieved data reference sources are verified for relevance using the large model prompt words to determine whether the data reference sources are truly strongly relevant to the questions raised by the user.

[0035] Optionally, the comprehensive answer includes: an answer to the question raised by the user, and specific citations of key literature fragments or chapters that are clearly marked as being based on the answer, and a brief explanation is provided.

[0036] On the other hand, a novel large-scale intelligent question-answering system for traditional Chinese medicine course resources is provided, comprising:

[0037] The receiving module is used by the large model to receive questions raised by users regarding TCM course resources;

[0038] A first reference answer generation module is used for the large model to embed the question into words, convert it into a question vector, perform similarity search and matching on the question vector in the Fass vector library, and construct a first reference answer based on the search results;

[0039] A second reference answer generation module is used for the large model to mine entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the distinctive synonym detection algorithm, and to filter the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships existing in the knowledge graph, analyzing the true intention of the user's question, determining the application scenario of graph query or graph computing, and automatically generating corresponding Cypher statements based on the filtered entities and relationships, executing them in Neo4j, and generating a natural language answer based on the user's question and the execution results to construct a second reference answer;

[0040] A third reference answer generation module is used for the large model to perform fine word segmentation on the question using a predefined word segmenter, perform a full-text search in a pre-built Elasticsearch search engine index core, sort the search results according to the characteristic sorting strategy of traditional Chinese medicine course resources, and generate a generative answer based on the multiple data with the highest search result scores to construct a third reference answer;

[0041] The comprehensive answer generation module is used for the large model to summarize and generate knowledge based on the first, second and third reference answers, and strictly screen the data reference source through the verification mechanism to generate the most accurate comprehensive answer.

[0042] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned novel large-model traditional Chinese medicine course resource intelligent question-answering method.

[0043] On the other hand, a computer-readable storage medium is provided, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the above-mentioned new large-model traditional Chinese medicine course resource intelligent question-answering method.

[0044] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0045] This paper proposes an innovative intelligent question-answering method through the deep integration of search engines, Neo4j-based knowledge graphs, vector retrieval, and large-scale model technologies. This method cleverly integrates the technical advantages of knowledge graphs, search engines, and vector retrieval to achieve efficient mining, precise analysis, and systematic organization of knowledge information on traditional Chinese medicine course resources. As a result, it can provide professional and accurate answers to users' questions about specific traditional Chinese medicine course resources, significantly improving the quality and efficiency of users' information acquisition, as shown in the following aspects:

[0046] 1) Improve the accuracy and professionalism of answers

[0047] By building a Neo4j-based knowledge graph, we organized Traditional Chinese Medicine (TCM) course resources in a structured manner, enhancing the system's flexibility and adaptability. Furthermore, leveraging the powerful natural language processing capabilities of the large model, we were able to more deeply understand the intent behind user queries and provide more accurate and personalized answers. The introduction of the Elasticsearch full-text search engine combined with a custom tokenizer optimized the index creation process, improving the relevance of query results and ensuring accurate information retrieval.

[0048] 2) Enhance system flexibility and coverage

[0049] This solves the inflexibility of traditional rule-based question-answering solutions by dynamically building a knowledge graph to support the adaptation and discovery of new questions, freeing students from being limited by pre-set question patterns. The system continuously optimizes as course content updates and new questions emerge, ensuring long-term effectiveness and adaptability, and covering a wider range of user questioning methods.

[0050] 3) Improve semantic understanding and response capabilities

[0051] To address the challenges posed by complex and ambiguous problem statements and non-standard languages ​​or dialects, advanced large-scale model technology is used to capture the subtle differences behind semantics, better understand and respond to users' actual needs, and significantly improve the system's performance in processing unconventional expressions, metaphors, or culturally specific content, bringing it closer to the level of understanding of human experts.

[0052] 4) Ensure the timeliness and reliability of information

[0053] A new AI-powered automatic annotation mechanism has been implemented, enabling TCM curriculum resources to promptly reflect the latest academic advances, reducing the cost and time of manual maintenance. The application of a verification mechanism effectively reduces the occurrence of "hallucinations," ensuring that the answers provided are both accurate and reliable, further enhancing the system's credibility.

[0054] 5) Increased explainability and transparency

[0055] Each generated answer clearly identifies the key literature fragment or chapter it is based on, and provides a brief explanation to help users understand the source and logic of the answer, which is particularly suitable for TCM education. This approach not only increases the transparency of the system, but also makes it easier for learners to accept and trust the information provided.

[0056] 6) Optimize search efficiency and user experience

[0057] Featured sorting strategies and algorithm optimization ensure efficient data access and improve user query speed. Combining the characteristics of TCM course resources with the word segmentation weights corresponding to Neo4j entities to perform search relevance sorting improves the hit rate and enables users to quickly find the most relevant information. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1This is a flow chart of a novel large-scale intelligent question-answering method for traditional Chinese medicine course resources provided by an embodiment of the present invention;

[0060] Figure 2 This is an overall block diagram of a novel large-scale intelligent question-answering method for traditional Chinese medicine course resources provided by an embodiment of the present invention;

[0061] Figure 3 It is a semi-structured data resource processing diagram provided by an embodiment of the present invention;

[0062] Figure 4 It is a fully structured resource processing graph provided by an embodiment of the present invention;

[0063] Figure 5 This is a block diagram of a new large-scale intelligent question-answering system for traditional Chinese medicine course resources provided by an embodiment of the present invention;

[0064] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0066] An embodiment of the present invention provides a novel large-scale model of traditional Chinese medicine course resources intelligent question-answering method, which can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The flow chart of this method is shown below. Figure 2 The overall block diagram of the method is shown below. The processing flow may include the following steps:

[0067] S1. The large model receives questions raised by users regarding TCM course resources;

[0068] The large model in the embodiment of the present invention may be a large language model (LLM).

[0069] S2. The large model embeds the question into a word and converts it into a question vector. The question vector is searched and matched for similarity in the Fass vector library, and a first reference answer is constructed based on the search results.

[0070] Optionally, the Fass vector library stores chapter semi-structured data generated by traditional Chinese medicine course data resources (the traditional Chinese medicine course resources are parsed for outline catalog to generate chapter semi-structured data, including chapter title, author, abstract, content, update time, etc.), and the chapter semi-structured data is word-embedded by the large model and synchronously entered into the Fass vector library, such as Figure 3 shown.

[0071] S3. The large model mines entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the distinctive synonym detection algorithm. It then filters the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships in the knowledge graph. The model analyzes the true intent of the user's question, determines the application scenario of graph query or graph computing, and automatically generates corresponding Cypher statements based on the filtered entities and relationships. The statements are executed in Neo4j, and a natural language answer is generated based on the user's question and the execution results, thereby constructing a second reference answer.

[0072] Optionally, the dynamic construction process of the knowledge graph includes: a pre-construction process and a dynamic update process;

[0073] The pre-build process includes:

[0074] like Figure 4 As shown, the TCM course data resources are fully structured. The fully structured processing includes two parts: large-scale model automatic annotation and manual review. The automatic annotation is to extract the TCM course data resources through the large-scale model prompt words. The extracted content is five parts: entity, entity type, entity attribute, relationship, and relationship attribute (entity: identifying key terms or concepts in the text; entity type: determining the category to which each entity belongs, such as medicinal materials, diseases, treatment methods, etc.; entity attribute: describing the specific characteristics or parameters of the entity; relationship: defining the association between different entities; relationship attribute: refining the specific nature or conditions of the relationship). After the extraction is completed, manual review and verification are performed, and the parts that fail the review and verification are deleted. The fully structured data that pass the review and verification are imported into the neo4j graph database to form the knowledge graph.

[0075] The dynamic update process includes:

[0076] Conduct real-time analysis, automatic annotation and manual review of newly added traditional Chinese medicine course resources.

[0077] The update speed of traditional rule bases is often unable to keep up with the rapid evolution of knowledge, which may weaken the timeliness and effectiveness of the system. To this end, the embodiment of the present invention introduces large model technology to achieve real-time AI automatic labeling, ensuring that traditional Chinese medicine course resources can promptly reflect the latest academic progress.

[0078] For example, the question raised by the user is:

[0079] What is Li’s academic heritage and influence?

[0080] The prompt words are as follows:

[0081] Extract the entities or keywords and synonyms of the following content:

[0082] What is Li’s academic heritage and influence?

[0083] ---

[0084] The output format is as follows: ["Entity 1","Entity 2",...]

[0085] ---

[0086] Note: Only statements are returned, no explanation or apology is required. The output JSON format must be correct.

[0087] Optionally, the formal synonym table (a formal synonym table is created in advance in the embodiment of the present invention, and the format is [entity-entity synonym][relationship-relationship synonym]) includes conventional synonyms of entities and relationships, and is used to mine conventional synonyms of entities and relationships;

[0088] The characteristic synonym detection algorithm is used to further calculate potential entity and relationship synonyms. The algorithm steps are as follows:

[0089] Construct a feature set: For each entity term and relationship term Wi, construct a basic feature set Fwi, the basic feature set Fwi including the corresponding structured attribute information, Fwi = {c1, c2, c3, ...}, c1, c2, c3 is the attribute list;

[0090] Calculation construction: Intersection: the number of features shared by two terms |Fwa∩Fwb|=Fshare; Union: the total number of all features of the two terms |Fwa∪Fwb|=Fall; Symmetric difference: the union-intersection of the two term sets, Fall-Fshare=Fsym; Total number: FWa+FWb=Fnum;

[0091] Perform the calculation: Sim(Wa,Wb) = ((2*Fshare) / Fnum) - (Fsym / Fall), where Sim(Wa,Wb) represents the similarity between the two terms. The first part ((2*Fshare) / Fnum) emphasizes the importance of common features. The more common features, the higher the similarity. The second part - (Fsym / Fall) slightly penalizes the mismatched parts, making the result more balanced. When calculating the similarity, this part of the value will be subtracted, thereby slightly reducing the similarity score. This ensures that even if two terms have many common features, their differences will be reflected in the score. At the same time, it helps to avoid misclassification or overly high similarity scores caused by ignoring differences.

[0092] Similarity normalization: normalize the similarity results of two terms: Sim(Wa,Wb)=max(0,min(1,Sim(Wa,Wb))) to ensure that the similarity score is between [0,1];

[0093] Result output: Two terms with similarity scores higher than the preset threshold are output as positive synonyms.

[0094] The similarity detection algorithm of the embodiment of the present invention not only considers the intersection and union of the terms themselves, but also combines the influence of symmetric difference and total number, thereby improving the accuracy and interpretability of term similarity evaluation. For example, the characteristics of "Huangqi" are {Qi deficiency, tonifying Qi, Leguminosae, root, unique feature 1}, and the characteristics of "Mianqi" are {Qi deficiency, tonifying Qi, Leguminosae, root, unique feature 2}. Then "Huangqi" and "Mianqi" each have 5 features, Fwa=5, Fwb=5, and the intersection is {Qi deficiency, tonifying Qi, Leguminosae, root}, so Fshare =4; the union is {Qi deficiency, Qi tonification, Leguminosae, root, unique feature 1, unique feature 2}, so Fall=6; Fsym=Fall-Fshare=6-4=2; Fnum=FWa+FWb=5+5=10; similarity Sim(Wa,Wb)=((2*Fshare) / Fnum)-(Fsym / Fall)=((2*4) / 10)=0.8-(2 / 6)≈0.467>preset threshold 0.4, output correct name: "Huangqi" synonym: "Mianqi".

[0095] This embodiment of the present invention uses a large model to analyze the true intention of the user's question, determines the application scenario (graph query or graph calculation), and automatically generates corresponding Cypher statements based on the filtered entities and relationships. The Cypher statements are executed in Neo4j and the execution results are obtained. The specific example is as follows:

[0096] Graph query:

[0097] Question: Which Chinese medicines have the effect of clearing heat and detoxifying?

[0098] Cypher statement: MATCH(herb:Herb)-[:HAS_EFFECT]->(effect:Effect{name:"clearing heat and detoxifying"})RETURN herb.name

[0099] Execution result: List the names of all Chinese medicines with the effect of "clearing heat and detoxifying".

[0100] Graph Computation:

[0101] Question: Please find the shortest path between the two syndromes of "wind-heat cold" and "lung-heat cough", including the nodes in between (such as traditional Chinese medicine, other syndromes) and their relationship types.

[0102] Cypher statement: MATCH path = shortestPath((syndrome1:Syndrome{name: "Wind-Heat Cold"})-[:TREATS|CAUSES|LEADS_TO*]->(syndrome2:Syndrome{name: "Lung-Heat Cough"})) RETURN [node IN nodes(path)|node.name] AS PathNodes, [rel IN relationships(path)|type(rel)] AS PathRelationships

[0103] Execution result: {"PathNodes": ["Wind-Heat Cold", "Forsythia suspensa", "Lung-Heat Cough"], "PathRelationships": ["TREATS", "LEADS_TO"]}

[0104] The embodiment of the present invention then combines the user's question and the execution result to generate a natural language answer and constructs the second reference answer.

[0105] S4. The large model performs fine-grained word segmentation on the question using a predefined word segmenter, performs full-text search in the pre-constructed Elasticsearch search engine index core, sorts the search results according to the traditional Chinese medicine curriculum resource feature sorting strategy, and generates an answer based on multiple pieces of data with the highest search result scores (such as the top three pieces of data with the highest scores), and constructs the third reference answer;

[0106] Optionally, the word segmenter is HanLP. The entities in the knowledge graph are used as a custom word list, the word segmentation rules are set according to the entity types, and the word segmentation weight values are dynamically adjusted according to the frequency of the entities appearing in the traditional Chinese medicine curriculum resources.

[0107] This approach not only improves the accuracy of word segmentation but also enhances the understanding ability of the specific terms in the field of traditional Chinese medicine.

[0108] Optionally, the process of pre-constructing the Elasticsearch search engine index core is as follows:

[0109] Parse the outline directory of the traditional Chinese medicine curriculum resources to generate chapter-based semi-structured data;

[0110] Perform secondary verification and error correction on the chapter-based semi-structured data through prompt words + large model to form new semi-structured information data;

[0111] Synchronize the new semi-structured information data into Elasticsearch to build an efficient indexing core, such as Figure 3 shown.

[0112] This core can effectively narrow the search scope and improve the hit rate. It is the basis for the entire system to quickly respond to user queries and ensure efficient data access.

[0113] Optionally, the ranking formula of the TCM course resource feature ranking strategy is as follows:

[0114]

[0115] Among them: FScore represents the score of the hit document d; TF ti,d is the entity term t i Frequency of terms in document d; IDF ti is the entity term t i Inverse document frequency, where the inverse document frequency = total number of hit documents / containing entity terms t i The number of documents; W ti is the word segmentation weight corresponding to the frequency of entity terms in traditional Chinese medicine course resources; dn is the total number of hit documents; R d It is the timeliness factor, which indicates the year since the document was stored in the database and is used to reflect the newness of the document.

[0116] S5. The large model summarizes and generates knowledge based on the first, second, and third reference answers, and strictly screens data reference sources through a verification mechanism to generate the most accurate comprehensive answer.

[0117] This process involves more than a simple aggregation of existing information. Instead, a large-scale model is used to deeply analyze and integrate information from various sources, extracting key points and tailoring the angle and depth of the response to the specific context of the user's question, ensuring that the information provided is both comprehensive and targeted. Simultaneously, the large-scale model checks the consistency and logic of the generated responses to avoid conflicting or misleading information. Ultimately, the final response is customized with an appropriate level of terminology complexity and detailed explanations, making it easier for users to understand complex Traditional Chinese Medicine concepts and theories. Finally, the entire response is optimized into a fluent and natural language format for easy reading and dissemination, ensuring that users receive a satisfactory and beneficial response.

[0118] Optionally, the verification mechanism includes:

[0119] The retrieved data reference sources are verified for relevance using the large model prompt words to determine whether the data reference sources are truly strongly relevant to the questions raised by the user.

[0120] For example, the prompt words are as follows:

[0121] Determine whether the following contents are relevant to the search statement. The following contents are:

[0122] {"zidingyi_indexpkey_score":"37.836456","Course Column":"IV. <em> plum< / em> <em> clan< / em> <em> of< / em> <em> study< / em> <em> technique< / em> <em> pass< / em> <em> Cheng< / em> <em> and< / em> <em> film< / em> <em> ring< / em> ","Course content":"Compendium of Materia Medica records many diseases and symptoms in the "Treatment of All Diseases" section. <em> of< / em> Drug application method, acupuncture point application <em> have< / em> Shenque, Yongquan, Lao ; ; ; Palace, Yintang, etc. The summary list is as follows (Table 7-2). ; ; ; Acupoint application is very popular and has a great influence on later generations <em> film< / em> <em> ring< / em> In the Qing Dynasty, Wu Shiji recorded many contents of the application in his Lihua Pianwen. <em> study< / em> In the "Chuanya Waibian", Min established the "Tie Fa Men" to promote this method. Modern clinical use of drugs to treat ulcerative colitis, colitis, bronchial asthma, constipation, etc. has achieved good results. <em> of< / em> Efficacy, <em> have< / em> widely <em> of< / em> Development prospects. Although the specific medication acupoints <em> and< / em> <em> plum< / em> <em> clan< / em> The book is not exactly the same, but <em> have< / em> Clear <em> of< / em> <em> pass< / em> <em> Cheng< / em> This method is non-invasive, simple, convenient, cheap and effective. <em> of< / em> Acupuncture therapy <em> study< / em> middle <em> of< / em> The edge of a branch <em> study< / em> ","Relevance Score":"37.836456"}

[0123] ---

[0124] The search statement is:

[0125] ---

[0126] What is Li’s academic heritage and influence?

[0127] ---

[0128] The output options can only be: {"isok":false} or {"isok":true}, where true indicates strong correlation and false indicates no correlation.

[0129] ---

[0130] Note: Only statements are returned, no explanation or apology is required. The output JSON format must be correct.

[0131] Optionally, the comprehensive answer includes: an answer to the question raised by the user, and specific citations of key literature fragments or chapters that are clearly marked as being based on the answer, and a brief explanation is provided.

[0132] After completing the comprehensive answer, the system may also provide some additional resources or suggestions, such as recommending relevant literature, course chapters or other learning materials to encourage users to further explore and learn.

[0133] like Figure 5 As shown, the embodiment of the present invention also provides a new large-scale model of traditional Chinese medicine course resource intelligent question-answering system, the system comprising:

[0134] Receiving module 510, used for the large model to receive questions raised by users regarding traditional Chinese medicine course resources;

[0135] A first reference answer generation module 520 is configured to embed the question into a word using the large model, convert the word into a question vector, perform similarity search and matching on the question vector in a Fass vector library, and construct a first reference answer based on the search results;

[0136] A second reference answer generation module 530 is used for the large model to mine entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the unique synonym detection algorithm, and to filter the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships existing in the knowledge graph, analyzing the true intention of the user's question, determining the application scenario of graph query or graph computing, and automatically generating corresponding Cypher statements based on the filtered entities and relationships, executing them in Neo4j, and generating a natural language answer based on the user's question and the execution results to construct a second reference answer;

[0137] A third reference answer generation module 540 is configured to use the large model to perform fine word segmentation on the question using a predefined word segmenter, perform a full-text search in a pre-built Elasticsearch search engine index core, sort the search results according to a ranking strategy for TCM course resources, and generate a generative answer based on the multiple data items with the highest search result scores to construct a third reference answer.

[0138] The comprehensive answer generation module 550 is used for the large model to summarize and generate knowledge based on the first, second and third reference answers, and strictly screen the data reference source through the verification mechanism to generate the most accurate comprehensive answer.

[0139] The embodiment of the present invention provides a new large-scale intelligent question-answering system for traditional Chinese medicine course resources, and its functional structure corresponds to the new large-scale intelligent question-answering method for traditional Chinese medicine course resources provided by the embodiment of the present invention, which will not be repeated here.

[0140] Figure 6 It is a structural diagram of an electronic device 600 provided in an embodiment of the present invention. The electronic device 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 601 and one or more memories 602, wherein the memory 602 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 601 to implement the steps of the above-mentioned new large-scale model of traditional Chinese medicine course resources intelligent question and answer method.

[0141] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions. The instructions are executable by a processor in a terminal to implement the novel large-scale model of TCM course resources intelligent question-answering method. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0142] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0143] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An intelligent question-answering method for a large-scale traditional Chinese medicine course resource, characterized in that: The method comprises: S1. The large model receives questions raised by users regarding TCM course resources; S2. The large model embeds the question into a word and converts it into a question vector. The question vector is searched and matched for similarity in the Faiss vector library, and a first reference answer is constructed based on the search results. S3. The large model mines entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the distinctive synonym detection algorithm. It then filters the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships in the knowledge graph. The model analyzes the true intent of the user's question, determines the application scenario of graph query or graph computing, and automatically generates corresponding Cypher statements based on the filtered entities and relationships. The statements are executed in Neo4j, and a natural language answer is generated based on the user's question and the execution results, thereby constructing a second reference answer. S4. The large model performs fine word segmentation on the question using a predefined word segmenter, performs a full-text search in a pre-built Elasticsearch search engine index core, sorts the search results according to the characteristic sorting strategy of traditional Chinese medicine course resources, and generates a generative answer based on the multiple data with the highest search result scores to construct a third reference answer; S5. The large model summarizes and generates knowledge based on the first, second, and third reference answers, and strictly screens data reference sources through a verification mechanism to generate the most accurate comprehensive answer; The formal synonym table includes regular synonyms of entities and relationships, and is used to mine regular synonyms of entities and relationships; The characteristic synonym detection algorithm is used to further calculate potential entity and relationship synonyms. The algorithm steps are as follows: Construct a feature set: For each entity term and relationship term Wi, construct a basic feature set Fwi, the basic feature set Fwi including the corresponding structured attribute information, Fwi = {c1, c2, c3, ...}, c1, c2, c3 is the attribute list; Calculation construction: intersection: the number of features shared by the two terms |Fwa∩Fwb| = Fshare; union: the total number of all features of the two terms |Fwa∪Fwb| = Fall; symmetric difference: the union-intersection of the two term sets, Fall-Fshare = Fsym; total number: FWa+FWb = Fnum; Perform the calculation: Sim(Wa,Wb) = ((2*Fshare) / Fnum)-(Fsym / Fall), where Sim(Wa,Wb) represents the similarity between the two terms; Similarity normalization: normalize the similarity results of two terms: Sim(Wa,Wb)=max(0,min(1,Sim(Wa,Wb))) to ensure that the similarity score is between [0,1]; Result output: Two terms with similarity scores higher than the preset threshold are output as positive synonyms.

2. The method according to claim 1, characterized in that The Faiss vector library stores chapter-based semi-structured data generated from traditional Chinese medicine course data resources. The chapter-based semi-structured data is word-embedded by the large model and synchronously enters the Faiss vector library.

3. The method according to claim 1, characterized in that The dynamic construction process of the knowledge graph includes: a pre-construction process and a dynamic update process; The pre-build process includes: Performing fully structured processing on TCM course data resources. The fully structured processing includes two parts: automatic annotation of the large model and manual review. The automatic annotation is to extract TCM course data resources through the large model prompt words. The extracted content is five parts: entity, entity type, entity attribute, relationship, and relationship attribute. After the extraction is completed, manual review and verification are performed. The parts that fail the review and verification are deleted, and the fully structured data that pass the review and verification are imported into the neo4j graph database to form the knowledge graph. The dynamic update process includes: Conduct real-time analysis, automatic annotation and manual review of newly added traditional Chinese medicine course resources.

4. The method according to claim 1, wherein The word segmenter is HanLP, which takes the entities in the knowledge graph as a custom vocabulary, sets word segmentation rules according to the entity type, and dynamically adjusts the word segmentation weight value according to the frequency of the entity appearing in the traditional Chinese medicine course resources.

5. The method according to claim 1, characterized in that The pre-construction process of the Elasticsearch search engine index core is as follows: Parse the outline catalog of TCM course resources to generate chapter-based semi-structured data; Performing secondary verification and error correction on the chapter semi-structured data through the prompt word enlargement model to form new semi-structured information data; Synchronize the new semi-structured information data into Elasticsearch to build an efficient indexing core.

6. The method according to claim 1, characterized in that The ranking formula of the TCM course resource feature ranking strategy is as follows: Among them: FScore represents the score of the hit document d; TF ti,d is the entity term t i Frequency of terms in document d; IDF ti is the entity term t i Inverse document frequency, where the inverse document frequency = total number of hit documents / containing entity terms t i The number of documents; W ti is the word segmentation weight corresponding to the frequency of entity terms in traditional Chinese medicine course resources; dn is the total number of hit documents; R d It is the timeliness factor, which indicates the year since the document was stored in the database and is used to reflect the newness of the document.

7. The method according to claim 1, characterized in that The verification mechanism includes: The retrieved data reference sources are verified for relevance using the large model prompt words to determine whether the data reference sources are truly strongly relevant to the questions raised by the user.

8. The method according to claim 1, characterized in that The comprehensive answer includes: the answer to the question raised by the user, and the specific citation of the key literature fragment or chapter clearly marked and provided with a brief explanation.

9. A large-scale intelligent question-answering system for traditional Chinese medicine course resources, characterized by: The system comprises: The receiving module is used by the large model to receive questions raised by users regarding TCM course resources; A first reference answer generation module is used for the large model to embed the question into words, convert it into a question vector, perform similarity search and matching on the question vector in the Faiss vector library, and construct a first reference answer based on the search results; A second reference answer generation module is used for the large model to mine entities, relationships, and synonyms for the question based on the dynamically constructed knowledge graph, the list of synonyms, and the distinctive synonym detection algorithm, and to filter the mined entities, relationships, and synonyms through the knowledge graph, retaining only valid entities and relationships existing in the knowledge graph, analyzing the true intention of the user's question, determining the application scenario of graph query or graph computing, and automatically generating corresponding Cypher statements based on the filtered entities and relationships, executing them in Neo4j, and generating a natural language answer based on the user's question and the execution results to construct a second reference answer; A third reference answer generation module is used for the large model to perform fine word segmentation on the question using a predefined word segmenter, perform a full-text search in a pre-built Elasticsearch search engine index core, sort the search results according to the characteristic sorting strategy of traditional Chinese medicine course resources, and generate a generative answer based on the multiple data with the highest search result scores to construct a third reference answer; A comprehensive answer generation module is used by the large model to summarize and generate knowledge based on the first, second, and third reference answers, and to strictly screen data reference sources through a verification mechanism to generate the most accurate comprehensive answer; The formal synonym table includes regular synonyms of entities and relationships, and is used to mine regular synonyms of entities and relationships; The characteristic synonym detection algorithm is used to further calculate potential entity and relationship synonyms. The algorithm steps are as follows: Construct a feature set: For each entity term and relationship term Wi, construct a basic feature set Fwi, the basic feature set Fwi including the corresponding structured attribute information, Fwi = {c1, c2, c3, ...}, c1, c2, c3 is the attribute list; Calculation construction: intersection: the number of features shared by the two terms |Fwa∩Fwb| = Fshare; union: the total number of all features of the two terms |Fwa∪Fwb| = Fall; symmetric difference: the union-intersection of the two term sets, Fall-Fshare = Fsym; total number: FWa+FWb = Fnum; Perform the calculation: Sim(Wa,Wb) = ((2*Fshare) / Fnum)-(Fsym / Fall), where Sim(Wa,Wb) represents the similarity between the two terms; Similarity normalization: normalize the similarity results of two terms: Sim(Wa,Wb)=max(0,min(1,Sim(Wa,Wb))) to ensure that the similarity score is between [0,1]; Result output: Two terms with similarity scores higher than the preset threshold are output as positive synonyms.

Citation Information

Patent Citations

  • Novel consulting method and device and electronic equipment

    CN112650857A

  • Information processing method and device, equipment, storage medium and program product

    CN116975437A

  • Method and system for enhancing RAG questions and answers through mixed retrieval method

    CN118627625A