A diagnostic method for chronic obstructive pulmonary disease based on large model graph retrieval enhancement

By combining the large language model with knowledge graph, extracting and expanding the triple list, generating a complete link of evidence, and using the prompt strategy selection model, the problem of insufficient accuracy and reliability of the large language model in medical diagnosis is solved, and more efficient diagnostic reasoning capabilities are achieved.

CN119694544BActive Publication Date: 2025-05-23ANHUI PROVINCIAL HOSPITAL +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510209673.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-23
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

In the prior art, large language models have problems such as insufficient depth of professional knowledge, limited data deviation and generalization capabilities, poor context integration capabilities, and inability to deal with uncertainty in diagnosis in medical diagnosis, resulting in low accuracy and reliability of outputs.

Method used

By combining the large language model and knowledge graph, a triple list is extracted and semantic expansion and merged to generate a complete evidence link. Use the prompt strategy selection model to calculate the scores of each prompt strategy based on accuracy, context adaptability, and simplicity rewards to determine the prompt strategy.

Benefits of technology

It improves the accuracy and reliability of large language models in medical diagnosis, enhances their interpretability and reasoning capabilities, and can more effectively deal with uncertainty in diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119694544B_ABST
    Figure CN119694544B_ABST
Patent Text Reader

Abstract

A method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement, comprising: prompting a large language model to obtain a question input by a user, identifying the user's intention, and extracting a list of question entities; generating a knowledge graph query statement based on the entity list through the large language model, extracting a triple list on the knowledge graph through the knowledge graph query statement, prompting the large language model to semantically expand and merge the triple list to obtain a chain of evidence; selecting a prompt strategy based on a prompt strategy selection model; wherein selecting a prompt strategy based on the prompt strategy selection model comprises: the prompt strategy selection model includes multiple prompt strategies, and the large language model generates multiple question answers based on the multiple prompt strategies; calculating rewards based on the multiple question answers of the large language model, calculating the score of each prompt strategy through the rewards, and determining the prompt strategy; inputting the chain of evidence into the large language model, and the large language model generates an answer to the question based on the prompt strategy and the chain of evidence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and more specifically to a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement. Background Art

[0002] Knowledge graph is a structured form of knowledge representation that supports reasoning and interpretation by explicitly storing rich facts, while large language models are good at automatically extracting knowledge from unstructured text to enhance their understanding and generation capabilities. At present, large language models have problems in medical diagnosis, such as insufficient depth of professional knowledge, limited data bias and generalization ability, poor context integration ability, and inability to handle uncertainty in diagnosis, resulting in low accuracy and reliability of output. Knowledge graphs can provide external knowledge for large language models to improve their interpretability and reasoning capabilities; large language models can further enrich and expand the content of knowledge graphs through natural language processing tasks (such as embedding, completion, generation, etc.). Although knowledge graphs and large language models each have their own advantages, the traditional combination method has the problem of insufficient connection. Knowledge graphs are usually only used as tools for information retrieval, and their deep interaction with large language models is limited. This simple combination is difficult to fully tap the potential of both. Summary of the invention

[0003] The present application is proposed to solve the above problems. According to one aspect of the present application, a method for diagnosing chronic obstructive pulmonary disease based on large model atlas retrieval enhancement is provided, characterized in that the method comprises:

[0004] prompting the large language model to obtain the question input by the user, identify the user's intention, and extract the entity list of the question from the question;

[0005] Generate a knowledge graph query statement based on the entity list through the large language model, extract a triple list on the knowledge graph through the knowledge graph query statement, and prompt the large language model to perform semantic expansion and merging on the triple list to obtain a complete chain of evidence;

[0006] Select the cue strategy based on the cue strategy selection model;

[0007] The prompt strategy is selected according to the prompt strategy selection model, including: the prompt strategy selection model includes multiple prompt strategies, the prompt strategies include a triple format, a sentence format and a graph description format, and the large language model generates multiple question answers according to the multiple prompt strategies; rewards are calculated according to the multiple question answers of the large language model, the rewards include accuracy rewards, context adaptability rewards and concise rewards, and the score of each prompt strategy is calculated through rewards, thereby determining the prompt strategy;

[0008] The chain of evidence is input into a large language model, and the large language model generates an answer to the question according to the prompt strategy and the chain of evidence.

