Medical analysis model training method and device, electronic equipment and storage medium

CN117558442BActive Publication Date: 2026-11-03CHINA UNICOM (GUANGDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311569982.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2026-11-03
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

Existing medical data analysis and retrieval platforms require programming skills, which limits their promotion and use, resulting in insufficient convenience and accuracy.

Method used

By acquiring multiple samples of medical data, contextual merging is performed to generate sample prompts. A pre-trained medical analysis model is then used to perform multiple medical data retrieval analyses, calculate the similarity and probability distribution of predicted medical responses, and adjust the model parameters until convergence conditions are met, thereby improving the model's accuracy.

Benefits of technology

It improves the accuracy and convenience of medical analysis models, and enhances the efficiency and precision of medical data retrieval and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117558442B_ABST
    Figure CN117558442B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a medical analysis model training method and device, electronic equipment and storage medium. The method comprises: obtaining a plurality of sample medical data corresponding to the same sample medical reply; merging the plurality of sample medical data to obtain sample prompt information; performing multiple medical data retrieval analyses on the sample prompt information by using a pre-trained medical analysis model to obtain a plurality of predicted medical replies; determining the prediction probability corresponding to each predicted medical reply according to the similarity between the plurality of predicted medical replies and the sample medical reply, and then determining the probability distribution; and adjusting the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution. The medical analysis model training method, device, electronic equipment and storage medium improve the accuracy of the predicted medical replies obtained by the medical analysis model, thereby improving the convenience and accuracy of medical data retrieval analysis using the medical analysis model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, specifically to a training method, apparatus, electronic device, and storage medium for a medical analysis model. Background Technology

[0002] In the context of big data, with the intelligent development and digital application of healthcare, there has been a growing demand for efficient retrieval and use of massive amounts of medical data. This has led to the development of medical data analysis and retrieval platforms, such as the Elasticsearch search engine based on Lucene. These platforms can be used for constructing, querying, and processing complex index structures based on different patient patterns. However, current medical data analysis and retrieval platforms all require users to have a certain level of programming knowledge, which limits their promotion and use. Therefore, improving the convenience and accuracy of medical data retrieval and analysis has become a technical problem that needs to be solved. Summary of the Invention

[0003] This application discloses a training method, apparatus, electronic device, and storage medium for a medical analysis model, which improves the accuracy of the predicted medical responses obtained by the medical analysis model, thereby enhancing the convenience and accuracy of using the medical analysis model for medical data retrieval and analysis.

[0004] In a first aspect, embodiments of this application disclose a method for training a medical analysis model, comprising:

[0005] Obtain multiple sample medical data corresponding to the same sample medical response;

[0006] Context merging is performed on the multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data;

[0007] The pre-trained medical analysis model performs multiple medical data retrieval and analysis based on the sample prompt information to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval and analysis.

[0008] The prediction probability of each predicted medical response is determined based on the similarity between the multiple predicted medical responses and the sample medical responses.

[0009] Determine the probability distribution based on the predicted probability corresponding to each of the predicted medical responses;

[0010] The parameters of the pre-trained medical analysis model are adjusted according to the gradient descent direction of the probability distribution until the convergence condition is met.

[0011] As an optional implementation, in a first aspect of the embodiments of this application, after obtaining multiple sample medical data corresponding to the same sample medical response, the method further includes:

[0012] The quality of the multiple sample medical data is assessed separately to obtain the assessment results corresponding to the multiple sample medical data.

[0013] Retain the medical data of the samples whose corresponding assessment results meet the assessment requirements.

[0014] As an optional implementation, in a first aspect of the embodiments of this application, determining the prediction probability corresponding to each of the predicted medical responses based on the similarity between the plurality of predicted medical responses and the sample medical responses includes:

[0015] Calculate the similarity between each of the predicted medical responses and the sample medical responses, and determine the first probability corresponding to each of the predicted medical responses based on the similarity between each of the predicted medical responses;

[0016] The first probability corresponding to each of the predicted medical responses is subjected to exponential processing to obtain the first index corresponding to each of the predicted medical responses.

[0017] The first index corresponding to each of the predicted medical responses is normalized to generate the predicted probability corresponding to each of the predicted medical responses.

[0018] As an optional implementation, in a first aspect of this application, adjusting the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution until the convergence condition is met includes:

[0019] The L1 norm of the probability distribution is used as the gradient value of the probability distribution;

[0020] The parameters of the pre-trained medical analysis model are adjusted along the direction in which the gradient value of the probability distribution decreases until the convergence condition is met.

[0021] As an optional implementation, in a first aspect of the embodiments of this application, the convergence condition includes:

[0022] The current medical analysis model performs multiple medical data retrieval and analysis based on sample prompts. Among the multiple predicted medical responses obtained, there is a corresponding predicted medical response with the highest probability.

[0023] As an optional implementation, in a first aspect of the embodiments of this application, the method further includes:

[0024] Obtain medical search data;

[0025] The medical retrieval data is vectorized to obtain a medical retrieval vector;

[0026] The medical retrieval vector is matched with a plurality of stored medical vectors for similarity, so as to determine at least one target medical vector that matches the medical retrieval vector from the plurality of medical vectors;

[0027] Obtain the medical data corresponding to each of the target medical vectors as the target medical data;

[0028] Context merging is performed on multiple target medical data sets to obtain target prompt information corresponding to the multiple target medical data sets;

[0029] The trained medical analysis model performs medical data retrieval and analysis based on the target prompt information to obtain the target medical response.

[0030] As an optional implementation, in a first aspect of the embodiments of this application, before acquiring the medical retrieval data, the method further includes:

[0031] Acquire multiple medical data;

[0032] Each of the medical data is segmented into text to obtain one or more text blocks corresponding to each of the medical data.

[0033] Vectorize each of the text blocks to generate one or more medical vectors corresponding to each of the medical data;

[0034] An index is created for each of the medical data, an index number is generated for each of the medical data, and the same index number is assigned to the medical vectors corresponding to the same medical data.

[0035] The step of obtaining the medical data corresponding to each of the target medical vectors as target medical data includes:

[0036] Obtain the index number corresponding to each of the target medical vectors;

[0037] Based on each index number, determine the medical data corresponding to each target medical vector, and use the medical data corresponding to each target medical vector as the target medical data.

[0038] Secondly, embodiments of this application disclose a training device for a medical analysis model, comprising:

[0039] The data acquisition module is used to acquire multiple sample medical data corresponding to the same sample medical response;

[0040] The prompt generation module is used to perform context merging on the multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data;

[0041] The response generation module is used to perform multiple medical data retrieval and analysis based on the sample prompt information using a pre-trained medical analysis model, and obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval and analysis.

[0042] The probability determination module is used to determine the predicted probability of each of the predicted medical responses based on the similarity between the plurality of predicted medical responses and the sample medical responses.

[0043] The distribution determination module is used to determine the probability distribution based on the predicted probabilities corresponding to each of the predicted medical responses;

[0044] The parameter adjustment module is used to adjust the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution until the convergence condition is met.

[0045] Thirdly, embodiments of this application disclose an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to implement the method described in any of the above embodiments.

[0046] Fourthly, embodiments of this application disclose a computer-readable storage medium that stores a computer program, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0047] The medical analysis model training method, apparatus, electronic device, and storage medium disclosed in this application acquire multiple sample medical data corresponding to the same sample medical response, ensuring that the correct medical response corresponding to the predicted medical response generated by the pre-trained medical analysis model is the same sample medical response; context merging is performed on multiple sample medical data to obtain sample prompt information corresponding to multiple sample medical data; multiple medical data retrieval analyses are performed by the pre-trained medical analysis model based on the sample prompt information to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses, and performing multiple medical data retrieval analyses on the same sample prompt information can, to a certain extent, avoid generating random predicted medical responses; the prediction probability corresponding to each predicted medical response is determined based on the similarity between the multiple predicted medical responses and the sample medical responses, and then the probability distribution is determined; the parameters of the pre-trained medical analysis model are adjusted according to the gradient descent direction of the probability distribution. In this embodiment, multiple medical data retrieval analyses are performed using a pre-trained medical analysis model to obtain multiple predicted medical responses. Based on the probability distribution of the predicted probabilities corresponding to each of the multiple predicted medical responses, since a smaller gradient in the probability distribution indicates a higher probability that the predicted medical response is the sample medical response, adjusting the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution can improve the accuracy of the medical analysis model. This, in turn, can improve the convenience and accuracy of using the medical analysis model for medical data retrieval analysis. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 A flowchart illustrating a training method for a medical analysis model in one embodiment;

