Method and device for updating medical big model based on cardiovascular comorbidity knowledge graph
By constructing a knowledge graph in the field of cardiovascular comorbidities and fine-tuning model parameters, the problem of the lack of fine-tuning solutions for large medical models in the subdivision of cardiovascular comorbidities has been solved, and the effective construction and application of large models for multiple downstream tasks have been achieved.
Patent Information
- Application Number
- CN202410400021.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-04-03
AI Technical Summary
The prior art lacks mature solutions to fine-tune model parameters in the field of cardiovascular comorbidity subdivision on pre-trained medical models.
By constructing a knowledge graph based on knowledge in the field of cardiovascular comorbidities and combining it with the encoder network of the base model, the model parameters of each downstream model task of the large medical model are fine-tuned to obtain the corresponding large downstream task model.
It achieves effective fine-tuning of model parameters for large medical models in the field of cardiovascular comorbidity subdivisions, solves the problem of missing model fine-tuning solutions, and combines it with multiple downstream model tasks to improve the application efficiency of the model.
Smart Images

Figure CN118171694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for updating a medical big model based on a cardiovascular comorbidity knowledge graph. Background Art
[0002] Generative large language models (LLMs) can be used in a variety of fields. When applied in the medical field, they are called medical large models. Before specific applications, the medical large model needs to be pre-trained based on the knowledge in the medical field. The large model obtained after pre-training is also called a base model. If the medical large model is to be further applied to a specific sub-field, such as the cardiovascular comorbidity sub-field, it is necessary to further fine-tune the base model based on the knowledge in the cardiovascular comorbidity sub-field. At present, the pre-training technical solutions for large models are relatively mature, but there is no mature technical solution for reference for model fine-tuning solutions based on the cardiovascular comorbidity sub-field. The technical problem to be solved by the present invention is how to fine-tune the model parameters (also called model update) of the pre-trained medical large model (also called the base model) based on the knowledge in the cardiovascular comorbidity sub-field. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, electronic device and computer-readable storage medium for updating a medical big model based on a cardiovascular comorbidity knowledge graph in response to the defects of the prior art. The present invention configures the medical big model based on the base model parameter set to obtain a base model; and constructs corresponding knowledge graphs for each downstream model task (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) of the medical big model by collecting cardiovascular comorbidity field knowledge; and fine-tunes the model parameters of the base model based on the knowledge graph corresponding to each downstream model task to obtain the corresponding downstream task big model. The present invention can not only solve the problem of the lack of model fine-tuning solutions in the subdivided field of cardiovascular comorbidity, but also combine with each downstream model task of the medical big model to obtain multiple downstream task big models through model parameter fine-tuning.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present invention provides a method for updating a medical big model based on a cardiovascular comorbidity knowledge graph, the method comprising:
[0005] Acquire a base model parameter set of the large medical model; and configure parameters of the large medical model based on the base model parameter set to obtain a corresponding first base model;
[0006] Collecting cardiovascular comorbidity domain knowledge and combining with the encoder network of the first base model to construct corresponding knowledge graphs for each downstream model task of the medical big model, recorded as the corresponding first knowledge graph;
[0007] Based on each of the first knowledge graphs, the model parameters of the first base model are fine-tuned to obtain the corresponding first downstream task large model.
[0008] Preferably, the medical big model is a type of generative big language model implemented based on the Transformer model structure, which is composed of the encoder network, the decoder network and multiple downstream task prediction networks; each downstream task prediction network corresponds to one downstream model task; the encoder network, the decoder network and one downstream task prediction network of the medical big model constitute a corresponding downstream task big model;
[0009] The downstream model tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks and critical illness risk prediction tasks; wherein the medical vocabulary query task is a model processing task for vocabulary interpretation query based on the input medical vocabulary name; the disease classification prediction task is a model processing task for disease classification prediction based on the input detection information and / or inspection information and / or symptom description information; the disease treatment plan prediction task is a model processing task for treatment plan prediction based on the disease type information and / or detection information and / or inspection information and / or symptom description information input by the model; the critical illness risk prediction task is a model processing task for predicting the disease type and its corresponding critical illness level based on the detection information and / or inspection information and / or symptom description information input by the model;
[0010] The reasoning process of the medical big model is: i =M i (x i ;AE,AD,AP i ); i is the downstream model task index, 1≤i≤N, N is the total number of downstream model tasks; M i is a model reasoning expression for a large model of the downstream task; x i ,y i For M i The corresponding input target information and output prediction information of the downstream task model; AE is the model parameter set of the encoder network; AD is the model parameter set of the decoder network; AP i For M i The corresponding model parameter set of the downstream task prediction network;
[0011] The base model parameter set is the full model parameter set obtained after pre-training the medical large model, including AE pre , A.D. pre and four APs i,pre AE preA model parameter set of the encoder network of the medical large model to complete the pre-training; AD pre A model parameter set of the decoder network of the pre-trained medical large model; AP i,pre To complete the model parameter set of the pre-trained medical big model for each of the downstream tasks prediction network.
[0012] Preferably, the first knowledge graph consists of a plurality of first nodes and a plurality of first node edges;
[0013] The first node includes a first node identifier, a first node type and a first node attribute set;
[0014] The first node identification is a unique identification code for each first node;
[0015] The first node type includes a target node and a prediction node;
[0016] The first node attribute set includes one or more first node attributes;
[0017] The first node attribute includes a first attribute type and first attribute data;
[0018] The first attribute type includes a vocabulary name attribute, a detection attribute, a test attribute, a symptom description attribute, a disease type attribute, a vocabulary interpretation attribute, a treatment plan attribute, and a critical illness type and level attribute; when the first attribute type is a vocabulary name attribute, the corresponding first attribute data is a medical vocabulary name; when the first attribute type is a detection attribute, the corresponding first attribute data is a detection record of a medical detection item; when the first attribute type is a test attribute, the corresponding first attribute data is a test record of a medical test item; when the first attribute type is a symptom description attribute, the corresponding first attribute data is a symptom description record for describing the manifestation of disease symptoms; when the first attribute type is a disease type attribute, the corresponding first attribute data is a specific disease type; when the first attribute type is a vocabulary interpretation attribute, the corresponding first attribute data is a medical vocabulary interpretation text; when the first attribute type is a treatment plan attribute, the corresponding first attribute data is a treatment plan record; when the first attribute type is a critical illness type and level attribute, the corresponding first attribute data consists of a disease type and a critical illness level;
[0019] The first node edge is a directed node edge, used to connect two first nodes recorded as corresponding first starting nodes and first ending nodes; the first starting node is the first node whose first node type is a target node, and the first ending node is the first node whose first node type is a prediction node; the first node edge includes a first starting node identifier, a first ending node identifier and a first node edge feature; the first starting node identifier and the first ending node identifier are the first node identifiers of the corresponding first starting node and the first ending node, respectively; the first node edge feature is a feature encoding tensor corresponding to the first node attribute set of the first starting node, and is obtained by encoding the first node attribute set of the first starting node by the encoder network of the large medical model;
[0020] In the first knowledge graph, a first node whose first node type is a target node is only connected to a first node whose first node type is a prediction node; but a first node whose first node type is a prediction node can be connected to one or more first nodes whose first node type is a target node.
[0021] Preferably, in the first knowledge graph corresponding to the medical vocabulary query task, the first node attribute set of each first node whose first node type is a target node consists of one first node attribute whose first attribute type is a vocabulary name attribute; the first node attribute set of each first node whose first node type is a prediction node consists of one first node attribute whose first attribute type is a vocabulary interpretation attribute;
[0022] In the first knowledge graph corresponding to the disease classification prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a disease type attribute;
[0023] In the first knowledge graph corresponding to the disease treatment plan prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a disease type attribute and / or one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a treatment plan attribute;
[0024] In the first knowledge graph corresponding to the critical illness risk prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a critical illness type and level attribute.
[0025] Preferably, the collection of cardiovascular comorbidity domain knowledge and combining the encoder network of the first base model to construct a corresponding knowledge graph for each downstream model task of the medical large model is recorded as the corresponding first knowledge graph, specifically including:
[0026] Collect a large number of specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the field of cardiovascular comorbidities to form a corresponding original information database;
[0027] and collecting medical vocabulary names and their corresponding vocabulary interpretation information from the original information database to obtain a plurality of first name interpretation records to form a corresponding first name interpretation record set; the first name interpretation record set includes a plurality of the first name interpretation records; the first name interpretation record includes a first vocabulary name and a first vocabulary interpretation;
[0028] and constructing the first knowledge graph corresponding to the medical vocabulary query task, which is one of the downstream model tasks, based on the first name interpretation record set and the encoder network of the first base model;
[0029] And collect disease diagnosis information from the original information database to obtain a first disease diagnosis record set corresponding to a plurality of first disease diagnosis records; the first disease diagnosis record set includes a plurality of the first disease diagnosis records; the first disease diagnosis record includes a first disease type and a corresponding first diagnosis reference record set; the first diagnosis reference record set includes a first detection record set, a first inspection record set and a first symptom description record set; when the first detection record set is not empty, it is composed of one or more first detection records; when the first inspection record set is not empty, it is composed of one or more first inspection records; when the first symptom description record set is not empty, it is composed of one or more first symptom description records;
[0030] and constructing the first knowledge graph corresponding to the disease classification prediction task, which is one of the downstream model tasks, based on the first disease diagnosis record set and the encoder network of the first base model;
[0031] And collect disease treatment plan information from the original information database to obtain a first disease treatment plan record set corresponding to a plurality of first disease treatment plan records; the first disease treatment plan record set includes a plurality of the first disease treatment plan records; the first disease treatment plan record includes a first treatment plan and a corresponding first plan reference record set; the first plan reference record set includes a second disease type set, a second detection record set, a second inspection record set, and a second symptom description record set; when the second disease type set is not empty, it is composed of one or more second disease types; when the second detection record set is not empty, it is composed of one or more second detection records; when the second inspection record set is not empty, it is composed of one or more second inspection records; when the second symptom description record set is not empty, it is composed of one or more second symptom description records;
[0032] and constructing the first knowledge graph corresponding to the disease treatment plan prediction task, which is one of the downstream model tasks, based on the first disease treatment plan record set and the encoder network of the first base model;
[0033] And collect critical disease assessment information from the original information database to obtain a first critical disease assessment record set corresponding to a plurality of first critical disease assessment records; the first critical disease assessment record set includes a plurality of the first critical disease assessment records; the first critical disease assessment record includes a third disease type, a first critical illness level and a corresponding first assessment reference record set; the first assessment reference record set includes a third detection record set, a third inspection record set and a third symptom description record set; when the third detection record set is not empty, it is composed of one or more third detection records; when the third inspection record set is not empty, it is composed of one or more third inspection records; when the third symptom description record set is not empty, it is composed of one or more third symptom description records;
[0034] And based on the first critical disease assessment record set and the encoder network of the first base model, the first knowledge graph corresponding to the critical disease risk prediction task, which is one of the downstream model tasks, is constructed.
[0035] Furthermore, the encoder network based on the first name interpretation record set and the first base model constructs the first knowledge graph corresponding to the medical vocabulary query task which is one of the downstream model tasks, specifically including:
[0036] Performing synonym clustering on the first name interpretation record set to obtain a plurality of first synonym record sets; the first synonym record set includes one or more first name interpretation records; if a certain first synonym record set includes only one first name interpretation record, it means that the first vocabulary name of the current only first name interpretation record has no synonym in the first name interpretation record set; if a certain first synonym record set includes two or more first name interpretation records, it means that all the first vocabulary names in the current first synonym record set are synonyms of each other;
[0037] extracting the first vocabulary interpretation of the only first name interpretation record in the first synonym record set including only one first name interpretation record as the second vocabulary interpretation corresponding to the current first synonym record set;
[0038] Extracting all the first vocabulary interpretations from the first synonym record set including two or more first name interpretation records, performing interpretation fusion processing to obtain corresponding first vocabulary fusion interpretations, and using the currently obtained first vocabulary fusion interpretations as the second vocabulary interpretations corresponding to the current first synonym record set;
[0039] Traverse all the first name interpretation records of the first name interpretation record set; and during the traversal, take the first name interpretation record currently traversed as the corresponding current record; and take the first vocabulary name of the current record as a corresponding first attribute data, and set a corresponding first attribute type as a vocabulary name attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a target node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current record by the currently obtained first node identification, the first node type and the first node attribute set;
[0040] Traverse all the obtained second vocabulary definitions; and during the traversal, use the currently traversed second vocabulary definitions as the corresponding current definitions; and use the current definitions as the corresponding first attribute data, and set a corresponding first attribute type as a vocabulary definition attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current definition by the currently obtained first node identification, the first node type and the first node attribute set;
[0041] Traverse all the first name interpretation records of the first name interpretation record set; and during the traversal, take the first name interpretation record currently traversed as the corresponding current record; and take the first node whose first node type is the target node corresponding to the current record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the second vocabulary interpretation corresponding to the first synonym record set corresponding to the current record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding first encoded feature tensor, and take the first encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity;
[0042] All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the medical vocabulary query task.
[0043] Furthermore, the encoder network based on the first disease diagnosis record set and the first base model constructs the first knowledge graph corresponding to the disease classification prediction task of one of the downstream model tasks, specifically including:
[0044] extracting all the first disease types from the first disease diagnosis record set to form a corresponding first disease type set; and performing deduplication processing on the first disease types in the first disease type set;
[0045] Traverse all the first disease diagnosis records in the first disease diagnosis record set; and during the traversal, take the first disease diagnosis record currently traversed as the corresponding current diagnosis record; and take the first detection record set, the first inspection record set and the first symptom description record set of the first diagnosis reference record set of the current diagnosis record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each of the first detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the first detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the first detection records; and when the current inspection record set is not empty, take each of the first inspection records in the set as a corresponding first attribute data, and set a corresponding first inspection record for each of the first inspection records. a corresponding first attribute type specifically set as an inspection attribute, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first inspection record; and when the current symptom description record set is not empty, each first symptom description record in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as a symptom description attribute is set for each first symptom description record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first symptom description record; and all the first node attributes obtained are composed of a corresponding first node attribute set; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and the first node corresponding to the current diagnosis record is composed of the currently obtained first node identification, the first node type and the first node attribute set;
[0046] Traverse all the first disease types in the first disease type set; and during the traversal, take the first disease type currently traversed as the corresponding current disease type; and take the current disease type as a corresponding first attribute data, and set a corresponding first attribute type as a disease type attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current disease type by the currently obtained first node identification, the first node type and the first node attribute set;
[0047] Traverse all the first disease diagnosis records of the first disease diagnosis record set; and during the traversal, take the first disease diagnosis record currently traversed as the corresponding current diagnosis record; and take the first node whose first node type is the target node corresponding to the current diagnosis record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first disease type of the current diagnosis record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding second encoded feature tensor, and take the second encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current diagnosis record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity;
[0048] All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the disease classification prediction task.
[0049] Furthermore, the encoder network based on the first disease treatment plan record set and the first base model constructs the first knowledge graph corresponding to the disease treatment plan prediction task which is one of the downstream model tasks, specifically including:
[0050] extracting all the first treatment plans from the first disease treatment plan record set to form a corresponding first treatment plan set; and performing deduplication processing on the first treatment plans in the first treatment plan set;
[0051] Traverse all the first disease treatment plan records of the first disease treatment plan record set; and during the traversal, take the first disease treatment plan record currently traversed as the corresponding current treatment plan record; and take the second disease type set, the second detection record set, the second inspection record set and the second symptom description record set of the first plan reference record set of the current treatment plan record as the corresponding current disease type set, the current detection record set, the current inspection record set and the current symptom description record set; and when the current disease type set is not empty, take each of the second disease types in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the disease type attribute for each of the second disease types, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the second disease types; and when the current detection record set is not empty, take each of the second detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the second detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the second detection records The first node attribute is composed of the first attribute data and the first attribute data; and when the current inspection record set is not empty, each of the second inspection records in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the inspection attribute is set for each of the second inspection records, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each of the second inspection records; and when the current symptom description record set is not empty, each of the second symptom description records in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the symptom description attribute is set for each of the second symptom description records, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each of the second symptom description records; and a corresponding first node attribute set is composed of all the obtained first node attributes; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and a first node corresponding to the current treatment plan record is composed of the currently obtained first node identification, the first node type and the first node attribute set;
[0052] Traverse all the first treatment plans of the first treatment plan set; and during the traversal, take the first treatment plan currently traversed as the corresponding current treatment plan; and take the current treatment plan as a corresponding first attribute data, and set a corresponding first attribute type as a treatment plan attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current treatment plan by the currently obtained first node identification, the first node type and the first node attribute set;
[0053] Traverse all the first disease treatment plan records of the first disease treatment plan record set; and during the traversal, take the first disease treatment plan record currently traversed as the corresponding current treatment plan record; and take the first node whose first node type is a target node corresponding to the current treatment plan record as the corresponding current starting node; and take the first node whose first node type is a prediction node corresponding to the first treatment plan of the current treatment plan record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding third encoded feature tensor, and take the third encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current treatment plan record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity;
[0054] All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the disease treatment plan prediction task.
[0055] Furthermore, the encoder network based on the first critical disease assessment record set and the first base model constructs the first knowledge graph corresponding to the critical disease risk prediction task which is one of the downstream model tasks, specifically including:
[0056] Extracting the third disease type and the first critical disease level of each of the first critical disease assessment records in the first critical disease assessment record set to form a corresponding first critical disease level; and forming a corresponding first critical disease level set from all the obtained first critical disease levels; and performing deduplication processing on the first critical disease levels in the first critical disease level set;
[0057] Traverse all the first critical disease assessment records of the first critical disease assessment record set; and when traversing, take the first critical disease assessment record currently traversed as the corresponding current assessment record; and take the third detection record set, the third inspection record set and the third symptom description record set of the first assessment reference record set of the current assessment record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each of the third detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the third detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the third detection records; and when the current inspection record set is not empty, take each of the third inspection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the third inspection records Record setting a corresponding first attribute type specifically set as a test attribute, and the first attribute type and the first attribute data corresponding to each of the third test records form a corresponding first node attribute; and when the current symptom description record set is not empty, each of the third symptom description records in the set is used as a corresponding first attribute data, and a corresponding first attribute type specifically set as a symptom description attribute is set for each of the third symptom description records, and the first attribute type and the first attribute data corresponding to each of the third symptom description records form a corresponding first node attribute; and all the first node attributes obtained form a corresponding first node attribute set; and set a corresponding first node type as a target node; and assign a unique node identification code as the corresponding first node identification; and the first node identification currently obtained, the first node type and the first node attribute set form a first node corresponding to the current evaluation record;
[0058] Traverse all the first critical disease levels of the first critical disease level set; and during the traversal, take the currently traversed first critical disease level as the corresponding current critical disease level; and take the current critical disease level as a corresponding first attribute data, and set a corresponding first attribute type as a critical disease type and level attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current critical disease level by the currently obtained first node identification, the first node type and the first node attribute set;
[0059] Traverse all the first critical disease assessment records of the first critical disease assessment record set; and during the traversal, take the first critical disease assessment record currently traversed as the corresponding current assessment record; and take the first node whose first node type is the target node corresponding to the current assessment record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first critical disease level corresponding to the current assessment record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding fourth encoded feature tensor, and take the fourth encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current assessment record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity;
[0060] All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the critical illness risk prediction task.
[0061] Preferably, fine-tuning the model parameters of the first base model based on each of the first knowledge graphs to obtain the corresponding first downstream task large model specifically includes:
[0062] Take each of the first knowledge graphs as the corresponding current knowledge graph; take the downstream model task corresponding to the current knowledge graph as the corresponding current downstream model task; take the downstream task prediction network corresponding to the current downstream model task in the first base model as the corresponding current downstream task prediction network; and take the loss function corresponding to the current downstream model task in the preset multi-class loss function as the corresponding current loss function; the loss function corresponding to the medical vocabulary query task in the multi-class loss function includes the L1 loss function and the L2 loss function, the loss function corresponding to the disease classification prediction task includes the cross entropy loss function, the loss function corresponding to the disease treatment plan prediction task includes the L1 loss function and the L2 loss function, and the loss function corresponding to the critical illness risk prediction task includes the cross entropy loss function;
[0063] All the first node edges of the current knowledge graph are traversed; and during the traversal, the first node edge currently traversed is used as the corresponding current node edge; and the first end node and the first node edge feature corresponding to the current node edge are used as the corresponding current end node and the current encoding feature tensor; and the first attribute data of the first node attribute that is unique in the first node attribute set of the current end node is extracted as the corresponding current label data; and the current encoding feature tensor is input into the decoder network of the first base model for decoding to obtain the corresponding current decoding tensor; and the current decoding tensor is input into the current downstream task prediction network for prediction to obtain the corresponding current prediction data; and the current prediction data and the current label data are input into the current loss function, and based on the preset large model fine-tuning optimization mechanism, the model parameter set of the decoder network of the first base model and the current downstream task prediction network is fine-tuned in a round in the direction of minimizing the loss value of the current loss function; and at the end of the traversal, the full model parameter set of the first base model is solidified once to obtain the first downstream task large model corresponding to the current downstream model task; the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism.
[0064] A second aspect of an embodiment of the present invention provides a device for implementing the method for updating a medical big model based on a cardiovascular comorbidity knowledge graph as described in the first aspect, the device comprising: a base model configuration module, a knowledge graph construction module, and a model parameter fine-tuning module;
[0065] The base model configuration module is used to obtain a base model parameter set of the medical large model; and based on the base model parameter set, perform parameter configuration on the medical large model to obtain a corresponding first base model;
[0066] The knowledge graph construction module is used to collect knowledge in the field of cardiovascular comorbidities and, in combination with the encoder network of the first base model, to construct corresponding knowledge graphs for each downstream model task of the medical large model, which are recorded as corresponding first knowledge graphs;
[0067] The model parameter fine-tuning module is used to fine-tune the model parameters of the first base model based on each of the first knowledge graphs to obtain the corresponding first downstream task large model.
[0068] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0069] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0070] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0071] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0072] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for updating a medical big model based on a cardiovascular comorbidity knowledge graph. As can be seen from the above content, the embodiment of the present invention configures the medical big model based on the base model parameter set to obtain a base model; and constructs corresponding knowledge graphs for each downstream model task (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) of the medical big model by collecting cardiovascular comorbidity field knowledge; and fine-tunes the model parameters of the base model based on the knowledge graph corresponding to each downstream model task to obtain the corresponding downstream task big model. The embodiment of the present invention not only solves the problem of the lack of big model fine-tuning solutions in the current cardiovascular comorbidity subdivision field, but also can be combined with each downstream model task of the medical big model to obtain multiple downstream task big models through model parameter fine-tuning. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 A schematic diagram of a method for updating a medical big model based on a cardiovascular comorbidity knowledge graph provided in Example 1 of the present invention;
[0074] Figure 2 A module structure diagram of a device for updating a medical big model based on a cardiovascular comorbidity knowledge graph provided in the second embodiment of the present invention;
[0075] Figure 3A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0077] Embodiment 1 of the present invention provides a method for updating a medical big model based on a cardiovascular comorbidity knowledge graph, such as Figure 1 As shown in the schematic diagram of a method for updating a medical big model based on a cardiovascular comorbidity knowledge graph provided in the first embodiment of the present invention, the method mainly includes the following steps:
[0078] Step 1: Obtain a base model parameter set of the large medical model; and configure the parameters of the large medical model based on the base model parameter set to obtain a corresponding first base model.
[0079] Here, the medical big model of an embodiment of the present invention is a type of generative large language model implemented based on the Transformer model structure, which is composed of an encoder network, a decoder network and multiple downstream task prediction networks; each downstream task prediction network corresponds to a downstream model task; the encoder network, decoder network and a downstream task prediction network of the medical big model can form a corresponding downstream task big model.
[0080] The downstream model tasks of the medical big model in the embodiment of the present invention include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks and critical illness risk prediction tasks; among which: 1) the medical vocabulary query task is a model processing task for vocabulary interpretation query based on the input medical vocabulary name; 2) the disease classification prediction task is a model processing task for disease classification prediction based on the input detection information and / or inspection information and / or symptom description information; 3) the disease treatment plan prediction task is a model processing task for treatment plan prediction based on the disease type information and / or detection information and / or inspection information and / or symptom description information input by the model; 4) the critical illness risk prediction task is a model processing task for predicting the disease type and its corresponding critical illness level based on the detection information and / or inspection information and / or symptom description information input by the model.
[0081] The reasoning process of the medical big model in the embodiment of the present invention can be understood as follows:
[0082] y i =M i (x i;AE,AD,AP i );
[0083] Where i is the downstream model task index, 1≤i≤N, N is the total number of downstream model tasks; M i is the model reasoning expression of a large model for a type of downstream task; x i ,y i For M i The corresponding downstream task model has input target information and output prediction information; AE is the model parameter set of the encoder network; AD is the model parameter set of the decoder network; AP i For M i The corresponding set of model parameters of the downstream task prediction network.
[0084] The base model parameter set obtained in the embodiment of the present invention is a full model parameter set obtained by pre-training the medical large model through the known large model pre-training scheme and general knowledge in the medical field, including AE pre , A.D. pre and four APs i,pre ; Among them, AE pre To complete the model parameter set of the encoder network of the pre-trained medical large model; AD pre To complete the model parameter set of the decoder network of the pre-trained medical large model; AP i,pre The model parameter set of the prediction network is used to complete various downstream tasks of the pre-trained medical large model.
[0085] Step 2: Collect knowledge in the field of cardiovascular comorbidities and combine it with the encoder network of the first base model to build corresponding knowledge graphs for each downstream model task of the medical big model, which are recorded as the corresponding first knowledge graphs.
[0086] Here, before explaining the processing steps of constructing each first knowledge graph in the current step 2, the structure of the first knowledge graph of an embodiment of the present invention is briefly described.
[0087] The first knowledge graph of the embodiment of the present invention is composed of multiple first nodes and multiple first node edges; wherein,
[0088] 1) The first node includes a first node identifier, a first node type, and a first node attribute set;
[0089] The first node identification is a unique identification code for each first node;
[0090] The first node type includes target nodes and prediction nodes;
[0091] The first node attribute set includes one or more first node attributes; the first node attribute includes a first attribute type and first attribute data; the first attribute type includes a vocabulary name attribute, a detection attribute, a test attribute, a symptom description attribute, a disease type attribute, a vocabulary interpretation attribute, a treatment plan attribute, and a critical illness type and level attribute;
[0092] The data content of the first attribute data is related to the first attribute type, specifically: a) when the first attribute type is a vocabulary name attribute, the corresponding first attribute data is a medical vocabulary name; b) when the first attribute type is a detection attribute, the corresponding first attribute data is a detection record of a medical detection item; c) when the first attribute type is an inspection attribute, the corresponding first attribute data is an inspection record of a medical inspection item; d) when the first attribute type is a symptom description attribute, the corresponding first attribute data is a symptom description record used to describe the manifestation of disease symptoms; e) when the first attribute type is a disease type attribute, the corresponding first attribute data is a specific disease type; f) when the first attribute type is a vocabulary interpretation attribute, the corresponding first attribute data is a medical vocabulary interpretation text; g) when the first attribute type is a treatment plan attribute, the corresponding first attribute data is a treatment plan record; h) when the first attribute type is a critical illness type and level attribute, the corresponding first attribute data consists of a disease type and a critical illness level;
[0093] 2) The first node edge is a directed node edge, used to connect two first nodes recorded as corresponding first starting nodes and first ending nodes; the first starting node is a first node whose first node type is a target node, and the first ending node is a first node whose first node type is a prediction node; the first node edge includes a first starting node identifier, a first ending node identifier and a first node edge feature;
[0094] The first starting node identifier and the first ending node identifier are first node identifiers of the corresponding first starting node and first ending node respectively;
[0095] The first node edge feature is a feature coding tensor corresponding to the first node attribute set of the first starting node, and the feature coding tensor is obtained by encoding the first node attribute set of the first starting node by the encoder network of the large medical model.
[0096] It should be noted that in the first knowledge graph of the embodiment of the present invention: a first node whose first node type is a target node is only connected to a first node whose first node type is a prediction node; but a first node whose first node type is a prediction node can be connected to one or more first nodes whose first node type is a target node.
[0097] The following is an explanation of the processing steps of the current step 2, that is, step 2 specifically includes:
[0098] Step 21, collect a large number of specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the field of cardiovascular comorbidities to form a corresponding original information database;
[0099] Step 22, collecting medical vocabulary names and their corresponding vocabulary interpretation information from the original information database to obtain a plurality of first name interpretation records to form a corresponding first name interpretation record set;
[0100] The first name interpretation record set includes a plurality of first name interpretation records; the first name interpretation record includes a first vocabulary name and a first vocabulary interpretation;
[0101] Step 23, constructing a first knowledge graph corresponding to a medical vocabulary query task, which is one of the downstream model tasks, based on the first name interpretation record set and the encoder network of the first base model;
[0102] Specifically, it includes: step 231, performing synonym clustering on the first name interpretation record set to obtain a plurality of first synonym record sets;
[0103] Wherein, the first synonym record set includes one or more first name interpretation records; if a first synonym record set includes only one first name interpretation record, it means that the first vocabulary name of the current only first name interpretation record has no synonym in the first name interpretation record set; if a first synonym record set includes two or more first name interpretation records, it means that all first vocabulary names in the current first synonym record set are synonyms of each other;
[0104] Step 232, extracting the first vocabulary interpretation of the only first name interpretation record in the first synonym record set including only one first name interpretation record as the second vocabulary interpretation corresponding to the current first synonym record set;
[0105] Step 233, extracting all first vocabulary interpretations from the first synonym record set including two or more first name interpretation records, performing interpretation fusion processing to obtain corresponding first vocabulary fusion interpretations, and using the currently obtained first vocabulary fusion interpretations as second vocabulary interpretations corresponding to the current first synonym record set;
[0106] Step 234, traverse all first name interpretation records of the first name interpretation record set; and during the traversal, take the currently traversed first name interpretation record as the corresponding current record; and take the first vocabulary name of the current record as a corresponding first attribute data, and set a corresponding first attribute type as a vocabulary name attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as the target node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current record by the currently obtained first node identification, the first node type and the first node attribute set;
[0107] Step 235, traverse all the obtained second vocabulary definitions; and during the traversal, take the currently traversed second vocabulary definitions as the corresponding current definitions; and take the current definitions as a corresponding first attribute data, and set a corresponding first attribute type as a vocabulary definition attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current definitions by the currently obtained first node identification, the first node type and the first node attribute set;
[0108] Step 236, traverse all first name interpretation records of the first name interpretation record set; and during the traversal, take the currently traversed first name interpretation record as the corresponding current record; and take the first node whose first node type is the target node corresponding to the current record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the second vocabulary interpretation corresponding to the first synonym record set corresponding to the current record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding first encoded feature tensor, and take the first encoded feature tensor as the corresponding first node edge feature; and form a first node edge corresponding to the current record by the currently obtained first starting node identifier, first ending node identifier and first node edge feature;
[0109] Step 237, forming a first knowledge graph corresponding to the medical vocabulary query task by using all the first nodes and all the first node edges obtained;
[0110] Here, in the first knowledge graph corresponding to the medical vocabulary query task obtained by the above steps 231-237 in the embodiment of the present invention: the first node attribute set of each first node whose first node type is a target node consists of a first node attribute whose first attribute type is a vocabulary name attribute; the first node attribute set of each first node whose first node type is a prediction node consists of a first node attribute whose first attribute type is a vocabulary interpretation attribute;
[0111] Step 24, collecting disease diagnosis information from the original information database to obtain a plurality of first disease diagnosis records to form a corresponding first disease diagnosis record set;
[0112] Among them, the first disease diagnosis record set includes multiple first disease diagnosis records; the first disease diagnosis record includes a first disease type and a corresponding first diagnosis reference record set; the first diagnosis reference record set includes a first detection record set, a first inspection record set and a first symptom description record set; when the first detection record set is not empty, it is composed of one or more first detection records; when the first inspection record set is not empty, it is composed of one or more first inspection records; when the first symptom description record set is not empty, it is composed of one or more first symptom description records;
[0113] Step 25, constructing a first knowledge graph corresponding to a disease classification prediction task, which is one of the downstream model tasks, based on the first disease diagnosis record set and the encoder network of the first base model;
[0114] Specifically, it includes: step 251, extracting all first disease types from the first disease diagnosis record set to form a corresponding first disease type set; and performing deduplication processing on the first disease types in the first disease type set;
[0115] Step 252, traverse all first disease diagnosis records of the first disease diagnosis record set; and when traversing, take the currently traversed first disease diagnosis record as the corresponding current diagnosis record; and take the first detection record set, the first inspection record set and the first symptom description record set of the first diagnosis reference record set of the current diagnosis record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each first detection record in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each first detection record, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each first detection record; and when the current inspection record set is not empty, take each first inspection record in the set as a corresponding first attribute data, and set a corresponding first node attribute for each first inspection record. A corresponding first attribute type specifically set as the inspection attribute is set for the inspection record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first inspection record; and when the current symptom description record set is not empty, each first symptom description record in the set is used as a corresponding first attribute data, and a corresponding first attribute type specifically set as the symptom description attribute is set for each first symptom description record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first symptom description record; and a corresponding first node attribute set is composed of all the obtained first node attributes; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and a first node corresponding to the current diagnosis record is composed of the currently obtained first node identification, the first node type and the first node attribute set;
[0116] Step 253, traverse all first disease types of the first disease type set; and during the traversal, take the currently traversed first disease type as the corresponding current disease type; and take the current disease type as a corresponding first attribute data, and set a corresponding first attribute type as a disease type attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current disease type by the currently obtained first node identification, the first node type and the first node attribute set;
[0117] Step 254, traverse all the first disease diagnosis records of the first disease diagnosis record set; and when traversing, take the currently traversed first disease diagnosis record as the corresponding current diagnosis record; and take the first node whose first node type is the target node corresponding to the current diagnosis record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first disease type of the current diagnosis record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding second encoded feature tensor, and take the second encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current diagnosis record by the currently obtained first starting node identifier, first ending node identifier and first node edge feature quantity;
[0118] Step 255, forming a first knowledge graph corresponding to the disease classification prediction task by using all the first nodes and all the first node edges obtained;
[0119] Here, in the first knowledge graph corresponding to the disease classification prediction task obtained by the above steps 251-255 in the embodiment of the present invention: the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of a first node attribute whose first attribute type is a disease type attribute;
[0120] Step 26, collecting disease treatment plan information from the original information database to obtain a plurality of first disease treatment plan records to form a corresponding first disease treatment plan record set;
[0121] Among them, the first disease treatment plan record set includes multiple first disease treatment plan records; the first disease treatment plan record includes a first treatment plan and a corresponding first plan reference record set; the first plan reference record set includes a second disease type set, a second detection record set, a second inspection record set, and a second symptom description record set; when the second disease type set is not empty, it is composed of one or more second disease types; when the second detection record set is not empty, it is composed of one or more second detection records; when the second inspection record set is not empty, it is composed of one or more second inspection records; when the second symptom description record set is not empty, it is composed of one or more second symptom description records;
[0122] Step 27, constructing a first knowledge graph corresponding to the disease treatment plan prediction task, which is one of the downstream model tasks, based on the first disease treatment plan record set and the encoder network of the first base model;
[0123] Specifically, it includes: step 271, extracting all first treatment plans from the first disease treatment plan record set to form a corresponding first treatment plan set; and performing deduplication processing on the first treatment plans in the first treatment plan set;
[0124] Step 272, traverse all first disease treatment plan records in the first disease treatment plan record set; and during the traversal, take the currently traversed first disease treatment plan record as the corresponding current treatment plan record; and take the second disease type set, the second detection record set, the second inspection record set, and the second symptom description record set of the first plan reference record set of the current treatment plan record as the corresponding current disease type set, the current detection record set, the current inspection record set, and the current symptom description record set; and when the current disease type set is not empty, take each second disease type in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the disease type attribute for each second disease type, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each second disease type; and when the current detection record set is not empty, take each second detection record in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each second detection record, and form a corresponding first node attribute by the first attribute type corresponding to each second detection record type and the first attribute data form a corresponding first node attribute; and when the current inspection record set is not empty, each second inspection record in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the inspection attribute is set for each second inspection record, and a corresponding first node attribute is formed by the first attribute type and the first attribute data corresponding to each second inspection record; and when the current symptom description record set is not empty, each second symptom description record in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the symptom description attribute is set for each second symptom description record, and a corresponding first node attribute is formed by the first attribute type and the first attribute data corresponding to each second symptom description record; and all the obtained first node attributes form a corresponding first node attribute set; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and a first node corresponding to the current treatment plan record is formed by the currently obtained first node identification, the first node type and the first node attribute set;
[0125] Step 273, traverse all first treatment plans of the first treatment plan set; and during the traversal, take the currently traversed first treatment plan as the corresponding current treatment plan; and take the current treatment plan as a corresponding first attribute data, and set a corresponding first attribute type as a treatment plan attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current treatment plan by the currently obtained first node identification, the first node type and the first node attribute set;
[0126] Step 274, traverse all first disease treatment plan records of the first disease treatment plan record set; and during the traversal, take the currently traversed first disease treatment plan record as the corresponding current treatment plan record; and take the first node whose first node type is the target node corresponding to the current treatment plan record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first treatment plan of the current treatment plan record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding third encoded feature tensor, and take the third encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current treatment plan record by the currently obtained first starting node identifier, first ending node identifier and first node edge feature quantity;
[0127] Step 275, forming a first knowledge graph corresponding to the disease treatment plan prediction task by using all the first nodes and all the first node edges obtained;
[0128] Here, in the first knowledge graph corresponding to the disease treatment plan prediction task obtained by the above steps 271-275 in the embodiment of the present invention: the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a disease type attribute and / or one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of a first node attribute whose first attribute type is a treatment plan attribute;
[0129] Step 28, collecting critical disease assessment information from the original information database to obtain a plurality of first critical disease assessment records to form a corresponding first critical disease assessment record set;
[0130] Among them, the first critical disease assessment record set includes multiple first critical disease assessment records; the first critical disease assessment record includes a third disease type, a first critical illness level and a corresponding first assessment reference record set; the first assessment reference record set includes a third detection record set, a third inspection record set and a third symptom description record set; when the third detection record set is not empty, it is composed of one or more third detection records; when the third inspection record set is not empty, it is composed of one or more third inspection records; when the third symptom description record set is not empty, it is composed of one or more third symptom description records;
[0131] Step 29, constructing a first knowledge graph corresponding to the critical disease risk prediction task, which is one of the downstream model tasks, based on the first critical disease assessment record set and the encoder network of the first base model;
[0132] Specifically, it includes: step 291, extracting the third disease type and the first critical disease level of each first critical disease assessment record in the first critical disease assessment record set to form a corresponding first critical disease level; and forming a corresponding first critical disease level set from all the obtained first critical disease levels; and performing deduplication processing on the first critical disease levels in the first critical disease level set;
[0133] Step 292, traverse all the first critical disease assessment records of the first critical disease assessment record set; and when traversing, take the currently traversed first critical disease assessment record as the corresponding current assessment record; and take the third detection record set, the third inspection record set and the third symptom description record set of the first assessment reference record set of the current assessment record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each third detection record in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each third detection record, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each third detection record; and when the current inspection record set is not empty, take each third inspection record in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each third detection record. A corresponding first attribute type specifically set as the inspection attribute is set for each third inspection record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each third inspection record; and when the current symptom description record set is not empty, each third symptom description record in the set is used as a corresponding first attribute data, and a corresponding first attribute type specifically set as the symptom description attribute is set for each third symptom description record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each third symptom description record; and a corresponding first node attribute set is composed of all the obtained first node attributes; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and a first node corresponding to the current evaluation record is composed of the currently obtained first node identification, the first node type and the first node attribute set;
[0134] Step 293, traverse all first critical disease levels of the first critical disease level set; and when traversing, take the currently traversed first critical disease level as the corresponding current critical disease level; and take the current critical disease level as a corresponding first attribute data, and set a corresponding first attribute type as the critical disease type and level attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current critical disease level by the currently obtained first node identification, the first node type and the first node attribute set;
[0135] Step 294, traverse all first critical disease assessment records of the first critical disease assessment record set; and when traversing, take the currently traversed first critical disease assessment record as the corresponding current assessment record; and take the first node whose first node type is the target node corresponding to the current assessment record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first critical disease level corresponding to the current assessment record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding fourth encoded feature tensor, and take the fourth encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current assessment record by the currently obtained first starting node identifier, first ending node identifier and first node edge feature quantity;
[0136] Step 295, all the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the critical illness risk prediction task.
[0137] Here, in the first knowledge graph corresponding to the critical illness risk prediction task obtained by the above steps 291-295 in the embodiment of the present invention: the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is an inspection attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of a first node attribute whose first attribute type is a critical illness type and level attribute.
[0138] Step 3: fine-tune the model parameters of the first base model based on each first knowledge graph to obtain the corresponding first downstream task large model;
[0139] Specifically including: step 31, taking each first knowledge graph as the corresponding current knowledge graph; taking the downstream model task corresponding to the current knowledge graph as the corresponding current downstream model task; taking the downstream task prediction network corresponding to the current downstream model task in the first base model as the corresponding current downstream task prediction network; taking the loss function corresponding to the current downstream model task in the preset multi-class loss function as the corresponding current loss function;
[0140] Among them, the loss functions corresponding to the medical vocabulary query task in the multiple loss functions preset in the embodiment of the present invention include L1 loss function and L2 loss function, the loss function corresponding to the disease classification prediction task includes the cross entropy loss function, the loss function corresponding to the disease treatment plan prediction task includes L1 loss function and L2 loss function, and the loss function corresponding to the critical illness risk prediction task includes the cross entropy loss function;
[0141] Step 32, traverse all the first node edges of the current knowledge graph; and during the traversal, take the first node edge currently traversed as the corresponding current node edge; and take the first end node and the first node edge feature value corresponding to the current node edge as the corresponding current end node and the current encoding feature tensor; and extract the first attribute data of the only first node attribute in the first node attribute set of the current end node as the corresponding current label data; and input the current encoding feature tensor into the decoder network of the first base model for decoding to obtain the corresponding current decoding tensor; and input the current decoding tensor into the current downstream task prediction network for prediction to obtain the corresponding current prediction data; and input the current prediction data and the current label data into the current loss function, and based on the preset large model fine-tuning optimization mechanism, the model parameter set of the decoder network of the first base model and the current downstream task prediction network is fine-tuned in a direction to minimize the loss value of the current loss function; and at the end of the traversal, the full model parameter set of the first base model is solidified once to obtain the first downstream task large model corresponding to the current downstream model task;
[0142] Among them, the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism.
[0143] Figure 2 The module structure diagram of a device for updating a medical big model based on a cardiovascular comorbidity knowledge graph provided in the second embodiment of the present invention, the device is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment, for example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: a base model configuration module 201, a knowledge graph construction module 202 and a model parameter fine-tuning module 203.
[0144] The base model configuration module 201 is used to obtain a base model parameter set of the large medical model; and configure the parameters of the large medical model based on the base model parameter set to obtain a corresponding first base model.
[0145] The knowledge graph construction module 202 is used to collect knowledge in the field of cardiovascular comorbidities and combine the encoder network of the first base model to construct corresponding knowledge graphs for each downstream model task of the medical large model, which are recorded as the corresponding first knowledge graphs.
[0146] The model parameter fine-tuning module 203 is used to fine-tune the model parameters of the first base model based on each first knowledge graph to obtain the corresponding first downstream task large model.
[0147] An embodiment of the present invention provides a device for updating a medical big model based on a cardiovascular comorbidity knowledge graph, which can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0148] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the base model configuration module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0149] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0150] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media (such as DVDs), or semiconductor media (such as solid-state drives (SSDs)), etc.
[0151] Figure 3This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0152] exist Figure 3 The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM), and may also include a non-volatile memory (Non-Volume ile Memory), such as at least one disk storage.
[0153] The above-mentioned processors can be general-purpose processors, including central processing units (CPU), network processors (Network Processor, NP), graphics processing units (Graphics Processing Unit, GPU), etc.; they can also be digital signal processors DSP, application-specific integrated circuits ASIC, field programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0154] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0155] An embodiment of the present invention further provides a chip for executing instructions, wherein the chip is used to execute the processing steps described in the aforementioned method embodiment.
[0156] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for updating a medical big model based on a cardiovascular comorbidity knowledge graph. As can be seen from the above content, the embodiment of the present invention configures the medical big model based on the base model parameter set to obtain a base model; and constructs corresponding knowledge graphs for each downstream model task (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) of the medical big model by collecting cardiovascular comorbidity field knowledge; and fine-tunes the model parameters of the base model based on the knowledge graph corresponding to each downstream model task to obtain the corresponding downstream task big model. The embodiment of the present invention not only solves the problem of the lack of big model fine-tuning solutions in the current cardiovascular comorbidity subdivision field, but also can be combined with each downstream model task of the medical big model to obtain multiple downstream task big models through model parameter fine-tuning.
[0157] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0158] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0159] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for updating a medical big model based on a cardiovascular comorbidity knowledge graph, characterized in that: The method comprises: Acquire a base model parameter set of the large medical model; and configure parameters of the large medical model based on the base model parameter set to obtain a corresponding first base model; Collecting cardiovascular comorbidity domain knowledge and combining with the encoder network of the first base model to construct corresponding knowledge graphs for each downstream model task of the medical big model, recorded as the corresponding first knowledge graph; Fine-tune the model parameters of the first base model based on each of the first knowledge graphs to obtain a corresponding first downstream task large model; The medical big model is a generative big language model based on the Transformer model structure, which is composed of the encoder network, the decoder network and multiple downstream task prediction networks; each downstream task prediction network corresponds to one downstream model task; the encoder network, the decoder network and one downstream task prediction network of the medical big model constitute a corresponding downstream task big model; The downstream model tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks and critical illness risk prediction tasks; wherein the medical vocabulary query task is a model processing task for vocabulary interpretation query based on the input medical vocabulary name; the disease classification prediction task is a model processing task for disease classification prediction based on the input detection information and / or inspection information and / or symptom description information; the disease treatment plan prediction task is a model processing task for treatment plan prediction based on the disease type information and / or detection information and / or inspection information and / or symptom description information input by the model; the critical illness risk prediction task is a model processing task for predicting the disease type and its corresponding critical illness level based on the detection information and / or inspection information and / or symptom description information input by the model; The reasoning process of the medical big model is: i =M i (x i ;AE,AD,AP i ); i is the downstream model task index, 1≤i≤N, N is the total number of downstream model tasks; M i is a model reasoning expression for a large model of the downstream task; x i ,y i For M i The corresponding input target information and output prediction information of the downstream task model; AE is the model parameter set of the encoder network; AD is the model parameter set of the decoder network; AP i For M i The corresponding model parameter set of the downstream task prediction network; The base model parameter set is the full model parameter set obtained after pre-training the medical large model, including AE pre , A.D. pre and four APs i,pre AE pre A model parameter set of the encoder network of the medical large model to complete the pre-training; AD pre A model parameter set of the decoder network of the pre-trained medical large model; AP i,pre Predicting a model parameter set of the network for each of the downstream tasks of the pre-trained medical big model; The first knowledge graph consists of a plurality of first nodes and a plurality of first node edges; The first node includes a first node identifier, a first node type and a first node attribute set; The first node identification is a unique identification code for each first node; The first node type includes a target node and a prediction node; The first node attribute set includes one or more first node attributes; The first node attribute includes a first attribute type and first attribute data; The first attribute type includes a vocabulary name attribute, a detection attribute, a test attribute, a symptom description attribute, a disease type attribute, a vocabulary interpretation attribute, a treatment plan attribute, and a critical illness type and level attribute; when the first attribute type is a vocabulary name attribute, the corresponding first attribute data is a medical vocabulary name; when the first attribute type is a detection attribute, the corresponding first attribute data is a detection record of a medical detection item; when the first attribute type is a test attribute, the corresponding first attribute data is a test record of a medical test item; when the first attribute type is a symptom description attribute, the corresponding first attribute data is a symptom description record for describing the manifestation of disease symptoms; when the first attribute type is a disease type attribute, the corresponding first attribute data is a specific disease type; when the first attribute type is a vocabulary interpretation attribute, the corresponding first attribute data is a medical vocabulary interpretation text; when the first attribute type is a treatment plan attribute, the corresponding first attribute data is a treatment plan record; when the first attribute type is a critical illness type and level attribute, the corresponding first attribute data consists of a disease type and a critical illness level; The first node edge is a directed node edge, used to connect two first nodes recorded as corresponding first starting nodes and first ending nodes; the first starting node is the first node whose first node type is a target node, and the first ending node is the first node whose first node type is a prediction node; the first node edge includes a first starting node identifier, a first ending node identifier and a first node edge feature; the first starting node identifier and the first ending node identifier are the first node identifiers of the corresponding first starting node and the first ending node, respectively; the first node edge feature is a feature encoding tensor corresponding to the first node attribute set of the first starting node, and is obtained by encoding the first node attribute set of the first starting node by the encoder network of the large medical model; In the first knowledge graph, a first node whose first node type is a target node is only connected to a first node whose first node type is a prediction node; but a first node whose first node type is a prediction node can be connected to one or more first nodes whose first node type is a target node.
2. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 1 is characterized in that: In the first knowledge graph corresponding to the medical vocabulary query task, the first node attribute set of each first node whose first node type is a target node consists of one first node attribute whose first attribute type is a vocabulary name attribute; the first node attribute set of each first node whose first node type is a prediction node consists of one first node attribute whose first attribute type is a vocabulary interpretation attribute; In the first knowledge graph corresponding to the disease classification prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a disease type attribute; In the first knowledge graph corresponding to the disease treatment plan prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a disease type attribute and / or one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a treatment plan attribute; In the first knowledge graph corresponding to the critical illness risk prediction task, the first node attribute set of each first node whose first node type is a target node is composed of one or more first node attributes whose first attribute type is a detection attribute and / or one or more first node attributes whose first attribute type is a test attribute and / or one or more first node attributes whose first attribute type is a symptom description attribute; the first node attribute set of each first node whose first node type is a prediction node is composed of one first node attribute whose first attribute type is a critical illness type and level attribute.
3. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 2 is characterized in that: The collecting of cardiovascular comorbidity domain knowledge and combining the encoder network of the first base model to construct corresponding knowledge graphs for each downstream model task of the medical big model is recorded as the corresponding first knowledge graph, which specifically includes: Collect a large number of specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the field of cardiovascular comorbidities to form a corresponding original information database; and collecting medical vocabulary names and their corresponding vocabulary interpretation information from the original information database to obtain a plurality of first name interpretation records to form a corresponding first name interpretation record set; the first name interpretation record set includes a plurality of the first name interpretation records; the first name interpretation record includes a first vocabulary name and a first vocabulary interpretation; and constructing the first knowledge graph corresponding to the medical vocabulary query task, which is one of the downstream model tasks, based on the first name interpretation record set and the encoder network of the first base model; And collect disease diagnosis information from the original information database to obtain a first disease diagnosis record set corresponding to a plurality of first disease diagnosis records; the first disease diagnosis record set includes a plurality of the first disease diagnosis records; the first disease diagnosis record includes a first disease type and a corresponding first diagnosis reference record set; the first diagnosis reference record set includes a first detection record set, a first inspection record set and a first symptom description record set; when the first detection record set is not empty, it is composed of one or more first detection records; when the first inspection record set is not empty, it is composed of one or more first inspection records; when the first symptom description record set is not empty, it is composed of one or more first symptom description records; and constructing the first knowledge graph corresponding to the disease classification prediction task, which is one of the downstream model tasks, based on the first disease diagnosis record set and the encoder network of the first base model; And collect disease treatment plan information from the original information database to obtain a first disease treatment plan record set corresponding to a plurality of first disease treatment plan records; the first disease treatment plan record set includes a plurality of the first disease treatment plan records; the first disease treatment plan record includes a first treatment plan and a corresponding first plan reference record set; the first plan reference record set includes a second disease type set, a second detection record set, a second inspection record set, and a second symptom description record set; when the second disease type set is not empty, it is composed of one or more second disease types; when the second detection record set is not empty, it is composed of one or more second detection records; when the second inspection record set is not empty, it is composed of one or more second inspection records; when the second symptom description record set is not empty, it is composed of one or more second symptom description records; and constructing the first knowledge graph corresponding to the disease treatment plan prediction task, which is one of the downstream model tasks, based on the first disease treatment plan record set and the encoder network of the first base model; And collect critical disease assessment information from the original information database to obtain a first critical disease assessment record set corresponding to a plurality of first critical disease assessment records; the first critical disease assessment record set includes a plurality of the first critical disease assessment records; the first critical disease assessment record includes a third disease type, a first critical illness level and a corresponding first assessment reference record set; the first assessment reference record set includes a third detection record set, a third inspection record set and a third symptom description record set; when the third detection record set is not empty, it is composed of one or more third detection records; when the third inspection record set is not empty, it is composed of one or more third inspection records; when the third symptom description record set is not empty, it is composed of one or more third symptom description records; And based on the first critical disease assessment record set and the encoder network of the first base model, the first knowledge graph corresponding to the critical disease risk prediction task, which is one of the downstream model tasks, is constructed.
4. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 3 is characterized in that: The encoder network based on the first name interpretation record set and the first base model constructs the first knowledge graph corresponding to the medical vocabulary query task which is one of the downstream model tasks, specifically including: Performing synonym clustering on the first name interpretation record set to obtain a plurality of first synonym record sets; the first synonym record set includes one or more first name interpretation records; if a certain first synonym record set includes only one first name interpretation record, it means that the first vocabulary name of the current only first name interpretation record has no synonym in the first name interpretation record set; if a certain first synonym record set includes two or more first name interpretation records, it means that all the first vocabulary names in the current first synonym record set are synonyms of each other; extracting the first vocabulary interpretation of the only first name interpretation record in the first synonym record set including only one first name interpretation record as the second vocabulary interpretation corresponding to the current first synonym record set; Extracting all the first vocabulary interpretations from the first synonym record set including two or more first name interpretation records, performing interpretation fusion processing to obtain corresponding first vocabulary fusion interpretations, and using the currently obtained first vocabulary fusion interpretations as the second vocabulary interpretations corresponding to the current first synonym record set; Traverse all the first name interpretation records of the first name interpretation record set; and during the traversal, take the first name interpretation record currently traversed as the corresponding current record; and take the first vocabulary name of the current record as a corresponding first attribute data, and set a corresponding first attribute type as a vocabulary name attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a target node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current record by the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the obtained second vocabulary definitions; and during the traversal, use the currently traversed second vocabulary definitions as the corresponding current definitions; and use the current definitions as the corresponding first attribute data, and set a corresponding first attribute type as a vocabulary definition attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current definition by the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first name interpretation records of the first name interpretation record set; and during the traversal, take the first name interpretation record currently traversed as the corresponding current record; and take the first node whose first node type is the target node corresponding to the current record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the second vocabulary interpretation corresponding to the first synonym record set corresponding to the current record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding first encoded feature tensor, and take the first encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity; All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the medical vocabulary query task.
5. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 3 is characterized in that: The encoder network based on the first disease diagnosis record set and the first base model constructs the first knowledge graph corresponding to the disease classification prediction task which is one of the downstream model tasks, specifically including: extracting all the first disease types from the first disease diagnosis record set to form a corresponding first disease type set; and performing deduplication processing on the first disease types in the first disease type set; Traverse all the first disease diagnosis records in the first disease diagnosis record set; and during the traversal, take the first disease diagnosis record currently traversed as the corresponding current diagnosis record; and take the first detection record set, the first inspection record set and the first symptom description record set of the first diagnosis reference record set of the current diagnosis record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each of the first detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the first detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the first detection records; and when the current inspection record set is not empty, take each of the first inspection records in the set as a corresponding first attribute data, and set a corresponding first inspection record for each of the first inspection records. a corresponding first attribute type specifically set as an inspection attribute, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first inspection record; and when the current symptom description record set is not empty, each first symptom description record in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as a symptom description attribute is set for each first symptom description record, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each first symptom description record; and all the first node attributes obtained are composed of a corresponding first node attribute set; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and the first node corresponding to the current diagnosis record is composed of the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first disease types in the first disease type set; and during the traversal, take the first disease type currently traversed as the corresponding current disease type; and take the current disease type as a corresponding first attribute data, and set a corresponding first attribute type as a disease type attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current disease type by the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first disease diagnosis records of the first disease diagnosis record set; and during the traversal, take the first disease diagnosis record currently traversed as the corresponding current diagnosis record; and take the first node whose first node type is the target node corresponding to the current diagnosis record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first disease type of the current diagnosis record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding second encoded feature tensor, and take the second encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current diagnosis record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity; All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the disease classification prediction task.
6. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 3 is characterized in that: The encoder network based on the first disease treatment plan record set and the first base model constructs the first knowledge graph corresponding to the disease treatment plan prediction task which is one of the downstream model tasks, specifically including: extracting all the first treatment plans from the first disease treatment plan record set to form a corresponding first treatment plan set; and performing deduplication processing on the first treatment plans in the first treatment plan set; Traverse all the first disease treatment plan records of the first disease treatment plan record set; and during the traversal, take the first disease treatment plan record currently traversed as the corresponding current treatment plan record; and take the second disease type set, the second detection record set, the second inspection record set and the second symptom description record set of the first plan reference record set of the current treatment plan record as the corresponding current disease type set, the current detection record set, the current inspection record set and the current symptom description record set; and when the current disease type set is not empty, take each of the second disease types in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the disease type attribute for each of the second disease types, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the second disease types; and when the current detection record set is not empty, take each of the second detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the second detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the second detection records The first node attribute is composed of the first attribute data and the first attribute data; and when the current inspection record set is not empty, each of the second inspection records in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the inspection attribute is set for each of the second inspection records, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each of the second inspection records; and when the current symptom description record set is not empty, each of the second symptom description records in the set is taken as a corresponding first attribute data, and a corresponding first attribute type specifically set as the symptom description attribute is set for each of the second symptom description records, and a corresponding first node attribute is composed of the first attribute type and the first attribute data corresponding to each of the second symptom description records; and a corresponding first node attribute set is composed of all the obtained first node attributes; and a corresponding first node type is set as the target node; and a unique node identification code is assigned as the corresponding first node identification; and a first node corresponding to the current treatment plan record is composed of the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first treatment plans of the first treatment plan set; and during the traversal, take the first treatment plan currently traversed as the corresponding current treatment plan; and take the current treatment plan as a corresponding first attribute data, and set a corresponding first attribute type as a treatment plan attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current treatment plan by the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first disease treatment plan records of the first disease treatment plan record set; and during the traversal, take the first disease treatment plan record currently traversed as the corresponding current treatment plan record; and take the first node whose first node type is a target node corresponding to the current treatment plan record as the corresponding current starting node; and take the first node whose first node type is a prediction node corresponding to the first treatment plan of the current treatment plan record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding third encoded feature tensor, and take the third encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current treatment plan record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity; All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the disease treatment plan prediction task.
7. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 3 is characterized in that: The encoder network based on the first critical disease assessment record set and the first base model constructs the first knowledge graph corresponding to the critical disease risk prediction task which is one of the downstream model tasks, specifically including: Extracting the third disease type and the first critical disease level of each of the first critical disease assessment records in the first critical disease assessment record set to form a corresponding first critical disease level; and forming a corresponding first critical disease level set from all the obtained first critical disease levels; and performing deduplication processing on the first critical disease levels in the first critical disease level set; Traverse all the first critical disease assessment records of the first critical disease assessment record set; and when traversing, take the first critical disease assessment record currently traversed as the corresponding current assessment record; and take the third detection record set, the third inspection record set and the third symptom description record set of the first assessment reference record set of the current assessment record as the corresponding current detection record set, the current inspection record set and the current symptom description record set; and when the current detection record set is not empty, take each of the third detection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the third detection records, and form a corresponding first node attribute by the first attribute type and the first attribute data corresponding to each of the third detection records; and when the current inspection record set is not empty, take each of the third inspection records in the set as a corresponding first attribute data, and set a corresponding first attribute type specifically set as the detection attribute for each of the third inspection records Record setting a corresponding first attribute type specifically set as a test attribute, and the first attribute type and the first attribute data corresponding to each of the third test records form a corresponding first node attribute; and when the current symptom description record set is not empty, each of the third symptom description records in the set is used as a corresponding first attribute data, and a corresponding first attribute type specifically set as a symptom description attribute is set for each of the third symptom description records, and the first attribute type and the first attribute data corresponding to each of the third symptom description records form a corresponding first node attribute; and all the first node attributes obtained form a corresponding first node attribute set; and set a corresponding first node type as a target node; and assign a unique node identification code as the corresponding first node identification; and the first node identification currently obtained, the first node type and the first node attribute set form a first node corresponding to the current evaluation record; Traverse all the first critical disease levels of the first critical disease level set; and during the traversal, take the currently traversed first critical disease level as the corresponding current critical disease level; and take the current critical disease level as a corresponding first attribute data, and set a corresponding first attribute type as a critical disease type and level attribute for the current first attribute data, and form a corresponding first node attribute by the current first attribute data and the corresponding first attribute type; and form a corresponding first node attribute set by the currently obtained first node attributes; and set a corresponding first node type as a predicted node; and assign a unique node identification code as the corresponding first node identification; and form a first node corresponding to the current critical disease level by the currently obtained first node identification, the first node type and the first node attribute set; Traverse all the first critical disease assessment records of the first critical disease assessment record set; and during the traversal, take the first critical disease assessment record currently traversed as the corresponding current assessment record; and take the first node whose first node type is the target node corresponding to the current assessment record as the corresponding current starting node; and take the first node whose first node type is the prediction node corresponding to the first critical disease level corresponding to the current assessment record as the corresponding current ending node; and take the first node identifiers of the current starting node and the current ending node as the corresponding first starting node identifier and the first ending node identifier; and perform feature encoding on the first node attribute set of the current starting node by the encoder network of the first base model to obtain the corresponding fourth encoded feature tensor, and take the fourth encoded feature tensor as the corresponding first node edge feature quantity; and form a first node edge corresponding to the current assessment record by the currently obtained first starting node identifier, the first ending node identifier and the first node edge feature quantity; All the first nodes and all the first node edges obtained form a first knowledge graph corresponding to the critical illness risk prediction task.
8. The method for updating the medical big model based on the cardiovascular comorbidity knowledge graph according to claim 2 is characterized in that: The fine-tuning of the model parameters of the first base model based on each of the first knowledge graphs to obtain the corresponding first downstream task large model specifically includes: Take each of the first knowledge graphs as the corresponding current knowledge graph; take the downstream model task corresponding to the current knowledge graph as the corresponding current downstream model task; take the downstream task prediction network corresponding to the current downstream model task in the first base model as the corresponding current downstream task prediction network; and take the loss function corresponding to the current downstream model task in the preset multi-class loss function as the corresponding current loss function; the loss function corresponding to the medical vocabulary query task in the multi-class loss function includes the L1 loss function and the L2 loss function, the loss function corresponding to the disease classification prediction task includes the cross entropy loss function, the loss function corresponding to the disease treatment plan prediction task includes the L1 loss function and the L2 loss function, and the loss function corresponding to the critical illness risk prediction task includes the cross entropy loss function; All the first node edges of the current knowledge graph are traversed; and during the traversal, the first node edge currently traversed is used as the corresponding current node edge; and the first end node and the first node edge feature corresponding to the current node edge are used as the corresponding current end node and the current encoding feature tensor; and the first attribute data of the first node attribute that is unique in the first node attribute set of the current end node is extracted as the corresponding current label data; and the current encoding feature tensor is input into the decoder network of the first base model for decoding to obtain the corresponding current decoding tensor; and the current decoding tensor is input into the current downstream task prediction network for prediction to obtain the corresponding current prediction data; and the current prediction data and the current label data are input into the current loss function, and based on the preset large model fine-tuning optimization mechanism, the model parameter set of the decoder network of the first base model and the current downstream task prediction network is fine-tuned in a round in the direction of minimizing the loss value of the current loss function; and at the end of the traversal, the full model parameter set of the first base model is solidified once to obtain the first downstream task large model corresponding to the current downstream model task; the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism.
9. A device for executing the method for updating a medical big model based on a cardiovascular comorbidity knowledge graph according to any one of claims 1 to 8, characterized in that: The device comprises: a base model configuration module, a knowledge graph construction module and a model parameter fine-tuning module; The base model configuration module is used to obtain a base model parameter set of the medical large model; and based on the base model parameter set, perform parameter configuration on the medical large model to obtain a corresponding first base model; The knowledge graph construction module is used to collect knowledge in the field of cardiovascular comorbidities and, in combination with the encoder network of the first base model, to construct corresponding knowledge graphs for each downstream model task of the medical large model, which are recorded as corresponding first knowledge graphs; The model parameter fine-tuning module is used to fine-tune the model parameters of the first base model based on each of the first knowledge graphs to obtain the corresponding first downstream task large model.
10. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 8; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Prompt recommendation method and device based on atlas, equipment and medium
CN116821373A