[0009] In one embodiment of the present application, the prompt strategy selection model includes multiple prompt strategies, and the prompt strategies include triple format, sentence format and graph description format:

[0010] The triple format directly presents the triples in the question subgraph as hints for the large language model to predict;

[0011] The sentence format converts the triples in the question subgraph into natural sentence language as hints for the large language model to predict;

[0012] The graph description format uses a structured language to describe the entire question subgraph as a hint for the large language model to predict.

[0013] In one embodiment of the present application, the rewards are calculated based on the multiple question answers of the large language model, and the rewards include accuracy rewards, contextual adaptability rewards, and concise rewards:

[0014] The accuracy reward is awarded based on whether the answer to the question generated by the large language model is correct;

[0015] The context adaptability reward uses a semantic matching method to calculate the similarity between the prompt strategy and the question, and rewards are given according to the similarity;

[0016] The simplicity reward is awarded based on the effectiveness of the hint strategy in representing the subgraph.

[0017] In one embodiment of the present application, the score of each prompt strategy is calculated through the reward, thereby determining the prompt strategy:

[0018] Get the historical average reward of the tip strategy;

[0019] The score of the prompt strategy was calculated by the following formula;

[0020] ;

[0021] in, is the score of the prompt strategy, To suggest strategies, is a positive integer, is the historical average reward of the prompt strategy; To explore the parameters, It represents the logarithm with the mathematical constant e as the base, so that the power of e is equal to the exponential value of t, where t is the total number of choices for the current question. Tips for strategy The number of times selected;

[0022] The scores of the prompt strategies are compared, and the prompt strategy score that meets the preset conditions is selected to determine the prompt strategy.

[0023] In one embodiment of the present application, rewards are dynamically weighted, and for different types of patient questions, the reward weights are adaptively adjusted based on the complexity of the question and the requirements for answer generation;

[0024] The different types of patient questions include closed questions and open questions.

[0025] In one embodiment of the present application, a timely update strategy is used to update the reward weight after prompt strategy selection and reward calculation, thereby improving the efficiency of prompt strategy selection.

[0026] In one embodiment of the present application, prompting a large language model includes:

[0027] Combine the initial large language model with the named entity recognition model;

[0028] An integrated learning module is constructed to complement the recognition results of the initial large language model and the named entity recognition model.

[0029] In one embodiment of the present application, the integrated learning module combines the label prediction and probability distribution of each word of the initial large language model and the named entity recognition model into a training data set, and uses the training data set to train a meta-learner to let the meta-learner learn how to combine the output of the initial large language model and the named entity recognition model to make the final label prediction.

[0030] In one embodiment of the present application, the named entity recognition model includes a language model based on the Transformer architecture, a bidirectional long short-term memory network layer, and a conditional random field layer:

[0031] The language model based on the Transformer architecture encodes the question to obtain a dynamic word vector;

[0032] The bidirectional long short-term memory network layer performs bidirectional semantic encoding on the dynamic word vector to obtain a vector with contextual features;

[0033] The conditional random field layer classifies the vector to obtain an answer to the question.

[0034] In one embodiment of the present application, the large language model includes a task prompt, and the task prompt includes:

[0035] Baseline prompts with task descriptions and formatting specifications, prompts based on annotation guidelines, and annotated samples to support few-shot learning.

[0036] The present invention provides a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement. The large language model extracts a triple list on the knowledge graph through a knowledge graph query statement, prompting the large language model to semantically expand and merge the triple list, extracting a chain of evidence with a strong correlation between information and the question from the knowledge graph, selecting a prompt strategy according to the prompt strategy selection model, inputting the chain of evidence into the large language model, and the large language model generates an accurate and reliable answer to the question based on the prompt strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0038] Figure 1 A schematic flow chart showing a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement according to an embodiment of the present application;

[0039] Figure 2 A schematic flow chart showing the selection of a prompt strategy according to a prompt strategy selection model according to an embodiment of the present application is shown;

[0040] Figure 3 A schematic structural diagram of a named entity recognition model according to an embodiment of the present application is shown;

[0041] Figure 4 A diagram showing a case study on the effectiveness of different prompting strategies for exploring a specific problem according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of the present application more obvious, the example embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described herein. Based on the embodiments of the present application described in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.