[0050] Figure 2 A flowchart of a training method for a medical analysis model in another embodiment;

[0051] Figure 3 This is an overall flowchart of the training method for a medical analysis model in one embodiment;

[0052] Figure 4 This is a flowchart illustrating how a trained medical analysis model performs medical data retrieval and analysis on medical retrieval data to obtain a target medical response in one embodiment.

[0053] Figure 5This is a flowchart illustrating the process of assigning index numbers to medical vectors before performing medical data retrieval and analysis on the medical retrieval data using a trained medical analysis model, as described in another embodiment.

[0054] Figure 6 This is a flowchart illustrating the overall process of using a trained medical analysis model to perform medical data retrieval and analysis on medical retrieval data to obtain a target medical response in one embodiment.

[0055] Figure 7 A block diagram of a training device for a medical analysis model in one embodiment;

[0056] Figure 8 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation

[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0059] This application discloses a training method, apparatus, electronic device, and storage medium for a medical analysis model, which improves the accuracy of the predicted medical responses obtained by the medical analysis model, thereby enhancing the convenience and accuracy of using the medical analysis model for medical data retrieval and analysis.

[0060] like Figure 1 As shown, in one embodiment, a method for training a medical analysis model is provided, which can be applied to an electronic device, including but not limited to mobile phones, smart wearable devices, tablets, PCs (Personal Computers), etc. The method may include the following steps:

[0061] Step 110: Obtain multiple sample medical data corresponding to the same sample medical response.

[0062] Medical data refers to data related to patients. Medical data can be stored in a medical system, which is a management system for medical data. A medical system can directly store medical data, or it can be a data lake formed by combining various medical databases that store different medical data.

[0063] Optionally, medical data may include patient personal information, diagnostic information, treatment information, etc. A medical response refers to an overall summary of the medical data obtained through the analysis of one or more medical data sets. Medical responses may be presented using natural language, charts, etc.

[0064] For example, given four pieces of medical data: "name and age of patients with hypertension", "patient's hospital room", "name and age of patients who have undergone surgery", and "patient's past medical history", the medical response obtained by analyzing the medical data could be "name, age, hospital room, and past medical history of patients with hypertension who have undergone surgery".

[0065] Electronic devices can acquire a sample medical data set and use it to perform secondary training on a pre-trained medical analysis model, adjusting the model's parameters. The sample medical data set can include multiple sample medical responses and multiple sample medical data points corresponding to each response. During each parameter adjustment of the pre-trained medical analysis model, a sample medical response and its corresponding multiple sample medical data points can be obtained from the sample medical data set to train the model.

[0066] Sample medical responses refer to medical responses generated through medical data retrieval and analysis of various sample medical data and verified by humans. In this embodiment, sample medical responses can be considered as the correct output of the medical analysis model, i.e., the correct medical responses corresponding to multiple medical data. Sample medical data refers to the medical data corresponding to the sample medical responses obtained each time the pre-trained medical analysis model is trained.

[0067] In some embodiments, multiple sample medical data correspond to the same sample medical response. The multiple sample medical data corresponding to different sample medical responses can be completely different, and the multiple sample medical data corresponding to different sample medical responses can also be partially the same.

[0068] In some embodiments, the electronic device may use SQL to query multiple medical data corresponding to the same medical response from various medical databases as sample medical data, and the corresponding medical response is the sample medical response.

[0069] Step 120: Perform context merging on multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data.

[0070] Context merging refers to merging multiple medical data samples based on the logic between them. Sample hints are information generated from context merging of medical data samples that can be recognized by a pre-trained medical analysis model. Sample hints are used to guide the pre-trained medical analysis model in retrieving and analyzing medical data.

[0071] In some embodiments, electronic devices can use functions from the Pandas library to merge individual medical data samples. For example, the merge() or append() function can be used to merge individual medical data samples.

[0072] In other embodiments, the electronic device can also extract keywords from the merged data generated by context merging of multiple sample medical data to form a keyword set, which is then used as sample prompt information corresponding to the multiple sample medical data. The electronic device can use keyword extraction algorithms to extract keywords from task instructions to obtain the keywords corresponding to the task. Keyword extraction (KPE) refers to extracting phrases from a document that summarize the core content. Possible keyword extraction algorithms include, but are not limited to, TextRank, TF-IDF (class-based Term Frequency-Inverse Document Frequency), and keyword extraction based on PyHanLP.

