Medical institution-oriented large language model training method and system, terminal and medium
By dividing types according to the number of patients' visits and analyzing the visit data, calculating the symptoms and examination sample coefficients, the problems of lack of targetedness and possible misdiagnosis in the existing technology are solved, and more accurate and personalized medical advice is achieved.
Patent Information
- Application Number
- CN202411554237.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-25
AI Technical Summary
The existing large language model training methods for medical institutions lack the inclusion of the patient's previous visits into the training data, resulting in a lack of targeted recommendations or predictions output and may lead to misdiagnosis.
By dividing the patients into the first type and the second type according to the number of visits to patients, the corresponding multiple visits, single diagnosis text and examination result text are obtained, and these data are analyzed to calculate the symptom sample coefficient and examination sample coefficient, and then model training is carried out to obtain a large language model for different types of patients.
It improves the pertinence and scientific nature of model training, provides patients with more accurate and personalized services, and reduces the possibility of misdiagnosis.
Smart Images

Figure CN119517266A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the medical field and relates to large language model technology, specifically a large language model training method, system, terminal and medium for medical institutions. Background Art
[0002] A large language model is a deep learning model that can process and understand natural language. Its goal is to learn the regularities and semantic information of language from large-scale text data through training, so as to be able to generate, understand and process text data. Large language models are usually based on advanced architectures such as Transformer, can process long text sequences, and show excellent performance in various natural language processing tasks, such as text generation, translation, question-answering systems, etc.
[0003] The existing large language model training methods for medical institutions have the following defects:
[0004] 1. Existing large language models are usually trained based on large-scale general data. The patient's previous symptoms are not included in the training data. The model cannot learn the disease development pattern and individual differences of a specific patient, resulting in a lack of pertinence in the output suggestions or predictions.
[0005] 2. The lack of training data with specific patient history and symptom information may lead to bias in the knowledge learned by the model. This bias will directly affect the model's accurate judgment of the patient's condition and may even lead to misdiagnosis.
[0006] To this end, we propose a large language model training method, system, terminal and medium for medical institutions. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention aims to provide a large language model training method, system, terminal and medium for medical institutions. The present invention divides patients into first-type patients and second-type patients according to the number of their visits, obtains multiple visit data corresponding to the first-type patients, obtains the first-type patient data, obtains a single diagnosis text corresponding to the second-type patients and a plurality of examination result texts corresponding to the examination items, obtains the second-type patient data, defines the first-type patient data and the second-type patient data as patient medical data, and obtains the upper limit and lower limit of the symptom sample coefficient interval corresponding to multiple clinical symptoms by analyzing the patient medical data. limit, select multiple sample cases to calculate the symptom sample coefficient, obtain multiple symptom sample coefficients, compare the range with the upper limit of the symptom sample coefficient interval and the lower limit of the symptom sample coefficient interval, and obtain the first type of sample cases, by analyzing the patient's medical data, obtain the upper limit and lower limit of the inspection sample coefficient corresponding to multiple abnormal inspection items, select multiple cases with consistent diagnosis to calculate the inspection sample coefficient, obtain multiple inspection sample coefficients, compare the range with the upper limit and lower limit of the inspection sample coefficient, and obtain the second type of sample cases, perform model training according to the first type of sample cases and the second type of sample cases, and obtain the first type of large language model and the second type of large language model.
[0008] In order to achieve the above object, the present invention adopts the following technical solution: A large language model training method for medical institutions comprises the following specific steps:
[0009] Step A1: dividing patients into first-type patients and second-type patients according to the number of visits, acquiring multiple visit data corresponding to the first-type patients to obtain first-type patient data, acquiring a single diagnosis text and a plurality of examination result texts corresponding to the second-type patients to obtain second-type patient data, and defining the first-type patient data and the second-type patient data as patient medical data;
[0010] Step A2: Analyze the patient's medical data to obtain the upper and lower limits of the symptom sample coefficient interval corresponding to multiple clinical symptoms, select multiple sample cases to calculate the symptom sample coefficients, obtain multiple symptom sample coefficients, compare the symptom sample coefficients with the upper and lower limits of the symptom sample coefficient interval, and obtain the first type of sample cases;
[0011] Step A3: by analyzing the patient's medical data, the upper and lower limits of the inspection sample coefficients corresponding to the multiple inspection abnormal items are obtained, and multiple cases with consistent diagnoses are selected to calculate the inspection sample coefficients to obtain multiple inspection sample coefficients, which are compared with the upper and lower limits of the inspection sample coefficients to obtain the second type of sample cases;
[0012] Step A4: Perform model training based on the first type of sample cases and the second type of sample cases to obtain a first type of large language model and a second type of large language model.
[0013] Furthermore, the step A1 further includes the following specific steps:
[0014] Step A11: Obtain the number of visits of the patient to the medical institution according to the number of visits of the patient, and divide the patient into the first type of patients and the second type of patients according to the number of visits of the patient to the same institution;
[0015] The details are as follows:
[0016] When the number of visits is greater than q, the patient is classified as the first type of visit patient;
[0017] When the number of visits is less than or equal to q times, the patient is classified as the second type of visit patient;
[0018] Step A12: Acquire the medical consultation data corresponding to the first medical consultation type patient to obtain the first type patient data;
[0019] Step A13: Acquire the medical consultation data corresponding to the second medical consultation type patient to obtain the second type patient data;
[0020] The step A13 further includes the following specific steps:
[0021] Obtain multiple medical examinations that the second type of patient receives during the medical institution visit, and name them as the first to kth medical examination items respectively;
[0022] Respectively obtain the text of the examination results corresponding to the first to k-th medical examination items to obtain the first to k-th examination result texts;
[0023] The text of the diagnosis report corresponding to the patient's current visit is obtained to obtain a single diagnosis text;
[0024] The first to k-th examination result texts and a single diagnosis text are defined as the second type of patient data.
[0025] Furthermore, the step A12 further includes the following specific steps:
[0026] Obtaining a time value corresponding to each visit of a patient of the first visit type to a medical institution to obtain multiple visit time values;
[0027] Obtain the difference between each visit time value and the current time value respectively, obtain multiple visit time difference values, mark the multiple visit time difference values in descending order as the first to aath visit difference values, and name the visits corresponding to the first to aath visit differences as the first to aath visits respectively;
[0028] Obtain the actual symptoms that the patient experienced when they first visited the doctor and name them as the first to the pth patient clinical symptoms respectively;
[0029] Obtain the duration of symptoms corresponding to the clinical symptoms of the first to pth patients respectively to obtain the duration of symptoms from the first to pth;
[0030] The text of the diagnosis report made by the medical institution during the patient's first visit to the doctor is obtained to obtain a first diagnosis text;
[0031] The clinical symptoms of the first to pth patients, the duration of the first to pth symptoms, and the first diagnosis text are defined as the visit data corresponding to the first visit, and are named the first visit data;
[0032] Obtain the visit data corresponding to the second to aath visits respectively, and obtain the second to aath visit data;
[0033] The first to aath visit data are defined as the first type of patient data.
[0034] Furthermore, the step A2 further includes the following specific steps:
[0035] Step A21: Acquire patient medical data, acquire first type patient data respectively according to the patient medical data, and acquire first to aath medical consultation data according to the first type patient data;
[0036] Step A22: performing sample analysis and matching on the first medical consultation data to obtain medical consultation sample cases corresponding to the first type of medical consultation patients;
[0037] Step A23: performing sample analysis and matching on the second to aath visit data to obtain the first to aath visit sample cases, and defining the first to aath visit sample cases as first type sample cases;
[0038] The step A22 further includes the following specific steps:
[0039] Obtain the clinical symptoms of the first to pth patients and the duration of the first to pth symptoms according to the first visit data;
[0040] According to the clinical symptoms of the first to pth patients, the upper limits of the first to pth symptom constants and the lower limits of the first to pth symptom constants are set respectively;
[0041] The upper limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the upper limit of the interval of the first symptom sample coefficient;
[0042] Calculate the upper limit of the first symptom sample coefficient interval. The specific formula configuration is as follows:
[0043] Yxs1=Zcs1×Zcc1+Zcs2×Zcc3+······+Zcsp×Zccp;
[0044] Among them, Yxs1 is the upper limit of the first symptom sample coefficient interval, Zcs1 to Zcsp are the upper limits of the first to pth symptom constants, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively;
[0045] The lower limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the lower limit of the first symptom sample coefficient interval;
[0046] Obtain a first diagnosis text according to the first medical consultation data, crawl related symptom cases using the first diagnosis text as a keyword through crawler technology, obtain multiple identical diagnosis cases, and mark them as the first to qth identical diagnosis cases respectively;
[0047] Acquire multiple clinical symptoms corresponding to the first identically diagnosed case, and match them with the clinical symptoms of the first to pth patients, acquire the matching identical symptoms to obtain multiple matching identical symptoms, acquire the duration of each matching identical symptom on the first identically diagnosed case, and obtain multiple matching identical symptom durations;
[0048] Obtain the upper limit and lower limit of the symptom constant corresponding to each clinical symptom of the first to pth patients that match the same symptom, calculate the average of each symptom constant upper limit and the corresponding symptom constant lower limit, and obtain the symptom constant average value;
[0049] Calculate the product of the duration of each matching symptom and the average value of the corresponding symptom constant, and then sum the multiple products to obtain the first corresponding symptom sample coefficient;
[0050] The symptom sample coefficients corresponding to the second to qth cases with the same diagnosis are obtained respectively to obtain a plurality of symptom sample coefficients;
[0051] When the symptom sample coefficient is between the upper limit of the first symptom sample coefficient interval and the lower limit of the first symptom sample coefficient interval, the same diagnosis case corresponding to the symptom sample coefficient is judged to be the first visit sample case.
[0052] Furthermore, the step A3 further includes the following specific steps:
[0053] Step A31: Acquire patient medical data, acquire second-type patient data respectively according to the patient medical data, and acquire first to k-th examination result texts according to the second-type patient data;
[0054] Step A32: acquiring inspection result indicators according to the first to kth inspection result texts to obtain a plurality of inspection result indicators, comparing the plurality of inspection result indicators with the normal range values of the corresponding indicators, marking the inspection results whose inspection result indicators are not within the normal range values of the indicators as abnormal results, obtaining a plurality of inspection abnormality items, and naming them as the first to tth inspection abnormality items;
[0055] Step A33: setting the first to t-th inspection constant upper limits and the first to t-th inspection constant lower limits respectively according to the first to t-th inspection abnormality items;
[0056] Step A34: Calculating the first to t-th indicator abnormal deviation values and the first to t-th inspection constant upper limits to obtain the first inspection sample coefficient upper limit;
[0057] Calculate the upper limit of the inspection sample coefficient. The specific formula configuration is as follows:
[0058] Jcs=Ypc1×Jjc1+Ypc2×Jjc2+·······+Ypct×Jjct;
[0059] Among them, Jcs is the upper limit of the inspection sample coefficient, Ypc1 to Ypct are the abnormal deviation values of the first to tth indicators respectively, and Jjc1 to Jjct are the upper limits of the first to tth inspection constants respectively;
[0060] Step A35: Calculating the first to tth indicator abnormal deviation values and the first to tth inspection constant upper limits to obtain the first to tth inspection sample coefficient lower limits;
[0061] Step A36: Obtain a single diagnosis text according to the second medical consultation data, crawl multiple cases with the same diagnosis using the single diagnosis text as a keyword through crawler technology, and mark them as the first to hth diagnosis consistent cases respectively;
[0062] Step A37: Obtaining the examination sample coefficient corresponding to the first diagnosis consistent case;
[0063] Step A38: respectively obtaining the inspection sample coefficients corresponding to the second to hth diagnosis consistent cases to obtain a plurality of inspection sample coefficients;
[0064] Step A39: The diagnosis-consistent cases corresponding to the inspection sample coefficients between the upper limit and the lower limit of the inspection sample coefficients are determined as the second type of sample cases.
[0065] Furthermore, the step A37 further includes the following specific steps:
[0066] Obtain the abnormal examination items corresponding to the first diagnosis consistent case, and match the item names of the abnormal examination items corresponding to the second type of patients, and mark the abnormal examination items with the same matching as the first to Vth abnormal examination items;
[0067] Obtain the inspection constant upper limits and inspection constant lower limits corresponding to the first to Vth abnormal inspection items respectively, and average them to obtain the average values of the constants of multiple abnormal inspection items, which are named as the first to vth inspection constant average values respectively;
[0068] Obtain the indicator abnormal deviation values corresponding to the first to Vth abnormal inspection items to obtain the first to vth indicator abnormal deviation values;
[0069] The inspection sample coefficient corresponding to the first diagnosis consistent case is obtained by calculating the first to vth index abnormal deviation values corresponding to the first diagnosis consistent case and the first to vth inspection constant average values;
[0070] The inspection sample coefficient corresponding to the first diagnosis consistent case is calculated, and the specific formula configuration is as follows:
[0071] Jyx=Zp1×Jcp1+Zp2×Jcp2+······+Zpv×Jcpv;
[0072] Among them, Jyx is the inspection sample coefficient corresponding to the first diagnosis consistent case, Zp1 to Zpv are the abnormal deviation values of the first to vth indicators, and Jcp1 to Jcpv are the average values of the first to vth inspection constants.
[0073] Furthermore, the step A4 further includes the following specific steps:
[0074] Step A41: Obtaining a first type of sample case and a second type of sample case;
[0075] Step A42: creating a large language model according to the first type of sample cases and training it to obtain a first type of large language model;
[0076] The step A42 further includes the following specific steps:
[0077] Step A421: Obtain the medical records corresponding to each of the first type sample cases' visits to the medical institution to obtain a plurality of sample medical records;
[0078] Step A422: Building a language model based on an existing artificial intelligence framework, and setting default hyperparameters of the language model;
[0079] Step A423: Divide the plurality of sample medical records into a model training set, a model validation set, and a model test set according to a preset division ratio;
[0080] Step A424: Mark multiple symptoms corresponding to each sample case in the model training set as test input text, and mark the clinical diagnosis corresponding to the test input text as test output text, and take the test input text and test output text corresponding to the same case as a model training group to obtain multiple model training groups;
[0081] Step A425: annotating the model validation set and the model test set respectively to obtain multiple model validation groups and model test groups;
[0082] Step A426: Use multiple model training groups to train the language model respectively. After the model training group is trained, the model verification group performs gradient tuning on the model parameters generated during the test until all model verification groups complete the training verification of the language model, thereby obtaining a verified language model.
[0083] Step A427: Use the model test group to train and test the verified language model, obtain the test pass rate, and compare the obtained benchmark pass rate with the test pass rate;
[0084] Step A428: When the test pass rate is greater than or equal to the benchmark pass rate, the language model training is completed and a first type large language model is obtained;
[0085] Step A429: When the test pass rate is less than the benchmark pass rate, repeat the above-mentioned training, verification and testing process of the language model until the test pass rate is greater than or equal to the benchmark pass rate;
[0086] Step A43: Create and train a large language model based on the second type of sample cases to obtain a second type of large language model.
[0087] A large language model training system for medical institutions, including:
[0088] Data acquisition module: used to acquire the first type of patient data and the second type of patient data respectively to obtain patient medical data;
[0089] The first sample collection module is used to collect model training samples for the first type of patient data according to the patient medical data to obtain the first type of sample cases;
[0090] The second sample collection module is used to collect model training samples for the second type of patient data according to the patient medical data to obtain the second type of sample cases;
[0091] Model training module: used to perform model training based on the first type of sample cases and the second type of sample cases to obtain the first type of large language model and the second type of large language model.
[0092] An electronic terminal includes a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the training method are executed.
[0093] A storage medium stores a computer program, which, when executed by a processor, executes the steps in the training method.
[0094] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0095] 1. The present invention obtains the first type of patient data and the second type of patient data respectively, and obtains the corresponding sample patients to participate in the large language model training, which can effectively improve the pertinence of the model training process and improve the scientific nature of the model working process;
[0096] 2. The present invention selects sample cases for patients according to their symptoms and examination results, trains a large language model based on the sample cases, and provides patients with more accurate personalized services. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0098] Figure 1 is the overall system block diagram of the present invention;
[0099] Figure 2 It is a diagram of the implementation steps of the present invention;
[0100] Figure 3 Schematic diagram of the artificial intelligence framework structure in the present invention. DETAILED DESCRIPTION
[0101] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0102] Embodiment 1
[0103] See also Figure 1, the present invention provides a technical solution: a large language model training system for medical institutions, comprising a data acquisition module, a first sample acquisition module, a second sample acquisition module, a model testing module and a server, wherein the data acquisition module, the first sample acquisition module, the second sample acquisition module and the model testing module are respectively connected to the server, and the server controls the data acquisition module, the first sample acquisition module, the second sample acquisition module and the model testing module respectively;
[0104] The data acquisition module acquires the patient's medical data;
[0105] The number of visits of the patient to the medical institution is obtained, and the patient is divided into the first type of patients and the second type of patients according to the number of visits of the patient to the same institution;
[0106] The details are as follows:
[0107] When the number of visits is greater than q, the patient is classified as the first type of visit patient;
[0108] When the number of visits is less than or equal to q times, the patient is classified as the second type of visit patient;
[0109] It should be noted here that:
[0110] The q involved here is a classification index for classifying the types of medical visits. The specific value of q here needs to be set according to the patient's symptom type, age value and physiological indicators;
[0111] The first type of patients involved here have more visits to medical institutions than the second type of patients;
[0112] Acquire the medical consultation data corresponding to the first medical consultation type patient to obtain the first type patient data;
[0113] The details are as follows:
[0114] Obtaining a time value corresponding to each visit of a patient of the first visit type to a medical institution to obtain multiple visit time values;
[0115] Obtain the difference between each visit time value and the current time value respectively, obtain multiple visit time difference values, mark the multiple visit time difference values in descending order as the first to aath visit difference values, and name the visits corresponding to the first to aath visit difference values as the first to aath visits respectively;
[0116] It should be noted here that:
[0117] The aa involved here is the number of visits made by the patient of the first visit type in the medical institution, and the number of visits and the difference in visits are corresponding and unified in quantity, and aa is an integer greater than 0;
[0118] In this application, the time value corresponding to the patient's visit to a medical institution is specifically the patient's registration time;
[0119] The first visit is specifically the visit with the largest difference between the time value corresponding to the patient's visit to the medical institution and the current time value, that is, the patient's first visit to the medical institution;
[0120] Obtain first visit data;
[0121] The details are as follows:
[0122] Obtain the actual symptoms that the patient experienced when they first visited the doctor and name them as the first to the pth patient clinical symptoms respectively;
[0123] It should be noted here that:
[0124] In this application, p is the numerical value corresponding to the actual symptoms occurring at the first visit, and p is an integer greater than 0;
[0125] The actual symptom values of the patients involved here at the time of their first visit to the doctor need to be specifically determined based on the patients' actual symptoms and actual clinical manifestations;
[0126] For example:
[0127] If the specific disease corresponding to the patient at the first visit is rhinitis, the clinical symptom of the first patient may be nasal congestion, the clinical symptom of the second patient may be runny nose, and the clinical symptom of the third patient may be sneezing;
[0128] Obtain the duration of symptoms corresponding to the clinical symptoms of the first to pth patients respectively to obtain the duration of symptoms from the first to pth;
[0129] Obtain the text of the diagnosis report made by the medical institution when the patient visits the doctor for the first time, and obtain the first diagnosis text;
[0130] The clinical symptoms of the first to pth patients, the duration of the first to pth symptoms, and the first diagnosis text are defined as the visit data corresponding to the first visit, and are named the first visit data;
[0131] Obtain the current visit data corresponding to the second to aath visits respectively, and obtain the second to aath visit data;
[0132] The first to aath visit data are defined as the first type of patient data;
[0133] Acquire the medical consultation data corresponding to the second medical consultation type patients to obtain the second type patient data;
[0134] The details are as follows:
[0135] Obtain multiple medical examinations that the second type of patient receives during the medical institution visit, and name them as the first to kth medical examination items respectively;
[0136] It should be noted here that:
[0137] The medical examinations involved here include targeted examination items based on the patient's specific symptoms, as well as basic physiological index examinations such as blood routine examinations, urine routine examinations, liver function and kidney function;
[0138] Respectively obtain the text of the examination results corresponding to the first to k-th medical examination items to obtain the first to k-th examination result texts;
[0139] The text of the diagnosis report corresponding to the patient's current visit is obtained to obtain a single diagnosis text;
[0140] The first to kth examination result texts and a single diagnosis text are defined as second type patient data;
[0141] defining the first type of patient data and the second type of patient data as patient medical data;
[0142] The data acquisition module acquires the patient's medical data and transmits it to the first sample collection module;
[0143] The first sample collection module collects model training samples for the first type of patient data according to the patient medical data to obtain the first type of sample cases;
[0144] Acquire patient medical data, and acquire first type of patient data respectively according to the patient medical data;
[0145] Acquire the first to aath visit data according to the first type of patient data;
[0146] Perform sample analysis and matching on the first medical consultation data to obtain medical consultation sample cases corresponding to the first type of medical consultation patients;
[0147] The details are as follows:
[0148] Obtain the clinical symptoms of the first to pth patients and the duration of the first to pth symptoms according to the first visit data;
[0149] According to the clinical symptoms of the first to pth patients, the upper limits of the first to pth symptom constants and the lower limits of the first to pth symptom constants are set respectively;
[0150] It should be noted here that:
[0151] The upper limit of the symptom constant and the lower limit of the symptom constant involved here represent the upper and lower ranges of the weights of different symptoms in the corresponding disease conditions. The more severe the symptoms, the larger the range of the corresponding values of the upper limit of the symptom constant and the lower limit of the symptom constant.
[0152] For example, the clinical symptoms of pneumonia patients usually include cough and respiratory failure. For pneumonia patients, the severity of the symptom of respiratory failure is higher than that of cough. Therefore, the interval values corresponding to the upper limit and lower limit of the symptom constant corresponding to the symptom of respiratory failure are higher than those corresponding to the cough symptom.
[0153] The upper limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the upper limit of the interval of the first symptom sample coefficient;
[0154] Calculate the upper limit of the first symptom sample coefficient interval. The specific formula configuration is as follows:
[0155] Yxs1=Zcs1×Zcc1+Zcs2×Zcc3+······+Zcsp×Zccp;
[0156] Among them, Yxs1 is the upper limit of the first symptom sample coefficient interval, Zcs1 to Zcsp are the upper limits of the first to pth symptom constants, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively;
[0157] The lower limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the lower limit of the first symptom sample coefficient interval;
[0158] Calculate the lower limit of the first symptom sample coefficient interval. The specific formula configuration is as follows:
[0159] Yxx1=Zcx1×Zcc1+Zcx2×Zcc3+······+Zcxp×Zccp;
[0160] Among them, Yxx1 is the lower limit of the sample coefficient interval of the first symptom, Zcx1 to Zcxp are the lower limits of the constants of the first to pth symptoms respectively, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively;
[0161] Obtain a first diagnosis text according to the first medical consultation data, crawl related symptom cases using the first diagnosis text as a keyword through crawler technology, obtain multiple identical diagnosis cases, and mark them as the first to qth identical diagnosis cases respectively;
[0162] It should be noted here that:
[0163] In this application, q is the number value corresponding to the same diagnosed case, and q is an integer greater than 0;
[0164] Acquire multiple clinical symptoms corresponding to the first identically diagnosed case, and match them with the clinical symptoms of the first to pth patients, acquire the matching identical symptoms to obtain multiple matching identical symptoms, acquire the duration of each matching identical symptom on the first identically diagnosed case, and obtain multiple matching identical symptom durations;
[0165] Obtain the upper limit and lower limit of the symptom constant corresponding to each clinical symptom of the first to pth patients that match the same symptom, calculate the average of each symptom constant upper limit and the corresponding symptom constant lower limit, and obtain the symptom constant average value;
[0166] Calculate the product of the duration of each matching symptom and the average value of the corresponding symptom constant, and then sum the multiple products to obtain the first corresponding symptom sample coefficient;
[0167] The symptom sample coefficients corresponding to the second to qth cases with the same diagnosis are obtained respectively to obtain a plurality of symptom sample coefficients;
[0168] When the symptom sample coefficient is between the upper limit of the first symptom sample coefficient interval and the lower limit of the first symptom sample coefficient interval, the case with the same diagnosis corresponding to the symptom sample coefficient is judged to be the first visit sample case;
[0169] It should be noted here that:
[0170] The first visit sample cases involved here include the interval boundaries;
[0171] Perform sample analysis and matching on the second to aath visit data to obtain the first to aath visit sample cases, and define the first to aath visit sample cases as the first type of sample cases;
[0172] The first sample collection module acquires the first type of sample cases and transmits them to the second sample collection module;
[0173] The second sample collection module collects model training samples for the second type of patient data based on the patient medical data to obtain the second type of sample cases;
[0174] Acquire patient medical data, acquire second-type patient data respectively according to the patient medical data, and acquire first to k-th examination result texts according to the second-type patient data;
[0175] Acquire inspection result indicators according to the first to kth inspection result texts to obtain multiple inspection result indicators, compare the multiple inspection result indicators with the corresponding normal range values of the indicators, mark the inspection results whose inspection result indicators are not within the normal range values of the indicators as inspection abnormality items, obtain multiple inspection abnormality items, and name them as the first to tth inspection abnormality items;
[0176] It should be noted here that:
[0177] In this application, t is the quantity value corresponding to the abnormal item checked, and t is an integer greater than 0;
[0178] Obtain the indicator abnormal deviation values corresponding to the first to t-th inspection abnormal items, and name them as the first to t-th indicator abnormal deviation values respectively;
[0179] It should be noted here that:
[0180] The abnormal deviation value of the indicator involved here is specifically the difference between the value corresponding to the test result indicator and the endpoint average value of the normal range value of the indicator;
[0181] For example: if the value corresponding to the inspection result indicator of the abnormal item of the i-th inspection is 0.9, and the normal range value of the indicator corresponding to the abnormal item of the i-th inspection is 0.3-0.6, and the abnormal deviation value of the indicator corresponding to the abnormal item of the i-th inspection is 0.45;
[0182] According to the first to t-th inspection abnormality items, the first to t-th inspection constant upper limits and the first to t-th inspection constant lower limits are respectively set;
[0183] It should be noted here that:
[0184] The upper limit and lower limit of the inspection constant involved here represent the upper and lower ranges of the weights of different inspection indicators in the corresponding disease conditions. The more important the indicator is, the larger the range value corresponding to the upper limit and lower limit of the inspection constant is.
[0185] For example, the examination indicators obtained clinically for pneumonia patients usually include blood oxygen saturation and the number of coughs per unit time. For pneumonia patients, the importance of the symptom of blood oxygen saturation is higher than the number of coughs per unit time. Therefore, the interval range values corresponding to the upper and lower limits of the examination constant corresponding to blood oxygen saturation are higher than the number of coughs per unit time.
[0186] The first inspection sample coefficient upper limit is obtained by calculating the first to tth indicator abnormal deviation values and the first to tth inspection constant upper limits;
[0187] Calculate the upper limit of the inspection sample coefficient. The specific formula configuration is as follows:
[0188] Jcs=Ypc1×Jjc1+Ypc2×Jjc2+·······+Ypct×Jjct;
[0189] Among them, Jcs is the upper limit of the inspection sample coefficient, Ypc1 to Ypct are the abnormal deviation values of the first to tth indicators respectively, and Jjc1 to Jjct are the upper limits of the first to tth inspection constants respectively;
[0190] The first to tth inspection sample coefficient lower limits are obtained by calculating the first to tth indicator abnormal deviation values and the first to tth inspection constant upper limits;
[0191] Calculate the lower limit of the inspection sample coefficient. The specific formula configuration is as follows:
[0192] Jcs=Ypc1×Jjx1+Ypc2×Jjx2+·······+Ypct×Jjxt;
[0193] Among them, Jcs is the lower limit of the inspection sample coefficient, Ypc1 to Ypct are the first to tth indicator abnormal deviation values, and Jjx1 to Jjxt are the first to tth inspection constant lower limits, respectively;
[0194] Obtain a single diagnosis text according to the second medical consultation data, use the crawler technology to use the single diagnosis text as a keyword to crawl multiple cases with the same diagnosis, and mark them as the first to the hth diagnosis consistent cases respectively;
[0195] Obtain the abnormal examination items corresponding to the first diagnosis consistent case, and match the item names of the abnormal examination items corresponding to the second type of patients, and mark the abnormal examination items with common abnormalities as the first to Vth abnormal examination items;
[0196] It should be noted here that:
[0197] In this application, v is the number of abnormal inspection items with common abnormalities, and v is an integer greater than 0;
[0198] Obtain the inspection constant upper limits and inspection constant lower limits corresponding to the first to Vth abnormal inspection items respectively, and average them to obtain the average values of the constants of multiple abnormal inspection items, which are named as the first to vth inspection constant average values respectively;
[0199] Obtain the indicator abnormal deviation values corresponding to the first to Vth abnormal inspection items to obtain the first to vth indicator abnormal deviation values;
[0200] The inspection sample coefficient corresponding to the first diagnosis consistent case is obtained by calculating the first to vth index abnormal deviation values corresponding to the first diagnosis consistent case and the first to vth inspection constant average values;
[0201] The inspection sample coefficient corresponding to the first diagnosis consistent case is calculated, and the specific formula configuration is as follows:
[0202] Jyx=Zp1×Jcp1+Zp2×Jcp2+······+Zpv×Jcpv;
[0203] Among them, Jyx is the inspection sample coefficient corresponding to the first diagnosis consistent case, Zp1 to Zpv are the abnormal deviation values of the first to vth indicators, and Jcp1 to Jcpv are the average values of the first to vth inspection constants;
[0204] The inspection sample coefficients corresponding to the second to the hth diagnosis consistent cases are obtained respectively to obtain a plurality of inspection sample coefficients;
[0205] The diagnosis-consistent cases corresponding to the inspection sample coefficients between the upper limit and the lower limit of the inspection sample coefficient are judged as the second type of sample cases;
[0206] The second sample collection module acquires the second type of sample cases and transmits them to the second sample collection module;
[0207] The model training module performs model training according to the first type of sample cases and the second type of sample cases to obtain a first type of large language model and a second type of large language model;
[0208] Obtaining the first type of sample cases and the second type of sample cases;
[0209] Creating and training a large language model based on the first type of sample cases to obtain a first type of large language model;
[0210] The details are as follows:
[0211] Obtain the medical records corresponding to each visit of each first type sample case to the medical institution to obtain multiple sample medical records;
[0212] Based on the existing artificial intelligence framework, a language model is established and the model's hyperparameters are set by default;
[0213] It should be noted here that:
[0214] The artificial intelligence framework involved here is TensorFlow, please refer to Figure 3 ;
[0215] The hyperparameters involved here specifically include the number of model layers, hidden layer size, learning rate, number of attention heads, etc.
[0216] Divide multiple sample medical records into a model training set, a model validation set, and a model test set according to a preset division ratio;
[0217] In the model training set, multiple symptoms corresponding to each sample case are marked as test input texts, and the clinical diagnosis corresponding to the test input texts are marked as test output texts. The test input texts and test output texts corresponding to the same case are taken as a model training group to obtain multiple model training groups.
[0218] The model validation set and the model test set are labeled respectively to obtain multiple model validation groups and model test groups;
[0219] Use multiple model training groups to train the language model respectively. After the model training group is trained, use the model verification group to perform gradient tuning on the model parameters generated during the test until all model verification groups have completed the training and verification of the language model, thus obtaining a verified language model.
[0220] Use the model test group to train and test the verified language model, obtain the test pass rate, and compare the benchmark pass rate with the test pass rate;
[0221] When the test pass rate is greater than or equal to the benchmark pass rate, the language model training is completed and the first type of large language model is obtained;
[0222] When the test pass rate is less than the benchmark pass rate, the above training, verification and testing process of the language model is repeated until the test pass rate is greater than or equal to the benchmark pass rate;
[0223] Repeat the training to obtain the first type of large language model, create a large language model according to the second type of sample cases and train it to obtain the second type of large language model.
[0224] In this application, if corresponding calculation formulas appear, the above calculation formulas are all dimensionless and take their numerical calculations. The weight coefficients, proportional coefficients and other coefficients in the formulas are set to a result value obtained by quantifying each parameter. The size of the weight coefficient and the proportional coefficient can be determined as long as it does not affect the proportional relationship between the parameter and the result value.
[0225] Embodiment 2
[0226] See also Figure 2 Based on another concept of the same invention, a large language model training method for medical institutions is proposed, comprising the following steps:
[0227] Step A1: Obtain patient medical data;
[0228] Step A11: Obtain the number of visits of the patient to the medical institution according to the number of visits of the patient, and divide the patient into the first type of patients and the second type of patients according to the number of visits of the patient to the same institution;
[0229] The details are as follows:
[0230] When the number of visits is greater than q, the patient is classified as the first type of visit patient;
[0231] When the number of visits is less than or equal to q times, the patient is classified as the second type of visit patient;
[0232] Step A12: Acquire the medical consultation data corresponding to the first medical consultation type patient to obtain the first type patient data;
[0233] The step A12 further includes the following specific steps:
[0234] Step A121: Acquire the time value corresponding to each visit of the first visit type patient to the medical institution to obtain multiple visit time values;
[0235] Step A122: respectively obtain the difference between each visit time value and the current time value, obtain multiple visit time difference values, mark the multiple visit time difference values in descending order as the first to aath visit difference values, and name the visits corresponding to the first to aath visit difference values as the first to aath visits;
[0236] Step A123: Obtaining the first medical consultation data;
[0237] The step A123 further includes the following specific steps:
[0238] Step A1231: obtaining the actual symptoms of the patient during the first visit to the doctor, and naming them as the first to pth patient clinical symptoms respectively;
[0239] Step A1232: respectively obtaining the duration of symptoms corresponding to the clinical symptoms of the first to p-th patients to obtain the duration of symptoms of the first to p-th patients;
[0240] Step A1233: Obtain the text of the diagnosis report made by the medical institution when the patient visits the doctor for the first time, and obtain a first diagnosis text;
[0241] Step A1234: define the clinical symptoms of the first to p-th patients, the duration of the first to p-th symptoms, and the first diagnosis text as the current visit data corresponding to the first visit, and name it as the first visit data;
[0242] Step A124: respectively obtain the current visit data corresponding to the second to aath visits, and obtain the second to aath visit data;
[0243] Step A125: define the first to aath medical consultation data as first type patient data;
[0244] Step A13: Acquire the medical consultation data corresponding to the second medical consultation type patient to obtain the second type patient data;
[0245] The step A13 further includes the following specific steps:
[0246] Step A131: obtaining multiple medical examinations received by the second medical examination type patient during the medical institution, and naming them as the first to kth medical examinations respectively;
[0247] Step A132: respectively obtain texts of the examination results corresponding to the first to k-th medical examinations to obtain the first to k-th examination result texts;
[0248] Step A133: obtaining the text of the diagnosis report corresponding to the patient's current visit to obtain a single diagnosis text;
[0249] Step A135: defining the first to k-th medical examinations, the first to k-th examination result texts and the single diagnosis text as second type patient data;
[0250] Step A14: defining the first type of patient data and the second type of patient data as patient medical data;
[0251] Step A2: collecting model training samples for the first type of patient data according to the patient medical data to obtain the first type of sample cases;
[0252] Step A21: Acquire patient medical data, acquire first type patient data respectively according to the patient medical data, and acquire first to aath medical consultation data according to the first type patient data;
[0253] Step A22: performing sample analysis and matching on the first medical consultation data to obtain medical consultation sample cases corresponding to the first type of medical consultation patients;
[0254] The step A22 further includes the following specific steps:
[0255] Step A221: Obtain clinical symptoms of the first to p-th patients and duration of the first to p-th symptoms according to the first medical consultation data;
[0256] Step A222: setting the first to pth symptom constant upper limits and the first to pth symptom constant lower limits respectively according to the clinical symptoms of the first to pth patients;
[0257] Step A223: Calculate the upper limit of the first symptom sample coefficient interval by using the upper limit of the first to p-th symptom constants and the first to p-th symptom durations;
[0258] Calculate the upper limit of the first symptom sample coefficient interval. The specific formula configuration is as follows:
[0259] Yxs1=Zcs1×Zcc1+Zcs2×Zcc3+······+Zcsp×Zccp;
[0260] Among them, Yxs1 is the upper limit of the first symptom sample coefficient interval, Zcs1 to Zcsp are the upper limits of the first to pth symptom constants, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively;
[0261] Step A224: Calculate the lower limit of the first symptom sample coefficient interval by using the lower limit of the first to p-th symptom constants and the duration of the first to p-th symptoms;
[0262] Calculate the lower limit of the first symptom sample coefficient interval. The specific formula configuration is as follows:
[0263] Yxx1=Zcx1×Zcc1+Zcx2×Zcc3+······+Zcxp×Zccp;
[0264] Among them, Yxx1 is the lower limit of the sample coefficient interval of the first symptom, Zcx1 to Zcxp are the lower limits of the constants of the first to pth symptoms respectively, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively;
[0265] Step A225: obtaining a first diagnosis text according to the first medical consultation data, crawling related symptom cases with the first diagnosis text as a keyword through crawler technology, obtaining multiple identical diagnosis cases, and marking them as the first to qth identical diagnosis cases, respectively, obtaining multiple clinical symptoms corresponding to the first identical diagnosis case, and matching them with the clinical symptoms of the first to pth patients, obtaining matching identical symptoms, obtaining a plurality of matching identical symptoms, obtaining the duration of each matching identical symptom on the first identical diagnosis case, and obtaining a plurality of matching identical symptom durations;
[0266] Step A226: Obtain the symptom constant upper limit and symptom constant lower limit corresponding to each clinical symptom of the first to pth patients that match the same symptom, calculate the average value of each symptom constant upper limit and the corresponding symptom constant lower limit, and obtain the symptom constant average value;
[0267] Step A227: Calculate the product of the duration of each matching identical symptom and the average value of the corresponding symptom constant, and then sum the obtained multiple products to obtain the first corresponding symptom sample coefficient;
[0268] Step A228: acquiring the symptom sample coefficients corresponding to the second to qth cases with the same diagnosis respectively, to obtain a plurality of symptom sample coefficients;
[0269] Step A229: When the symptom sample coefficient is between the upper limit of the first symptom sample coefficient interval and the lower limit of the first symptom sample coefficient interval, it is determined that the same diagnosis case corresponding to the symptom sample coefficient is the first visit sample case;
[0270] Step A23: performing sample analysis and matching on the second to aath visit data to obtain the first to aath visit sample cases, and defining the first to aath visit sample cases as first type sample cases;
[0271] Step A3: collecting model training samples for the second type of patient data according to the patient medical data to obtain the second type of sample cases;
[0272] Step A31: Acquire patient medical data, acquire second-type patient data respectively according to the patient medical data, and acquire first to k-th medical examinations and first to k-th examination result texts according to the second-type patient data;
[0273] Step A32: acquiring inspection result indicators according to the first to kth inspection result texts to obtain a plurality of inspection result indicators, comparing the plurality of inspection result indicators with the normal range values of the corresponding indicators, marking the inspection results whose inspection result indicators are not within the normal range values of the indicators as abnormal results, obtaining a plurality of inspection abnormality items, and naming them as the first to tth inspection abnormality items;
[0274] Step A33: setting the first to t-th inspection constant upper limits and the first to t-th inspection constant lower limits respectively according to the first to t-th inspection abnormality items;
[0275] Step A34: Calculating the first to t-th indicator abnormal deviation values and the first to t-th inspection constant upper limits to obtain the first inspection sample coefficient upper limit;
[0276] Calculate the upper limit of the inspection sample coefficient. The specific formula configuration is as follows:
[0277] Jcs=Ypc1×Jjc1+Ypc2×Jjc2+·······+Ypct×Jjct;
[0278] Among them, Jcs is the upper limit of the inspection sample coefficient, Ypc1 to Ypct are the abnormal deviation values of the first to tth indicators respectively, and Jjc1 to Jjct are the upper limits of the first to tth inspection constants respectively;
[0279] Step A35: Calculating the first to tth indicator abnormal deviation values and the first to tth inspection constant upper limits to obtain the first to tth inspection sample coefficient lower limits;
[0280] Calculate the lower limit of the inspection sample coefficient. The specific formula configuration is as follows:
[0281] Jcs=Ypc1×Jjx1+Ypc2×Jjx2+·······+Ypct×Jjxt;
[0282] Among them, Jcs is the lower limit of the inspection sample coefficient, Ypc1 to Ypct are the first to tth indicator abnormal deviation values, and Jjx1 to Jjxt are the first to tth inspection constant lower limits, respectively;
[0283] Step A36: Obtain a single diagnosis text according to the second medical consultation data, crawl multiple cases with the same diagnosis using the single diagnosis text as a keyword through crawler technology, and mark them as the first to hth diagnosis consistent cases respectively;
[0284] Step A37: Obtaining the examination sample coefficient corresponding to the first diagnosis consistent case;
[0285] The details are as follows:
[0286] Step A371: Obtain the abnormal examination items corresponding to the first diagnosis consistent case, and match the item names of the abnormal examination items corresponding to the second type of patients, and mark the abnormal examination items with common abnormalities as the first to Vth abnormal examination items;
[0287] Step A372: respectively obtain the inspection constant upper limits and inspection constant lower limits corresponding to the first to Vth abnormal inspection items, and average them to obtain the average values of the constants of multiple abnormal inspection items, which are named as the first to vth inspection constant average values respectively;
[0288] Step A373: Obtain the index abnormal deviation values corresponding to the first to Vth abnormal inspection items to obtain the first to vth index abnormal deviation values;
[0289] Step A374: Calculate the inspection sample coefficient corresponding to the first diagnosis consistent case by using the first to vth indicator abnormal deviation values corresponding to the first diagnosis consistent case and the first to vth inspection constant average values;
[0290] The inspection sample coefficient corresponding to the first diagnosis consistent case is calculated, and the specific formula configuration is as follows:
[0291] Jyx=Zp1×Jcp1+Zp2×Jcp2+······+Zpv×Jcpv;
[0292] Among them, Jyx is the inspection sample coefficient corresponding to the first diagnosis consistent case, Zp1 to Zpv are the abnormal deviation values of the first to vth indicators, and Jcp1 to Jcpv are the average values of the first to vth inspection constants;
[0293] Step A38: respectively obtaining the inspection sample coefficients corresponding to the second to hth diagnosis consistent cases to obtain a plurality of inspection sample coefficients;
[0294] Step A39: determining the diagnosis consistent cases corresponding to the inspection sample coefficients between the inspection sample coefficient upper limit and the inspection sample coefficient lower limit as the second type of sample cases;
[0295] Step A4: Perform model training based on the first type of sample cases and the second type of sample cases to obtain a first type of large language model and a second type of large language model;
[0296] Step A41: Obtaining a first type of sample case and a second type of sample case;
[0297] Step A42: creating a large language model according to the first type of sample cases and training it to obtain a first type of large language model;
[0298] The step A42 further includes the following specific steps:
[0299] Step A421: Obtain the medical records corresponding to each of the first type sample cases' visits to the medical institution to obtain a plurality of sample medical records;
[0300] Step A422: Building a language model based on an existing artificial intelligence framework and setting default hyperparameters of the model;
[0301] Step A423: Divide the plurality of sample medical records into a model training set, a model validation set, and a model test set according to a preset division ratio;
[0302] Step A424: Mark multiple symptoms corresponding to each sample case in the model training set as test input text, and mark the clinical diagnosis corresponding to the test input text as test output text, and take the test input text and test output text corresponding to the same case as a model training group to obtain multiple model training groups;
[0303] Step A425: annotating the model validation set and the model test set respectively to obtain multiple model validation groups and model test groups;
[0304] Step A426: Use multiple model training groups to train the language model respectively. After the model training group is trained, the model verification group performs gradient tuning on the model parameters generated during the test until all model verification groups complete the training verification of the language model, thereby obtaining a verified language model.
[0305] Step A427: Use the model test group to train and test the verified language model, obtain the test pass rate, and compare the obtained benchmark pass rate with the test pass rate;
[0306] Step A428: When the test pass rate is greater than or equal to the benchmark pass rate, the language model training is completed and a first type large language model is obtained;
[0307] Step A429: When the test pass rate is less than the benchmark pass rate, repeat the above-mentioned training, verification and testing process of the language model until the test pass rate is greater than or equal to the benchmark pass rate;
[0308] Step A43: Repeat the training to obtain the first type of large language model, create a large language model according to the second type of sample cases and perform training to obtain a second type of large language model;
[0309] An electronic terminal includes a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the training method are executed.
[0310] A storage medium stores a computer program, which, when executed by a processor, executes the steps in the training method.
[0311] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A large language model training method for medical institutions, characterized in that: include: Step A1: Divide the patients into first-type patients and second-type patients according to the number of visits, obtain the first to aath visit data corresponding to the first-type patients, obtain the first-type patient data, obtain the single diagnosis text and the first to kth examination result text corresponding to the second-type patients, obtain the second-type patient data, and define the first-type patient data and the second-type patient data as patient medical data; Step A2: Analyze the patient's medical data to obtain the upper and lower limits of the symptom sample coefficient interval corresponding to multiple clinical symptoms, select multiple sample cases to calculate the symptom sample coefficients, obtain multiple symptom sample coefficients, compare the symptom sample coefficients with the upper and lower limits of the symptom sample coefficient interval, and obtain the first type of sample cases; Step A3: by analyzing the patient's medical data, the upper and lower limits of the inspection sample coefficients corresponding to the multiple inspection abnormal items are obtained, and multiple cases with consistent diagnoses are selected to calculate the inspection sample coefficients to obtain multiple inspection sample coefficients, which are compared with the upper and lower limits of the inspection sample coefficients to obtain the second type of sample cases; Step A4: Perform model training based on the first type of sample cases and the second type of sample cases to obtain a first type of large language model and a second type of large language model.
2. A large language model training method for medical institutions according to claim 1, characterized in that: The step A1 further includes the following specific steps: Step A11: Obtain the number of visits of the patient to the medical institution according to the number of visits of the patient, and divide the patient into the first type of patients and the second type of patients according to the number of visits of the patient to the same institution; The specific steps are as follows: When the number of visits is greater than q, the patient is classified as the first type of visit patient; When the number of visits is less than or equal to q times, the patient is classified as the second type of visit patient; Step A12: Acquire the medical consultation data corresponding to the first medical consultation type patient to obtain the first type patient data; Step A13: Acquire the medical consultation data corresponding to the second medical consultation type patient to obtain the second type patient data; The step A13 further includes the following specific steps: Obtain multiple medical examinations that the second type of patient receives during the medical institution visit, and name them as the first to kth medical examination items respectively; Respectively obtain the text of the examination results corresponding to the first to k-th medical examination items to obtain the first to k-th examination result texts; The text of the diagnosis report corresponding to the patient's current visit is obtained to obtain a single diagnosis text; The first to k-th examination result texts and a single diagnosis text are defined as the second type of patient data.
3. A large language model training method for medical institutions according to claim 2, characterized in that: The step A12 further includes the following specific steps: Obtaining a time value corresponding to each visit of a patient of the first visit type to a medical institution to obtain multiple visit time values; Obtain the difference between each visit time value and the current time value respectively, obtain multiple visit time difference values, mark the multiple visit time difference values in descending order as the first to aath visit difference values, and name the visits corresponding to the first to aath visit differences as the first to aath visits respectively; Obtain the actual symptoms that the patient experienced when they first visited the doctor and name them as the first to the pth patient clinical symptoms respectively; Obtain the duration of symptoms corresponding to the clinical symptoms of the first to pth patients respectively, and obtain the duration of symptoms from the first to pth; The text of the diagnosis report made by the medical institution during the patient's first visit to the doctor is obtained to obtain a first diagnosis text; The clinical symptoms of the first to pth patients, the duration of the first to pth symptoms, and the first diagnosis text are defined as the visit data corresponding to the first visit, and are named the first visit data; Obtain the visit data corresponding to the second to aath visits respectively, and obtain the second to aath visit data; The first to aath visit data are defined as the first type of patient data.
4. The large language model training method for medical institutions according to claim 1, characterized in that: The step A2 further includes the following specific steps: Step A21: Acquire patient medical data, acquire first type patient data respectively according to the patient medical data, and acquire first to aath medical consultation data according to the first type patient data; Step A22: performing sample analysis and matching on the first medical consultation data to obtain medical consultation sample cases corresponding to the first type of medical consultation patients; Step A23: performing sample analysis and matching on the second to aath visit data to obtain the first to aath visit sample cases, and defining the first to aath visit sample cases as first type sample cases; The step A22 further includes the following specific steps: Obtain the clinical symptoms of the first to pth patients and the duration of the first to pth symptoms according to the first visit data; According to the clinical symptoms of the first to pth patients, the upper limits of the first to pth symptom constants and the lower limits of the first to pth symptom constants are set respectively; The upper limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the upper limit of the interval of the first symptom sample coefficient; Calculate the upper limit of the first symptom sample coefficient interval. The specific formula configuration is as follows: Yxs1=Zcs1×Zcc1+Zcs2×Zcc3+······+Zcsp×Zccp; Among them, Yxs1 is the upper limit of the first symptom sample coefficient interval, Zcs1 to Zcsp are the upper limits of the first to pth symptom constants, and Zcc1 to Zccp are the duration of the first to pth symptoms respectively; The lower limit of the constant of the first to pth symptoms and the duration of the first to pth symptoms are calculated to obtain the lower limit of the first symptom sample coefficient interval; Obtain a first diagnosis text according to the first medical consultation data, crawl related symptom cases using the first diagnosis text as a keyword through crawler technology, obtain multiple identical diagnosis cases, and mark them as the first to qth identical diagnosis cases respectively; Acquire multiple clinical symptoms corresponding to the first identically diagnosed case, and match them with the clinical symptoms of the first to pth patients, acquire the matching identical symptoms to obtain multiple matching identical symptoms, acquire the duration of each matching identical symptom on the first identically diagnosed case, and obtain multiple matching identical symptom durations; Obtain the upper limit and lower limit of the symptom constant corresponding to each clinical symptom of the first to pth patients that match the same symptom, calculate the average of each symptom constant upper limit and the corresponding symptom constant lower limit, and obtain the symptom constant average value; Calculate the product of the duration of each matching symptom and the average value of the corresponding symptom constant, and then sum the multiple products to obtain the first corresponding symptom sample coefficient; The symptom sample coefficients corresponding to the second to qth cases with the same diagnosis are obtained respectively to obtain a plurality of symptom sample coefficients; When the symptom sample coefficient is between the upper limit of the first symptom sample coefficient interval and the lower limit of the first symptom sample coefficient interval, the same diagnosis case corresponding to the symptom sample coefficient is judged to be the first visit sample case.
5. The large language model training method for medical institutions according to claim 1, characterized in that: The step A3 further includes the following specific steps: Step A31: Acquire patient medical data, acquire second-type patient data respectively according to the patient medical data, and acquire first to k-th examination result texts according to the second-type patient data; Step A32: acquiring inspection result indicators according to the first to kth inspection result texts to obtain a plurality of inspection result indicators, comparing the plurality of inspection result indicators with the normal range values of the corresponding indicators, marking the inspection results whose inspection result indicators are not within the normal range values of the indicators as abnormal results, obtaining a plurality of inspection abnormality items, and naming them as the first to tth inspection abnormality items; Step A33: setting the first to t-th inspection constant upper limits and the first to t-th inspection constant lower limits respectively according to the first to t-th inspection abnormality items; Step A34: Calculating the first to t-th indicator abnormal deviation values and the first to t-th inspection constant upper limits to obtain the first inspection sample coefficient upper limit; Calculate the upper limit of the inspection sample coefficient. The specific formula configuration is as follows: Jcs=Ypc1×Jjc1+Ypc2×Jjc2+·······+Ypct×Jjct; Among them, Jcs is the upper limit of the inspection sample coefficient, Ypc1 to Ypct are the abnormal deviation values of the first to tth indicators respectively, and Jjc1 to Jjct are the upper limits of the first to tth inspection constants respectively; Step A35: Calculating the first to tth indicator abnormal deviation values and the first to tth inspection constant upper limits to obtain the first to tth inspection sample coefficient lower limits; Step A36: Obtain a single diagnosis text according to the second medical consultation data, crawl multiple cases with the same diagnosis using the single diagnosis text as a keyword through crawler technology, and mark them as the first to hth diagnosis consistent cases respectively; Step A37: Obtaining the examination sample coefficient corresponding to the first diagnosis consistent case; Step A38: respectively obtaining the inspection sample coefficients corresponding to the second to hth diagnosis consistent cases to obtain a plurality of inspection sample coefficients; Step A39: The diagnosis-consistent cases corresponding to the inspection sample coefficients between the upper limit and the lower limit of the inspection sample coefficients are determined as the second type of sample cases.
6. A large language model training method for medical institutions according to claim 5, characterized in that: The step A37 further includes the following specific steps: Obtain the abnormal examination items corresponding to the first diagnosis consistent case, and match the item names of the abnormal examination items corresponding to the second type of patients, and mark the abnormal examination items with the same matching as the first to Vth abnormal examination items; Obtain the inspection constant upper limits and inspection constant lower limits corresponding to the first to Vth abnormal inspection items respectively, and average them to obtain the average values of the constants of multiple abnormal inspection items, which are named as the first to vth inspection constant average values respectively; Obtain the indicator abnormal deviation values corresponding to the first to Vth abnormal inspection items to obtain the first to vth indicator abnormal deviation values; The inspection sample coefficient corresponding to the first diagnosis consistent case is obtained by calculating the first to vth index abnormal deviation values corresponding to the first diagnosis consistent case and the first to vth inspection constant average values; The inspection sample coefficient corresponding to the first diagnosis consistent case is calculated, and the specific formula configuration is as follows: Jyx=Zp1×Jcp1+Zp2×Jcp2+······+Zpv×Jcpv; Among them, Jyx is the inspection sample coefficient corresponding to the first diagnosis consistent case, Zp1 to Zpv are the abnormal deviation values of the first to vth indicators, and Jcp1 to Jcpv are the average values of the first to vth inspection constants.
7. The large language model training method for medical institutions according to claim 1, characterized in that: The step A4 further includes the following specific steps: Step A41: Obtaining a first type of sample case and a second type of sample case; Step A42: creating a large language model according to the first type of sample cases and training it to obtain a first type of large language model; The step A42 further includes the following specific steps: Step A421: Obtain the medical records corresponding to each of the first type sample cases' visits to the medical institution to obtain a plurality of sample medical records; Step A422: Building a language model based on an existing artificial intelligence framework, and setting default hyperparameters of the language model; Step A423: Divide the plurality of sample medical records into a model training set, a model validation set, and a model test set according to a preset division ratio; Step A424: Mark multiple symptoms corresponding to each sample case in the model training set as test input text, and mark the clinical diagnosis corresponding to the test input text as test output text, and take the test input text and test output text corresponding to the same case as a model training group to obtain multiple model training groups; Step A425: annotating the model validation set and the model test set respectively to obtain multiple model validation groups and model test groups; Step A426: Use multiple model training groups to train the language model respectively. After the model training group is trained, the model verification group performs gradient tuning on the model parameters generated during the test until all model verification groups complete the training verification of the language model, thereby obtaining a verified language model. Step A427: Use the model test group to train and test the verified language model, obtain the test pass rate, and compare the obtained benchmark pass rate with the test pass rate; Step A428: When the test pass rate is greater than or equal to the benchmark pass rate, the language model training is completed and a first type large language model is obtained; Step A429: When the test pass rate is less than the benchmark pass rate, repeat the above-mentioned training, verification and testing process of the language model until the test pass rate is greater than or equal to the benchmark pass rate; Step A43: Create and train a large language model based on the second type of sample cases to obtain a second type of large language model.
8. A large language model training system for medical institutions, applicable to a large language model training method for medical institutions as described in any one of claims 1 to 7, characterized in that: The training system comprises: Data acquisition module: used to acquire the first type of patient data and the second type of patient data respectively to obtain patient medical data; The first sample collection module is used to collect model training samples for the first type of patient data according to the patient medical data to obtain the first type of sample cases; The second sample collection module is used to collect model training samples for the second type of patient data according to the patient medical data to obtain the second type of sample cases; Model training module: used to perform model training based on the first type of sample cases and the second type of sample cases to obtain the first type of large language model and the second type of large language model.
9. An electronic terminal, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the training method according to any one of claims 1 to 7 are executed.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the training method according to any one of claims 1 to 7 are performed.
Citation Information
Cited By
Medical decision support method and system based on multi-modal data
CN122050667A