[0043] First, refer to Figure 1 To describe a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement for implementing an embodiment of the present invention. Figure 1 FIG. 1 is a schematic flow chart of a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement according to an embodiment of the present application. Figure 1 As shown, according to an embodiment of the present application, a method for diagnosing chronic obstructive pulmonary disease based on large model atlas retrieval enhancement may include the following steps:

[0044] In step S100, the large language model is prompted to obtain a question input by the user, identify the user's intention, and extract an entity list of the question from the question;

[0045] In step S200, a knowledge graph query statement is generated according to the entity list through the large language model, a triple list is extracted on the knowledge graph through the knowledge graph query statement, and the large language model is prompted to perform semantic expansion and merging on the triple list to obtain a complete chain of evidence;

[0046] In step S300, a prompt strategy is selected according to a prompt strategy selection model;

[0047] In step S400, the chain of evidence is input into a large language model, and the large language model generates an answer to the question according to the prompt strategy and the chain of evidence.

[0048] Figure 2 FIG. 2 shows a schematic flow chart of selecting a prompt strategy according to a prompt strategy selection model according to an embodiment of the present application. Figure 2 As shown, selecting a prompt strategy according to a prompt strategy selection model according to an embodiment of the present application may include the following steps:

[0049] In step S310, the prompt strategy selection model includes multiple prompt strategies, including a triple format, a sentence format, and a graph description format, and the large language model generates multiple question answers according to the multiple prompt strategies;

[0050] In step S320, rewards are calculated based on the answers to various questions of the large language model. The rewards include accuracy rewards, context adaptability rewards, and conciseness rewards. The scores of each prompt strategy are calculated through the rewards, and then the prompt strategy is determined.

[0051] The present invention provides a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement. The large language model extracts a triple list on the knowledge graph through a knowledge graph query statement, prompting the large language model to semantically expand and merge the triple list, extracting a chain of evidence with a strong correlation between information and the question from the knowledge graph, selecting a prompt strategy according to the prompt strategy selection model, inputting the chain of evidence into the large language model, and the large language model generates an accurate and reliable answer to the question based on the prompt strategy.

[0052] In an embodiment of the present application, in step S100, the large language model is prompted to obtain the question input by the user to identify the user's intention and extract the entity list of the question from the question. According to the question input by the patient, the large language model is prompted to understand the patient's inquiry intention and extract the list of medical entities contained in the question. Through training with a large amount of medical corpus, the large language model can automatically identify and extract entities in the text (such as diseases, treatments, factors, etc.) and their relationships with each other (such as "treatment", "influence", "co-occurrence", etc.), can accurately extract medical entities from long context information, and extract the attributes of medical entities and the relationship between them and other entities from the context information.

[0053] In an embodiment of the present application, prompting a large language model includes: combining an initial large language model with a named entity recognition model; constructing an integrated learning module, and making the recognition results of the initial large language model and the named entity recognition model complementary through the integrated learning module.

[0054] Named Entity Recognition (NER) is the most important task in building a knowledge graph. Named Entity Recognition models fine-tuned in the medical field show satisfactory performance. However, it performs poorly on unseen entity recognition due to the small amount of data on COPD, limited fine-tuning data, and lack of knowledge. In contrast, Large Language Models (LLMs) like GPT-4 have extensive external knowledge, but studies have shown that they lack specialization for NER tasks.

[0055] To solve these problems, an ensemble learning framework combining traditional NER models with large language models (LLMs) was proposed, aiming to accurately extract medical entities, relations, and attributes from chronic obstructive pulmonary disease (COPD) medical texts, thereby providing high-quality input for constructing knowledge graphs in the medical field.

[0056] In an embodiment of the present application, the integrated learning module combines the label prediction and probability distribution of each word of the initial large language model and the named entity recognition model into a training data set, and uses the training data set to train the meta-learner, so that the meta-learner learns how to combine the output of the initial large language model and the named entity recognition model to make the final label prediction. After the training is completed, in the test phase, the prediction results are generated by the two basic models and input into the trained meta-learner to obtain the final predicted label.