[0073] As a specific implementation method, the merged data is treated as a document. Based on the word frequency of each word in the document, the TF-IDF algorithm is applied to the document to obtain the most representative words. The most representative words are then used as keywords corresponding to the merged data, forming a keyword set. The most representative words refer to words whose frequency in the document is higher than a first threshold but whose frequency in the corpus is lower than a second threshold, where the first threshold is greater than or equal to the second threshold.

[0074] In some embodiments, the electronic device can also extract keywords from the merged data generated by contextually merging multiple sample medical data using a keyword extraction model, thereby obtaining a keyword set corresponding to the merged data. For example, the electronic device can perform keyword extraction based on the LDA (Latent Dirichlet Allocation) topic model.

[0075] Step 130: Using a pre-trained medical analysis model, perform multiple medical data retrieval analyses based on sample prompts to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses.

[0076] A pre-trained medical analysis model refers to a model capable of retrieving and analyzing medical data and generating predictive medical responses. The input to a pre-trained medical analysis model is sample prompt information, and the output is a predicted medical response. The model is trained multiple times using a sample medical data set until it meets the convergence condition, resulting in a fully trained model. Each time, a sample medical response and its corresponding multiple sample medical data are randomly selected from the sample medical data set. Sample prompt information is generated for these multiple sample medical data. Based on this prompt information, the pre-trained medical analysis model is used to perform multiple medical data retrieval and analysis operations, obtaining multiple predicted medical responses corresponding one-to-one with each analysis. The parameters of the pre-trained medical analysis model are then adjusted based on the relationship between these predicted responses and the original sample medical response. The model is then judged to have met the convergence condition. If not, the model is used as the pre-trained model for the next training iteration.

[0077] The pre-trained medical analysis model performs multiple medical data retrieval analyses based on sample prompts, generating multiple predicted medical responses that correspond one-to-one with each analysis. Electronic devices can analyze the relationship between each predicted medical response and the sample medical response to adjust the parameters of the pre-trained model, increasing the probability that the predicted medical responses generated by the model will match the sample responses, thereby improving the accuracy of the pre-trained model. Performing multiple medical data retrieval analyses can, to some extent, mitigate the impact of chance.

[0078] Predictive medical responses refer to medical responses generated by a pre-trained medical analysis model based on sample prompts and medical data retrieval and analysis.

[0079] In some embodiments, an electronic device may load model parameters obtained through pre-training on a medical dataset to construct a pre-trained medical analysis model. The medical dataset may include a large amount of medical data from a medical system. The electronic device may use the medical dataset as training data for the medical analysis model during the pre-training phase, utilizing the medical dataset to pre-train the model, thereby obtaining a pre-trained medical analysis model with the ability to retrieve and analyze medical data and generate medical responses.

[0080] In some specific embodiments, the medical analysis model may include, but is not limited to, large language models from the LLaMA series. Electronic devices can use the LLaMA-2-13b model as the medical analysis model to be trained. A sample medical response and corresponding sample medical data are arbitrarily selected from the medical dataset to pre-train the LLaMA-2-13b model. The sample prompt information corresponding to the sample medical data is then used to perform multiple medical data retrieval analyses through the LLaMA-2-13b model, resulting in multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses. The LLaMA2-13b model is the 13B size of the second-generation version of the LLaMA series. Using a large language model can reduce the size of the medical dataset used for pre-training, thereby improving the accuracy of the predicted medical responses obtained by the medical analysis model while reducing the training cost.

[0081] Step 140: Determine the prediction probability of each predicted medical response based on the similarity between multiple predicted medical responses and sample medical responses.

[0082] Predictive probability refers to the probability that each predicted medical response is the sample medical response.

[0083] In some embodiments, electronic devices can determine the similarity between multiple predicted medical responses and sample medical responses using text similarity calculation methods. Possible text similarity calculation methods include, but are not limited to, using supervised models and calculating the distance between texts as similarity.

[0084] In some embodiments, the higher the similarity between the predicted medical response and the sample medical response, the greater the probability that the predicted medical response is the sample medical response, and the greater the prediction probability corresponding to the predicted medical response. Similarly, the lower the similarity between the predicted medical response and the sample medical response, the lower the probability that the predicted medical response is the sample medical response, and the lower the prediction probability corresponding to the predicted medical response.

[0085] In some embodiments, the electronic device may determine the vector distance between each predicted medical response and the sample medical response based on the similarity between multiple predicted medical responses and the sample medical response; and normalize the vector distances corresponding to each predicted medical response to obtain the predicted probability corresponding to each predicted medical response.

[0086] In some embodiments, the electronic device may, based on the predicted probability p corresponding to each predicted medical response, i Let i∈{1,2,...,k}, and determine the probability distribution of sample medical responses generated by the pre-trained medical analysis model during medical data retrieval and analysis, where k is the number of predicted medical responses, and p... iThis represents the predicted probability that the i-th predicted medical response becomes the sample medical response.

[0087] In some embodiments, the electronic device can calculate the predicted probability p corresponding to all predicted medical responses. i The mean of the values ​​is used to obtain the sample probability corresponding to the pre-trained medical analysis model. This sample probability refers to the probability that the pre-trained medical analysis model will generate a sample medical response by performing medical data retrieval and analysis. It is also possible to calculate the predicted probabilities p corresponding to all predicted medical responses. i The median value is used as the sample probability corresponding to the pre-trained medical analysis model. The electronic device can use the sample probability corresponding to the pre-trained medical analysis model as the accuracy of the pre-trained medical analysis model; during the training process of the pre-trained medical analysis model, the difference between the first accuracy and the second accuracy is analyzed to determine whether the pre-trained medical analysis model is the optimal model; the first accuracy is the accuracy of the pre-trained medical analysis model, and the second accuracy is the accuracy of the medical analysis model trained in the previous session.

[0088] Step 150: Determine the probability distribution based on the predicted probabilities corresponding to each predicted medical response.

[0089] In some embodiments, a probability distribution can be used to indicate the distribution of predicted probabilities corresponding to multiple predicted medical responses. The probability distribution can be expressed using a probability distribution function, and the electronic device can obtain the probability distribution function of the pre-trained medical analysis model from the predicted probabilities corresponding to each predicted medical response. The smaller the gradient corresponding to the probability distribution function, the greater the probability that the predicted medical response generated by the pre-trained medical analysis model is the sample medical response, and the greater the accuracy of the pre-trained medical analysis model.

