Medical record text recommendation method and device, equipment and storage medium
By training the medical record text recommendation model, the problem of large errors in query similar medical records in the prior art is solved, and the accurate identification of the medical record text and entity relationship is achieved, and recommendation efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411345462.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
AI Technical Summary
In the selection of disease diagnosis and treatment plans, the error of similar medical records query is large, and it is impossible to effectively capture specific domain knowledge, resulting in limited model performance and the inability to accurately query the entity relationship in the medical record text.
By obtaining the sample data set and a preset knowledge database, initializing the neural network model, training the medical record text recommendation model, updating the model parameters until converging, identifying similar medical records and entity relationships in the medical record text to be recommended.
It improves the efficiency and accuracy of medical record text recommendation, can accurately identify similar medical records and entity relationship information, and enhances the stability and accuracy of the model.
Smart Images

Figure CN119248926A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a medical record text recommendation method, device, equipment and storage medium. Background Art
[0002] With the popularization of electronic medical record systems, similar medical records play an increasingly important role in disease diagnosis, treatment plan selection, and drug selection. Similar medical record matching can reduce duplication of work and provide an effective channel and help for training new doctors. Currently, similar medical records are queried by calculating semantic similarity or identified by preset semantic models. However, language models are usually pre-trained on large-scale text data, which may not fully capture knowledge in specific fields, resulting in limited performance of the model in specific field tasks, which in turn leads to large errors in the query of similar medical records. Secondly, the current preset semantic model cannot query the relationship between various entities from the medical record text.
[0003] Therefore, how to accurately query similar medical record texts and the relationship between various entities in the medical record text is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a medical record text recommendation method, device, equipment and storage medium, aiming to improve the efficiency and accuracy of similar medical record text recommendation.
[0005] In a first aspect, the present application provides a medical record text recommendation method, the medical record text recommendation method comprising the following steps:
[0006] Acquire a sample data set, the sample data set comprising a plurality of sample data, the sample data comprising a sample case text, a plurality of first case texts and a plurality of second case texts, each of the first case texts being similar to the sample case text, and each of the second case texts being dissimilar to the sample case text;
[0007] Acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities;
[0008] Initializing a preset neural network model to obtain a medical record text recommendation model, and selecting a sample data from the sample data set as target sample data;
[0009] Inputting the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtaining the model output results of each of the first case texts, each of the second case texts and the sample case text;
[0010] Determining whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0011] If the medical record text recommendation model has not converged, updating the model parameters of the medical record text recommendation model, and continuing to perform the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges;
[0012] The medical record text to be recommended is obtained, and the medical record text to be recommended is identified by the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
[0013] In a second aspect, the present application further provides a medical record text recommendation device, the medical record text recommendation device comprising an acquisition module, a model initialization module, a model training module, a determination module and a generation module, wherein:
[0014] The acquisition module is used to acquire a sample data set, the sample data set includes a plurality of sample data, the sample data includes a sample case text, a plurality of first case texts and a plurality of second case texts, each of the first case texts is similar to the sample case text, and each of the second case texts is not similar to the sample case text;
[0015] The acquisition module is further used to acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities;
[0016] The model initialization module is used to initialize the preset neural network model to obtain a medical record text recommendation model;
[0017] The acquisition module is further used to select a sample data from the sample data set as the target sample data;
[0018] The model training module is used to input the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtain the model output results of each of the first case texts, each of the second case texts and the sample case text;
[0019] The determination module is used to determine whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0020] The generating module is used for updating the model parameters of the medical record text recommendation model if the medical record text recommendation model has not converged, and continuing to execute the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges;
[0021] The acquisition module is also used to acquire the medical record text to be recommended;
[0022] The generation module is also used to identify the medical record text to be recommended through the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
[0023] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the medical record text recommendation method as described above are implemented.
[0024] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the medical record text recommendation method as described above are implemented.
[0025] The present application provides a medical record text recommendation method, device, equipment and storage medium. The present application obtains a sample data set, the sample data set includes multiple sample data, the sample data includes sample case text, multiple first case texts and multiple second case texts, each first case text is similar to the sample case text, and each second case text is not similar to the sample case text; obtains a preset knowledge database, the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities; initializes a preset neural network model to obtain a medical record text recommendation model, and selects a sample data from the sample data set as the target sample data; compares the target sample data and The preset knowledge database is input into the medical record text recommendation model for training, and the model output results of each first case text, each second case text and the sample case text are obtained; according to the model output results and the similarity categories between the sample case text and the first case text and the second case text in the target sample data, it is determined whether the medical record text recommendation model has converged; if the medical record text recommendation model has not converged, the model parameters of the medical record text recommendation model are updated, and the step of selecting a sample data from the sample data set as the target sample data is continued until the medical record text recommendation model converges; the medical record text to be recommended is obtained, and the medical record text to be recommended is identified through the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended. The present application can accurately obtain the recommended medical record text by training the medical record text recommendation model and then identifying the medical record text based on the medical record text recommendation model, which greatly improves the efficiency and accuracy of medical record text recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0027] Figure 1 A flowchart of a medical record text recommendation method provided in an embodiment of the present application;
[0028] Figure 2 A schematic block diagram of the structure of a medical record text recommendation device provided in an embodiment of the present application;
[0029] Figure 3 for Figure 1 A flowchart of the sub-steps of the medical record text recommendation method;
[0030] Figure 4 for Figure 3A flowchart of the sub-steps of the medical record text recommendation method;
[0031] Figure 5 A schematic block diagram of a medical record text recommendation device provided in an embodiment of the present application;
[0032] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0033] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0036] It should be noted that the medical record text recommendation method can be applied to computer devices, which can be electronic devices such as mobile phones, tablet computers, laptops, desktop computers, personal digital assistants and wearable devices.
[0037] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0038] Please refer to Figure 1 , Figure 1 A flowchart of a medical record text recommendation method provided in an embodiment of the present application.
[0039] like Figure 1 As shown, the medical record text recommendation method includes steps S101 to S107.
[0040] Step S101, obtaining a sample data set, wherein the sample data set includes multiple sample data, and the sample data includes a sample case text, multiple first case texts, and multiple second case texts, each of the first case texts is similar to the sample case text, and each of the second case texts is not similar to the sample case text.
[0041] The sample data set includes multiple sample data, each sample data includes a sample medical record text, multiple first case texts and multiple second case texts, each first case text is similar to the sample medical record text, and each second case text is not similar to the sample medical record text. It should be noted that similarity and dissimilarity refer to the same proportion of medical record types and diagnosis results in the medical record texts. If the similarities in the medical record types and diagnosis results of the two medical record texts are greater than or equal to a preset threshold, the two medical record texts are determined to be similar medical record texts. If the similarities in the medical record types and diagnosis results of the two medical record texts are less than a preset threshold, the two medical record texts are determined to be dissimilar medical record texts. The preset threshold can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the preset threshold can be set to 70%.
[0042] In some embodiments, a large number of medical record texts are obtained, a medical record text is randomly selected as a sample medical record text, and a preset number of similar medical record texts are selected from the large number of medical record texts to obtain multiple first medical record texts, and a preset number of dissimilar medical record texts are selected from the large number of medical record texts to obtain multiple second medical record texts, and the sample medical record text, the multiple first medical record texts and the multiple second medical record texts are integrated to obtain sample data. Repeat the above steps to obtain multiple sample data to generate a sample data set. Among them, the preset number can be set according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the preset number can be set to 100. By constructing sample data for a large number of medical record texts, the sample data set can be accurately obtained, which can effectively improve the efficiency and accuracy of model training.
[0043] Step S102: Acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities.
[0044] Among them, the case text includes multiple entities, which can be preset according to actual conditions. For example, entities include but are not limited to: atrial fibrillation, unfractionated heparin, warfarin, fracture, inflammation and aspirin, etc. Entities can be set to have relationships with each other. For example, the entity relationship between the entity atrial fibrillation and the entity unfractionated heparin is a quality solution.
[0045] The preset knowledge database includes an embedding representation set of each entity and an embedding representation of each relationship between entities.
[0046] In some embodiments, a preset entity weight matrix and a relationship weight matrix are obtained, an entity feature vector and an entity relationship feature vector of each entity are obtained, a preset entity embedding representation formula and a preset entity relationship embedding representation formula are obtained, and the preset entity weight matrix and each entity feature vector are calculated according to the preset entity embedding representation formula to obtain an embedded representation of each entity; the relationship weight matrix and each entity relationship feature vector are calculated according to the preset entity relationship embedding representation formula to obtain an embedded representation of each relationship between entities.
[0047] Exemplarily, the preset entity embedding representation formula is v(e i )=w e *x(e i ), where v(e i ) is the embedding representation of the entity, w e is the preset entity weight matrix, x(e i ) is the entity feature vector. The preset entity weight matrix and each entity feature vector are calculated according to the preset entity embedding representation formula to obtain the embedding representation of each entity.
[0048] Exemplarily, the preset entity embedding representation formula is v(r j )=w r *x(r j ), where v(r j ) is the embedding representation of each relationship between entities, w r is the preset relationship weight matrix, x(r j ) is the entity relationship feature vector. The relationship weight matrix and each entity relationship feature vector are calculated according to the preset entity relationship embedding representation formula to obtain the embedding representation of each relationship between entities.
[0049] Step S103: Initialize the preset neural network model to obtain a medical record text recommendation model, and select a sample data from the sample data set as the target sample data.
[0050] Among them, the preset neural network model can be selected according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the neural network model can be a convolutional neural network model, a recurrent neural network model, a recurrent convolutional neural network model, and the like.
[0051] In some embodiments, the preset neural network model is initialized to obtain a medical record text recommendation model, such as Figure 2As shown, the medical record text recommendation model 20 includes a preprocessing layer 21, a fusion layer 22 and an output layer 23. The preprocessing layer 21 is used to extract the word vector matrix of the medical record text, the fusion layer 22 is used to fuse the word embedding matrix, and the output layer 23 is used to identify the similarity of the medical record text and the entity relationship.
[0052] In some embodiments, a sample data is selected from the sample data set as the target sample data, and the target sample data includes a sample medical record text, a plurality of first medical record texts and a plurality of second medical record texts corresponding to the sample medical record text.
[0053] Step S104: input the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtain the model output results of each of the first case texts, each of the second case texts and the sample case text.
[0054] In some embodiments, Figure 3 As shown, step S104 includes sub-steps S1041 to S1043.
[0055] Sub-step S1041, performing word vector matrix generation on the sample case text of the target sample data through the preprocessing layer to obtain a first target word embedding matrix, and performing word vector matrix generation on each of the first case texts to obtain multiple first word embedding matrices, and performing word vector matrix generation on each of the second case texts to obtain multiple second word embedding matrices.
[0056] In some embodiments, a word vector matrix is generated for a sample case text of the target sample data through a preprocessing layer to obtain a first target word embedding matrix. A word vector matrix is generated for each first case text through the preprocessing layer to obtain multiple first word embedding matrices. A word vector matrix is generated for each second case text through the preprocessing layer to obtain multiple second word embedding matrices. The word embedding matrix can be accurately generated through the preset processing layer.
[0057] Sub-step S1042: fusing the embedding representation of each of the entities, the embedding representation of each relationship between the multiple entities, and the first target word embedding matrix through the fusion layer to obtain a second target word embedding matrix; and fusing the embedding representation of each of the entities, the embedding representation of each relationship between the multiple entities, and the first word embedding matrix of each of the first medical record texts to obtain multiple third word embedding matrices; and fusing the embedding representation of each of the entities, the embedding representation of each relationship between the multiple entities, and the second word embedding matrix of each of the second medical record texts to obtain multiple fourth word embedding matrices.
[0058] Among them, the second target word embedding matrix is a matrix obtained by fusing the first target word embedding matrix with the embedding representation of entities in a preset knowledge database and the embedding representation of each relationship between multiple entities. By performing matrix fusion processing on the first target word embedding matrix, the trained model can be made more accurate.
[0059] In some embodiments, Figure 4 As shown, sub-step S1042 includes sub-steps S1042a to S1042c.
[0060] Sub-step S1042a: determine the correlation weight between each element in the first target word embedding matrix and the embedding representation of each relationship, and obtain multiple correlation weight coefficients.
[0061] In some embodiments, an element is selected from the first target word embedding matrix as the target element; the target element and the embedding representation of each relationship are operated through a preset attention mechanism to obtain multiple sub-correlation weight coefficients; the step of selecting an element from the first target word embedding matrix as the target element is repeated until all elements of the first target word embedding matrix are operated to obtain multiple sub-correlation weight coefficients, and the multiple sub-correlation weight coefficients are arranged to obtain the correlation weight coefficient.
[0062] Sub-step S1042b: construct a correlation weight coefficient matrix according to each of the correlation weight coefficients, and obtain preset hyperparameters.
[0063] The correlation weight coefficients are arranged in sequence to construct a correlation weight coefficient matrix. By constructing a correlation weight coefficient matrix for each correlation weight coefficient, the correlation weight coefficient matrix can be accurately obtained, which greatly improves the efficiency and accuracy of model establishment.
[0064] In some embodiments, a preset hyperparameter is obtained, wherein the hyperparameter can be set according to actual conditions, and the embodiments of the present invention do not specifically limit this.
[0065] Sub-step S1042c, fusing the first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix and the embedding representation of each relationship to obtain a second target word embedding matrix.
[0066] In some embodiments, the matrix parameter coefficients are calculated for the preset hyperparameters, the correlation weight coefficient matrix, and the embedding representation of each relationship to obtain the first matrix parameter coefficients; the first target word embedding matrix and the first matrix parameter coefficients are added to obtain the second target word embedding matrix. By calculating the first target word embedding matrix, the preset hyperparameters, the correlation weight coefficient matrix, and the embedding representation of each relationship, the second target word embedding matrix can be accurately obtained.
[0067] In some embodiments, matrix parameter coefficients are calculated for preset hyperparameters, correlation weight coefficient matrix, and embedded representation of each relationship to obtain first matrix parameter coefficients by obtaining preset matrix parameter coefficient formulas, and calculating matrix parameter coefficients for preset hyperparameters, correlation weight coefficient matrix, and embedded representation of each relationship according to the preset matrix parameter coefficient formulas to obtain first matrix parameter coefficients.
[0068] Exemplarily, the preset matrix parameter coefficient formula is β=λ×∑α i ×(v(e i )+∑v(r z )), where β is the matrix parameter coefficient, λ is the preset hyperparameter, α i is the correlation weight coefficient matrix, (v(e i )+∑v(r z )) is the accumulation of the embedding representation of each relationship, the v(e i ) is the embedding representation of the entity in the sample case text, the v(r z ) is entity e i The corresponding embedded representation of each relationship. The preset matrix parameter coefficient formula is used to calculate the matrix parameter coefficients of the preset hyperparameters, the correlation weight coefficient matrix and the embedded representation of each relationship to obtain the first matrix parameter coefficients.
[0069] In some embodiments, the correlation weights of each element in the first word embedding matrix and the embedded representation of each relationship are determined to obtain multiple correlation weight coefficients; a correlation weight coefficient matrix is constructed based on each of the correlation weight coefficients, and preset hyperparameters are obtained; the first word embedding matrix, the preset hyperparameters, the correlation weight coefficient matrix and the embedded representation of each relationship are fused to obtain a third target word embedding matrix.
[0070] In some embodiments, the correlation weights between each element in the first word embedding matrix and the embedded representation of each relationship are determined to obtain multiple correlation weight coefficients by: selecting an element from the first word embedding matrix as the target element; performing operations on the target element and the embedded representation of each relationship through a preset attention mechanism to obtain multiple sub-correlation weight coefficients; repeating the step of selecting an element from the first word embedding matrix as the target element until all elements of the first word embedding matrix are operated to obtain multiple sub-correlation weight coefficients; and arranging the multiple sub-correlation weight coefficients to obtain the correlation weight coefficient.
[0071] In some embodiments, the method of fusing the first word embedding matrix, the preset hyperparameters, the correlation weight coefficient matrix and the embedding representation of each relationship to obtain the third word embedding matrix can be: calculating the matrix parameter coefficients of the preset hyperparameters, the correlation weight coefficient matrix and the embedding representation of each relationship to obtain the second matrix parameter coefficients; adding the third word embedding matrix and the second matrix parameter coefficients to obtain the third word embedding matrix.
[0072] In some embodiments, the correlation weights of each element in the second word embedding matrix and the embedded representation of each relationship are determined to obtain multiple correlation weight coefficients; a correlation weight coefficient matrix is constructed based on each of the correlation weight coefficients, and preset hyperparameters are obtained; the second word embedding matrix, the preset hyperparameters, the correlation weight coefficient matrix and the embedded representation of each relationship are fused to obtain a fourth target word embedding matrix.
[0073] In some embodiments, the correlation weights of the embedding representations of each element in the second word embedding matrix and each relationship are determined to obtain multiple correlation weight coefficients by: selecting an element from the second word embedding matrix as the target element; performing operations on the target element and the embedding representations of each relationship through a preset attention mechanism to obtain multiple sub-correlation weight coefficients; repeating the step of selecting an element from the second word embedding matrix as the target element until all elements of the second word embedding matrix are operated to obtain multiple sub-correlation weight coefficients; and arranging the multiple sub-correlation weight coefficients to obtain the correlation weight coefficient.
[0074] In some embodiments, the method of fusing the second word embedding matrix, the preset hyperparameters, the correlation weight coefficient matrix and the embedding representation of each relationship to obtain the fourth word embedding matrix can be: calculating the matrix parameter coefficients of the preset hyperparameters, the correlation weight coefficient matrix and the embedding representation of each relationship to obtain the third matrix parameter coefficients; adding the second word embedding matrix and the third matrix parameter coefficients to obtain the fourth word embedding matrix.
[0075] Sub-step S1043, input the first target word embedding matrix, the multiple first word embedding matrices, the multiple second word embedding matrices, the second target word embedding matrix, the multiple third word embedding matrices and the multiple fourth word embedding matrices into the output layer for similarity identification, and obtain the model output results of each of the first case texts and each of the second case texts and the sample case text.
[0076] Among them, the model output results include the similarity or dissimilarity between sample medical record texts and the entity relationships between entities.
[0077] In some embodiments, the first target word embedding matrix, multiple first word embedding matrices, and multiple second word embedding matrices are input to the output layer for similarity identification, and the first similarity result and the first entity relationship result of each first case text and each second case text with the sample case text are obtained. The second target word embedding matrix, multiple third word embedding matrices, and multiple fourth word embedding matrices are input to the output layer for similarity identification, and the second similarity result and the second entity relationship result of each first case text and each second case text with the sample case text are obtained. By training the non-feature fused first target word embedding matrix, multiple first word embedding matrices, and multiple second word embedding matrices respectively and training the feature fused second target word embedding matrix, multiple third word embedding matrices, and multiple fourth word embedding matrices, the stability and accuracy of the model can be effectively improved.
[0078] Sub-step S105, determining whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text.
[0079] In some embodiments, the loss value of the medical record text recommendation model is determined based on the model output results and the similarity categories between the sample case text and the first case text and the second case text in the target sample data; if the loss value is less than or equal to the preset loss value, it is determined that the medical record text recommendation model has converged; if the loss value is greater than the preset loss value, it is determined that the medical record text recommendation model has not converged. Among them, the preset loss value can be set according to actual conditions, and the embodiments of the present invention do not specifically limit this. For example, the preset loss value can be set to 0.02.
[0080] In some embodiments, the cosine similarity between the model output result and the sample case text in the target sample data and the similar categories of the first case text and the second case text is calculated to obtain a cosine similarity value; the cosine similarity value is subtracted from the unit 1 to obtain a difference parameter, and the difference parameter is determined as a loss value.
[0081] It should be noted that the model output results include a first similarity result, a second similarity result, a first entity relationship result and a second entity relationship result.
[0082] In some embodiments, the cosine similarity between the first similarity result and the similar category is calculated to obtain a cosine similarity value; the cosine similarity value is subtracted from the unit one to obtain a difference parameter, and the difference parameter is determined as a first loss value; the cosine similarity between the second similarity result and the similar category is calculated to obtain a cosine similarity value; the cosine similarity value is subtracted from the unit one to obtain a difference parameter, and the difference parameter is determined as a second loss value; the cosine similarity between the first entity relationship result and the entity relationship of each entity in the sample data is calculated to obtain a cosine similarity value; the cosine similarity value is subtracted from the unit one to obtain a difference parameter, and the difference parameter is determined as a third loss value; the cosine similarity between the second entity relationship result and the entity relationship of each entity in the sample data is calculated to obtain a cosine similarity value; the cosine similarity value is subtracted from the unit one to obtain a difference parameter, and the difference parameter is determined as a fourth loss value; the first loss value, the second loss value, the third loss value and the fourth loss value are added to obtain the loss value of the medical record text recommendation model.
[0083] Sub-step S106: if the medical record text recommendation model has not converged, update the model parameters of the medical record text recommendation model, and continue to execute the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges.
[0084] If the medical record text recommendation model has not converged, the model parameters of the medical record text recommendation model are updated, and the step of selecting a sample data from the sample data set as the target sample data is continued until the medical record text recommendation model converges to obtain a converged medical record text recommendation model.
[0085] Sub-step S107, obtaining the medical record text to be recommended, identifying the medical record text to be recommended by the medical record text recommendation model, and obtaining multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
[0086] Obtain medical record text to be recommended, identify the medical record text to be recommended through a preset medical record text recommendation model, and obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended, wherein the preset medical record text recommendation model is trained based on the medical record text recommendation method described in the embodiment of the present invention.
[0087] The medical record text recommendation method is to obtain a sample data set, the sample data set includes multiple sample data, the sample data includes a sample case text, multiple first case texts and multiple second case texts, each first case text is similar to the sample case text, and each second case text is not similar to the sample case text; obtain a preset knowledge database, the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities; initialize a preset neural network model to obtain a medical record text recommendation model, and select a sample data from the sample data set as the target sample data; input the target sample data and the preset knowledge database into The medical record text recommendation model is trained to obtain the model output results of each first case text and each second case text and the sample case text; according to the model output results and the similarity categories between the sample case text and the first case text and the second case text in the target sample data, it is determined whether the medical record text recommendation model has converged; if the medical record text recommendation model has not converged, the model parameters of the medical record text recommendation model are updated, and the step of selecting a sample data from the sample data set as the target sample data is continued until the medical record text recommendation model converges; the medical record text to be recommended is obtained, and the medical record text to be recommended is identified through the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended. The present application can accurately obtain the recommended medical record text by training the medical record text recommendation model and then identifying the medical record text based on the medical record text recommendation model, which greatly improves the efficiency and accuracy of medical record text recommendation and the multiple entity relationship information in the medical record text to be recommended.
[0088] Please refer to Figure 5 , Figure 5 A schematic block diagram of a medical record text recommendation device provided in an embodiment of the present application.
[0089] like Figure 5 As shown, the medical record text recommendation device 200 includes an acquisition module 210, a model initialization module 220, a model training module 230, a determination module 240 and a generation module 250, wherein:
[0090] The acquisition module 210 is used to acquire a sample data set, wherein the sample data set includes a plurality of sample data, wherein the sample data includes a sample case text, a plurality of first case texts, and a plurality of second case texts, wherein each of the first case texts is similar to the sample case text, and each of the second case texts is not similar to the sample case text;
[0091] The acquisition module 210 is further used to acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities;
[0092] The model initialization module 220 is used to initialize the preset neural network model to obtain a medical record text recommendation model;
[0093] The acquisition module 210 is further used to select a sample data from the sample data set as target sample data;
[0094] The model training module 230 is used to input the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtain the model output results of each of the first case texts, each of the second case texts and the sample case text;
[0095] The determination module 240 is used to determine whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0096] The generating module 250 is used to update the model parameters of the medical record text recommendation model if the medical record text recommendation model has not converged, and continue to perform the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges;
[0097] The acquisition module 210 is also used to acquire the medical record text to be recommended;
[0098] The generating module 250 is further used to identify the medical record text to be recommended through the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
[0099] In some embodiments, the model training module 230 is further used to:
[0100] Generate a word vector matrix for the sample case text of the target sample data through the preprocessing layer to obtain a first target word embedding matrix, generate a word vector matrix for each of the first case texts to obtain multiple first word embedding matrices, and generate a word vector matrix for each of the second case texts to obtain multiple second word embedding matrices;
[0101] The embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first target word embedding matrix are fused through the fusion layer to obtain a second target word embedding matrix; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first word embedding matrix of each first medical record text are fused to obtain a plurality of third word embedding matrices; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the second word embedding matrix of each second medical record text are fused to obtain a plurality of fourth word embedding matrices;
[0102] The first target word embedding matrix, the multiple first word embedding matrices, the multiple second word embedding matrices, the second target word embedding matrix, the multiple third word embedding matrices and the multiple fourth word embedding matrices are input into the output layer for similarity identification to obtain the model output results of each of the first case texts, each of the second case texts and the sample case text.
[0103] In some embodiments, the model training module 230 is further used to:
[0104] Determine the correlation weight between each element in the first target word embedding matrix and the embedding representation of each relationship to obtain a plurality of correlation weight coefficients;
[0105] Constructing a correlation weight coefficient matrix according to each of the correlation weight coefficients, and obtaining preset hyperparameters;
[0106] The first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix and the embedding representation of each relationship are fused to obtain a second target word embedding matrix.
[0107] In some embodiments, the model training module 230 is further used to:
[0108] Select an element from the first target word embedding matrix as a target element;
[0109] By using a preset attention mechanism, the target element and the embedding representation of each relationship are operated to obtain a plurality of sub-correlation weight coefficients;
[0110] Repeat the step of selecting an element from the first target word embedding matrix as a target element until all elements of the first target word embedding matrix are calculated to obtain a plurality of sub-correlation weight coefficients;
[0111] The plurality of sub-correlation weight coefficients are arranged to obtain a correlation weight coefficient.
[0112] In some embodiments, the model training module 230 is further used to:
[0113] Calculating matrix parameter coefficients for the preset hyperparameters, the correlation weight coefficient matrix, and the embedded representation of each relationship to obtain first matrix parameter coefficients;
[0114] An addition operation is performed on the first target word embedding matrix and the first matrix parameter coefficients to obtain the second target word embedding matrix.
[0115] In some embodiments, the model training module 230 is further used to:
[0116] Determine the loss value of the medical record text recommendation model according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0117] If the loss value is less than or equal to a preset loss value, it is determined that the medical record text recommendation model has converged;
[0118] If the loss value is greater than a preset loss value, it is determined that the medical record text recommendation model has not converged.
[0119] In some embodiments, the model training module 230 is further used to:
[0120] Calculating the cosine similarity between the model output result and the sample case text in the target sample data and the first case text and the second case text in similar categories to obtain a cosine similarity value;
[0121] The cosine similarity value is subtracted from the unit value to obtain a difference parameter, and the difference parameter is determined as the loss value.
[0122] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, the specific working process of the above-mentioned medical record text recommendation device can refer to the corresponding process in the aforementioned medical record text recommendation method embodiment, and will not be repeated here.
[0123] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0124] like Figure 6 As shown, the computer device 300 includes a processor 302 and a memory 303 connected via a system bus 301 , wherein the memory may include a storage medium and an internal memory.
[0125] The storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any medical record text recommendation method.
[0126] The processor 302 is used to provide computing and control capabilities and support the operation of the entire computer device.
[0127] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any medical record text recommendation method.
[0128] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] It should be understood that the processor 302 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, 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, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0130] In one embodiment, the processor 302 is used to run a computer program stored in the memory to implement the following steps:
[0131] Acquire a sample data set, the sample data set comprising a plurality of sample data, the sample data comprising a sample case text, a plurality of first case texts and a plurality of second case texts, each of the first case texts being similar to the sample case text, and each of the second case texts being dissimilar to the sample case text;
[0132] Acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities;
[0133] Initializing a preset neural network model to obtain a medical record text recommendation model, and selecting a sample data from the sample data set as target sample data;
[0134] Inputting the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtaining the model output results of each of the first case texts, each of the second case texts and the sample case text;
[0135] Determining whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0136] If the medical record text recommendation model has not converged, updating the model parameters of the medical record text recommendation model, and continuing to perform the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges;
[0137] The medical record text to be recommended is obtained, and the medical record text to be recommended is identified by the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
[0138] In one embodiment, when the processor 302 implements the inputting of the target sample data and the preset knowledge database into the medical record text recommendation model for training and obtains the model output results of each of the first case texts, each of the second case texts and the sample case text, it is used to implement:
[0139] Generate a word vector matrix for the sample case text of the target sample data through the preprocessing layer to obtain a first target word embedding matrix, generate a word vector matrix for each of the first case texts to obtain multiple first word embedding matrices, and generate a word vector matrix for each of the second case texts to obtain multiple second word embedding matrices;
[0140] The embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first target word embedding matrix are fused through the fusion layer to obtain a second target word embedding matrix; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first word embedding matrix of each first medical record text are fused to obtain a plurality of third word embedding matrices; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the second word embedding matrix of each second medical record text are fused to obtain a plurality of fourth word embedding matrices;
[0141] The first target word embedding matrix, the multiple first word embedding matrices, the multiple second word embedding matrices, the second target word embedding matrix, the multiple third word embedding matrices and the multiple fourth word embedding matrices are input into the output layer for similarity identification to obtain the model output results of each of the first case texts, each of the second case texts and the sample case text.
[0142] In one embodiment, when the processor 502 implements fusing the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first target word embedding matrix through the fusion layer to obtain the second target word embedding matrix, it is used to implement:
[0143] Determine the correlation weight between each element in the first target word embedding matrix and the embedding representation of each relationship to obtain a plurality of correlation weight coefficients;
[0144] Constructing a correlation weight coefficient matrix according to each of the correlation weight coefficients, and obtaining preset hyperparameters;
[0145] The first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix and the embedding representation of each relationship are fused to obtain a second target word embedding matrix.
[0146] In one embodiment, the processor 502, when implementing the determination of the relevance weights between each element in the first target word embedding matrix and the embedding representation of each relationship to obtain a plurality of relevance weight coefficients, is used to implement:
[0147] Select an element from the first target word embedding matrix as a target element;
[0148] By using a preset attention mechanism, the target element and the embedding representation of each relationship are operated to obtain a plurality of sub-correlation weight coefficients;
[0149] Repeat the step of selecting an element from the first target word embedding matrix as a target element until all elements of the first target word embedding matrix are calculated to obtain a plurality of sub-correlation weight coefficients;
[0150] The plurality of sub-correlation weight coefficients are arranged to obtain a correlation weight coefficient.
[0151] In one embodiment, when the processor 502 implements the fusing of the first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix, and the embedding representation of each relationship to obtain the second target word embedding matrix, it is used to implement:
[0152] Calculating matrix parameter coefficients for the preset hyperparameters, the correlation weight coefficient matrix, and the embedded representation of each relationship to obtain first matrix parameter coefficients;
[0153] An addition operation is performed on the first target word embedding matrix and the first matrix parameter coefficients to obtain the second target word embedding matrix.
[0154] In one embodiment, when the processor 502 determines whether the medical record text recommendation model converges according to the model output result, the similarity categories of the sample case text in the target sample data and the first case text and the second case text, it is used to implement:
[0155] Determine the loss value of the medical record text recommendation model according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text;
[0156] If the loss value is less than or equal to a preset loss value, it is determined that the medical record text recommendation model has converged;
[0157] If the loss value is greater than a preset loss value, it is determined that the medical record text recommendation model has not converged.
[0158] In one embodiment, when the processor 302 determines the loss value of the medical record text recommendation model according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text, it is configured to implement:
[0159] Calculating the cosine similarity between the model output result and the sample case text in the target sample data and the first case text and the second case text in similar categories to obtain a cosine similarity value;
[0160] The cosine similarity value is subtracted from the unit value to obtain a difference parameter, and the difference parameter is determined as the loss value.
[0161] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned medical record text recommendation method embodiment, and will not be repeated here.
[0162] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the medical record text recommendation method of the present application.
[0163] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0164] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0165] It should also be understood that the term "and / or" used in the present specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0166] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.
Claims
1. A medical record text recommendation method, characterized in that: include: Acquire a sample data set, the sample data set comprising a plurality of sample data, the sample data comprising a sample case text, a plurality of first case texts and a plurality of second case texts, each of the first case texts being similar to the sample case text, and each of the second case texts being dissimilar to the sample case text; Acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities; Initializing a preset neural network model to obtain a medical record text recommendation model, and selecting a sample data from the sample data set as target sample data; Inputting the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtaining the model output results of each of the first case texts, each of the second case texts and the sample case text; Determining whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text; If the medical record text recommendation model has not converged, updating the model parameters of the medical record text recommendation model, and continuing to perform the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges; The medical record text to be recommended is obtained, and the medical record text to be recommended is identified by the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
2. The medical record text recommendation method according to claim 1, characterized in that: The medical record text recommendation model includes a preprocessing layer, a fusion layer and an output layer; the target sample data and the preset knowledge database are input into the medical record text recommendation model for training, and the model output results of each of the first case texts, each of the second case texts and the sample case text are obtained, including: Generate a word vector matrix for the sample case text of the target sample data through the preprocessing layer to obtain a first target word embedding matrix, generate a word vector matrix for each of the first case texts to obtain multiple first word embedding matrices, and generate a word vector matrix for each of the second case texts to obtain multiple second word embedding matrices; The embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first target word embedding matrix are fused through the fusion layer to obtain a second target word embedding matrix; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the first word embedding matrix of each first medical record text are fused to obtain a plurality of third word embedding matrices; and the embedding representation of each entity, the embedding representation of each relationship between the multiple entities and the second word embedding matrix of each second medical record text are fused to obtain a plurality of fourth word embedding matrices; The first target word embedding matrix, the multiple first word embedding matrices, the multiple second word embedding matrices, the second target word embedding matrix, the multiple third word embedding matrices and the multiple fourth word embedding matrices are input into the output layer for similarity identification to obtain the model output results of each of the first case texts, each of the second case texts and the sample case text.
3. The medical record text recommendation method according to claim 2, characterized in that: The step of fusing the embedding representation of each entity, the embedding representation of each relationship between the multiple entities, and the first target word embedding matrix through the fusion layer to obtain a second target word embedding matrix includes: Determine the correlation weight between each element in the first target word embedding matrix and the embedding representation of each relationship to obtain a plurality of correlation weight coefficients; Constructing a correlation weight coefficient matrix according to each of the correlation weight coefficients, and obtaining preset hyperparameters; The first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix and the embedding representation of each relationship are fused to obtain a second target word embedding matrix.
4. The medical record text recommendation method according to claim 3, characterized in that: The determining of the correlation weights between each element in the first target word embedding matrix and the embedding representation of each relationship to obtain a plurality of correlation weight coefficients includes: Select an element from the first target word embedding matrix as a target element; By using a preset attention mechanism, the target element and the embedding representation of each relationship are operated to obtain a plurality of sub-correlation weight coefficients; Repeat the step of selecting an element from the first target word embedding matrix as a target element until all elements of the first target word embedding matrix are calculated to obtain a plurality of sub-correlation weight coefficients; The plurality of sub-correlation weight coefficients are arranged to obtain a correlation weight coefficient.
5. The medical record text recommendation method according to claim 3, characterized in that: The step of fusing the first target word embedding matrix, the preset hyperparameters, the relevance weight coefficient matrix, and the embedding representation of each relationship to obtain a second target word embedding matrix includes: Calculating matrix parameter coefficients for the preset hyperparameters, the correlation weight coefficient matrix, and the embedded representation of each relationship to obtain first matrix parameter coefficients; An addition operation is performed on the first target word embedding matrix and the first matrix parameter coefficients to obtain the second target word embedding matrix.
6. The medical record text recommendation method according to claim 2, characterized in that: The determining whether the medical record text recommendation model converges according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text includes: Determine the loss value of the medical record text recommendation model according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text; If the loss value is less than or equal to a preset loss value, it is determined that the medical record text recommendation model has converged; If the loss value is greater than a preset loss value, it is determined that the medical record text recommendation model has not converged.
7. The medical record text recommendation method according to claim 6, characterized in that: The determining the loss value of the medical record text recommendation model according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text includes: Calculating the cosine similarity between the model output result and the sample case text in the target sample data and the first case text and the second case text in similar categories to obtain a cosine similarity value; The cosine similarity value is subtracted from the unit value to obtain a difference parameter, and the difference parameter is determined as the loss value.
8. A medical record text recommendation device, characterized in that: The medical record text recommendation device includes an acquisition module, a model initialization module, a model training module, a determination module and a generation module, wherein: The acquisition module is used to acquire a sample data set, the sample data set includes a plurality of sample data, the sample data includes a sample case text, a plurality of first case texts and a plurality of second case texts, each of the first case texts is similar to the sample case text, and each of the second case texts is not similar to the sample case text; The acquisition module is further used to acquire a preset knowledge database, wherein the preset knowledge database includes an embedded representation of each of the multiple entities and an embedded representation of each relationship between the multiple entities; The model initialization module is used to initialize the preset neural network model to obtain a medical record text recommendation model; The acquisition module is further used to select a sample data from the sample data set as the target sample data; The model training module is used to input the target sample data and the preset knowledge database into the medical record text recommendation model for training, and obtain the model output results of each of the first case texts, each of the second case texts and the sample case text; The determination module is used to determine whether the medical record text recommendation model has converged according to the model output result and the similarity categories between the sample case text in the target sample data and the first case text and the second case text; The generating module is used for updating the model parameters of the medical record text recommendation model if the medical record text recommendation model has not converged, and continuing to execute the step of selecting a sample data from the sample data set as the target sample data until the medical record text recommendation model converges; The acquisition module is also used to acquire the medical record text to be recommended; The generation module is also used to identify the medical record text to be recommended through the medical record text recommendation model to obtain multiple similar medical record texts and multiple entity relationship information in the medical record text to be recommended.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the medical record text recommendation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the medical record text recommendation method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Rare disease CRF form generation method and device
CN119623441A