[0057] In an embodiment of the present application, a named entity recognition model includes a language model based on a Transformer architecture, a bidirectional long short-term memory network layer, and a conditional random field layer: the language model based on the Transformer architecture encodes the question to obtain a dynamic word vector; the bidirectional long short-term memory network layer performs bidirectional semantic encoding on the dynamic word vector to obtain a vector with contextual features; the conditional random field layer classifies the vector to obtain the answer to the question.

[0058] like Figure 3 As shown, transformer is a language model based on the Transformer architecture; , , , , , The output of the language model based on the Transformer architecture is a dynamic word vector; , , , , , The contextual features of each smallest semantic unit; , , , , , is the output of the bidirectional long short-term memory network layer, which is a vector with contextual features; Self-Attention is the self-attention layer, , , , , , is the output of the self-attention layer, which is a vector with contextual features and local features. B and I are the labels corresponding to the words, B is the beginning part of the label, and I is the middle part of the label.

[0059] The named entity recognition model is used to extract entities from Chinese chronic obstructive pulmonary disease medical texts. The model first uses the RoBERTa (A Robustly Optimized BERT) model to encode the medical texts and obtain dynamic word vectors. The random masking mechanism of RoBERTa is used to capture the medical text features that may be lost in the text encoding process of RoBERTa.

[0060] Then, these dynamic word vectors are fed to the bidirectional long short-term memory network layer for bidirectional semantic encoding, which effectively solves the long-distance dependency problem and obtains the contextual features of the text. The bidirectional long short-term memory network layer here can be a BiLSTM layer (Bi-directional Long Short-Term Memory). By strengthening the understanding and extraction of deep semantic information in the text, the performance of the model in natural language processing (NLP) tasks is improved. The BiLSTM layer is a bidirectional long short-term memory network that combines forward LSTM and backward LSTM to simultaneously capture the front and back contextual information of sequence data. Specifically, the BiLSTM layer generates two hidden state sequences by processing the input sequence from two directions (forward and reverse), and then splices the two sequences together to obtain a comprehensive representation of each word. This structure enables BiLSTM to better understand the semantic relationship in the text when processing natural language processing tasks, such as sentiment classification and text classification.

[0061] In order to more effectively filter key data and capture local features of the input sequence, a self-attention layer is incorporated. Finally, in the labeled sequence, the Conditional Random Field (CRF) model is used to better simulate the sequential relationship between labels, thereby improving the accuracy of sequence labeling. The best label sequence is selected based on the calculated probability of a large number of labels and output as the result of the model. By introducing the CRF model, the dependency between labels and contextual information can be better considered, thereby significantly improving the accuracy and robustness of sequence labeling. Conditional random field is a Markov random field model for labeling sequence problems. It defines the conditional probability distribution of the output variable under the condition of a given random variable, thereby achieving modeling and prediction of sequence data. The learning process of CRF usually uses maximum likelihood estimation or regularized maximum likelihood estimation to optimize model parameters to maximize the log-likelihood value of the training data.

[0062] In an embodiment of the present application, the large language model includes task prompts, which include: baseline prompts with task descriptions and format specifications, prompts based on annotation criteria, and annotated samples to support few-sample learning.

[0063] The large language model part designs a task-specific prompt, which includes the following:

[0064] Baseline prompt with task description and format specification: This section provides basic information about the task description and output format for the large language model, which is required to predict the label of each smallest semantic unit, i.e. token, and calculate the corresponding prediction probability. The purpose of this section is to provide standardized outputs for the ensemble learning module so that it can be effectively combined with the results of other NER methods. The task description details the specific tasks that the model needs to complete. For example, for a sentiment analysis task, the task description may involve how to identify and classify the sentiment in the text. The format specification provides the specific format requirements for generating the output. For example, using a numerical value between 0 and 1 to represent the intensity of the sentiment, or using simple tags to distinguish different sentiment categories.

[0065] Tips based on annotation guidelines: To improve the accuracy of the large language model in identifying medical entities, entity definitions and language rules are provided through annotation guidelines. This part guides the large language model to understand the boundaries of each entity and improves the annotation accuracy of the large language model in specific fields through examples.

[0066] Annotated samples to support few-shot learning: Using a few-shot learning strategy, 1 or 5 annotated examples are randomly selected and formatted based on the task description and annotation guidelines. For example, in the sentence "He was diagnosed with knee osteoarthritis and underwent arthroscopy a few years before admission", "knee osteoarthritis" is annotated as a "medical disease" entity and "arthroscopy" is annotated as a "medical examination" entity. With a small number of annotated examples, large language models can better understand domain-specific tasks and improve their application results in medical texts.