[0090] Step 160: Adjust the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution until the convergence condition is met.

[0091] Gradient descent (GD) is simply a method for finding the minimum objective function. It utilizes gradient information and iteratively adjusts parameters to find a suitable target value, essentially solving for the minimum along the gradient descent direction. This makes the iterative solution of model parameters more efficient. The adjusted parameters can include the weights of a medical analysis model.

[0092] In some embodiments, the electronic device can update the parameters of a pre-trained medical analysis model according to the gradient descent direction of the probability distribution, and determine whether the pre-trained medical analysis model after parameter update meets the convergence condition. If the convergence condition is met, the training is complete, and a trained medical analysis model is obtained. Optionally, meeting the convergence condition may include that when the model parameters are updated two or more times consecutively, the maximum predicted probability value corresponding to each predicted medical response generated by the new pre-trained medical analysis model no longer decreases; such model parameters are considered to meet the convergence condition. Meeting the convergence condition may also include that, among the multiple predicted medical responses obtained by the current medical analysis model through multiple medical data retrieval and analysis based on sample prompts, there exists a predicted medical response with the highest predicted probability; in this case, the current medical analysis model meets the convergence condition.

[0093] If the convergence condition is not met, a new sample medical response and its corresponding multiple sample medical data can be arbitrarily obtained from the sample medical data set. Context merging of the multiple sample medical data is then performed again to obtain sample prompt information corresponding to the multiple sample medical data. The pre-trained medical analysis model performs multiple medical data retrieval analyses based on the sample prompt information to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses. The prediction probability corresponding to each predicted medical response is determined based on the similarity between the multiple predicted medical responses and the sample medical responses. The probability distribution is determined based on the prediction probability corresponding to each predicted medical response. The parameters of the pre-trained medical analysis model are adjusted according to the gradient descent direction of the probability distribution until the pre-trained medical analysis model with updated parameters meets the convergence condition, thus completing the training of the medical analysis model.

[0094] In this embodiment, multiple medical data retrieval analyses are performed using a pre-trained medical analysis model to obtain multiple predicted medical responses. Based on the probability distribution of the predicted probabilities corresponding to each of the multiple predicted medical responses, the smaller the gradient of the probability distribution, the greater the probability that the predicted medical response generated by the pre-trained medical analysis model is the sample medical response, and the greater the accuracy of the pre-trained medical analysis model. Therefore, adjusting the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution can improve the accuracy of the medical analysis model, thereby improving the convenience and accuracy of using the medical analysis model for medical data retrieval analysis.

[0095] like Figure 2 As shown, in one embodiment, a method for training a medical analysis model is provided, which can be applied to the aforementioned electronic device. This method may include the following steps:

[0096] Step 202: Obtain multiple sample medical data corresponding to the same sample medical response.

[0097] The description of step 202 can be referred to the relevant description of step 110 in the above embodiments, and will not be repeated here.

[0098] Step 204: Perform quality assessment on multiple sample medical data separately to obtain the assessment results corresponding to each sample medical data.

[0099] Quality assessment refers to the overall evaluation of the impact of a sample medical dataset on the sample medical responses generated by a pre-trained medical analysis model, following specific steps and procedures. In this embodiment, quality assessment of each sample medical data is conducted to determine whether each sample medical data is valid, so as to retain valid medical data and delete invalid medical data. Valid medical data refers to sample medical data whose impact on the sample medical responses generated by the pre-trained medical analysis model is greater than an impact threshold, while invalid medical data refers to sample medical data whose impact on the sample medical responses generated by the pre-trained medical analysis model is less than or equal to the impact threshold.

[0100] The evaluation results are used to measure the probability or degree of validity of each sample of medical data. Evaluation results can be expressed using Arabic numerals, English, Chinese, etc. For example, electronic devices can use Arabic numerals to represent evaluation results, where a larger number indicates a greater probability that the sample of medical data is valid. Electronic devices can also set a maximum evaluation result; by defining a range of evaluation results, the impact of the sample of medical data on the sample medical responses generated by the pre-trained medical analysis model can be fully understood.

[0101] In some embodiments, electronic devices can assess the quality of individual medical data samples across six dimensions. These six dimensions may include: data completeness, uniqueness, validity, consistency, accuracy, and timeliness. Quality assessment methods primarily include qualitative, quantitative, and combined methods. Qualitative methods rely heavily on the subjective judgment of the evaluator and may include third-party evaluation, user feedback, and expert review. Quantitative methods provide a systematic and objective quantitative analysis approach, yielding more intuitive and specific results, and may include statistical analysis and content scoring. Comprehensive evaluation methods may include the analytic hierarchy process (AHP) and defect deduction methods.

[0102] Step 206: Retain the sample medical data whose corresponding evaluation results meet the evaluation requirements.

[0103] In some embodiments, the electronic device can set a quality threshold, using an evaluation result greater than the threshold as the evaluation requirement. Then, it retains medical data samples with evaluation results greater than the threshold and deletes those with evaluation results less than or equal to the threshold. For example, when using Arabic numerals to represent evaluation results, the maximum evaluation result is set to 5, and the quality threshold is set to 4. Therefore, after the electronic device performs quality evaluations on multiple medical data samples to obtain evaluation results for each sample, it retains medical data samples with evaluation results greater than 4 and deletes those with evaluation results less than or equal to 4. This ensures that high-quality medical data samples are used for training the medical analysis model, reducing the losses associated with training the model using invalid medical data samples.

[0104] Step 208: Context merging is performed on multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data.

[0105] Step 210: Using a pre-trained medical analysis model, perform multiple medical data retrieval analyses based on sample prompts to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses.

[0106] The descriptions of steps 208 to 210 can be found in the descriptions of steps 120 to 130 in the above embodiments, and will not be repeated here.

[0107] Step 212: Determine the prediction probability of each predicted medical response based on the similarity between multiple predicted medical responses and sample medical responses.

[0108] In some embodiments, the electronic device may calculate the similarity between each predicted medical response and the sample medical response, and determine the first probability corresponding to each predicted medical response based on the similarity corresponding to each predicted medical response; perform exponential processing on the first probability corresponding to each predicted medical response to obtain the first index corresponding to each predicted medical response; and normalize the first index corresponding to each predicted medical response to generate the predicted probability corresponding to each predicted medical response.

