A method for generating clinical case analysis questions based on multiple rounds of prompts
Through the interaction of multiple rounds of prompts and conversational large language models, the problem of automatically generating clinical case analysis questions in the medical field is solved, and efficient question generation under document-level input is achieved without providing answers. It is suitable for multiple languages. Especially in Chinese, it improves the economy and accuracy of question generation.
Patent Information
- Application Number
- CN202410224629.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-02-29
AI Technical Summary
The existing technology is difficult to automatically generate clinical case analysis problems in the medical field, especially in document-level long text input scenarios, and fails to make full use of human language expression skills and common sense knowledge, and is mainly concentrated on English data sets, lacking in Chinese and document-level input methods.
It uses a multi-round prompting method to interact with the conversational large language model, generates prompt words through the prompt word generator, extracts summary information round by round, analyzes the similarity of the question bank, derives question ideas and generates clinical case analysis questions, and does not provide answers. filter answerable questions.
It realizes the economical and efficient generation of clinical case analysis questions related to electronic medical records without requiring a lot of manual intervention. It supports multiple languages, is suitable for document-level text input, and improves the fluency and accuracy of question generation. .
Smart Images

Figure CN118014083B
Abstract
Description
Technical Field
[0001] The invention relates to a method for generating clinical case analysis questions based on multiple rounds of prompts, and belongs to the technical field of natural language processing. Background Art
[0002] Question generation is a natural language generation task, which aims to generate effective and fluent questions based on a given passage and a target answer. Question generation methods can be roughly divided into two categories: rule-based question generation and neural network-based question generation. Rule-based question generation relies on manually designed rules and templates to convert declarative sentences into interrogative sentences. Such methods require a lot of manpower and rely on deep grammatical knowledge, and have poor generalization performance and scalability. Neural network-based question generation, which applies end-to-end neural networks to question generation tasks, breaks away from the limitations of rule-based methods. The most classic model structure is the encoder-decoder structure. With the development of deep learning technology, the network structure used has gradually evolved from the initial RNN, LSTM, etc. to a unified Transformer architecture. Current methods still have some shortcomings: (1) Most methods require a passage of text and an answer to generate the corresponding question; (2) Previous methods have not yet fully utilized human knowledge, such as language retelling, experience and common sense; (3) Most methods are based on English data, and little work has been invested in basic data construction and model research for Chinese question generation. (4) Most of the current methods are based on sentence-level or paragraph-level input texts, and there are few question generation methods for document-level long text inputs.
[0003] With the rapid development of natural language processing technology, it has now entered the era of large models, and conversational large language models have shown amazing performance in many fields. Conversational large language models usually adopt the pre-training-fine-tuning paradigm. In the pre-training stage, the model performs self-supervised learning on large-scale unlabeled corpora. Then in the fine-tuning stage, the model performs supervised learning on various forms of instruction question and answer data. After the model is trained, its performance needs to be evaluated on the evaluation dataset. Whether it is the instruction dataset in the fine-tuning stage or the evaluation dataset in the evaluation stage, the construction of both requires a large number of text questions in various forms.
[0004] At present, industry-wide large models for fields such as medical care, education, and law are constantly emerging, and they also adopt the pre-training-fine-tuning paradigm. However, there are many difficulties in the process of building these industry-wide large models. The use of artificially generated questions in the fine-tuning and evaluation stages is not only time-consuming and laborious, but also may lead to a single form of generated questions due to the rigidity of people's thinking. In addition, in order to ensure the professionalism and reliability of the final model, most of the text questions required by these industry-wide large models need to be raised by industry experts. This means that compared with the construction of a general large language model, the industry-wide large language model will cost more in question generation.
[0005] For conversational large language models in the medical field, it is important to have the ability to analyze clinical cases. Through clinical case analysis, medical conversational large language models can help doctors diagnose diseases more accurately and treat diseases better. At the same time, they can also find some general rules and commonalities in horizontal or vertical comparisons and summaries of multiple cases. In the automatic generation of clinical case analysis questions, it is necessary to generate questions based on multiple electronic medical record documents, which is extremely challenging for the current question generation methods that are only applicable to sentence or paragraph levels.
[0006] Most current question generation methods require both text and the corresponding answer to generate relevant questions, which limits their practical application scenarios. In practice, question generation tasks usually only require a text paragraph to be given, and relevant questions need to be automatically generated. Therefore, it is necessary to develop a question generation method that can automatically generate questions with only a paragraph of text input.
[0007] Existing methods have not been able to fully utilize various human language expression skills and common sense knowledge for reasoning when automatically generating questions, which is very critical for generating questions with a certain degree of difficulty and logical reasoning. How to accurately apply human language expression skills and common sense knowledge to question generation tasks is a direction that needs improvement.
[0008] Existing research on question generation mainly focuses on English datasets, and less work has been devoted to Chinese question generation tasks. Chinese has different language characteristics from English, and it is necessary to study a language-independent question generation method.
[0009] Most of the current methods are studied on sentence-level or paragraph-level input text, and there are few question generation methods for document-level long text input. For the generation of clinical case analysis questions, the input text is often multiple electronic medical record documents. Therefore, it is necessary to study a question generation method for document-level long text input.
[0010] In summary, there is an urgent need for an economical and efficient method for the automatic generation of clinical case analysis problems, which is the core text problem in the construction of large models in the medical industry. Summary of the invention
[0011] In order to solve the above problems, the present invention provides a method for generating clinical case analysis questions based on multiple rounds of prompts. For a given electronic medical record of a patient, the present invention can obtain multiple case analysis questions related to the patient and with clinical significance, and can generate questions economically and efficiently.
[0012] The technical solution of the present invention is: a method for generating clinical case analysis questions based on multi-round prompts, including four rounds of interactive prompting processes with a conversational large language model:
[0013] The first round of prompts: The electronic medical records are sent to the prompt word generator to generate prompt words. Then, with the help of the inductive summarization ability of the large language model, the generated prompt words are sent to the conversational large language model to extract summary information from the medical records while also removing the patient's personal privacy information. Finally, the patient's case summary is obtained;
[0014] Second round of prompts: Compare and analyze the similarity between the patient's case summary and the questions in the medical record analysis question bank, select the top several case analysis question-and-answer questions, send these questions to the prompt word generator, and then send the generated prompt words to the conversational large language model. With the powerful creativity and rich knowledge reserve of the large language model, let the large language model summarize and derive question ideas from these several case analysis question-and-answer questions;
[0015] The third round of prompts: The case summary obtained in the first round of prompts and the question ideas obtained in the second round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to generate several clinical case analysis questions based on the provided case summary and question ideas;
[0016] Fourth round of prompts: The clinical case analysis questions generated by the model in the third round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to allow it to answer these case analysis questions while eliminating those questions that cannot be answered.
[0017] "Questioning ideas" refer to the logic and thinking paths generated in the second round of prompts to guide the formation of questions. This includes identifying key medical information in the case, relevant disease theories, possible clinical operations or treatment plans, etc., and then forming the direction and framework of specific questions.
[0018] "Unanswerable" questions are those that cannot be answered definitively due to insufficient information, the question being beyond current medical knowledge, or logical errors.
[0019] Furthermore, in the first round of prompts, the prompt word generator fills the electronic medical record into the first prompt word template to generate a prompt word; the first prompt word template includes two parts: [system] system message and [user] user message; in the system message, the conversational large language model plays the role of an artificial intelligence-assisted doctor to facilitate the completion of subsequent tasks; in the user message, the content of the electronic medical record is first roughly described, followed by the fill-in position of the electronic medical record {electronic medical record}, and finally the instruction to guide the model to summarize the content of the medical record.
[0020] Furthermore, the second round of prompts includes the following: the case analysis question bank is composed of case analysis questions from various medical examinations that can be collected on the Internet, and does not contain completely repeated or overly similar questions; each case analysis question contains three parts: medical record summary, question and answer, and only the analysis and comparison between medical record summaries are performed when performing similarity analysis; the measurement index of text similarity is BertScore, a measurement index based on a pre-trained language model, and its calculation method is shown in formula (1), where , and Represents recall rate, precision rate and F1 score respectively, generally used As the final BertScore, Indicates reference text, represents the candidate text, Represents a word in the reference text, indicating A word in the candidate text, and Represents the context word embedding vector corresponding to the word unit;
[0021]
[0022] After completing the similarity analysis and comparison between the case summary and the case analysis question bank, 5 case analysis questions that are most similar to the medical record summary obtained in the first round of prompts are selected from the case analysis question bank. The measurement index and similarity judgment adopt the measurement index BertScore based on the pre-trained language model. Its calculation method is shown in formula (1). The relevant case analysis questions and medical record summaries are sent to the prompt word generator together. The prompt word generator then fills these inputs into the second prompt word template to generate prompt words, and finally sends the prompt words to the conversational large language model. The second prompt word template has the same structure as the first prompt word template and is also composed of a system message [system] and a user message [user]. The content of the system message is the same as that in the first prompt word template. In the user message of the second prompt word template, the text information provided and the location of these text fillings are first explained; then the conversational large language model is instructed to generate question ideas around the medical record summary and the relevant case analysis questions. Finally, the conversational large language model generates question generation ideas.
[0023] Furthermore, the third round of prompts includes the following: the prompt word generator generates prompt words based on the third prompt word template to be sent to the conversational large language model; in the user message of the third prompt word template, the provided text information and the positions of these text fillings are first explained, and then the conversational large language model is allowed to generate answerable and clinically meaningful instructions based on the given medical record summary and question generation ideas, and finally the conversational large language model generates clinical case analysis questions.
[0024] Furthermore, the fourth round of prompts includes the following: the prompt word generator generates prompt words based on the fourth prompt word template to be sent to the conversational large language model. The user message of the fourth prompt word template includes instructions for the conversational large language model to screen medical record analysis questions and fill-in positions for clinical case analysis questions {clinical pathology analysis questions}, and finally the screened clinical case analysis questions are obtained.
[0025] The beneficial effects of the present invention are:
[0026] 1. In order to solve the problem that the text in the input electronic medical record is too long and the information contained is too sparse. In the first round of prompts, the present invention first refines the information of the input electronic medical record, retains the information with important clinical significance and removes useless information such as personal privacy;
[0027] 2. In order to enable the model to generate questions well without being provided with answers, in the second round of prompts, the present invention finds case analysis questions similar to the provided electronic medical records from the case analysis seed library constructed by human experts, and allows the model to summarize the ideas of these case analysis questions, and at the same time derives them based on these ideas;
[0028] 3. To ensure that the questions generated by the model are effective and smooth. In the fourth round of prompts, the present invention allows the model to answer the clinical case analysis questions generated by itself, and at the same time screens the questions, retaining only those questions that the model believes can be answered and have clinical significance;
[0029] 4. The method proposed in the present invention can support multiple languages such as Chinese and English. As long as the language is supported by the conversational large language model used, the present invention can work. The method proposed in the present invention can also work for document-level long text input such as electronic medical records. The method provided by the present invention is economical, efficient and easy to use. There is no need to train a question generation model additionally, only the existing conversational large language model can be used. When generating clinical case analysis questions, only the patient's electronic medical record needs to be provided, and no answer is required. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flow chart of the present invention;
[0031] Figure 2 This is the first round of prompting flow chart of the present invention;
[0032] Figure 3 This is the second round of prompting flow chart of the present invention;
[0033] Figure 4 This is the third round of prompting flow chart of the present invention;
[0034] Figure 5 This is the fourth round of prompting flow chart of the present invention. DETAILED DESCRIPTION
[0035] Example 1: Figure 1-Figure 5 As shown, a method for generating clinical case analysis questions based on multiple rounds of prompts. Generally speaking, the method of the present invention involves four rounds of interaction with the conversational large language model, starting from the input of electronic medical records to the generation of the final clinical case analysis topic. The prompt word generator is a "bridge" for interacting with the conversational large language model. It fills the input text into the corresponding position in the prompt word template to obtain prompt words that enable the conversational large language model to complete some tasks better. In these four rounds of prompting, the tasks to be completed by the conversational large language model are different in each stage and the input text of the prompt word generator is also different, so the prompt word template in each prompting process is different. The following will explain these four rounds of prompting processes one by one:
[0036] First round of tips: Figure 2As shown in the figure, the electronic medical records including admission records, medical history records, consultation records, anesthesia records, operation records, operation nursing records, medical imaging examination data, pathological examination data, medical test data, serious (critical) nursing records, inpatient health examination records, etc. are sent to the prompt word generator to generate prompt words, and then with the help of the summarization and summary ability of the large language model, the generated prompt words are sent to the conversational large language model to extract summary information from the medical records while also removing the patient's personal privacy information, and finally the patient's case summary is obtained;
[0037] Furthermore, in the first round of prompts, the prompt word generator fills the electronic medical record into the first prompt word template to generate a prompt word; the first prompt word template includes two parts: [system] system message and [user] user message; in the system message, the conversational large language model plays the role of an artificial intelligence-assisted doctor to facilitate the completion of subsequent tasks; in the user message, the content of the electronic medical record is first roughly described, followed by the fill-in position of the electronic medical record {electronic medical record}, and finally the instruction to guide the model to summarize the content of the medical record.
[0038] Second round of prompts: Figure 3 As shown in the figure, the patient's case summary is compared with the questions in the medical record analysis question bank for similarity analysis, and the case analysis question-answering questions with the top similarity rankings are selected. These questions are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model. With the powerful creativity and rich knowledge reserves of the large language model, the large language model is allowed to summarize and derive question ideas from these case analysis question-answering questions;
[0039] Furthermore, the second round of prompts includes the following: the case analysis question bank is composed of case analysis questions from various medical examinations that can be collected on the Internet, and does not contain completely repeated or overly similar questions; each case analysis question contains three parts: medical record summary, question and answer, and only the analysis and comparison between medical record summaries are performed when performing similarity analysis; the measurement index of text similarity is BertScore, a measurement index based on a pre-trained language model, and its calculation method is shown in formula (1), where , and Represents recall rate, precision rate and F1 score respectively, generally used As the final BertScore, Indicates reference text, represents the candidate text, Represents a word in the reference text, indicating A word in the candidate text, and Represents the context word embedding vector corresponding to the word unit;
[0040]
[0041] After completing the similarity analysis and comparison between the case summary and the case analysis question bank, 5 case analysis questions that are most similar to the medical record summary obtained in the first round of prompts are selected from the case analysis question bank. The measurement index and similarity judgment adopt the measurement index BertScore based on the pre-trained language model. Its calculation method is shown in formula (1). The relevant case analysis questions and medical record summaries are sent to the prompt word generator together. The prompt word generator then fills these inputs into the second prompt word template to generate prompt words, and finally sends the prompt words to the conversational large language model. The second prompt word template has the same structure as the first prompt word template and is also composed of a system message [system] and a user message [user]. The content of the system message is the same as that in the first prompt word template. In the user message of the second prompt word template, the text information provided and the location of these text fillings are first explained; then the conversational large language model is instructed to generate question ideas around the medical record summary and the relevant case analysis questions. Finally, the conversational large language model generates question generation ideas.
[0042] Tips for the third round: Figure 4 As shown, the case summary obtained in the first round of prompts and the question ideas obtained in the second round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to generate several clinical case analysis questions based on the provided case summary and question ideas;
[0043] Furthermore, the third round of prompts includes the following: the prompt word generator generates prompt words sent to the conversational large language model based on the third prompt word template; the third prompt word template has the same overall structure and system message as the above prompt word template. In the user message of the third prompt word template, the provided text information and the location of these text fillings are first explained, and then the conversational large language model is allowed to generate answerable and clinically meaningful instructions based on the given medical record summary and question generation ideas, and finally the conversational large language model generates a clinical case analysis question.
[0044] Fourth round of prompts: The clinical case analysis questions generated by the model in the third round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to allow it to answer these case analysis questions while eliminating those questions that cannot be answered.
[0045] "Questioning ideas" refer to the logic and thinking paths generated in the second round of prompts to guide the formation of questions. This includes identifying key medical information in the case, relevant disease theories, possible clinical operations or treatment plans, etc., and then forming the direction and framework of specific questions.
[0046] "Unanswerable" questions are those that cannot be answered definitively due to insufficient information, the question being beyond current medical knowledge, or logical errors.
[0047] Furthermore, if Figure 5 As shown, the fourth round of prompts includes the following: the prompt word generator generates prompt words sent to the conversational large language model based on the fourth prompt word template, and the fourth prompt word template has the same overall structure and system message as the above prompt word template. The user message of the fourth prompt word template includes instructions for the conversational large language model to screen medical record analysis questions and the filling position of clinical case analysis questions {clinical pathology analysis questions}, and finally obtains the screened clinical case analysis questions, which have higher answerability and richer clinical significance.
[0048] The existing methods are not suitable for generating scenarios such as document-level long text input for clinical case analysis questions. The present invention can only be compared with clinical case analysis questions written by human experts. The following table shows the comparison results of clinical case analysis questions automatically generated by the present invention and written by human experts. The present invention has achieved good results in speed and cost, and the accuracy is not low.
[0049] Table 1 is a comparison of the effects of using the present invention to automatically generate and experts to write clinical case analysis questions
[0050]
[0051] Experimental setup: Table 1 During the experiment, a clinician and the present invention were given 200 electronic medical records of patients respectively, and they were required to write 5 case analysis questions based on each medical record, that is, a total of 1000 case analysis questions. In order to enable clinicians to better understand the process of writing questions, we trained them before writing began, and provided the requirements for writing questions and some examples of clinical case analysis questions. Finally, we counted the time, money consumed by the two and the accuracy of writing questions. For expert writing, the time of the training process is not included in the statistical range, and the money spent is calculated using the standard of the average clinical income of Chinese doctors in the "2022 China Hospital Human Resources Status Survey Report". The accuracy rate refers to the proportion of questions that are answerable and clinically significant that are finally obtained by expert writing or automatic generation methods.
[0052] Result analysis: As can be seen from Table 1, compared with the method written by experts, although the accuracy of the present invention in generating clinical case analysis questions is slightly lower than that of the method written by experts, the time and money consumption of the present invention is much lower than that of the method written by experts. Therefore, under the premise of sacrificing a certain accuracy rate, the present invention is an economical, fast and efficient method for generating clinical case analysis questions.
[0053] Figure 2-Figure 5 The rightmost is an example of the prompt word template used in each round of prompting (the prompt word is the text fed into the conversational large language model, the prompt word template is a component designed to complete the core function of each round of prompting, and the prompt word generator is a module that splices the input text into the specified position in the prompt word template and generates the prompt word). It is part of the present invention, not an example in the implementation process of the present invention. During the implementation process, the prompt word template is fixed and unchanged, and only the prompt word fed into the conversational large language model changes. In actual implementation, the prompt word template is not required to be completely consistent with the prompt word template example we provide. The present invention can also be successfully implemented by slightly changing the prompt word template.
[0054] Prompt word template 1: Aims to use the computing and knowledge advantages of the artificial intelligence system to extract and filter information from the input detailed electronic medical records to generate a concise case summary that contains key clinical information.
[0055] Prompt Word Template 2: Aims to derive new question ideas by analyzing the question ideas of existing case analysis questions. Without giving answers, new high-quality case analysis questions are intelligently generated for new medical record summaries.
[0056] Prompt Template 3: Aims to provide clear ideas for generating case analysis questions, guiding the model to step by step generate clinically meaningful questions and answers around a given medical record, thereby generating high-quality case analysis questions.
[0057] Prompt Template 4: By letting the model filter the generated questions, retain the answerable parts, and use the model's own knowledge to verify and improve the quality and effectiveness of the question set.
[0058] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for generating clinical case analysis questions based on multiple rounds of prompts, characterized in that: Including four rounds of interactive prompts with a large conversational language model: The first round of prompts: The electronic medical records are sent to the prompt word generator to generate prompt words, and then the generated prompt words are sent to the conversational large language model to extract summary information from the medical records while also removing the patient's personal privacy information, and finally the patient's case summary is obtained; Second round of prompts: perform a similarity comparison analysis between the patient's case summary and the questions in the medical record analysis question bank, select the top several case analysis question-and-answer questions with the highest similarity, send these questions to the prompt word generator, and then send the generated prompt words to the conversational large language model, so that the large language model can summarize and derive question ideas from these several case analysis question-and-answer questions; The third round of prompts: The case summary obtained in the first round of prompts and the question ideas obtained in the second round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to generate several clinical case analysis questions based on the provided case summary and question ideas; Fourth round of prompts: The clinical case analysis questions generated by the model in the third round of prompts are sent to the prompt word generator, and then the generated prompt words are sent to the conversational large language model to let it answer these case analysis questions while eliminating those questions that cannot be answered; The second round of prompts includes the following: the case analysis question bank is composed of case analysis questions from various medical examinations that can be collected on the Internet, and does not contain completely repeated or overly similar questions; each case analysis question contains three parts: medical record summary, question and answer. When performing similarity analysis, only the analysis and comparison between medical record summaries are performed; the text similarity measurement index is the measurement index BertScore based on the pre-trained language model, and its calculation method is shown in formula (1), where , and Represent the recall rate, precision rate and F1 score respectively, using As the final BertScore, Indicates reference text, represents the candidate text, represents a word in the reference text, represents a word in the candidate text, and Represents the context word embedding vector corresponding to the word unit; ; After completing the similarity analysis and comparison between the case summary and the case analysis question bank, 5 case analysis questions that are most similar to the medical record summary obtained in the first round of prompts are selected from the case analysis question bank. The measurement index and similarity judgment adopt the measurement index BertScore based on the pre-trained language model. Its calculation method is shown in formula (1). The relevant case analysis questions and medical record summaries are sent to the prompt word generator together. The prompt word generator then fills these inputs into the second prompt word template to generate prompt words, and finally sends the prompt words to the conversational large language model. The second prompt word template has the same structure as the first prompt word template and is also composed of system messages and user messages. The content of the system message is the same as that in the first prompt word template. In the user message of the second prompt word template, the provided text information and the location of these text fillings are first explained; then the conversational large language model is instructed to generate question ideas around the medical record summary and the relevant case analysis questions. Finally, the conversational large language model generates question generation ideas.
2. The method for generating clinical case analysis questions based on multiple rounds of prompts according to claim 1, characterized in that: In the first round of prompts, the prompt word generator fills the electronic medical record into the first prompt word template to generate prompt words; the first prompt word template contains two parts: system message and user message; in the system message, the conversational large language model plays the role of an artificial intelligence to assist doctors in completing subsequent tasks; in the user message, the content of the electronic medical record is first described, followed by the filling position of the electronic medical record, and finally the instructions to guide the model to summarize the content of the medical record.
3. The method for generating clinical case analysis questions based on multiple rounds of prompts according to claim 1, characterized in that: The third round of prompts includes the following: the prompt word generator generates prompt words based on the third prompt word template to be sent to the conversational large language model; in the user message of the third prompt word template, the provided text information and the positions of these text fillings are first explained, and then the conversational large language model is allowed to generate answerable and clinically meaningful instructions based on the given medical record summary and question generation ideas, and finally the conversational large language model generates clinical case analysis questions.
4. The method for generating clinical case analysis questions based on multiple rounds of prompts according to claim 1, characterized in that: The fourth round of prompts includes the following: the prompt word generator generates prompt words based on the fourth prompt word template to be sent to the conversational large language model. The user message of the fourth prompt word template includes instructions for the conversational large language model to screen medical record analysis questions and fill-in positions for clinical case analysis questions, and finally obtains screened clinical case analysis questions.