[0067] In an embodiment of the present application, in step S200, a knowledge graph query statement is generated according to the entity list through the large language model, and a triple list is extracted on the knowledge graph through the knowledge graph query statement, prompting the large language model to perform semantic expansion and merging on the triple list to obtain a complete chain of evidence.

[0068] Based on the list of relevant medical entities extracted from the patient's questions, the large language model generates corresponding knowledge graph query statements based on these entities. These query statements can not only extract knowledge triples directly related to the question, but also fully consider the important information that may be contained in the node neighborhood. When designing the query logic, the knowledge associated with the node's two-hop neighbor nodes is also included in the return range. Knowledge graph query statements generally refer to structured queries used to retrieve information from the knowledge graph. These queries can be generated and executed in a variety of ways.

[0069] By executing the knowledge graph query statement, a series of triple lists can be obtained. In the knowledge graph generation, the triple list is used to store the nouns in the sentence and their dependencies. Subsequently, the powerful semantic understanding ability of the large language model is used to score the relevance of these triples and their value in answering the patient's questions one by one, and some triple lists that are not related to the questions are cut off. In addition, the large language model can also classify and merge triples through semantic expansion capabilities, and aggregate similar information into a complete chain of evidence. For example, for the two causes of "long-term smoking leads to decreased lung function and thus causes obstructive pulmonary disease" and "inhalation of a large amount of dust leads to impaired lung function and thus causes obstructive pulmonary disease", the large language model can, based on semantic understanding capabilities, unify "long-term smoking" and "inhalation of a large amount of dust" into "predisposing factors of obstructive pulmonary disease" and further construct a complete chain of evidence, thereby improving the logic and authority of the answer.

[0070] In an embodiment of the present application, in step S300, a prompt strategy is selected according to a prompt strategy selection model. The prompt strategy selection model can be a multi-armed bandit model (Multi-armed Bandit, MAB). After pruning and merging the triple list extracted from the knowledge graph to construct several evidence chains, a customized prompt strategy based on the multi-armed bandit model is further designed. Since the large language model is very sensitive to the performance of Prompt, different prompt formats (such as triples, natural language sentences, structured descriptions) may significantly affect the quality of the answer. Therefore, the goal of MAB is to dynamically select between different prompt strategies to find the optimal strategy while balancing exploration and utilization. The multi-armed bandit model is a classic reinforcement learning problem used to study online decision-making under uncertainty. The model usually consists of multiple options (called "arms"), each arm represents a potential strategy or choice, and the player needs to maximize the cumulative reward through continuous attempts.

[0071] In an embodiment of the present application, in step S310, the prompt strategy selection model includes multiple prompt strategies, the prompt strategies include a triple format, a sentence format and a graph description format, and the large language model generates multiple question answers according to the multiple prompt strategies.

[0072] In an embodiment of the present application, the prompt strategy selection model includes a variety of prompt strategies, including triple format, sentence format and graph description format: the triple format directly presents the triples in the question subgraph as prompts for large language model prediction. The format is such as: (COPD, need to be checked, lung function) (COPD, symptoms include, asthma) (COPD, may be accompanied by, spontaneous pneumothorax). The triple format consists of a subject, a predicate and an object, indicating the relationship between entities. The sentence format converts the triples in the question subgraph into natural sentence language as prompts for large language model prediction. For example: COPD is a chronic respiratory disease that requires a lung function test for diagnosis. Patients often have asthma symptoms, and may be accompanied by complications such as spontaneous pneumothorax during the course of the disease. The sentence format is commonly used in natural language processing tasks such as Web search, open question answering and natural language reasoning. It usually contains queries, documents and negative samples, and the format is (query, passage, negative). The graph description format uses structured language to describe the entire question subgraph as a prompt for large language model prediction. Provide more comprehensive background information and context associations. The present invention uses another large language model to preprocess this knowledge and highlight the central entity to generate a description. For example, COPD is a core disease entity of the respiratory system. Its diagnosis needs to be achieved through pulmonary function tests. Its clinical manifestations are characterized by persistent asthma and are associated with potential complications such as spontaneous pneumothorax. Graph description format: used to represent complex structural relationships, such as in knowledge graphs, to graphically display entities and their relationships.