[0109] In some specific embodiments, the electronic device may use the similarity between the i-th predicted medical response and the sample medical response as the first probability s corresponding to the i-th predicted medical response. i Next, the electronic device calculates the first probability s corresponding to the i-th predicted medical response. i We perform index processing to obtain the first index corresponding to the i-th predicted medical response. Then, we normalize the first index corresponding to the i-th predicted medical response to generate the prediction probability p corresponding to the i-th predicted medical response. i .

[0110] Specifically, the prediction probability p corresponding to the i-th predicted medical response can be calculated using formula (1). i :

[0111]

[0112] Among them, s i Let represent the first probability corresponding to the i-th predicted medical response; α represents a model parameter; i∈{1,2,...,k} represents the i-th predicted medical response among k predicted medical responses.

[0113] Step 214: Determine the probability distribution based on the predicted probabilities corresponding to each predicted medical response.

[0114] In some embodiments, the electronic device can determine a probability distribution based on the predicted probability corresponding to each predicted medical response and a first probability. The electronic device can use the partial derivative of the predicted probability corresponding to each predicted medical response with respect to the first probability as the probability distribution function of the pre-trained medical analysis model.

[0115] In some specific embodiments, when the i-th predicted medical response is equal to the j-th predicted medical response, the predicted probability p corresponding to the i-th predicted medical response is set... i With the predicted probability p i Subtracting the squares of the predicted medical responses yields the first difference corresponding to the i-th predicted medical response. Multiplying this first difference by the model parameter α yields the probability distribution function. When the i-th predicted medical response is not equal to the j-th predicted medical response, the predicted probability p corresponding to the i-th predicted medical response is... i The predicted probability p corresponding to the j-th predicted medical response j The negative value multiplied by the model parameter α is used as the probability distribution function.

[0116] Specifically, the probability distribution corresponding to the pre-trained medical analysis model can be calculated using formula (2).

[0117]

[0118] Among them, s j δ represents the first probability corresponding to the j-th predicted medical response; i,,j Used to determine whether i is greater than j, i.e., 1 when i = j, otherwise 0; j∈{1,2,...,k} represents the j-th predicted medical response among k predicted medical responses.

[0119] Step 216: Use the L1 norm value of the probability distribution as the gradient value of the probability distribution.

[0120] The L1 norm refers to the sum of the absolute values ​​of all elements in a vector; it is also known as the sparsity rule operator. In this application, the L1 norm value of the probability distribution is used as the gradient value because the calculation of the L1 norm is simple enough, avoiding the difficulty in calculating model parameters due to overly complex functions. Furthermore, L1 can achieve feature sparsity, removing some features that lack information. Also, the descent rate of L1 in a function is faster than that of L2, allowing it to reach the minimum gradient of the probability distribution more quickly and obtain the optimal model parameters.

[0121] In some specific embodiments, the electronic device can calculate the probability distribution corresponding to the pre-trained medical analysis model. The sum of the absolute values ​​of all values ​​i∈{1,2,...,k}, divided by 2, yields the L1 norm of the probability distribution, which is the gradient of the probability distribution.

[0122] Specifically, the gradient value of the probability distribution can be calculated using formula (3).

[0123]

[0124] in, The double vertical bars and the 1 in the lower right corner represent the L1 norm formula; the gradient value of the final probability distribution depends only on the model parameter α and the predicted probability p corresponding to each predicted medical response. i related.

[0125] Step 218: Adjust the parameters of the pre-trained medical analysis model along the direction of decreasing gradient value of the probability distribution until the convergence condition is met.

[0126] The description of step 218 can be referred to the relevant description of step 160 in the above embodiments, and will not be repeated here.

[0127] In some embodiments, the electronic device adjusts the parameters of a pre-trained medical analysis model along the direction of decreasing gradient values ​​of the probability distribution. Training is complete when the pre-trained medical analysis model, after parameter adjustment and updating, meets the convergence condition, resulting in a fully trained medical analysis model. A fully trained medical analysis model that meets the convergence condition has a maximum value among the predicted probabilities corresponding to multiple predicted medical responses. The fully trained medical analysis model has higher accuracy; therefore, using it for medical data retrieval and analysis is more convenient and accurate for electronic devices.

[0128] In one specific embodiment, such as Figure 3 As shown, the training process for the medical analysis model is as follows:

[0129] First, arbitrarily select a sample medical response and its corresponding multiple sample medical data from the sample medical data set. Then, evaluate the quality of these multiple sample medical data. For the multiple sample medical data that meet the evaluation requirements, perform context merging or keyword extraction to obtain a sample prompt message corresponding to each sample medical data. Use this sample prompt message to perform multiple medical data retrieval analyses through a pre-trained medical analysis model to obtain multiple corresponding predicted medical responses. Perform similarity matching between each predicted medical response and the sample medical response to determine the prediction probability of each predicted medical response. Based on the prediction probabilities of each predicted medical response, determine the probability distribution of the pre-trained medical analysis model. Use the L1 norm of the probability distribution as the gradient value of the probability distribution. Adjust the parameters of the pre-trained medical analysis model along the direction of decreasing L1 norm of the probability distribution until the convergence condition is met, thus completing the training of the medical analysis model and obtaining the trained medical analysis model.

[0130] In this embodiment, by conducting a quality assessment of the data, ensuring the use of high-quality sample medical data for training the medical analysis model, the performance of the trained model can be greatly improved, and the training time can be reduced. Furthermore, using a sufficiently simple L1 norm as the gradient value of the probability distribution avoids the difficulty in calculating model parameters due to overly complex functions. The L1 norm decreases rapidly in the probability function, allowing it to reach the minimum gradient value of the probability distribution more quickly, obtain the maximum prediction probability, and arrive at the optimal model parameters. This accelerates the training speed of the medical analysis model and improves the accuracy of the predicted medical responses obtained by the model.

[0131] like Figure 4 As shown, in one embodiment, the trained medical analysis model is obtained using the training method described above. The method further includes the following steps:

[0132] Step 402: Obtain medical search data.

[0133] The medical analysis model trained using the above-mentioned method has optimal model parameters, which makes the medical responses generated by the trained model more accurate. This improves the accuracy of the predicted medical responses obtained by the medical analysis model, thereby enhancing the convenience and accuracy of using the medical analysis model for medical data retrieval and analysis.

