Blood gas analysis and diagnosis system and method based on prompt learning, medium, program product and terminal
Through the blood gas analysis and diagnosis system based on prompt learning, the problem of relying on expert manual design rules in the existing technology is solved, and efficient and economical blood gas analysis and diagnosis is achieved. The generated diagnostic results can form electronic medical record archives, reduce labor costs, and improve the efficiency of medical resource utilization.
Patent Information
- Application Number
- CN202411646161.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-28
AI Technical Summary
The existing blood gas analysis and diagnosis system relies on expert manual design rules, resulting in incomplete rule coverage, high maintenance costs, difficult to scale, and the inability to directly generate archiveable electronic diagnosis.
The blood gas analysis and diagnosis system based on prompt learning is adopted, and the training sample set is generated through the data preprocessing module. The target prompt template generation module builds the initial prompt template and generates the target prompt template through the learning of the large language model. The alternative prompt strategy acquisition module filters the prompt template that meets the conditions, and the prompt strategy combination module is augmented and combined to generate the final diagnostic results.
Intelligent auxiliary diagnosis without relying on a large amount of storage space and computing resources is realized. The generated diagnostic results can form electronic medical record archives, reduce labor costs, and improve the efficiency of medical resource utilization.
Smart Images

Figure CN119541833A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of prompt learning technology, and in particular to a blood gas analysis diagnosis system, method, medium, program product and terminal based on prompt learning. Background Art
[0002] Currently, blood gas analysis is a key medical laboratory test that plays a vital role in diagnosing and monitoring various diseases or conditions related to the respiratory system, cardiac system, and acid-base balance. This test mainly analyzes multiple key parameters in the blood, including pH, partial pressure of oxygen (PaO2), partial pressure of carbon dioxide (PaCO2), blood oxygen saturation (SaO2), standard bicarbonate (SB), actual bicarbonate (AB), and excess base (BE). Relying on the values of these key parameters, doctors can help determine whether the patient has hypoxemia, hypercapnia, acid-base imbalance, or other abnormalities related to the respiratory system, cardiac system, or acid-base balance. This information is very important for guiding treatment decisions, monitoring disease progression, and evaluating the patient's overall health.
[0003] Automated auxiliary analysis and diagnosis of blood gas analysis parameter values is of great significance. It can provide results faster, reduce human errors, reduce labor costs, collect and analyze large amounts of data, and thus improve the efficiency of medical resource utilization. The process of analyzing blood gas analysis parameter values and then making a diagnosis belongs to the classification task: in this task, the input is the parameter value obtained by the blood gas analyzer, and the output is the diagnosis (e.g., respiratory acidosis). There are a lot of research and technical accumulation on classification tasks, which can be divided into three categories: rule-based methods, which classify text by defining a set of rules or patterns, usually requiring the participation of domain experts to design rules and then perform pattern matching; statistical methods, including Naive Bayes Classifier, Support Vector Machine and Maximum Entropy Model, which train classification models by counting features in text (such as word frequency, TF-IDF, etc.); deep learning-based methods, including Recurrent Neural Network, Convolutional Neural Network and Attention Mechanism, which classify by learning the semantic representation of text and can automatically extract useful features from text. With the development of deep learning structure design, the research on Transformer-type language models and generative models has been deepened, and large model technology has made significant breakthroughs in recent years. For example, OpenAI's GPT series of models have performed well in language generation and question-answering systems, and large models also have extraordinary potential in auxiliary diagnosis.
[0004] There are currently two main methods for automated analysis of blood gas analysis parameter values: one is a rule-based method, and the other is a classification method based on machine learning and deep learning. Among them, the rule-based method relies heavily on manual design of rules by experts, which may lead to problems such as incomplete rule coverage, high maintenance costs, and difficulty in expansion, which is particularly evident when dealing with large-scale and complex data sets. The classification method based on machine learning and deep learning has strict rule requirements for the form of input and output, so additional pre- / post-processing modules are required, and it is impossible to directly generate archivable electronic diagnoses, which limits its application in clinical practice. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, the present invention provides a blood gas analysis diagnosis system, method, medium, program product and terminal based on prompt learning, which is used to solve the problems in the prior art that blood gas analysis diagnosis relies on manual design of rules by experts, which may result in incomplete rule coverage, high maintenance cost, difficulty in expansion, and inability to directly generate archivable electronic diagnosis.
[0006] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a blood gas analysis and diagnosis system based on prompt learning, including: a data preprocessing module, used to obtain historical blood gas test data, and generate a training sample set and a verification sample set after preprocessing the historical blood gas test data; a target prompt template generation module, used to construct multiple initial prompt templates, and use the training sample set to learn each of the initial prompt templates based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates; an alternative prompt strategy acquisition module, used to input each target prompt template and the verification sample set into the pre-trained large language model for evaluation and verification, so as to obtain the evaluation and verification results under each target prompt template, and use the corresponding target prompt template whose evaluation and verification results meet the preset verification requirements as an alternative prompt strategy; a prompt strategy combination module, used to perform augmented combination based on each of the alternative prompt strategies and input the blood gas test data to be analyzed into the pre-trained large language model to obtain a blood gas analysis diagnosis result.
[0007] In some embodiments of the first aspect of the present application, the process of constructing multiple initial prompt templates includes: adjusting the diagnostic information placeholders, blood gas index parameter values and the positions of multiple learnable vectors within the preset prompt template to generate multiple initial prompt templates.
[0008] In some embodiments of the first aspect of the present application, the process of learning each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates includes: inputting any initial prompt template and the training sample set into the pre-trained large language model to obtain a prediction result; calculating a loss function based on the prediction result and the actual result of the training sample set; using an optimization algorithm to update the weight of the learnable vector of any initial prompt template to reduce the loss function; iterating the optimization until the preset iteration requirements are met to complete the weight update of the learnable vector of any initial prompt template to obtain the target prompt template corresponding to any initial prompt template.
[0009] In some embodiments of the first aspect of the present application, the combination method based on the augmented combination of each of the alternative prompt strategies includes: inputting any alternative prompt strategy among the alternative prompt strategies and the blood gas detection data to be analyzed into the pre-trained large language model to obtain the prompt output result corresponding to the any alternative prompt strategy; combining the prompt output result corresponding to the any alternative prompt strategy and the next alternative prompt strategy to form a new combined prompt strategy and inputting it into the pre-trained large language model to obtain the prompt output result corresponding to the new combined prompt strategy; and so on, until all the alternative strategies are combined to obtain the final combined prompt strategy.
[0010] In some embodiments of the first aspect of the present application, the combination method based on the augmented combination of each of the alternative prompt strategies also includes: inputting each alternative prompt strategy and the blood gas detection data to be analyzed into a pre-trained large language model to obtain the prompt output results corresponding to each alternative prompt strategy; combining the prompt output results corresponding to each alternative prompt strategy to form a final combined prompt strategy.
[0011] In some embodiments of the first aspect of the present application, the combination method based on the augmented combination of each of the alternative prompt strategies also includes: selecting any one of the alternative prompt strategies from each of the alternative prompt strategies and combining it with a preset prefix to form a final combined prompt strategy.
[0012] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a blood gas analysis and diagnosis method based on prompt learning, which is applied to the blood gas analysis and diagnosis system based on prompt learning as described above, and the method includes: obtaining historical blood gas test data, preprocessing the historical blood gas test data to generate a training sample set and a verification sample set; constructing multiple initial prompt templates, and using the training sample set to learn each of the initial prompt templates based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates; inputting each target prompt template and the verification sample set into the pre-trained large language model for evaluation and verification to obtain an evaluation and verification result under each target prompt template, and using the corresponding target prompt template whose evaluation and verification result meets the preset verification requirements as an alternative prompt strategy; performing augmented combination based on each of the alternative prompt strategies and inputting the blood gas test data to be analyzed into the pre-trained large language model to obtain a blood gas analysis and diagnosis result.
[0013] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the blood gas analysis diagnostic method based on prompt learning is implemented.
[0014] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements the blood gas analysis diagnostic method based on prompt learning.
[0015] To achieve the above-mentioned purpose and other related purposes, the fifth aspect of the present application provides an electronic terminal, including a memory, a processor and a computer program stored in the memory; the processor executes the computer program to implement the blood gas analysis diagnostic method based on prompt learning.
[0016] As described above, the blood gas analysis diagnosis system, method, medium, program product and terminal based on prompt learning provided by the present application have the following beneficial effects:
[0017] This application includes a target prompt template generation module and a prompt strategy combination module. The target prompt template generation module sets a set of learnable vectors as prompt tokens, which are used as alternative prompt strategies after training with a small number of samples. The prompt strategy combination module further enhances the prompt effect of the alternative prompt strategy after training, combines each alternative prompt strategy by augmentation and aggregation, and uses it as a new prompt input for the large model to guide the model to generate more reasonable text content. This application allows fine-tuning the large model without consuming a lot of storage space and computing resources. It can also adjust the text generation through prompt learning to be suitable for intelligent auxiliary diagnosis (blood gas analysis diagnosis) of medical water, electricity and acid-base imbalance types. The generated diagnostic results can be archived in electronic medical records, thereby reducing labor costs and improving the utilization efficiency of medical resources. At the same time, efficient archiving of patients' blood gas analysis diagnosis electronic medical records is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a structural schematic diagram of a blood gas analysis and diagnosis system based on prompt learning in one embodiment of the present application.
[0019] Figure 2 Shown is a specific embodiment diagram of a target prompt template generation module in one embodiment of the present application.
[0020] Figure 3 Shown is a structural diagram of a first combination method for augmenting a combination of alternative prompt strategies in an embodiment of the present application.
[0021] Figure 4 Shown is a structural diagram of a second combination method for augmenting a combination of alternative prompt strategies in an embodiment of the present application.
[0022] Figure 5Shown is a structural schematic diagram of a third combination method for augmenting a combination of alternative prompt strategies in an embodiment of the present application.
[0023] Figure 6 Shown is a schematic diagram of the dialogue effect of a large language model through manual input of prompt sentences in one embodiment of the present application.
[0024] Figure 7 Shown is a schematic diagram of a large language model outputting blood gas analysis diagnosis results in one embodiment of the present application.
[0025] Figure 8 Shown is a schematic diagram of a language model outputting treatment suggestions in one embodiment of the present application.
[0026] Fig. 9 Shown is a specific embodiment diagram of a blood gas analysis diagnosis system based on prompt learning in one embodiment of the present application.
[0027] Fig.10 Shown is a flow chart of a blood gas analysis diagnostic method based on prompt learning in one embodiment of the present application.
[0028] Fig.11 Shown is a schematic diagram of the structure of an electronic terminal in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0030] The blood gas analysis diagnosis system based on prompt learning provided in the embodiment of the present application includes a target prompt template generation module and a prompt strategy combination module. The target prompt template generation module sets a set of learnable vectors as prompt Tokens, which are used as alternative prompt strategies after training with a small number of samples. The prompt strategy combination module further enhances the prompt effect of the alternative prompt strategy after training, combines each alternative prompt strategy by augmentation and aggregation, and uses it as a new prompt input for the large model to guide the model to generate more reasonable text content. The present application allows fine-tuning the large model without consuming a large amount of storage space and computing resources, and can also adjust the text generation through prompt learning to be suitable for intelligent auxiliary diagnosis (blood gas analysis diagnosis) of medical water, electricity and acid-base imbalance types. The generated diagnostic results can be archived in electronic medical records, thereby reducing labor costs and improving the utilization efficiency of medical resources.
[0031] To facilitate understanding of the embodiments of the present application, first Figure 1 Detailed description. Figure 1 The structure diagram of a blood gas analysis diagnosis system based on prompt learning in an embodiment of the present invention is shown. The system in this embodiment includes: a data preprocessing module 110, a target prompt template generation module 120, an alternative prompt strategy acquisition module 130, and a prompt strategy combination module 140; the data preprocessing module 110 is connected to the target prompt template generation module 120, the target prompt template generation module 120 is connected to the alternative prompt strategy acquisition module 130, and the alternative prompt strategy acquisition module 130 is connected to the prompt strategy combination module 140.
[0032] In one embodiment, the data preprocessing module 110 is used to obtain historical blood gas test data, and to generate a training sample set and a verification sample set after preprocessing the historical blood gas test data.
[0033] It should be noted that a small amount of historical blood gas test data is obtained, and the blood gas test data is preprocessed by sentence segmentation and category information extraction to obtain the true diagnosis results. Among them, sentence segmentation is to divide the text in the blood gas test data into separate sentences or paragraphs, which may contain diagnostic information (such as "respiratory acidosis") or treatment recommendations (such as "give oxygen therapy"), and category information extraction is also performed, that is, identifying and classifying key medical terms and diagnoses in the text, for example, identifying "respiratory acidosis" as a specific diagnostic category.
[0034] After preprocessing the blood gas detection data, it is divided into a training sample set, a verification sample set and a test sample set. In this embodiment, 10 samples can be selected as the training sample set, which includes a training sample input data set and a training sample output data set. The actual diagnosis result is the training sample output data set.
[0035] In one embodiment, the target prompt template generation module 120 is connected to the data preprocessing module 110, and is used to construct multiple initial prompt templates, and use a training sample set based on a pre-trained large language model to learn each of the initial prompt templates to obtain a target prompt template corresponding to each of the initial prompt templates.
[0036] It should be explained that the Large Language Model (LLM) is a general model for natural language processing based on deep learning technology. It can understand and generate natural language by learning the patterns and rules of large-scale text data. In practical applications, in order to control the large language model to answer user input questions in a specified response style, it is necessary to fine-tune the large language model to generate various proprietary scenario models with specific response styles.
[0037] The large language model may include but is not limited to the following models: InternLM model, ChatGLM model, ChatGPT model, LLaMA model, etc. Taking the InternLM model as an example, when diagnosing the type of water-electrolyte acid-base imbalance during blood gas analysis, it is hoped that the InternLM model will be used to generate accurate electronic diagnostic text results. However, the InternLM model can only understand and create general texts, and usually does not have the function of accurately identifying and diagnosing complex medical terms and medical parameters. Therefore, in this embodiment, the pre-trained large language model InternLM model is fine-tuned based on the prompt learning method combined with the medical reports and diagnostic information in the medical data. The fine-tuned InternLM model can be more familiar with the medical terms of blood gas analysis diagnosis and the structure of the diagnostic report, etc., so that the blood gas analysis diagnosis results can be output more accurately, and it has the applicability to specific medical tasks.
[0038] Furthermore, prompt learning is a machine learning paradigm, especially in the field of natural language processing, which is achieved by converting tasks into a form that can be understood by a trained language model. The core idea of this method is to use the powerful capabilities of pre-trained large language models to guide the model to complete specific tasks through carefully designed prompts, rather than training a model from scratch. By changing the prompts, large language models can be easily applied to different tasks without retraining, and the demand for computing resources and time can be significantly reduced. Prompt learning is applied in the medical field and can be used for tasks such as auxiliary diagnosis, case analysis, and drug interaction prediction. By designing appropriate prompts to guide the model to focus on key information in medical texts, it can help doctors make diagnostic decisions faster and improve medical efficiency.
[0039] In some examples, the process of constructing multiple initial prompt templates includes: adjusting the diagnostic information placeholders, blood gas index parameter values, and positions of multiple learnable vectors within the preset prompt templates to generate multiple initial prompt templates.
[0040] It should be noted that if Figure 2As shown, a preset prompt template containing context words is designed. The preset prompt template contains a diagnostic information placeholder "others". The diagnostic information placeholder is used to add other necessary diagnostic information in addition to the blood gas index parameter value, such as age, gender, whether fainting, etc.; the preset prompt template also includes the blood gas index parameter value {S i}, such as pH value, oxygen partial pressure (PaO2), carbon dioxide partial pressure (PaCO2), blood oxygen saturation (SaO2), etc.; the preset prompt template also has multiple learnable vectors designed, which will be learned and updated during the training process to better capture the relationship between contextual information and blood gas index parameter values and diagnostic information. The preset prompt template can be used to guide the text generation of the general language model.
[0041] Combination Figure 2 Note that in this embodiment, based on the preset prompt template, the diagnostic information placeholder, blood gas index parameter value and the position relationship of multiple learnable vectors are modified to generate multiple initial prompt templates, for example, Prompt1 is [V1, V2, V3, V4, others, {S i}], Prompt2 is [V1, V2, {S i}, others, V3, V4], ..., Prompt n For [V1, V2, {S i}, V3, V4, others]. Prompt1, Prompt2 until Prompt n This is mainly reflected in the different positional relationships in the sequence, so the generated initial prompt template has different fine-tuning effects on the pre-trained large language model. In this embodiment, the learnable vectors [V1, V2, V3, V4] need to be learned to obtain a prompt template with better prompting effect.
[0042] In some examples, the process of learning each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates includes: inputting any initial prompt template and a training sample set into the pre-trained large language model to obtain a prediction result; calculating a loss function based on the prediction result and the actual result of the training sample set; using an optimization algorithm to update the weight of the learnable vector of any initial prompt template to reduce the loss function; iterating the optimization until the weight update of the learnable vector of any initial prompt template is completed when a preset iteration requirement is met to obtain a target prompt template corresponding to any initial prompt template.
[0043] It should be explained that the process of obtaining the target prompt templates corresponding to each of the initial prompt templates is to learn the learnable vectors in each initial prompt template to fix the value of the learnable vectors in each initial prompt template. In this embodiment, any initial prompt template and training sample set are first input into the pre-trained large language model, and the weights of the learnable vectors in any initial prompt template are initialized with random values. All weights of the pre-trained large language model remain fixed. At this time, the pre-trained large language model outputs the prediction results of the current training sample set under the prompt of the initialized initial prompt template. Then, the current loss function is calculated based on the current prediction results and the actual results of the training sample set. The calculation method of the loss function includes using CE Loss to calculate the error between the category of the prediction result and the corresponding category of the actual result, and using the similarity of the semantic vectors of the text of the prediction result and the text of the actual result to calculate the error of the diagnosis result / treatment suggestion segment. At the same time, the BELU method is also used to calculate the fluency of the text, thereby determining the current loss function.
[0044] Furthermore, based on the current loss function, an optimization algorithm is used to update the weight of the learnable vector of any initial prompt template, for example, the gradient of the current loss function with respect to the learnable vector is calculated by a back-propagation algorithm, and the weight of the current learnable vector is updated using a gradient descent optimization algorithm to reduce the loss function. The above steps are repeated for iterative optimization to complete the weight update of the learnable vector of any initial prompt template. At this time, the iterative optimization needs to meet the preset iteration requirements, which can be a predetermined number of iterations or convergence of the loss function value, which is selected according to the actual situation and is not limited in this embodiment.
[0045] For example, Figure 2 As shown, the initial prompt template Prompt1 = [V1, V2, V3, V4, others, {S i}] Input the pre-trained large language model and use the training sample set for learning, and the initial prompt template Prompt1 = [V1, V2, V3, V4, others, {S i The weights of the learnable vectors V1, V2, V3, and V4 of {S}] are updated and fixed, so as to obtain the target prompt template OB_Prompt1 corresponding to the initial prompt template Prompt1. And so on, Prompt2 = [V1, V2, {S i}, others, V3, V4], ..., Prompt n =[V1, V2, {S i}, V3, V4, others] to update the weights of the learnable vectors, thereby obtaining Prompt2, ..., Prompt nThe corresponding target prompt templates are OB_Prompt2, ..., OB_Prompt n .
[0046] The present invention designs a target prompt template generation module, sets a group of learnable initial prompt templates, and trains with a small number of samples to obtain a prompt strategy that is comprehensively suitable for blood gas analysis diagnosis. At the same time, a pre-trained large language model is used to complete intelligent auxiliary diagnosis of medical water, electrolyte, and acid-base imbalance types.
[0047] In one embodiment, the alternative prompt strategy acquisition module 130 is connected to the target prompt template generation module 120, and is used to input each target prompt template and the verification sample set into a pre-trained large language model for evaluation and verification, so as to obtain the evaluation and verification results under each target prompt template, and use the corresponding target prompt template whose evaluation and verification results meet the preset verification requirements as the alternative prompt strategy.
[0048] It should be explained that the alternative prompt strategy acquisition module 130 is used to select templates that meet the preset verification requirements from the various target prompt templates generated by the target prompt template generation module 120 as alternative prompt strategies. Specifically, any target prompt template (for example, OB_Prompt1) is selected, and the target prompt template OB_Prompt1 and the verification sample set are input into the pre-trained large language model. The pre-trained large language model outputs the prediction result of the verification sample set under the prompt of the target prompt template OB_Prompt1. The prediction result is the blood gas analysis diagnosis result based on the prompt output of the target prompt template OB_Prompt1, but the blood gas analysis diagnosis result may not meet the final diagnosis requirements.
[0049] Therefore, the evaluation verification result is calculated based on the predicted result of the verification sample set and the actual result of the verification sample set, and the actual result is the actual blood gas analysis diagnosis result of the verification sample set. Determine whether the evaluation verification result meets the preset verification requirements, that is, whether the performance of the pre-trained large language model using the target prompt template OB_Prompt1 for prompting meets the requirements. If it meets the preset verification requirements, the current target prompt template OB_Prompt1 can be selected as an alternative prompt strategy. For other target prompt templates OB_Prompt2, ..., OB_Prompt n The above-mentioned evaluation and verification processing is also performed to determine whether it can be used as an alternative prompt strategy.
[0050] In one embodiment, the prompt strategy combination module 140 is connected to the alternative prompt strategy acquisition module 130, and is used to perform augmented combination based on each of the alternative prompt strategies and input the blood gas detection data to be analyzed into the pre-trained large language model to obtain a blood gas analysis diagnosis result.
[0051] It should be noted that each alternative prompt strategy screened by the above-mentioned alternative prompt strategy acquisition module 130 can be used as the final prompt input for inputting the pre-trained large language model to prompt the output of the blood gas analysis diagnosis result. However, each alternative prompt strategy can also be augmented and combined, that is, the alternative prompt strategy is combined by augmentation and aggregation as the prompt input of the large language model, which can further enhance the prompt effect of the large language model, thereby obtaining a better blood gas analysis diagnosis result. The blood gas test data to be analyzed is the data that needs to be diagnosed in real time. The blood gas test data to be analyzed and the final prompt are input into the pre-trained large language model to obtain the corresponding blood gas diagnosis result.
[0052] In some examples, combined Figure 3 It is explained that the combination method based on the augmented combination of each of the alternative prompt strategies includes: inputting any alternative prompt strategy among the alternative prompt strategies and the blood gas detection data to be analyzed into the pre-trained large language model to obtain the prompt output result corresponding to the any alternative prompt strategy; combining the prompt output result corresponding to any alternative prompt strategy and the next alternative prompt strategy to form a new combination prompt strategy and inputting it into the pre-trained large language model to obtain the prompt output result corresponding to the new combination prompt strategy; and so on, until all the alternative strategies are combined to obtain the final combination prompt strategy.
[0053] For example, assume that OB_Prompt1, OB_Prompt2 and OB_Prompt3 are selected as alternative prompt strategies through the alternative prompt strategy acquisition module 130. Select any alternative prompt strategy (such as OB_Prompt1) and input it and the blood gas detection data to be analyzed into the pre-trained large language model, and obtain the prompt output result Output1 of any alternative prompt strategy OB_Prompt1 prompting the large language model to output the blood gas detection data to be analyzed. The prompt output result Output1 is actually the corresponding blood gas analysis diagnosis result. Then, the prompt output result Output1 corresponding to the alternative prompt strategy OB_Prompt1 is combined with the next alternative prompt strategy (such as OB_Prompt2) to generate a new combined prompt strategy [Output1, OB_Prompt2].
[0054] The new combined prompt strategy [Output1, OB_Prompt2] is further input into the pre-trained large language model, prompting the large language model to output the prompt output result Output corresponding to the new combined prompt strategy [Output1, OB_Prompt2] 12 Then, the prompt output result corresponding to the new combined prompt strategy [Output1, OB_Prompt2] is Output12 Combined with the next alternative prompt strategy OB_Prompt3 to form a new combined prompt strategy [Output 12 , OB_Prompt3], based on the fact that the alternative prompt strategies at this time only include OB_Prompt1, OB_Prompt2 and OB_Prompt3, the new combined prompt strategy [Output 12 OB_Prompt3] is the final combined prompt strategy. Based on the final combined prompt strategy [Output 12 , OB_Prompt3] inputs a large language model. The large language model prompts the output of the blood gas analysis diagnosis result better. At this time, the output result is Output.
[0055] It should be noted that if there are multiple (more than three) alternative prompt strategies, the prompt output result of each new combination strategy needs to be combined with the next alternative prompt strategy to form a new combination strategy for the next prompt input, and so on, until all the alternative prompt strategies are combined to obtain the final combination prompt strategy. At the same time, the new combination prompt strategy formed by combining the prompt output result of each round with the next alternative prompt strategy is more accurate than the output result of the previous round of combination prompt strategy.
[0056] Specifically, the alternative prompt strategy OB_Prompt1 prompts the large language model to output the prompt output result Output1 of the blood gas test data to be analyzed and the prompt output result Output corresponding to the combined prompt strategy [Output1, OB_Prompt2] 12 In comparison, the prompt output result corresponding to the combined prompt strategy [Output1, OB_Prompt2] is Output 12 Better, that is, the blood gas analysis diagnosis result is more reasonable, indicating that the combined prompt strategy [Output1, OB_Prompt2] has a better prompt effect. 12 , OB_Prompt3] has a better prompt effect than the previous round of combined prompt strategy [Output1, OB_Prompt2].
[0057] In some examples, combined Figure 4 It is explained that the combination method based on the augmented combination of each alternative prompt strategy also includes: inputting each alternative prompt strategy and the blood gas detection data to be analyzed into a pre-trained large language model to obtain the prompt output results corresponding to each alternative prompt strategy; combining the prompt output results corresponding to each alternative prompt strategy to form a final combined prompt strategy.
[0058] For example, assume that OB_Prompt1, OB_Prompt2 and OB_Prompt3 are screened out as alternative prompt strategies through the alternative prompt strategy acquisition module 130. Each alternative prompt strategy is input into the pre-trained large language model respectively to obtain the prompt output results of the blood gas test data to be analyzed output by the pre-trained large language model with different alternative prompt strategies. Specifically, the alternative prompt strategy OB_Prompt1 and the blood gas test data to be analyzed are input into the pre-trained large language model to obtain the prompt output result Output1, the alternative prompt strategy OB_Prompt2 and the blood gas test data to be analyzed are input into the pre-trained large language model to obtain the prompt output result Output2, and the alternative prompt strategy OB_Prompt3 and the blood gas test data to be analyzed are input into the pre-trained large language model to obtain the prompt output result Output3.
[0059] Furthermore, the prompt output results Output1, Output2, Output3 corresponding to each alternative prompt strategy OB_Prompt1, OB_Prompt2, OB_Prompt3 are combined to form a new combined prompt strategy [Output1, Output2, Output3]. At this time, based on the fact that the alternative prompt strategy only includes OB_Prompt1, OB_Prompt2 and OB_Prompt3, the new combined prompt strategy [Output1, Output2, Output3] is the final combined prompt strategy. The combined prompt strategy [Output1, Output2, Output3] and the blood gas test data to be analyzed are input into the pre-trained large language model to obtain the prompt output result Output, which is the blood gas analysis diagnosis result finally outputted by the blood gas test data to be analyzed. In some examples, combined with Figure 5 It is noted that the combination method of augmenting the combination based on each of the alternative prompt strategies also includes: selecting an alternative prompt strategy from each of the alternative prompt strategies and combining it with a preset prefix to form a final combined prompt strategy.
[0060] It should be noted that, it is assumed that OB_Prompt1, OB_Prompt2 and OB_Prompt3 are screened out as alternative prompt strategies through the alternative prompt strategy acquisition module 130. Any alternative prompt strategy OB_Prompt is selected to be combined with the preset prefix Prefix1 to form a new combined prompt strategy [Prefix1, OB_Prompt1]; alternative prompt strategy OB_Prompt2 can also be selected to be combined with the preset prefix Prefix1 to form a new combined prompt strategy [Prefix1, OB_Prompt2]. This is not limited in the present embodiment and can be randomly selected. The preset prefix Prefix1 is necessary information related to the diagnosis of blood gas analysis, which may be treatment advice or blood gas analysis judgment conditions. Based on the combination of the preset prefix Prefix1 and the alternative prompt strategy, the final combined prompt strategy formed can have a better prompt effect on the pre-trained large language model, and finally outputs the prompt output result Output.
[0061] It should be emphasized that the blood gas analysis and diagnosis system based on prompt learning provided by the embodiment of the present application includes two modules: a target prompt template generation module and a prompt strategy combination module. Among them, the target prompt template generation module performs learning and optimization of learnable prompts by converting context words into learnable vectors, which are initialized with random values and then optimized through back propagation to obtain the target prompt template, thereby achieving fine-tuning of the large language model; the prompt strategy combination module augments and aggregates the trained alternative prompt strategies applicable to the current task, further strengthening the prompt effect on the large model.
[0062] In order to facilitate the demonstration of the blood gas analysis and diagnosis system based on prompt learning of the present application, the following specific embodiments are provided for illustration.
[0063] Example 1: A schematic diagram of the dialogue effect of a large language model by manually inputting prompt sentences; Figure 6 As shown in the figure, the blood gas test data to be analyzed is obtained, and the blood gas test data to be analyzed and the alternative prompt sentence "You are an experienced imaging expert. According to the values of each indicator in this blood gas analysis table, give a detailed analysis, medical diagnosis and further treatment suggestions." are input into the pre-trained large language model, and the blood gas analysis diagnosis result is output as follows Figure 7 and Figure 8 . Figure 7 For specific diagnostic results, Figure 8 For treatment recommendations, Figure 7 and Figure 8 Generate electronic medical records.
[0064] Embodiment 2: A specific embodiment of a blood gas analysis and diagnosis system based on prompt learning, as shown in FIG. Fig. 9 As shown, blood sampling and other examinations are performed on the patient, and blood gas test data to be analyzed is obtained based on the blood gas analyzer. The blood gas test data to be analyzed and the prompts generated by the system are input into the large language model to obtain the diagnosis results and electronic medical records.
[0065] It should be noted that this application combines the classification task with the pre-trained large language model. On the one hand, the index parameter input task of blood gas analysis is adapted to the pre-trained large language model through prompt learning. On the other hand, the text output generated by the large language model can be used to efficiently generate diagnosis and electronic medical records. This application can realize intelligent auxiliary diagnosis of blood gas analysis test data, reduce labor costs, improve the utilization efficiency of medical resources, and realize efficient archiving of patients' blood gas analysis diagnosis electronic medical records.
[0066] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects, and do not limit their order. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0067] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0068] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.
[0069] Fig.10 is a schematic block diagram of a blood gas analysis diagnostic method based on prompt learning provided in an embodiment of the present application. Fig.10 As shown, the blood gas analysis diagnosis method based on prompt learning is applied to the blood gas analysis diagnosis system based on prompt learning as described above, and the method comprises:
[0070] Step S101: acquiring historical blood gas test data, and generating a training sample set and a verification sample set after preprocessing the historical blood gas test data;
[0071] Step S102: constructing a plurality of initial prompt templates, and learning each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates;
[0072] Step S103: input each target prompt template and the verification sample set into the pre-trained large language model for evaluation and verification, so as to obtain the evaluation and verification results under each target prompt template, and use the corresponding target prompt template whose evaluation and verification results meet the preset verification requirements as the candidate prompt strategy;
[0073] Step S104: performing augmented combination based on each of the alternative prompt strategies and inputting the blood gas detection data to be analyzed into the pre-trained large language model to obtain a blood gas analysis diagnosis result.
[0074] It should be understood that the specific process of each method executing the above corresponding steps has been described in detail in the above system embodiment, and for the sake of brevity, it will not be repeated here.
[0075] It should also be understood that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0076] Fig.11 is a schematic block diagram of an electronic terminal provided in an embodiment of the present application. Fig.11 As shown, the electronic terminal includes: at least one processor 1101, a memory 1102, at least one network interface 1103 and a user interface 1105. The various components in the device are coupled together through a bus system 1104. It can be understood that the bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.11 In the specification, various buses are labeled as bus systems.
[0077] The user interface 1105 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0078] It is understood that the memory 1102 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of exemplary but not limiting explanation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.
[0079] The memory 1102 in the embodiment of the present invention is used to store various categories of data to support the operation of the electronic terminal 1100. Examples of these data include: any executable program for operating on the electronic terminal 1100, such as an operating system 11021 and an application 11022; the operating system 11021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 11022 may include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The blood gas analysis diagnosis method based on prompt learning provided in the embodiment of the present invention may be included in the application 11022.
[0080] The method disclosed in the above embodiment of the present invention can be applied to the processor 1101, or implemented by the processor 1101. The processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 1101 or the instruction in the form of software. The above processor 1101 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1101 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 1101 can be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0081] In an exemplary embodiment, the electronic terminal 1100 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), or complex programmable logic device (CPLD) to execute the aforementioned method.
[0082] According to the method provided in the embodiments of the present application, the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes the blood gas analysis diagnosis method based on prompt learning of any of the embodiments shown.
[0083] According to the method provided in the embodiments of the present application, the present application also provides a computer-readable storage medium, which stores a program code. When the program code runs on a computer, the computer executes the blood gas analysis diagnosis method based on prompt learning of any one of the embodiments shown.
[0084] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).
[0085] Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in 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 may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0087] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0088] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0089] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0090] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When loading and executing computer program instructions (programs) on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrated. Available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., high-density digital video discs (DVDs), or semiconductor media (e.g., solid state disks (SSDs), etc.).
[0091] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0092] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0093] In summary, the present application provides a blood gas analysis diagnosis system, method, medium, program product and terminal based on prompt learning. The present application includes a target prompt template generation module and a prompt strategy combination module. The target prompt template generation module sets a set of learnable vectors as prompt tokens, which are used as alternative prompt strategies after training with a small number of samples. The prompt strategy combination module further enhances the prompt effect of the alternative prompt strategy after training, combines each alternative prompt strategy by augmentation and aggregation, and serves as a new prompt input for the large model to guide the model to generate more reasonable text content. The present application allows not to consume a large amount of storage space and computing resources to fine-tune the large model, and can also adjust the text generation through prompt learning to be suitable for intelligent auxiliary diagnosis (blood gas analysis diagnosis) of medical water and acid-base imbalance types. The generated diagnostic results can be formed into electronic medical records for archiving, thereby reducing labor costs, improving the utilization efficiency of medical resources, and realizing the efficient archiving of patients' blood gas analysis diagnosis electronic medical records. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0094] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A blood gas analysis and diagnosis system based on prompt learning, characterized in that: include: A data preprocessing module, used to obtain historical blood gas test data, and generate a training sample set and a verification sample set after preprocessing the historical blood gas test data; A target prompt template generation module is used to construct multiple initial prompt templates, and learn each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates; The alternative prompt strategy acquisition module is used to input each target prompt template and the verification sample set into the pre-trained large language model for evaluation and verification, so as to obtain the evaluation and verification results under each target prompt template, and use the corresponding target prompt template whose evaluation and verification results meet the preset verification requirements as the alternative prompt strategy; The prompt strategy combination module is used to perform augmented combination based on each of the alternative prompt strategies and input the blood gas detection data to be analyzed into the pre-trained large language model to obtain a blood gas analysis diagnosis result.
2. The blood gas analysis and diagnosis system based on prompt learning according to claim 1, characterized in that: The process of constructing multiple initial prompt templates includes: adjusting the diagnostic information placeholders, blood gas index parameter values and the positions of multiple learnable vectors within the preset prompt templates to generate multiple initial prompt templates.
3. The blood gas analysis and diagnosis system based on prompt learning according to claim 2, characterized in that: The process of learning each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates includes: Inputting any initial prompt template and the training sample set into the pre-trained large language model to obtain a prediction result; Calculate a loss function based on the predicted result and the actual result of the training sample set; Using an optimization algorithm to update the weights of the learnable vectors of any initial prompt template to reduce the loss function; The iterative optimization is performed until the preset iteration requirement is met, and the weight update of the learnable vector of any initial prompt template is completed to obtain the target prompt template corresponding to the any initial prompt template.
4. The blood gas analysis and diagnosis system based on prompt learning according to claim 1, characterized in that: The combination methods for augmenting the combination based on the alternative prompt strategies include: Inputting any one of the candidate prompt strategies and the blood gas detection data to be analyzed into the pre-trained large language model to obtain a prompt output result corresponding to the any one of the candidate prompt strategies; Combining the prompt output result corresponding to any candidate prompt strategy with the next candidate prompt strategy to form a new combined prompt strategy and inputting it into the pre-trained large language model to obtain the prompt output result corresponding to the new combined prompt strategy; And so on, until all the alternative strategies are combined to obtain the final combined prompt strategy.
5. The blood gas analysis and diagnosis system based on prompt learning according to claim 1, characterized in that: The combination method of augmenting the combination based on each of the alternative prompt strategies also includes: Input each candidate prompt strategy and the blood gas test data to be analyzed into a pre-trained large language model to obtain a prompt output result corresponding to each candidate prompt strategy; The prompt output results corresponding to each alternative prompt strategy are combined to form a final combined prompt strategy.
6. The blood gas analysis and diagnosis system based on prompt learning according to claim 1, characterized in that: The combination method of augmenting the combination based on each of the alternative prompt strategies also includes: Select any one of the candidate prompt strategies from among the candidate prompt strategies and combine it with the preset prefix to form a final combined prompt strategy.
7. A blood gas analysis diagnostic method based on prompt learning, characterized in that: Applied to the blood gas analysis and diagnosis system based on prompt learning as described in any one of claims 1 to 6, the method comprising: Acquire historical blood gas test data, and generate a training sample set and a verification sample set after preprocessing the historical blood gas test data; Constructing a plurality of initial prompt templates, and learning each of the initial prompt templates using a training sample set based on a pre-trained large language model to obtain a target prompt template corresponding to each of the initial prompt templates; Each target prompt template and the verification sample set are input into the pre-trained large language model for evaluation and verification, so as to obtain the evaluation and verification results under each target prompt template, and the corresponding target prompt template whose evaluation and verification results meet the preset verification requirements is used as the alternative prompt strategy; Based on each of the alternative prompt strategies, an augmented combination is performed and the blood gas detection data to be analyzed is input into the pre-trained large language model to obtain a blood gas analysis diagnosis result.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blood gas analysis diagnosis method based on prompt learning as described in claim 7 is implemented.
9. A computer program product, characterized in that The computer program product includes computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the blood gas analysis diagnosis method based on prompt learning as claimed in claim 7.
10. An electronic terminal comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the blood gas analysis diagnosis method based on prompt learning as described in claim 7.