[0073] like Figure 4Figure 1 shows a case study exploring the effectiveness of different prompting strategies for specific questions. The top of the figure shows the text input to the large language model. The extracted knowledge is displayed in the middle of the figure in the form of a graph, where the black nodes are the key question entities. The middle left side of the figure shows the key entities extracted from the knowledge graph. By prompting these entities, the large language model can perform semantic expansion and entity merging to build a chain of evidence. The middle right side of the figure shows the constructed chain of evidence, which not only includes the possible symptoms of COPD, but also covers the relevant examinations that need to be performed and the accompanying diseases. The core of this process is to use the model's in-depth understanding and integration of the relationships between entities, so that the final generated answer is more comprehensive and has reasoning capabilities. The text boxes at the bottom are the final prompts generated based on three different prompt strategies. The first column of text boxes is the final prompt generated based on the triple format, which directly presents the relationship between entities, is concise and clear, and is suitable for accurate information extraction. The second column of text boxes is the final prompt generated based on the sentence format. By converting triples into natural language, the semantic fluency and readability are enhanced, which is suitable for complex context understanding; the third column of text boxes is the final prompt generated based on the graph description format, which describes the network of entities and their relationships in detail through structured language, provides deep background information, and is suitable for dealing with complex problems that require a global perspective and reasoning. Answer Score is the answer score, which is obtained by scoring the three different prompt strategies using the critical model trained with previous expert diagnosis data. In this example, given the same extracted knowledge, the large language model generates the highest answer score based on the provided graph description format. It clearly shows its superiority in automatic context-aware timely translation. The following observations are obtained: the prompt strategy in the graph description format can introduce more descriptive text, enable the model to better understand key information, and improve the context fluency of the prompt text. Of course, the scores of the three prompt strategies are different in different situations. In this example, because "COPD" appears in the question, the knowledge of "COPD" is emphasized and connected with other concepts in the graph, which improves the model's understanding of COPD-related information. It can be seen that the prompt strategy selection model performs well in automatically constructing appropriate prompts for specific questions.

[0074] In an embodiment of the present application, in step S320, rewards are calculated based on answers to multiple questions of a large language model. The rewards include accuracy rewards, contextual adaptability rewards, and simplicity rewards. The scores of each prompt strategy are calculated through rewards, and then the prompt strategy is determined. In order to optimize the prompt selection strategy of the prompt strategy selection model, we introduce reinforcement learning into the training process of the prompt strategy selection model. For the patient's questions, all prompt strategies are used to generate answers, and rewards are calculated based on the performance of the model's answers.

[0075] In an embodiment of the present application, rewards are calculated based on answers to multiple questions of a large language model, and the rewards include accuracy rewards, contextual adaptability rewards, and concise rewards: the accuracy reward is rewarded based on whether the answer to the question generated by the large language model is correct. If the answer generated by the large language model is accurate, the reward is +11, otherwise the reward is 0. The contextual adaptability reward uses a semantic matching method to calculate the similarity between the prompt strategy and the question, and rewards are given based on the similarity. The BERT-Score semantic matching method is used to calculate the semantic distance between the prompt strategy and the question, and then determine the similarity. The higher the similarity, the higher the reward, and vice versa. BERT-Score is a semantic similarity evaluation method based on the BERT model, which measures the semantic similarity of two sentences by calculating the cosine similarity between word embeddings. Unlike traditional word matching, BERT-Score considers the lexical relationship in the context and can more accurately capture the similarity at the semantic level, so when evaluating the generated text, it can better reflect the actual semantic consistency. The concise reward is rewarded based on the effectiveness of the prompt strategy in representing the subgraph. Avoid overly lengthy descriptions, and concise and efficient prompt strategies will receive higher rewards.

[0076] In the embodiment of the present application, the score of each prompt strategy is calculated by rewarding, and then the prompt strategy is determined:

[0077] Get the historical average rewards for the tipping strategy:

[0078] ;

[0079] in Tips for strategy The historical average reward of is a positive integer, Tips for strategy The number of times selected, Tips for strategy The reward obtained when the kth selection is made, k is the number of times the prompt strategy is selected. The rewards received Then divide the total reward by the number of times the prompt strategy is selected. , thus obtaining the historical average reward of the prompt strategy.