[0134] Electronic devices can apply the trained medical analysis model obtained through the training method described above. Upon receiving medical retrieval data input by the user, the electronic device processes the data to obtain multiple target medical data sets. Based on these target medical data sets, it generates target prompts and, through the trained medical analysis model, performs medical data retrieval and analysis to generate the target medical response.

[0135] Medical search data includes user requirements for the target medical data or the target medical response; that is, the search criteria for the target medical data. Medical search data can be natural language, keywords, or key sentences.

[0136] Step 404: Vectorize the medical retrieval data to obtain the medical retrieval vector.

[0137] In some embodiments, electronic devices can use a tokenizer to vectorize medical retrieval data, obtaining medical retrieval vectors. This transforms string-type medical retrieval data into an input data type supported by a trained medical analysis model, enabling the data to be processed on a CPU (Central Processing Unit) or GPU (Graphics Processing Unit). A tokenizer is a typical vectorization tool that converts text data into integer data. Its core task is to convert what is typically considered a word (a single Chinese character or phrase is considered a word) into a positive integer, essentially turning text into a sequence.

[0138] Step 406: Perform similarity matching between the medical retrieval vector and multiple stored medical vectors to determine at least one target medical vector that matches the medical retrieval vector from the multiple medical vectors.

[0139] Electronic devices can pre-build a vector database, which stores multiple medical vectors and their corresponding index numbers. The index numbers associate each medical vector with different medical data stored in the medical system; one medical data point corresponds to one index number, and one medical data point can correspond to multiple medical vectors, thus one index number can correspond to multiple medical vectors. Using a vector database allows electronic devices to avoid traversing the medical data stored in the medical system when performing similarity matching between a medical retrieval vector and multiple stored medical vectors. This reduces the overhead of traversal searches, speeds up the acquisition of target medical data, and increases the rate at which users obtain the desired medical response.

[0140] In some embodiments, electronic devices construct a Milvus vector database. The Milvus vector database supports features such as data partitioning and sharding, incremental data ingestion, and scalar vector hybrid queries, while significantly optimizing vector matching performance to meet the needs of any vector matching application. The Milvus database provides efficient similarity matching capabilities and is also suitable for large-scale unstructured vector datasets.

[0141] In some embodiments, the electronic device can use a vector database to find at least one target medical vector corresponding to a medical retrieval vector. The vector database can be used to find at least one medical vector that matches the medical retrieval vector from multiple medical vectors, and this at least one medical vector can be used as the at least one target medical vector corresponding to the medical retrieval vector.

[0142] In some embodiments, the electronic device can match a medical retrieval vector with multiple stored medical vectors based on the distance between the medical retrieval vector and each of the stored medical vectors. Specifically, the similarity between the medical retrieval vector and the word frequency vector corresponding to any medical vector can be calculated based on the word frequency vector of the medical retrieval vector and the word frequency vectors of the multiple stored medical vectors. The word frequency vector consists of the top five or top ten most frequent words corresponding to each word in the medical retrieval vector or the medical vector; the specific number of words is not limited here. Methods for calculating the similarity between two word frequency vectors include, but are not limited to, cosine similarity, Pearson correlation coefficient, Jaccard similarity coefficient, log-likelihood similarity / log-likelihood similarity rate, etc.

[0143] Step 408: Obtain the medical data corresponding to each target medical vector as the target medical data.

[0144] In some embodiments, the electronic device can obtain the index number corresponding to each target medical vector through a vector database; determine the medical data corresponding to each target medical vector based on each index number, and use the medical data corresponding to each target medical vector as the target medical data.

[0145] Step 410: Perform context merging on multiple target medical data to obtain target prompt information corresponding to the multiple target medical data.

[0146] The method for obtaining target prompt information by merging contextual information from multiple target medical data can refer to the relevant description of step 120 in the above embodiment for obtaining sample prompt information by merging contextual information from multiple sample medical data, and will not be repeated here.

[0147] Step 412: Using the trained medical analysis model, medical data retrieval and analysis are performed based on the target prompt information to obtain the target medical response.

[0148] The method for generating target medical locations using a trained medical analysis model can refer to step 130 in the above embodiment, which generates a relevant description of the predicted medical response using a pre-trained medical analysis model, and will not be repeated here.

[0149] In this embodiment, the electronic device determines the target medical data corresponding to the target medical vector by performing similarity matching between the medical retrieval vector and multiple stored medical vectors. This enables more accurate acquisition of target medical data that matches the user-input medical retrieval data, making the data for medical data retrieval and analysis more precise. The electronic device also uses a trained medical analysis model to perform medical data retrieval and analysis on the target prompt information. The predicted medical responses obtained by the trained medical analysis model have high accuracy, making the use of the trained medical analysis model for medical data detection and analysis both convenient and accurate.

[0150] like Figure 5 As shown, in some embodiments, before obtaining medical retrieval data in step 402, the following steps may also be included:

[0151] Step 502: Obtain multiple medical data.

[0152] The method for obtaining medical data can refer to the relevant description of step 110 in the above embodiment for obtaining sample medical data, and will not be repeated here.

[0153] Step 504: Perform text segmentation on each piece of medical data to obtain one or more text blocks corresponding to each piece of medical data.

[0154] In some embodiments, since medical data may contain various data elements, directly vectorizing the medical data may result in medical vectors containing too much content, leading to low similarity scores when matching with medical retrieval vectors, resulting in a mismatch. Therefore, text segmentation is required to separate the various data elements within the medical data. Data elements refer to the specific content attributes of medical data, such as patient information, outpatient information, and treatment information. Specifically, the medical data may be "patients with hypertension and heart disease," which includes two data elements. Therefore, it can be segmented into two text blocks: "patients with hypertension" and "patients with heart disease."

[0155] In some embodiments, the electronic device may use a text segmenter to segment the medical data into one or more text blocks corresponding to each piece of medical data. The createDocuments() or splitDocuments() functions in the text segmenter can be used to segment the medical data.

[0156] Step 506: Vectorize each text block to generate one or more medical vectors corresponding to each medical data.

[0157] The method for vectorizing each text block can be referred to the relevant description of the vectorization processing of medical retrieval data in step 304 of the above embodiment, and will not be repeated here.

[0158] Step 508: Create an index for each medical data, generate an index number corresponding to each medical data, and assign the same index number to the medical vector corresponding to the same medical data.

