Information prediction method, device, storage medium and computer equipment
By generating a to-predicted statement with information to be filled in with the blanks and using a preset information prediction model for prediction, the problem that the model can only predict a certain type of information in the prior art is solved, and the model training efficiency and information prediction accuracy are improved.
Patent Information
- Application Number
- CN202210233050.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In the prior art, neural network models can only predict certain information. If you want to predict other information of patients, you need to re-acquire the sample medical record data to build a model, resulting in an increase in the burden on staff and inefficient model training.
By generating a sentence to be predicted with information to be filled in with the blanks, and predicting it using a preset information prediction model. The preset model is obtained from sample medical record text training that is blocked from information of different dimensions, and can adapt to the prediction of information of different dimensions.
It reduces the burden on staff to collect sample case data, improves model training efficiency and information prediction accuracy, especially for rare diseases.
Smart Images

Figure CN114627993B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital medical technology, and in particular to an information prediction method, device, storage medium and computer equipment. Background Art
[0002] Disease information encompasses medical knowledge such as disease symptoms, examinations, and diagnoses, as well as the patient's demographic information and medical information, such as allergy history, medical history, disease history, family medical history, etc. As the application rate of disease information gradually increases, data mining can be used to extract massive information and build richer clinical applications, assist medical decision-making, and improve the quality of medical and health services. Among them, using disease information to predict information for patients is an important application of disease information.
[0003] Currently, information prediction is typically performed using neural network models constructed from sample medical record data. However, this approach can only predict a specific type of information. To predict other patient information, the corresponding sample medical record data must be obtained and the model rebuilt. For example, a trained drug recommendation model can only recommend medications for patients. To also predict a patient's length of stay, the prediction model must be retrained. This results in a large amount of sample data, increasing the burden on staff and reducing model training efficiency. Summary of the Invention
[0004] The present invention provides an information prediction method, apparatus, storage medium and computer equipment, which are mainly capable of improving the efficiency of model training and thus improving the efficiency of information prediction.
[0005] According to a first aspect of the present invention, there is provided an information prediction method, comprising:
[0006] Obtain disease information of the patient to be predicted;
[0007] Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension;
[0008] The content to be filled in the blank in the sentence to be predicted is predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions blocked.
[0009] According to a second aspect of the present invention, there is provided an information prediction device, comprising:
[0010] An acquisition unit, used for acquiring disease information of the patient to be predicted;
[0011] a generating unit, configured to determine an information template matching the prediction information, and generate, based on the information template, a sentence to be predicted corresponding to the disease information, wherein the sentence to be predicted includes prompt information corresponding to content to be filled in the blank, and the content to be filled in the blank is information of any dimension;
[0012] The prediction unit is used to predict the content to be filled in the sentence to be predicted by using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions blocked.
[0013] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0014] Obtain disease information of the patient to be predicted;
[0015] Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension;
[0016] The content to be filled in the blank in the sentence to be predicted is predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions blocked.
[0017] According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps are implemented:
[0018] Obtain disease information of the patient to be predicted;
[0019] Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension;
[0020] The content to be filled in the blank in the sentence to be predicted is predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions blocked.
[0021] According to an information prediction method, device, storage medium and computer equipment provided by the present invention, compared with the current information prediction method using a neural network model constructed with sample medical record data, the present invention obtains the disease information of the patient to be predicted; and determines an information template that matches the prediction information, and generates a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension; finally, a preset information prediction model is used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record text with different dimensional information blocked. The method obtains the above results, thereby generating a sentence to be predicted with prompt information of the content to be filled in the blanks according to the form of an information template for the disease information, wherein the content to be filled in the blanks is information of any dimension, and using a preset information prediction model to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions, thereby avoiding the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model, thereby reducing the burden of staff in collecting sample case data to train the model, and improving the efficiency of model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 A flow chart of an information prediction method provided by an embodiment of the present invention is shown;
[0024] Figure 2 shows a flow chart of another information prediction method provided by an embodiment of the present invention;
[0025] Figure 3 A schematic structural diagram of an information prediction device provided by an embodiment of the present invention is shown;
[0026] Figure 4 A schematic structural diagram of another information prediction device provided by an embodiment of the present invention is shown;
[0027] Figure 5 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0028] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0029] At present, the method of using neural network models constructed with sample medical record data to predict information can only predict certain information. If you want to predict other information about the patient, you need to obtain the corresponding sample medical record data and rebuild the model, which increases the burden on staff and reduces the training efficiency of the model.
[0030] In order to solve the above problems, the embodiment of the present invention provides an information prediction method, such as Figure 1 As shown, the method includes:
[0031] 101. Obtain disease information of the patient to be predicted.
[0032] Among them, disease information includes medical knowledge such as visit type, examination, diagnosis, and patient demographic information such as age.
[0033] For the embodiment of the present invention, in order to overcome the problem of low training efficiency of the model in the prior art, the embodiment of the present invention generates a sentence to be predicted with prompt information of the content to be filled in the blank according to the form of an information template for the disease information, wherein the content to be filled in the blank is information of any dimension, and uses a preset information prediction model to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record text with blocked information of different dimensions. This can avoid the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model, thereby reducing the burden of staff collecting sample case data to train the model, and improving the efficiency of model training. The embodiment of the present invention is mainly used in the scenario of predicting information. The execution subject of the embodiment of the present invention is a device or equipment that can predict information, which can be specifically set on the client or server side.
[0034] Specifically, a large amount of disease information of patients is stored in the hospital database, and all disease information corresponding to each patient is stored in the database. By inputting the identity information of the patient to be predicted, such as the ID number and other information, all disease information of the patient to be predicted that has been diagnosed in the hospital can be searched in the database, and the disease information can be segmented and sorted in chronological order. For example, the disease information can be segmented and sorted according to the age of the patient to be predicted, and the sorted disease information can be spliced to obtain the spliced disease information. Then, an information template that matches the predicted information is determined, and a sentence to be predicted corresponding to the spliced disease information is generated according to the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be predicted, and the content to be predicted For information of any dimension, the preset information prediction model is finally used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is obtained by training sample case texts with blocked information of different dimensions, thereby avoiding the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model, which reduces the workload of the staff and improves the efficiency of model training. At the same time, if information prediction is performed for rare diseases, because there are fewer sample medical record data corresponding to rare diseases, the embodiment of the present invention can also avoid the problem of low prediction accuracy of the model trained based on a small amount of sample medical record data, thereby improving the accuracy of information prediction.
[0035] 102. Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension.
[0036] The information template may be in the form of a cloze test. If the predicted information is a drug, the information template may be in the form of: [X], Medication: [Z], wherein X in the [X] position represents disease information, Medication represents prompt information corresponding to the content to be filled in, and Z in the [Z] position represents the content to be filled in, i.e., the information to be predicted in the embodiment of the present invention.
[0037] For the embodiment of the present invention, after obtaining the disease information of the patient to be predicted, in order to predict the information of the patient to be predicted, it is first necessary to determine an information template that matches the predicted information. For example, if the information to be predicted is drug information, the information template that matches the predicted information is determined to be a drug information template. If the information to be predicted is hospitalization duration, the information template that matches the predicted information is determined to be a hospitalization duration information template. After determining the information template that matches the predicted information, based on the information template, a sentence to be predicted corresponding to the disease information is generated, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension. For example, if the information to be predicted is drug recommendation information and the disease information is cough or headache, the drug information template that matches the disease information is: [X], medication: [Z]. Then, based on the drug information Information template is used to generate the sentence to be predicted corresponding to the disease information: cough, headache, medication: [Z], wherein [Z] is the content to be filled in the sentence to be predicted, and "medication" is the prompt information corresponding to the content to be filled in. By changing the prompt information, the [Z] can be information of any dimension. The sentence to be predicted is then input into the preset information prediction model to predict the content to be filled in. The preset information prediction model is trained by sample case texts with blocked information of different dimensions, that is, the preset information prediction model obtained by training once can predict information of different dimensions, which can avoid the problem that the trained neural network model can only predict certain information. If you want to predict other information of the patient, you also need to obtain the corresponding sample medical record data to rebuild the model, which reduces the burden of staff collecting sample case data to train the model and improves the efficiency of model training.
[0038] 103. Predict the content to be filled in the blank in the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions.
[0039] Among them, information of different dimensions includes drug recommendation information, hospitalization duration information, etc., and the sample case text includes sample disease information and its corresponding drug recommendation information, hospitalization duration information, etc.
[0040] For the embodiment of the present invention, after generating the sentence to be predicted corresponding to the disease information based on the information template, in order to use the preset information prediction model to predict the content to be filled in the sentence to be predicted, it is first necessary to train the preset information prediction model using sample case texts with blocked information of different dimensions, and finally use the trained preset information prediction model to predict the content to be filled in the sentence to be predicted, thereby generating a sentence to be predicted with prompt information of the content to be filled in the blank according to the form of the disease information in the form of the information template, wherein the content to be filled in the blank is information of any dimension, and using the preset information prediction model to predict the content to be filled in the sentence to be predicted, wherein the The preset information prediction model is obtained by training sample medical record texts with blocked information of different dimensions. This can avoid the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model. This reduces the burden of staff in collecting sample case data to train the model and improves the efficiency of model training. At the same time, if information prediction is performed for rare diseases, because there are fewer sample medical record data corresponding to rare diseases, the embodiment of the present invention can also avoid the problem of low prediction accuracy of the model trained based on a small amount of sample medical record data, thereby improving the accuracy of information prediction.
[0041] According to an information prediction method provided by the present invention, compared with the current information prediction method using a neural network model constructed by sample medical record data, the present invention obtains the disease information of the patient to be predicted; and determines an information template that matches the prediction information, and generates a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension; finally, a preset information prediction model is used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record text with information of different dimensions blocked, thereby Disease information is generated into a sentence to be predicted with prompt information of content to be filled in the blanks in the form of an information template, wherein the content to be filled in the blanks is information of any dimension, and a preset information prediction model is used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions. This avoids the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model, which reduces the burden of staff in collecting sample case data to train the model and improves the efficiency of model training.
[0042] Furthermore, in order to better illustrate the above process of predicting information, as a refinement and extension of the above embodiment, the embodiment of the present invention provides another information prediction method, such as Figure 2 As shown, the method includes:
[0043] 201. Obtain disease information of the patient to be predicted.
[0044] For an embodiment of the present invention, the disease information of the patient to be predicted is obtained by inputting the ID number of the patient to be predicted in the hospital's disease information database, and an information template matching the predicted information is determined. Then, based on the information template, a sentence to be predicted corresponding to the disease information is generated, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blanks, and the content to be filled in the blanks can be information of any dimension. Finally, the sentence to be predicted is input into a preset information prediction model to predict the content to be filled in, wherein the preset information prediction model is trained by sample case texts with blocked information of different dimensions, thereby avoiding the burden of model training on staff and improving the efficiency of model training.
[0045] 202. Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension.
[0046] According to the embodiment of the present invention, after obtaining the disease information of the patient to be predicted, it is necessary to determine an information template that matches the prediction information. Based on this, step 202 specifically includes: determining an information template that matches the prediction information from a preset information template table.
[0047] Among them, the preset information template table records information templates corresponding to various prediction information, such as drug information template, hospitalization duration information template, etc.
[0048] For an embodiment of the present invention, the prediction information corresponding to the patient to be predicted is first determined. Based on the prediction information, an information template matching the prediction information is determined in the preset information template table. According to the information template, the disease information is constructed into a sentence to be predicted with prompt information of content to be filled in the blanks, wherein, based on different information templates, the content to be filled in the blanks can be information of any dimension. For example, the information to be predicted is the diagnosis result, and the disease information is cough and fever. Then, the information template matching the prediction information is determined to be [X], diagnosis: [Z]. Based on the diagnosis information template, the sentence to be predicted corresponding to the disease information is generated as "cough, fever, diagnosis: [Z]", wherein [Z] is the content to be filled in the blanks. Finally, the sentence to be predicted is input into the preset information prediction template to predict the content to be filled in the blanks.
[0049] 203. Determine each character included in the sentence to be predicted and an embedding vector corresponding to each character.
[0050] For an embodiment of the present invention, if the preset information prediction model is to be used to predict the content to be filled in the sentence to be predicted, it is first necessary to determine the characters contained in the sentence to be predicted and the latent vectors corresponding to the characters. For example, the sentence to be predicted is: cough, fever, take: [Z], then the characters corresponding to the sentence to be predicted are cough / , / fever / , / take / : / [Z]. Then, a word embedding method such as Word2Vec is used to convert the characters in the sentence to be predicted into an embedding vector, and the embedding vector corresponding to each character is input into the preset information prediction model for semantic information extraction to obtain the semantic information vector corresponding to the sentence to be predicted. Finally, based on the semantic information vector, the content to be filled in the sentence to be predicted is predicted.
[0051] 204. Input the embedding vector into the preset information prediction model to extract semantic information to obtain a semantic information vector corresponding to the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record texts with obscured information of different dimensions.
[0052] Among them, the preset information prediction model can specifically be a preset BERT model, which includes multiple encoders, each encoder is connected end to end, and the output of the previous encoder will serve as the input of the next encoder. The encoder specifically includes an attention layer and a feedforward neural network layer.
[0053] For an embodiment of the present invention, in order to improve the prediction accuracy of the preset information prediction model, before the embedding vector is input into the preset information prediction model for semantic information extraction, the preset information prediction model should be trained and constructed for training. The specific training and construction method is: performing word segmentation processing on the sample case text to obtain each word segmentation corresponding to the sample case text, and determining a first preset number of first word segmentations in each word segmentation, and determining a second preset number of second word segmentations in the remaining word segmentations of each word segmentation; performing occlusion processing on the first word segmentation, and replacing the second word segmentation with characters in a preset character dictionary to obtain a processed sample medical record text; inputting the processed sample medical record text into the initial information prediction model to predict the content of the occluded part to obtain a predicted word segmentation corresponding to the first word segmentation; based on the first word segmentation and the predicted word segmentation, constructing a loss function corresponding to the initial information prediction model; training the initial information prediction model based on the loss function to construct the preset information prediction model.
[0054] Specifically, a sample case text is obtained from the sample case text database of the hospital, wherein the sample case text contains sample disease information and prediction information of different dimensions. After obtaining the sample case text, the sample case text is sorted in chronological order, and the sorted sample case text is segmented to obtain each segmentation corresponding to the sample case text, and a first preset number of first segmentations is determined in each segmentation, for example, the first preset number can be 15% of the total number of each segmentation, and a second preset number of second segmentations is determined in each segmentation after removing the first segmentation, and then the first segmentation is blocked. In order to prevent the initial segmentation, The initial information prediction model remembers the content of the occlusion, and improves the prediction accuracy of the preset information prediction model. It is necessary to replace the second participle with the characters in the preset character dictionary to obtain the processed sample case text. At the same time, 15% of the participles can be determined in each participle, and 80% of the third participles can be determined in the 15% participles for occlusion processing, and 10% of the fourth participles can be determined in the 15% participles after removing the third participles, and the fourth participles can be replaced with the characters in the preset character dictionary. The remaining participles remain unchanged. For example, 15% of the participles corresponding to the sample case text are determined to be "patient / 60 years old / suffering from / coronary heart disease Disease / taking / quick-acting / heart-saving pills”, and determine that 80% of the 15% of the segmented words are “patient, suffering from, taking, quick-acting, heart-saving pills”, and perform masking on the above 80% of the segmented words, which can be replaced by masks, then the remaining segmented words are “60 years old, coronary heart disease”, and randomly select “60 years old” from the remaining segmented words, and replace “60 years old” with the cold in the preset character dictionary, then the processed sample case text is “.......mask / cold / mask / coronary heart disease / mask / mask / mask”, and then input the processed sample case text into the initial information prediction model to perform masking on the masked part. The content is predicted, that is, the content at the mask is predicted to obtain the predicted word segmentation at the occluded position, and based on the word segmentation and the predicted word segmentation at the corresponding position before occlusion, that is, the first word segmentation and the predicted word segmentation, a loss function corresponding to the initial information prediction model is constructed, wherein the method for constructing the loss function corresponding to the initial information prediction model is: determining a first word segmentation vector corresponding to the first word segmentation and a second word segmentation vector corresponding to the predicted word segmentation; calculating each vector difference at the same position of the first word segmentation vector and the second word segmentation vector; and constructing the loss function corresponding to the initial information prediction model by calculating the sum of the squares of the each vector difference.
[0055] Specifically, the first word segmentation vector corresponding to the first word segmentation and the second word segmentation vector corresponding to the predicted word segmentation are respectively determined, and the vector differences at the same position in the first word segmentation vector and the second word segmentation vector are calculated. Then, the vector differences are squared and summed, that is, the root mean square error corresponding to the initial information prediction model is calculated. By calculating the root mean square error, the loss function corresponding to the initial information prediction model is constructed. The specific formula for calculating the root mean square error is as follows:
[0056]
[0057] Among them, Z represents the root mean square error, u1, u2....u r Represents the first word segmentation vector, v1, v2....v r Represents the second word segmentation vector, r represents the number corresponding to the first word segmentation vector, after constructing the loss function corresponding to the initial information prediction model according to the above formula, the initial information prediction model is trained based on the loss function until the minimum loss function value appears, and based on the model parameters corresponding to the minimum loss function value, the preset information prediction model is constructed, that is, the preset encoder in the embodiment of the present invention, and the preset information prediction model is used to predict the content to be filled in the sentence to be predicted.
[0058] Furthermore, after constructing the preset information prediction model, in order to extract the semantic information vector corresponding to the sentence to be predicted, step 204 specifically includes: inputting the embedding vector into the attention layer for feature extraction to obtain the first feature vector corresponding to each character; adding the first feature vector and the embedding vector to obtain the second feature vector corresponding to each character; inputting the second feature vector into the feedforward neural network layer for feature extraction to obtain the semantic information vector corresponding to the sentence to be predicted.
[0059] Among them, the first eigenvector is the output vector of the attention layer, and the semantic information vector corresponding to the sentence to be predicted is the output vector of the feedforward neural network layer of the last encoder.
[0060] Specifically, in the process of extracting the semantic information vector corresponding to the sentence to be predicted using the preset BERT model, the embedding vector corresponding to each character is first input into the attention layer of the first encoder in the preset BERT model for feature extraction to obtain the output vector of the attention layer, that is, the first feature vector corresponding to each character, wherein the specific process of feature extraction in the attention layer is: according to the embedding vector corresponding to each character, determine the query vector, key vector and value vector corresponding to each character; multiply the query vector corresponding to the target character among the characters by the key vector corresponding to each character to obtain the attention score of each character for the target character; multiply the attention score corresponding to each character and the value vector and sum them to obtain the first feature vector corresponding to the target character.
[0061] For an embodiment of the present invention, in the process of obtaining the first feature vector corresponding to each character, the embedding vector corresponding to each character in the sentence to be predicted can be multiplied by the weight matrix corresponding to the attention layer in the preset BERT model to obtain the query vector, key vector and value vector corresponding to each character. Furthermore, it is necessary to calculate the attention score corresponding to each character. When calculating the attention score corresponding to any one of the characters (target character), it is necessary to use each character in the sentence to be predicted to score the target character. Specifically, the query vector corresponding to the target character is multiplied by the key vector corresponding to each character to obtain the score value of each character for the target character, that is, the attention score. Then, the attention score corresponding to each character is multiplied and summed with the value vector, and finally the attention layer output vector corresponding to the target character is obtained, that is, the first feature vector corresponding to the target character. Therefore, the first feature vector corresponding to each character can be determined in the above manner, so that the semantic information vector corresponding to the sentence to be predicted can be obtained using the first feature vector corresponding to each character.
[0062] Furthermore, in order to obtain the semantic information vector corresponding to the sentence to be predicted, after the embedding vector corresponding to each character in the sentence to be predicted is input into the attention layer of the first encoder and the first feature vector corresponding to each character is extracted, it is necessary to add the first feature vector to the embedding vector corresponding to each character to obtain the second feature vector corresponding to each character, and input the second feature vector into the feedforward neural network layer of the first encoder for feature extraction to obtain the output vector of the first encoder. Because the preset BERT model in the embodiment of the present invention includes multiple encoders, and the multiple encoders are connected in series end to end, the output vector of the first encoder is input into the second encoder for feature extraction to obtain the output vector of the second encoder, so that the output vector of the previous encoder is used as the input vector of the next encoder, and finally the output vector of the last encoder is determined as the semantic information vector corresponding to the sentence to be predicted, and then the semantic information necklace is input into the prediction classifier for classification to obtain the content to be filled in the sentence to be predicted.
[0063] 205. Input the semantic information vector into a preset classifier for classification to obtain the content to be filled in the sentence to be predicted.
[0064] For the embodiment of the present invention, after obtaining the semantic information vector corresponding to the sentence to be predicted, in order to predict the content to be filled in the sentence to be predicted based on the semantic information vector, step 205 specifically includes: inputting the semantic information vector into the preset classifier for classification to obtain probability values of different filling-in-the-blank contents corresponding to the sentence to be predicted; determining the maximum probability value among the probability values, and determining the filling-in-the-blank content corresponding to the maximum probability value as the content to be filled in the sentence to be predicted.
[0065] The preset classifier may specifically be a preset multi-layer perceptron, which includes an input layer, a hidden layer, and an output layer.
[0066] Specifically, after determining the semantic information vector corresponding to the sentence to be predicted, the semantic information vector is input to the hidden layer through the input layer of the preset multi-layer perceptron. The result output by the hidden layer is:
[0067] f(W1x+b1)
[0068] Among them, x is the semantic information vector corresponding to the sentence to be predicted, W1 is the weight of the hidden layer, which is also the connection coefficient of the preset multi-layer perceptron, b1 is the bias coefficient of the hidden layer, and the f function can usually use the sigmoid function or the tanh function, as shown below:
[0069] sigmoid(x)=1 / (1+e -x )
[0070] tanh(x)=(e x -e -x ) / (e x +e -x )
[0071] Furthermore, the semantic information vector corresponding to the sentence to be predicted is input into the hidden layer through the input layer of the preset multi-layer perceptron. After obtaining the output result of the hidden layer, the result is input into the output layer and classified by the output layer. The classification result obtained is:
[0072] softmax(W2f(W1x+b1)+b2)
[0073] Among them, W2 is the weight coefficient of the output layer, b2 is the bias coefficient of the output layer, and by presetting the output layer of the multilayer perceptron, the probability values of different fill-in-the-blank contents corresponding to the sentence to be predicted can be output, and the maximum probability value can be determined among the probability values. Finally, the fill-in-the-blank content corresponding to the maximum probability value is determined as the content to be filled in the sentence to be predicted.
[0074] According to another information prediction method provided by the present invention, compared with the current information prediction method using a neural network model constructed with sample medical record data, the present invention obtains the disease information of the patient to be predicted; and determines an information template that matches the prediction information, and generates a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension; finally, a preset information prediction model is used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record text with information of different dimensions blocked, thereby Disease information is generated into a sentence to be predicted with prompt information of content to be filled in the blanks in the form of an information template, wherein the content to be filled in the blanks is information of any dimension, and a preset information prediction model is used to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions. This avoids the problem that the trained neural network model can only predict certain information. If other information of the patient is to be predicted, the corresponding sample medical record data needs to be obtained to rebuild the model, which reduces the burden of staff in collecting sample case data to train the model and improves the efficiency of model training.
[0075] Further, as Figure 1 The specific implementation of the present invention provides an information prediction device, such as Figure 3 As shown, the device includes: an acquisition unit 31, a generation unit 32 and a prediction unit 33.
[0076] The acquisition unit 31 can be used to acquire disease information of the patient to be predicted.
[0077] The generation unit 32 can be used to determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in, and the content to be filled in is information of any dimension.
[0078] The prediction unit 33 can be used to predict the content to be filled in the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions blocked.
[0079] In a specific application scenario, in order to predict the content to be filled in the sentence to be predicted, Figure 4 As shown, the prediction unit 33 includes a first determination module 331 , an extraction module 332 and a classification module 333 .
[0080] The first determination module 331 may be configured to determine each character included in the sentence to be predicted and an embedding vector corresponding to each character.
[0081] The extraction module 332 may be configured to input the embedding vector into the preset information prediction model to extract semantic information, thereby obtaining a semantic information vector corresponding to the sentence to be predicted.
[0082] The classification module 333 may be used to input the semantic information vector into a preset classifier for classification, thereby obtaining the content to be filled in the sentence to be predicted.
[0083] In a specific application scenario, in order to extract the semantic information vector corresponding to the sentence to be predicted, the extraction module 332 includes an extraction submodule and an addition submodule.
[0084] The extraction submodule can be used to input the embedding vector into the attention layer for feature extraction to obtain the first feature vector corresponding to each character.
[0085] The addition submodule can be used to add the first feature vector and the embedding vector to obtain the second feature vector corresponding to each character.
[0086] The extraction submodule can be used to input the second feature vector into the feedforward neural network layer for feature extraction to obtain the semantic information vector corresponding to the sentence to be predicted.
[0087] In a specific application scenario, in order to construct a preset information prediction model, the device further includes: a word segmentation unit 34 , a processing unit 35 and a construction unit 36 .
[0088] The word segmentation unit 34 can be used to perform word segmentation processing on the sample case text to obtain each word segmentation corresponding to the sample case text, and determine a first preset number of first word segmentations from each word segmentation, and determine a second preset number of second word segmentations from the remaining word segmentations of each word segmentation.
[0089] The processing unit 35 may be configured to perform masking processing on the first segmented word and replace the second segmented word with characters in a preset character dictionary to obtain a processed sample medical record text.
[0090] The prediction unit 33 may also be configured to input the processed sample medical record text into an initial information prediction model to predict the content of the occluded portion, and obtain a predicted segmentation corresponding to the first segmentation.
[0091] The construction unit 36 may be configured to construct a loss function corresponding to the initial information prediction model based on the first segmented word and the predicted segmented word.
[0092] The construction unit 36 may be specifically configured to train the initial information prediction model based on the loss function to construct the preset information prediction model.
[0093] In a specific application scenario, in order to construct the loss function corresponding to the initial information prediction model, the construction unit 36 includes a second determination module 361 , a calculation module 362 and a construction module 363 .
[0094] The second determination module 361 can be used to determine a first word segmentation vector corresponding to the first word segmentation and a second word segmentation vector corresponding to the predicted word segmentation.
[0095] The calculation module 362 can be used to calculate the vector differences at the same position between the first word segmentation vector and the second word segmentation vector.
[0096] The construction module 363 can be used to construct a loss function corresponding to the initial information prediction model by calculating the sum of squares of the respective vector differences.
[0097] In a specific application scenario, in order to obtain the content to be filled in the sentence to be predicted, the classification module 333 includes a classification submodule and a determination submodule.
[0098] The classification submodule can be used to input the semantic information vector into the preset classifier for classification, and obtain probability values of different fill-in-the-blank contents corresponding to the sentence to be predicted.
[0099] The determination submodule may be configured to determine a maximum probability value among the probability values, and determine the fill-in-the-blank content corresponding to the maximum probability value as the content to be filled-in in the sentence to be predicted.
[0100] In a specific application scenario, in order to determine the information template that matches the disease information, the generating unit 32 may be specifically configured to determine the information template that matches the prediction information from a preset information template table.
[0101] It should be noted that for other corresponding descriptions of the functional modules involved in the information prediction device provided in the embodiment of the present invention, please refer to Figure 1 The corresponding description of the method shown will not be repeated here.
[0102] Based on the above Figure 1 The method shown, accordingly, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, which implements the following steps when executed by a processor: obtaining disease information of the patient to be predicted; determining an information template that matches the prediction information, and generating a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blanks, and the content to be filled in the blanks is information of any dimension; using a preset information prediction model to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record text with blocked information of different dimensions.
[0103] Based on the above Figure 1 The method shown and Figure 3 The embodiment of the device shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 5 As shown, the computer device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43. When the processor 41 executes the program, the following steps are implemented: obtaining disease information of the patient to be predicted; determining an information template that matches the predicted information, and generating a sentence to be predicted corresponding to the disease information based on the information template, wherein the sentence to be predicted contains prompt information corresponding to the content to be filled in the blanks, and the content to be filled in the blanks is information of any dimension; using a preset information prediction model to predict the content to be filled in the sentence to be predicted, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions obscured.
[0104] According to the technical solution of the present invention, the present invention obtains disease information of a patient to be predicted; determines an information template matching the prediction information, and generates a sentence to be predicted corresponding to the disease information according to the information template, wherein the sentence to be predicted includes prompt information corresponding to the content to be filled in the blank, and the content to be filled in the blank is information of any dimension; and finally predicts the content to be filled in the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions. Thus, by generating a sentence to be predicted with prompt information of the content to be filled in the blank according to the form of an information template, wherein the content to be filled in the blank is information of any dimension, and predicting the content to be filled in the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with blocked information of different dimensions, the problem that the trained neural network model can only predict certain information and needs to obtain corresponding sample medical record data to reconstruct the model if it is to predict other information of the patient can be avoided, thereby reducing the burden of staff on collecting sample case data to train the model and improving the efficiency of model training.
[0105] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0106] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. An information prediction method, characterized in that: include: Obtain disease information of the patient to be predicted; Determine an information template that matches the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the content to be filled in is information of any dimension, and the information template includes disease information, prompt information, and content to be filled in; Predicting the content to be filled in the blanks of the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained by sample medical record texts with information of different dimensions obscured, and the sentence to be predicted includes prompt information corresponding to the content to be filled in, and the prompt information is used to indicate the information prediction dimension of the preset information prediction model; Predicting the content to be filled in the blank in the sentence to be predicted using a preset information prediction model includes: Determining each character contained in the sentence to be predicted and the embedding vector corresponding to each character; inputting the embedding vector into the preset information prediction model to extract semantic information to obtain a semantic information vector corresponding to the sentence to be predicted; inputting the semantic information vector into a preset classifier for classification to obtain the content to be filled in the sentence to be predicted; Inputting the semantic information vector into a preset classifier for classification to obtain the content to be filled in the sentence to be predicted, including: The semantic information vector is input into the preset classifier for classification to obtain probability values of different fill-in-the-blank contents corresponding to the sentence to be predicted; the maximum probability value is determined among the probability values, and the fill-in-the-blank content corresponding to the maximum probability value is determined as the fill-in-the-blank content in the sentence to be predicted.
2. The method according to claim 1, characterized in that The preset information prediction model is a preset encoder, which includes an attention layer and a feedforward neural network layer. Inputting the embedding vector into the preset information prediction model to extract semantic information to obtain a semantic information vector corresponding to the sentence to be predicted includes: Inputting the embedding vector into the attention layer for feature extraction to obtain the first feature vector corresponding to each character; Adding the first feature vector and the embedding vector to obtain a second feature vector corresponding to each character; The second feature vector is input into the feedforward neural network layer for feature extraction to obtain a semantic information vector corresponding to the sentence to be predicted.
3. The method according to claim 1, characterized in that Before predicting the content to be filled in the blank of the sentence to be predicted using the preset information prediction model, the method further includes: Performing word segmentation processing on the sample medical record text to obtain each word segmentation corresponding to the sample medical record text, and determining a first preset number of first word segmentations from each word segmentation, and determining a second preset number of second word segmentations from each word segmentation after removing the first word segmentations; Performing masking processing on the first segmented word and replacing the second segmented word with characters in a preset character dictionary to obtain a processed sample medical record text; Inputting the processed sample medical record text into the initial information prediction model to predict the content of the occluded part, and obtaining the predicted participle corresponding to the first participle; Based on the first participle and the predicted participle, constructing a loss function corresponding to the initial information prediction model; The initial information prediction model is trained based on the loss function to construct the preset information prediction model.
4. The method according to claim 3, characterized in that The constructing a loss function corresponding to the initial information prediction model based on the first segmentation and the predicted segmentation includes: Determine a first word segmentation vector corresponding to the first word segmentation, and a second word segmentation vector corresponding to the predicted word segmentation; Calculate the vector differences between the first word segmentation vector and the second word segmentation vector at the same position; By calculating the sum of the squares of the vector differences, a loss function corresponding to the initial information prediction model is constructed.
5. The method according to claim 1, wherein The determining of the information template matching the prediction information includes: An information template matching the predicted information is determined from a preset information template table.
6. An information prediction device, characterized in that: include: An acquisition unit, used for acquiring disease information of the patient to be predicted; A generating unit, configured to determine an information template matching the prediction information, and generate a sentence to be predicted corresponding to the disease information based on the information template, wherein the content to be filled in is information of any dimension, and the information template includes the disease information, prompt information, and content to be filled in; A prediction unit is configured to predict content to be filled in the sentence to be predicted using a preset information prediction model, wherein the preset information prediction model is trained using sample medical record text with information of different dimensions obscured, the sentence to be predicted includes prompt information corresponding to the content to be filled in, and the prompt information is used to indicate the information prediction dimension of the preset information prediction model; predicting the content to be filled in the sentence to be predicted using the preset information prediction model includes: determining each character contained in the sentence to be predicted and an embedding vector corresponding to each character; inputting the embedding vector into the preset information prediction model to extract semantic information to obtain a semantic information vector corresponding to the sentence to be predicted; inputting the semantic information vector into a preset classifier for classification to obtain content to be filled in the sentence to be predicted; inputting the semantic information vector into the preset classifier for classification to obtain content to be filled in the sentence to be predicted, including: inputting the semantic information vector into the preset classifier for classification to obtain probability values of different fill-in-the-blank contents corresponding to the sentence to be predicted; determining a maximum probability value among the probability values, and determining the fill-in-the-blank content corresponding to the maximum probability value as the content to be filled in the sentence to be predicted.
7. A computer-readable storage medium, characterized in that A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the steps of the method according to any one of claims 1 to 5 are implemented when the computer program is executed by the processor.
Citation Information
Patent Citations
Diagnosis and treatment scheme prediction method and device
CN110297908A
Text data processing method and device
CN111309908A