[0080] The following formula calculates the score of the prompt strategy;

[0081] ;

[0082] in, is the score of the prompt strategy, To suggest strategies, is a positive integer, is the historical average reward of the tip strategy, which reflects the average performance of the strategy when it was selected in the past. A value of indicates that the strategy has historically performed well, and the model tends to rely on this strategy for “exploitation”; is the exploration parameter that controls the balance between “exploration” and “exploitation”. A value of encourages more exploration, prompting the model to try strategies that are not fully selected, while a smaller Value is more focused on leveraging strategies that are already performing well. It represents the logarithm with the mathematical constant e as the base, so that the power of e is equal to the exponential value of t; t is the total number of selections for the current problem, reflecting the training progress of the overall model; Tips for strategy The number of times selected is used to balance the fairness of strategy selection and avoid over-utilization of some strategies while ignoring other potential effective strategies. By adjusting the ratio of exploration to utilization, the model is prompted to maintain efficient utilization of existing experience while avoiding premature abandonment of new strategies with greater potential. The scores of the prompt strategies are compared, and the prompt strategy that meets the preset conditions is selected to determine the prompt strategy.

[0083] In each round of prompt strategy selection, the strategy that meets the preset conditions is the prompt strategy with a higher score. The strategy that meets the preset conditions will be selected first to ensure that the better prompt strategy can be fully utilized. At the same time, due to the exploration factor in the formula , templates with lower scores but fewer selections also have a certain probability of being tried, thus avoiding premature abandonment of potential efficient prompt strategies. By increasing the weight of the number of times selected, the confidence in the expected winning rate is increased, thus selecting the best option. By adjusting the parameters To control the degree of exploration, The larger the value, the more options will be explored.

[0084] In an embodiment of the present application, rewards are dynamically weighted, and for different types of patient questions, the reward weights are adaptively adjusted according to the complexity of the questions and the requirements for answer generation. Different types of patient questions include closed questions and open questions. For example, for open questions, the conciseness reward weight is higher, while for closed questions with clear answers, more attention will be paid to accuracy and contextual adaptability.

[0085] In an embodiment of the present application, a timely update strategy is used to update the reward weight after prompt strategy selection and reward calculation, thereby improving the efficiency of prompt strategy selection.

[0086] In an embodiment of the present application, in step S400, the chain of evidence is input into the large language model, and the large language model generates an answer to the question according to the prompt strategy and the chain of evidence.

[0087] The present invention provides a method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement. The large language model extracts a list of triples on the knowledge graph through knowledge graph query statements, and uses the semantic extension and semantic understanding capabilities of the large language model to prune and merge the triple lists, extracting evidence chains with strong correlation between information and questions from the knowledge graph, selecting a prompt strategy based on the prompt strategy selection model, and inputting the evidence chain into the large language model. The large language model generates accurate and reliable answers to questions based on the prompt strategy. The reasoning ability of the large language model is applied to the field of medical diagnosis of chronic obstructive pulmonary disease to assist doctors in making more accurate diagnoses and provide medical advice to patients. This requires integrating rich medical expertise in model training and adopting a verification mechanism to ensure the accuracy and reliability of the output. It aims to achieve more accurate and efficient medical diagnosis through the deep integration of the two technical advantages.

[0088] In addition, the present application also provides a storage medium having a computer program stored thereon, and when the computer program is run by a processor, the processor executes the above-mentioned method for diagnosing chronic obstructive pulmonary disease based on large model atlas retrieval enhancement according to an embodiment of the present application. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.

[0089] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present application to this. A person of ordinary skill in the art may make various changes and modifications therein without departing from the scope and spirit of the present application. All these changes and modifications are intended to be included within the scope of the present application as required by the appended claims.

[0090] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0091] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0092] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0093] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present application should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with features less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0094] Those skilled in the art will understand that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstract and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0095] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0096] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some modules according to the embodiments of the present application. The present application can also be implemented as a program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0097] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application can be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In the enumerated several unit claims, these several can be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