[0159] In databases, an index, also called a "key," is a special file that stores the location information of all records in the data. More simply, a database index is like a table of contents at the beginning of a book, speeding up database queries. Therefore, creating indexes for various medical records can accelerate the speed at which electronic devices can find the corresponding target medical data based on the target medical vector.

[0160] Therefore, electronic devices can determine the target medical data corresponding to each target medical vector through the index number, then merge the target medical data in context to generate target prompt information, and based on the target prompt information, perform medical data retrieval and analysis through the trained medical analysis model to obtain the target medical response.

[0161] In a specific embodiment, such as Figure 6 As shown, the application process of the trained medical analysis model is as follows:

[0162] The electronic device acquires multiple medical data points from a medical system, performs text segmentation on each data point to obtain one or more text blocks corresponding to each data point, vectorizes each text block to obtain multiple medical vectors, and indexes each data point to generate a unique index number. Medical vectors generated from the same data point are assigned the same index number, and the medical vectors and their corresponding index numbers are imported into a vector database. When the electronic device receives medical retrieval data input by the user, it vectorizes the retrieval data to obtain medical retrieval vectors. These retrieval vectors are then matched with medical vectors in the vector database to identify multiple target medical vectors that match the retrieval vectors. Based on the index numbers corresponding to each target medical vector, multiple target medical data points are obtained. These target medical data points are then combined with contextual information to obtain target prompts. Finally, these target prompts are used to generate a target medical response through a target medical data model.

[0163] In this embodiment, when the electronic device applies the trained medical analysis model, it segments the medical data to obtain text blocks and establishes index numbers. This allows the electronic device to directly determine the location of the target medical data through the index numbers stored in the vector database, thereby directly obtaining the target medical data without having to traverse all the medical data. This reduces the data loss from traversing the data and increases the speed at which the electronic device finds the target medical data corresponding to the target medical vector. Since the accuracy of the predicted medical responses obtained by the trained medical analysis model is improved, the convenience and accuracy of using the trained medical analysis model for medical data retrieval and analysis are also improved.

[0164] like Figure 7 As shown, in one embodiment, a training device 700 for a medical analysis model is provided, which can be applied to the aforementioned electronic device. The training device 700 for the medical analysis model may include a data acquisition module 710, a prompt generation module 720, a response generation module 730, a probability determination module 740, a distribution determination module 750, and a parameter adjustment module 760.

[0165] The data acquisition module 710 is used to acquire multiple sample medical data corresponding to the same sample medical response.

[0166] The prompt generation module 720 is used to merge the context of multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data.

[0167] The response generation module 730 is used to perform multiple medical data retrieval analyses based on sample prompts using a pre-trained medical analysis model, and obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval analyses.

[0168] The probability determination module 740 is used to determine the predicted probability of each predicted medical response based on the similarity between multiple predicted medical responses and sample medical responses.

[0169] The distribution determination module 750 is used to determine the probability distribution based on the predicted probabilities corresponding to each predicted medical response.

[0170] The parameter adjustment module 760 is used to adjust the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution until the convergence condition is met.

[0171] As an optional embodiment, the training device 700 for the medical analysis model also includes a quality assessment module.

[0172] The quality assessment module is used to assess the quality of multiple medical data samples separately and obtain the assessment results for each sample.

[0173] The data acquisition module 710 is also used to retain sample medical data whose corresponding evaluation results meet the evaluation requirements.

[0174] In some embodiments, the probability determination module 740 is further configured to calculate the similarity between each predicted medical response and the sample medical response, and determine the first probability corresponding to each predicted medical response based on the similarity corresponding to each predicted medical response; perform exponential processing on the first probability corresponding to each predicted medical response to obtain the first index corresponding to each predicted medical response; and normalize the first index corresponding to each predicted medical response to generate the predicted probability corresponding to each predicted medical response.

[0175] In some embodiments, the parameter adjustment module 760 is further configured to use the L1 norm value of the probability distribution as the gradient value of the probability distribution; and adjust the parameters of the pre-trained medical analysis model along the direction of decreasing gradient value of the probability distribution until the convergence condition is met.

[0176] Optionally, the convergence condition includes: among the multiple predicted medical responses obtained by the current medical analysis model through multiple medical data retrieval and analysis based on the sample prompt information, there exists a predicted medical response with the highest prediction probability.

[0177] As an optional embodiment, the training device 700 for the medical analysis model further includes a model application module, which includes a data acquisition unit, a vectorization unit, a matching unit, a merging unit, a retrieval unit, a text segmentation unit, and an index number generation unit.

[0178] The data acquisition unit is used to acquire medical retrieval data.

[0179] The vectorization unit is used to vectorize medical retrieval data to obtain medical retrieval vectors.

[0180] The matching unit is used to perform similarity matching between the medical retrieval vector and multiple stored medical vectors to determine at least one target medical vector that matches the medical retrieval vector from the multiple medical vectors.

[0181] Optionally, the data acquisition unit is also used to acquire the medical data corresponding to each target medical vector as the target medical data.

[0182] The merging unit is used to perform context merging on multiple target medical data to obtain target prompt information corresponding to the multiple target medical data.

[0183] The retrieval unit is used to retrieve and analyze medical data based on target prompts using a trained medical analysis model, and obtain the target medical response.

[0184] In some embodiments, the data acquisition unit is also used to acquire multiple medical data.

[0185] In some embodiments, the text segmentation unit is used to segment each piece of medical data into text, thereby obtaining one or more text blocks corresponding to each piece of medical data.

[0186] In some embodiments, the vectorization unit is also used to vectorize each text block to generate one or more medical vectors corresponding to each medical data.

[0187] The index number generation unit is used to create an index for each piece of medical data, generate an index number corresponding to each piece of medical data, and assign the same index number to medical vectors corresponding to the same piece of medical data.

[0188] In some embodiments, the data acquisition unit is further configured to acquire the index number corresponding to each target medical vector; determine the medical data corresponding to each target medical vector based on each index number; and use the medical data corresponding to each target medical vector as the target medical data.

[0189] In this embodiment, multiple medical data retrieval analyses are performed using a pre-trained medical analysis model to obtain multiple predicted medical responses. Based on the probability distribution of the predicted probabilities corresponding to each of the multiple predicted medical responses, the smaller the gradient of the probability distribution, the greater the probability that the predicted medical response generated by the pre-trained medical analysis model is the sample medical response, and the greater the accuracy of the pre-trained medical analysis model. Therefore, adjusting the parameters of the pre-trained medical analysis model according to the gradient descent direction of the probability distribution can improve the accuracy of the medical analysis model, thereby improving the convenience and accuracy of using the medical analysis model for medical data retrieval analysis.

[0190] Figure 8 This is a structural block diagram of an electronic device in one embodiment. The electronic device can be a mobile phone, tablet computer, smart wearable device, etc. Figure 8 As shown, the electronic device 800 may include one or more of the following components: a processor 810 and a memory 820 coupled to the processor 810, wherein the memory 820 may store one or more computer programs, which may be configured to implement the methods described in the above embodiments when executed by one or more processors 810.

[0191] The processor 810 may include one or more processing cores. The processor 810 connects to various parts within the electronic device 800 using various interfaces and lines, and performs various functions and processes data of the electronic device 800 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 820, and by calling data stored in the memory 820. Optionally, the processor 810 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 810 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 810 and may be implemented separately using a communication chip.

[0192] The memory 820 may include random access memory (RAM) or read-only memory (ROM). The memory 820 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 820 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created by the electronic device 800 during use.

[0193] Understandably, the electronic device 800 may include more or fewer structural elements than those shown in the block diagram above, such as power supply, input buttons, camera, speaker, screen, RF (Radio Frequency) circuit, Wi-Fi (Wireless Fidelity) module, Bluetooth module, sensor, etc., and may not be limited herein.

[0194] This application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the methods described in the above embodiments.

[0195] This application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.

[0196] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), etc.

[0197] Any references to memory, storage, databases, or other media used herein may include non-volatile and / or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Synchlink DRAM (SLDRAM), Rambus DRAM (RDRAM), and Direct Rambus DRAM (DRDRAM).

[0198] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0199] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0200] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0201] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0202] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0203] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-accessible memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests to cause a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the methods described in the various embodiments of this application.

[0204] The foregoing has provided a detailed description of a training method, apparatus, electronic device, and storage medium for a medical analysis model disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A training method for a medical analysis model, characterized in that, The method includes: Obtain multiple sample medical data corresponding to the same sample medical response; Context merging is performed on the multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data; The pre-trained medical analysis model performs multiple medical data retrieval and analysis based on the sample prompt information to obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval and analysis. Calculate the similarity between each of the predicted medical responses and the sample medical responses, and determine the first probability corresponding to each of the predicted medical responses based on the similarity between each of the predicted medical responses; The first probability corresponding to each of the predicted medical responses is subjected to exponential processing to obtain the first index corresponding to each of the predicted medical responses. Normalize the first index corresponding to each of the predicted medical responses to generate the predicted probability corresponding to each of the predicted medical responses. Determine the probability distribution based on the predicted probability corresponding to each of the predicted medical responses; The L1 norm of the probability distribution is used as the gradient value of the probability distribution; The parameters of the pre-trained medical analysis model are adjusted along the direction in which the gradient value of the probability distribution decreases until the convergence condition is met.

2. The method according to claim 1, characterized in that, After obtaining multiple sample medical data corresponding to the same sample medical response, the method further includes: The quality of the multiple sample medical data is assessed separately to obtain the assessment results corresponding to the multiple sample medical data. Retain the medical data of the samples whose corresponding assessment results meet the assessment requirements.

3. The method according to claim 1, characterized in that, The convergence conditions include: The current medical analysis model performs multiple medical data retrieval and analysis based on sample prompts. Among the multiple predicted medical responses obtained, there is a corresponding predicted medical response with the highest probability.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain medical search data; The medical retrieval data is vectorized to obtain a medical retrieval vector; The medical retrieval vector is matched with a plurality of stored medical vectors for similarity, so as to determine at least one target medical vector that matches the medical retrieval vector from the plurality of medical vectors; Obtain the medical data corresponding to each of the target medical vectors as the target medical data; Context merging is performed on multiple target medical data sets to obtain the target prompt information corresponding to the multiple target medical data sets; The trained medical analysis model performs medical data retrieval and analysis based on the target prompt information to obtain the target medical response.

5. The method according to claim 4, characterized in that, Prior to acquiring the medical retrieval data, the method further includes: Acquire multiple medical data; Each of the medical data is segmented into text to obtain one or more text blocks corresponding to each of the medical data. Vectorize each of the text blocks to generate one or more medical vectors corresponding to each of the medical data; An index is created for each of the medical data, an index number is generated for each of the medical data, and the same index number is assigned to the medical vectors corresponding to the same medical data. The step of obtaining the medical data corresponding to each of the target medical vectors as target medical data includes: Obtain the index number corresponding to each of the target medical vectors; Based on each index number, determine the medical data corresponding to each target medical vector, and use the medical data corresponding to each target medical vector as the target medical data.

6. A training device for a medical analysis model, characterized in that, The device includes: The data acquisition module is used to acquire multiple sample medical data corresponding to the same sample medical response; The prompt generation module is used to perform context merging on the multiple sample medical data to obtain sample prompt information corresponding to the multiple sample medical data; The response generation module is used to perform multiple medical data retrieval and analysis based on the sample prompt information using a pre-trained medical analysis model, and obtain multiple predicted medical responses that correspond one-to-one with the multiple medical data retrieval and analysis. The probability determination module is used to calculate the similarity between each of the predicted medical responses and the sample medical responses, and to determine the first probability corresponding to each of the predicted medical responses based on the similarity corresponding to each of the predicted medical responses; to perform exponential processing on the first probability corresponding to each of the predicted medical responses to obtain the first index corresponding to each of the predicted medical responses; and to normalize the first index corresponding to each of the predicted medical responses to generate the predicted probability corresponding to each of the predicted medical responses. The distribution determination module is used to determine the probability distribution based on the predicted probabilities corresponding to each of the predicted medical responses; The parameter adjustment module is used to take the L1 norm value of the probability distribution as the gradient value of the probability distribution; and adjust the parameters of the pre-trained medical analysis model along the direction of decreasing gradient value of the probability distribution until the convergence condition is met.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when executed by the processor, the computer program causes the processor to perform the method as described in any one of claims 1 to 5.

8. A computer storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Model training and target detection method and device, electronic equipment and roadside equipment

    CN113688920A

  • Model training method for improving semantic segmentation network prediction probability distribution quality

    CN115546225A