[0098] The above is only a specific implementation or description of a specific implementation of the present application, and the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for diagnosing chronic obstructive pulmonary disease based on large model graph retrieval enhancement, characterized in that: The method comprises: prompting the large language model to obtain the question input by the user, identify the user's intention, and extract the entity list of the question from the question; Generate a knowledge graph query statement based on the entity list through the large language model, extract a triple list on the knowledge graph through the knowledge graph query statement, and prompt the large language model to perform semantic expansion and merging on the triple list to obtain a complete chain of evidence; Select the cue strategy based on the cue strategy selection model; The prompt strategy is selected according to the prompt strategy selection model, including: the prompt strategy selection model includes multiple prompt strategies, the prompt strategies include a triple format, a sentence format and a graph description format, and the large language model generates multiple question answers according to the multiple prompt strategies; rewards are calculated according to the multiple question answers of the large language model, the rewards include accuracy rewards, context adaptability rewards and concise rewards, and the score of each prompt strategy is calculated through rewards, thereby determining the prompt strategy; The chain of evidence is input into a large language model, and the large language model generates an answer to the question according to the prompt strategy and the chain of evidence.

2. The method according to claim 1, characterized in that The prompt strategy selection model includes multiple prompt strategies, including triple format, sentence format and graph description format: The triple format directly presents the triples in the question subgraph as hints for the large language model to predict; The sentence format converts the triples in the question subgraph into natural sentence language as hints for the large language model to predict; The graph description format uses a structured language to describe the entire question subgraph as a hint for the large language model to predict.

3. The method according to claim 1, characterized in that The rewards are calculated based on the multiple question answers of the large language model, and the rewards include accuracy rewards, contextual adaptability rewards and conciseness rewards: The accuracy reward is awarded based on whether the answer to the question generated by the large language model is correct; The context adaptability reward uses a semantic matching method to calculate the similarity between the prompt strategy and the question, and rewards are given according to the similarity; The simplicity reward is awarded based on the effectiveness of the hint strategy in representing the subgraph.

4. The method according to claim 3, characterized in that The step of calculating the score of each prompt strategy through the reward, and then determining the prompt strategy, includes: Get the historical average reward of the tip strategy; The score of the prompt strategy was calculated by the following formula; ; in, is the score of the prompt strategy, To suggest strategies, is a positive integer, is the historical average reward of the prompt strategy; To explore the parameters, It represents the logarithm with the mathematical constant e as the base, so that the power of e is equal to the exponential value of t, where t is the total number of choices for the current question. Tips for strategy The number of times selected; The scores of the prompt strategies are compared, and the prompt strategy that meets the preset conditions is selected to determine the prompt strategy.

5. The method according to claim 4, characterized in that Dynamically weight rewards. For different types of patient questions, the reward weights are adaptively adjusted based on the complexity of the question and the requirements for answer generation. The different types of patient questions include closed questions and open questions.

6. The method according to claim 5, characterized in that Use the timely update strategy to update the reward weight after prompt strategy selection and reward calculation to improve the efficiency of prompt strategy selection.

7. The method according to claim 1, characterized in that Tip Large language models include: Combine the initial large language model with the named entity recognition model; An integrated learning module is constructed to complement the recognition results of the initial large language model and the named entity recognition model.

8. The method according to claim 7, characterized in that The integrated learning module combines the label prediction and probability distribution of each word of the initial large language model and the named entity recognition model into a training data set, and uses the training data set to train the meta-learner to learn how to combine the output of the initial large language model and the named entity recognition model for the final label prediction.

9. The method according to claim 7, characterized in that The named entity recognition model includes a language model based on the Transformer architecture, a bidirectional long short-term memory network layer, and a conditional random field layer: The language model based on the Transformer architecture encodes the question to obtain a dynamic word vector; The bidirectional long short-term memory network layer performs bidirectional semantic encoding on the dynamic word vector to obtain a vector with contextual features; The conditional random field layer classifies the vector to obtain an answer to the question.

10. The method according to claim 1, characterized in that The large language model includes a task prompt, and the task prompt includes: Baseline prompts with task descriptions and formatting specifications, prompts based on annotation guidelines, and annotated samples to support few-shot learning.

Citation Information

Patent Citations

  • Task unloading method based on QoE (Quality of Experience) perception and multi-layer guide reinforcement learning

    CN116471633A

  • Knowledge graph-based method for enhancing dual-carbon domain service of large language model

    CN117370580A

  • Reward model training method, answer evaluation method, device and equipment

    CN117688158A