Disease prediction device, method, equipment and storage medium based on machine learning
Through the processing method of splitting and splicing consultation data, a machine learning-based disease prediction model is constructed, which solves the problem of insufficient processing capabilities for long text information in the existing technology, and significantly improves the accuracy of disease prediction.
Patent Information
- Application Number
- CN202210695664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-06-20
AI Technical Summary
In the prior art, the disease prediction model has limited ability to process long text information, and it is difficult to accurately extract key points, resulting in low accuracy of disease prediction.
The consultation sample data is processed into unstructured text vector representation sequences and structured text vector representation sequences with different granularity through the split module, and then stitched them into the prediction model for training to build a disease prediction model to make full use of the consultation Data information.
It significantly improves the accuracy of the disease prediction model, can effectively model structured and unstructured information in the consultation data, and improves the processing ability of long texts.
Smart Images

Figure CN114937496B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to disease prediction devices, methods, equipment and storage media based on machine learning. Background Art
[0002] With the surge in demand for online AI self-diagnosis or AI pre-triage scenarios, more and more technologies are being used to analyze doctor-patient conversation data. For relatively simple diseases, AI disease prediction models can provide diagnostic information, thereby rationally allocating scarce physician resources. For uncertain diseases or more complex scenarios, the information collected from simple communication with patients can be used to assist doctors in auxiliary diagnosis and treatment, thereby reducing the efficiency of online consultations.
[0003] In the related art, the process of disease prediction mainly uses the disease prediction model to extract key points from a single round of short text information such as the symptoms described by the patient. However, many of the patient's answers depend on the questions asked by the doctor. In many cases, different questions may correspond to the same answer, resulting in a large amount of long text information in the doctor-patient conversation data. Due to the limited processing ability of the model for long text information, it is difficult to accurately extract key points from the long text information, and it is impossible to fully and effectively model the doctor-patient conversation data, resulting in low accuracy in predicting some relatively simple diseases. Summary of the invention
[0004] In view of this, the present invention provides a disease prediction device, method, equipment and storage medium based on machine learning. The main purpose is to solve the problem in the prior art that it is difficult to accurately extract key points from long text information and cannot effectively model the doctor-patient dialogue data due to the limited processing ability of the model for long text models.
[0005] According to one aspect of the present invention, a disease prediction device based on machine learning is provided, the device comprising:
[0006] A splitting module is used to obtain sample data of medical consultations containing different disease types, and split the sample data of medical consultations into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data of medical consultations, wherein the vector representation sequence uses a feature vector to represent each sentence in the unstructured text and each word in the sentence;
[0007] An extraction module, used to extract structured text data from the medical consultation sample data, and process the structured text data into a vector representation sequence of structured text;
[0008] A construction module, used for splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model;
[0009] The prediction model is used to use the constructed disease prediction model to predict diseases on the consultation data uploaded by users and output the disease prediction results.
[0010] According to another aspect of the present invention, a disease prediction method based on machine learning is provided, the method comprising:
[0011] Obtaining sample data of medical consultations containing different disease types, splitting the sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data, wherein the vector representation sequences use feature vectors to represent each sentence in the unstructured text and each word in the sentence;
[0012] Extracting structured text data from the medical consultation sample data, and processing the structured text data into a vector representation sequence of structured text;
[0013] splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model;
[0014] Use the constructed disease prediction model to predict diseases on the consultation data uploaded by users and output the disease prediction results.
[0015] According to another aspect of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a disease prediction method based on machine learning when executing the computer program.
[0016] According to another aspect of the present invention, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a disease prediction method based on machine learning are implemented.
[0017] Through the above technical scheme, the present invention provides a disease prediction device, method, equipment and storage medium based on machine learning, by obtaining consultation sample data containing different disease types, splitting the consultation sample data into vector representation sequences of unstructured text of different granularities according to the text attributes corresponding to the consultation sample data, the vector representation sequence uses a feature vector to represent each sentence in the unstructured text and each word in the sentence, extracts structured text data from the consultation sample data, processes the structured text data into a vector representation sequence of structured text, further splices the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputs them into multiple prediction models for training and parameter learning, constructs a disease prediction model, and the server uses the constructed disease prediction model to predict diseases on the consultation data uploaded by the user, and outputs the disease prediction results. Compared with the prior art method of using a disease prediction model to perform a single-round single-text information key single extraction method to predict diseases, the present application can model the sentence granularity and text granularity in the medical consultation data, which greatly alleviates the defect of the prior art that long texts cannot be effectively modeled, and controls the length that the model can process to the length of a single sentence. It is no longer limited to the use of the patient's response information, but includes complete medical consultation data and retains contextual information, so that the model can fully model the information of the medical consultation data, and can use the structured information and unstructured information in the medical consultation data as features for model training at the vector level, significantly improving the disease prediction accuracy of the multi-prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0019] Figure 1 is a structural schematic diagram of a disease prediction device based on machine learning in one embodiment of the present invention;
[0020] Figure 2 is a schematic diagram of an application environment of a disease prediction method based on machine learning in one embodiment of the present invention;
[0021] Figure 3 is a flow chart of a disease prediction method based on machine learning in one embodiment of the present invention;
[0022] Figure 4 yes Figure 2 A schematic flow chart of a specific implementation of step S10;
[0023] Figure 5 yes Figure 3 A schematic flow chart of a specific implementation of step S12;
[0024] Figure 6 yes Figure 3 A schematic flow chart of a specific implementation of step S13;
[0025] Figure 7 yes Figure 2 A schematic flow chart of a specific implementation of step S20;
[0026] Figure 8 It is a schematic diagram of the process of training and parameter learning of multiple prediction models in one embodiment of the present invention;
[0027] Fig. 9 is a flow chart of modeling processing for each character in a text sentence in one embodiment of the present invention;
[0028] Fig.10 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0029] Fig.11 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0030] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0031] In one embodiment, a disease prediction device based on machine learning is provided, such as Figure 1 As shown, the disease prediction device based on machine learning includes a splitting module 101, an extraction module 102, a construction module 103 and a prediction model 104. The detailed description of each functional module is as follows:
[0032] The splitting module 101 is used to obtain sample data of medical consultations containing different disease types, and split the sample data of medical consultations into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data of medical consultations, wherein the vector representation sequences use feature vectors to represent each sentence in the unstructured text and each word in the sentence;
[0033] An extraction module 102, configured to extract structured text data from the medical consultation sample data, and process the structured text data into a vector representation sequence of structured text;
[0034] A construction module 103 is used to splice the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and input them into a multi-prediction model for training and parameter learning to construct a disease prediction model;
[0035] The prediction model 104 is used to use the constructed disease prediction model to perform disease prediction on the medical consultation data uploaded by the user and output the disease prediction result.
[0036] In one embodiment, the splitting module is specifically used to:
[0037] Summarize the online consultation data collected by various medical platforms, filter out consultation data of multiple disease types from the online consultation data, and obtain consultation sample data containing different disease types;
[0038] Splitting the medical consultation sample data into unstructured text sentences of different text lengths according to text attributes corresponding to the medical consultation sample data;
[0039] Modeling is performed on the unstructured text sentences of different text lengths to obtain vector representation sequences of unstructured texts of different granularities.
[0040] In one embodiment, the splitting module is further used for:
[0041] According to the text attributes corresponding to the medical consultation sample data, traverse each text sentence in the medical consultation sample data, and determine if the proportion of the length of each text sentence in the total text length reaches a preset value, then split the text sentence from the medical consultation sample data;
[0042] Otherwise, the text sentence is merged into adjacent text sentences to form unstructured text sentences with different text lengths.
[0043] In one embodiment, the splitting module is further used for:
[0044] Taking the characters in the unstructured text sentences of different text lengths as units, modeling the characters in each unstructured text sentence using an embedding layer including a first structural parameter to obtain a vector representation sequence of the unstructured text sentence;
[0045] Taking the vector representation sequence of the unstructured text sentences as a unit, each unstructured text sentence is modeled using an embedding layer containing a second structural parameter to obtain a vector representation sequence of the unstructured text.
[0046] In one embodiment, the splitting module is further used for:
[0047] Taking the characters in the unstructured text sentences of different text lengths as units, special characters are spliced at positions before all the character representations of the unstructured text sentences to form a character sequence of the unstructured text for each text sentence;
[0048] The character sequence of the unstructured text is input into an embedding layer including a first structural parameter, so that each character in the text sentence is converted into a vector of a first preset dimension, thereby obtaining a vector representation sequence of the unstructured text sentence.
[0049] In one embodiment, the splitting module is further used for:
[0050] Taking the feature representation sequence of the unstructured text sentence as a unit, the vectors of the corresponding positions of the special characters are spliced before the feature representation sequence of all the unstructured text sentences, and the sentence sequence of the unstructured text is formed for all the text sentences, wherein the vectors of the corresponding positions of the special characters summarize the information of all the characters in the text sentences;
[0051] The sentence sequence of the unstructured text is input into an embedding layer including a second structural parameter, so that each sentence in the text is converted into a vector of a second preset dimension, thereby obtaining a vector representation sequence of the unstructured text.
[0052] In one embodiment, the extraction module is specifically used to:
[0053] According to the preset attribute tags, extracting structured text data matching the attribute tags from the medical consultation sample data;
[0054] The structured text data is input into an embedding layer including a third structural parameter for modeling processing, so that each attribute label in the structured text data is converted into a vector of a second preset dimension, and a vector representation sequence of the structured text is obtained.
[0055] This embodiment provides a disease prediction device based on machine learning. Taking into account the applicability of conversation tasks for different application scenarios, by splicing conversation samples with slot description information and intention state information, all required results are output at one time, which can effectively convey semantic information and force the model to learn the matching relationship between slots or intentions and conversation samples during the training process, thereby improving the semantic understanding of the model during the training process, generalizing the model to new prediction tasks, and allowing the knowledge learned by the model to be extended to the intentions of other application scenarios.
[0056] The present invention also provides a disease prediction method based on machine learning, which can be applied in Figure 2In an application environment, the client communicates with the server through a network. The server can obtain sample data of medical consultations containing different types of diseases, split the sample data of medical consultations into vector representation sequences of unstructured texts of different granularities according to the text attributes corresponding to the sample data of medical consultations, and use feature vectors to represent each sentence in the unstructured text and each word in the sentence. Structured text data is extracted from the sample data of medical consultations, and the structured text data is processed into a vector representation sequence of structured text. The vector representation sequence of unstructured text and the vector representation sequence of structured text are further spliced and input into multiple prediction models for training and parameter learning, and a disease prediction model is constructed. The constructed disease prediction model is used by the client server to predict diseases on the medical consultation data uploaded by the user, and the disease prediction results are fed back to the client. In the present invention, modeling is performed for the sentence granularity and text granularity in the medical consultation data, which greatly alleviates the defect of the prior art that long texts cannot be effectively modeled, and the length that the model can process is controlled to the length of a single sentence. It is no longer limited to the use of the patient's reply information, but includes complete medical consultation data, retains context information, so that the model can fully model the information of the medical consultation data, and can use the structured information and unstructured information in the medical consultation data as features for model training at the vector level, which significantly improves the disease prediction accuracy of the multi-prediction model. Among them, the client can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.
[0057] For the execution process of each module in the above-mentioned disease prediction device based on machine learning, please refer to Figure 3 As shown, Figure 3 A flow chart of a disease prediction method based on machine learning provided in an embodiment of the present invention, which corresponds one-to-one to the disease prediction device based on machine learning in the above embodiment. It includes the following steps:
[0058] S10, obtaining sample data of medical consultations containing different disease types, and splitting the sample data of medical consultations into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data of medical consultations.
[0059] The disease prediction method based on machine learning provided by the present invention, the disease prediction model obtained by training can be applied to the consultation engine such as intelligent customer service or intelligent assistant in the consultation scenario. The consultation engine is usually implemented by a server, which can receive the consultation data initiated by the patient in real time, and output the disease prediction results according to the consultation data, and then make corresponding replies. For example, in the intelligent consultation scenario, the patient can initiate a conversation by phone or online chat, and often needs to use the consultation engine to answer some disease questions or make a preliminary diagnosis based on the symptom information provided by the patient, so as to assist subsequent doctors in diagnosis and treatment. Here, the intelligent consultation engine needs to extract key points from the questions or symptom information raised by the patient, and then reply to the questions raised by the patient or preliminarily diagnose the type of disease based on the extracted key points.
[0060] For example, the conversation sentence initiated by the patient is "I have had some migraines recently, and my body temperature is normal." After receiving the conversation sentence, the intelligent consultation engine needs to extract key points from the symptom information provided by the patient, and extract that the patient has migraines and a normal body temperature. It is understandable that in the online diagnosis scenario, it is impossible to predict the disease based solely on this symptom information. The intelligent consultation engine can also further ask the patient whether the patient has other symptom information based on the disease pointed to by the symptom information, and then output the disease prediction result based on the symptom information provided by the patient again.
[0061] Among them, the consultation sample data of different disease types can be the consultation data collected from various digital medical platforms. Here, the digital medical platform is equivalent to the medical cloud, which means that on the basis of new technologies such as cloud computing, mobile technology, multimedia, 4G communication, big data and the Internet of Things, combined with medical technology, the use of "cloud computing" to create a medical and health service platform has achieved the sharing of medical resources and the expansion of medical scope. Because of the application and combination of cloud computing technology, the medical cloud improves the efficiency of medical institutions and facilitates residents' medical treatment. For example, the current hospital appointment registration, electronic medical records, medical insurance and other resources are the product of the combination of cloud computing and the medical field. The medical cloud also has the advantages of data security, information sharing, dynamic expansion, and overall layout.
[0062] Normally, the sample data of medical consultations are stored in the platform of various medical institutions in the form of unstructured text. Here, the text attributes can be the length of the text, the complexity of the text, and the initiator of the text. Considering the granularity of the text during the splitting process, the text sentences and the words in the text sentences can be used as the basis for splitting. For example, the text sentences can be split as units, the number of words in the text can be split as units, and the initiator of the text can be split. There is no limitation here. The further split text can be processed into vector representation sequences of unstructured texts of different granularities through modeling.
[0063] It should be understood that the modeling process here is equivalent to feature representation of text, that is, obtaining unstructured feature vectors. The vector representation sequence uses feature vectors to represent each sentence in the unstructured text and each word in the sentence. Figure 4 As shown, in step S10, that is, obtaining consultation sample data containing different disease types, splitting the consultation sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the consultation sample data, includes the following steps:
[0064] S11. Summarize the online consultation data collected by various medical platforms, filter out consultation data of various disease types from the online consultation data, and obtain consultation sample data containing different disease types.
[0065] S12: Split the medical consultation sample data into unstructured text sentences of different text lengths according to text attributes corresponding to the medical consultation sample data.
[0066] S13. Modeling the unstructured text sentences of different text lengths to obtain vector representation sequences of unstructured texts of different granularities.
[0067] For steps S11-S13, each medical platform may include online platforms corresponding to medical institutions, health management centers, hospitals, and clinics. After each medical platform collects online consultation data, since the online consultation data can be the patient's consultation data on different types of diseases, it can also be online diagnosis data on different types of diseases. Here, the online consultation data can be classified according to the disease type, and then the consultation sample data containing different disease types can be obtained. It is understandable that, considering the different disease classification methods, the disease types here can be subdivided into different granularities, for example, cardiovascular system diseases, respiratory system diseases, digestive system diseases, urinary system diseases, and blood system diseases, etc. Cardiovascular system diseases can also be subdivided into hypertension, myocardial infarction, hyperlipidemia, heart disease, etc. Specifically, for consultation data, the disease type is usually mentioned at the beginning of the doctor-patient conversation, and the online consultation data is classified according to the mentioned disease type. For diagnosis data, the disease type is usually mentioned at the end of the doctor-patient conversation, and the disease type may not have a high credibility as a diagnosis result. At this time, the online consultation data can be classified according to the disease type, and the coarse-grained disease type corresponding to the disease type can also be used as the disease type corresponding to the online consultation data. For example, if the diagnosis result is hypertension, the online consultation data can be classified into the hypertension disease type, and the online consultation data can also be classified into cardiovascular system diseases.
[0068] It should be noted here that in the process of modeling unstructured text sentences, a multi-level approach can be used to model information of different granularities in the text sentences. On the one hand, the character granularity in the text sentences can be modeled, and on the other hand, the sentence granularity in the text can be modeled, thereby alleviating the defect of related technologies that long texts cannot be effectively modeled, and long texts can be effectively modeled.
[0069] Furthermore, considering the impact of each text sentence in the consultation sample data on the disease prediction process, the length that the model can process is controlled to the length of a single text sentence. Specifically, Figure 5 As shown, in step S12, that is, splitting the sample data into unstructured text sentences of different text lengths according to the text attributes corresponding to the sample data, includes the following steps:
[0070] S121. According to the text attributes corresponding to the medical consultation sample data, traverse each text sentence in the medical consultation sample data, and determine if the proportion of the length of each text sentence in the total text length reaches a preset value, then split the text sentence from the medical consultation sample data.
[0071] S122: Otherwise, merge the text sentences into adjacent text sentences to form unstructured text sentences with different text lengths.
[0072] It is understandable that there may be a large number of text sentences with fewer words in the consultation sample data. If modeling is performed separately for the text sentences with fewer words, it will occupy processing resources to a certain extent. Here, the text sentences with fewer words can be merged with the adjacent text sentences and then the modeling process is performed. While ensuring effective modeling, the number of modeling times for the consultation sample data is reduced.
[0073] In an embodiment of the present invention, the length of a text sentence is evaluated by determining whether the proportion of the length of a text sentence in the total length of the text reaches a preset value. If the preset value is reached, it means that the length of the text sentence has reached a text length suitable for modeling. Otherwise, it means that the text sentence is not suitable for modeling and can be combined with adjacent text sentences that have reached a text length suitable for modeling. If the adjacent text sentences also do not reach a text length suitable for modeling, more text sentences can be further merged so that the merged text reaches a text length suitable for modeling. Therefore, an unstructured text sentence finally split out from the consultation sample data usually contains at least one text sentence.
[0074] Furthermore, considering the impact of each text sentence in the consultation sample data on the disease prediction process, the length that the model can process is controlled to the length of a single text sentence. Specifically, Figure 6As shown, in step S13, that is, modeling is performed on unstructured text sentences of different text lengths to obtain vector representation sequences of unstructured texts of different granularities, including the following steps:
[0075] S131. Taking the characters in the unstructured text sentences of different text lengths as units, modeling the characters in each unstructured text sentence using an embedding layer including a first structural parameter to obtain a vector representation sequence of the unstructured text sentences.
[0076] S132. Taking the vector representation sequence of the unstructured text sentences as a unit, perform modeling processing on each unstructured text sentence using an embedding layer including a second structural parameter to obtain a vector representation sequence of the unstructured text.
[0077] Among them, the embedding layer of the first structural parameter and the embedding layer of the second structural parameter have similar structures, but have different random initialization methods. The embedding layer of the first structural parameter is used to model the characters in the text sentence, and the embedding layer of the second structural parameter is used to model the text sentences in the text paragraph. Here, each layer in the embedding layer is composed of two components: a multi-head attention mechanism and a feedforward neural network. Each component is followed by a residual connection layer and a normalization operation. Among them, the multi-head attention mechanism enables the representation of each character and text sentence to be trained to be updated according to the representation of other characters or text sentences in its context, and the feedforward neural network introduces nonlinear changes and enhances the modeling ability. The first preset dimension is the vector dimension of the character representation, and the second preset dimension is the vector dimension of the text sentence representation. Here, the vector dimension of the text sentence summarizes the vector dimension of the character representation, which is equivalent to the vector representation of all characters in the text. In order to facilitate the subsequent processing of the vector representation sequence of the text sentence and the vector representation sequence of the text, the first preset dimension and the second preset dimension can be set to the same dimension.
[0078] Specifically, in the process of modeling the characters in each unstructured text sentence using an embedding layer including a first structural parameter, characters in unstructured text sentences of different text lengths are taken as units, special characters are spliced before all the character representations of the unstructured text sentences, and a character sequence of the unstructured text is formed for each text sentence. The character sequence of the unstructured text is input into the embedding layer including the first structural parameter, so that each character in the text sentence is converted into a vector of a first preset dimension, thereby obtaining a vector representation sequence of the unstructured text sentences.
[0079] Specifically, in the process of modeling each unstructured text sentence using the embedding layer containing the second structural parameters, the feature representation sequence of the unstructured text sentence is taken as a unit, and the vectors of the corresponding positions of the special characters are spliced before the feature representation sequence of all the unstructured text sentences, so as to form a sentence sequence of the unstructured text for all the text sentences, where the vectors of the corresponding positions of the special characters summarize the information of all the characters in the text sentences, and the sentence sequence of the unstructured text is input into the embedding layer containing the second structural parameters, so that each sentence in the text is converted into a vector of the second preset dimension, and the vector representation sequence of the unstructured text is obtained.
[0080] It can be understood that the role of the embedding layer is to fully model all the characters in the text sentence so that each character can be improved accordingly based on itself and other characters in the text. Here, the vector corresponding to the position of the special character is used as the feature vector of the text sentence. This vector integrates the information of all other characters in the text sentence and can more accurately extract the key points of the text sentence.
[0081] S20: extracting structured text data from the medical consultation sample data, and processing the structured text data into a vector representation sequence of structured text.
[0082] Considering that disease prediction needs to combine structured attribute information such as age and gender, and the existing disease prediction model based on deep learning architecture cannot well integrate the structured attribute information in the medical consultation data, directly splicing them together will result in incoherent sentences. Here, structured text data is extracted from the medical consultation data for separate processing, and then a vector representation sequence of the structured text is obtained.
[0083] Specifically, Figure 7 As shown, in step S20, that is, extracting structured text data from the medical consultation sample data and processing the structured text data into a vector representation sequence of the structured text, the following steps are included:
[0084] S21. According to a preset attribute tag, extract structured text data matching the attribute tag from the medical consultation sample data.
[0085] S22. Input the structured text data into an embedding layer including a third structural parameter for modeling processing, so that each attribute label in the structured text data is converted into a vector of a second preset dimension, and a vector representation sequence of the structured text is obtained.
[0086] Among them, the structure of the embedding layer of the third structural parameter is similar to the embedding layer of the first structural parameter and the embedding layer of the second structural parameter. It is mainly used to model structured text data, and then introduces structured system information such as age and gender at the feature vector level, which significantly improves the accuracy of the model's multi-classification disease prediction.
[0087] S30, splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model.
[0088] It can be understood that the medical consultation sample data usually contains multiple disease types. For each disease type, the vector representation sequence of unstructured text and the vector representation sequence of structured text obtained from the medical consultation sample data are used as the feature representation of the medical consultation sample data and input into the multi-prediction model for training and parameter information. The multi-prediction model can predict the probability value of the vector representation of different disease types based on the feature representation of the medical consultation sample data, and take the disease type with the highest probability value as the disease prediction result, and further evaluate the classification effect. The loss value is calculated by inputting the probability value corresponding to the disease prediction result and the actual value of the disease type corresponding to the medical consultation sample data into a pre-set loss function. If the loss value does not reach convergence, the training and parameter learning process of the above-mentioned multi-prediction model is repeated. If the loss value reaches convergence, it is determined that the multi-prediction model has achieved the training effect, and the training and parameter learning process of the multi-prediction model is ended, and the trained multi-prediction model is used as the disease prediction model.
[0089] Normally, the multi-prediction model will set n output nodes, where n is the number of categories. For each disease type, the multi-prediction model can obtain an n-dimensional array as the output result. Exemplarily, there are 10 disease types, numbered 0-9. For the disease type numbered 2, the closer the output result of the multi-prediction model is to [0,1,0,0,0,0,0,0,0,0], the better. If the output result of the multi-prediction model deviates from [0,1,0,0,0,0,0,0,0,0,0], the process of training and parameter learning of the multi-prediction model is repeated. Specifically, in the process of training and parameter learning of the multi-prediction model, the training can use the common classification cross entropy loss function, and the parameter learning can use the gradient descent algorithm or the stochastic gradient descent algorithm to optimize the classification cross entropy loss function until the loss value output by the loss function is reduced to a reasonable threshold, completing the model training and parameter learning process, and constructing a disease prediction model.
[0090] As an implementation method, for the consultation sample data including n rounds of dialogue between doctors and patients, the vector representation sequence of a segment of text obtained by splitting is History = [S1, S2, S3, S4, S5, S6, ..., Si, ..., Sn], where Si represents what the doctor or patient said, and the vector representation sequence of each text sentence can be specifically expressed as Si = [Si_1, Si_2, Si_3, Si_4, Si_5, Si_6, ..., Si_j, ..., Si_t], where t represents the length of the text, and Si_j represents the jth word in the Si text. The specific process of training and parameter learning of the multi-prediction model can be referred to Figure 8 As shown, on the one hand, for the unstructured text in the consultation data, the words in each text sentence are summarized to obtain HSi for modeling, and the feature vector representations [HS1, HS2, HS3, HS4, HS5, HS6, …, HSi, …, HSn] of all text sentences in the text are concatenated with the vector H[CLS] corresponding to the position of the feature character [CLS]. This vector comprehensively considers the information of all other words in the sentence Si. The concatenated vector is passed through an embedding layer containing the second structural parameter to convert all text sentences in the text into vectors of fixed dimensions, and then an unstructured feature vector that integrates the information of all text sentences is output. On the other hand, for the structured text age and gender extracted from the consultation data, the unstructured text is passed through an embedding layer containing the third structural parameter to obtain a structured feature vector. The final feature vector is obtained based on the unstructured feature vector and the structured feature vector. The loss function is used to determine whether the final feature vector meets the training termination condition. If so, the training and parameter learning process of the multi-prediction model is completed to construct a disease prediction model. The specific process of modeling the words in each text sentence can be referred to. Fig. 9 As shown, Fig. 9 After the special character [CLS] is concatenated with Si, each word in the text sentence is converted into a vector of fixed dimension through an embedding layer containing the first structural parameter. Here, the dimension is set to 768, and the feature vector table HSi of the text sentence Si is output.
[0091] S40: Use the constructed disease prediction model to predict diseases on the medical consultation data uploaded by the user, and output the disease prediction results.
[0092] Specifically, in an actual online consultation scenario, as the patient and the intelligent consultation assistant continue to communicate, the conversation between the two will generate a large number of text sentences. All text sentences are further passed through the disease prediction model trained in steps S10 to S30 to achieve online disease prediction.
[0093] For the specific definition of the disease prediction method based on machine learning, please refer to the definition of the disease prediction device based on machine learning above, which will not be repeated here. Each module in the above-mentioned disease prediction device based on machine learning can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0094] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements a function or step on the server side of a disease prediction method based on machine learning.
[0095] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the client side of a disease prediction method based on machine learning.
[0096] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0097] Obtaining sample data of medical consultations containing different disease types, splitting the sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data, wherein the vector representation sequences use feature vectors to represent each sentence in the unstructured text and each word in the sentence;
[0098] Extracting structured text data from the medical consultation sample data, and processing the structured text data into a vector representation sequence of structured text;
[0099] splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model;
[0100] Use the constructed disease prediction model to predict diseases on the consultation data uploaded by users and output the disease prediction results.
[0101] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0102] Obtaining sample data of medical consultations containing different disease types, splitting the sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data, wherein the vector representation sequences use feature vectors to represent each sentence in the unstructured text and each word in the sentence;
[0103] Extracting structured text data from the medical consultation sample data, and processing the structured text data into a vector representation sequence of structured text;
[0104] splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model;
[0105] Use the constructed disease prediction model to predict diseases on the consultation data uploaded by users and output the disease prediction results.
[0106] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0107] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0108] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0109] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A disease prediction device based on machine learning, characterized in that: The device comprises: A splitting module is used to obtain sample data of medical consultations containing different disease types, and split the sample data of medical consultations into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data of medical consultations, wherein the vector representation sequence uses a feature vector to represent each sentence in the unstructured text and each word in the sentence; An extraction module, used to extract structured text data from the medical consultation sample data, and process the structured text data into a vector representation sequence of structured text; A construction module, used for splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model; Prediction model, used to use the constructed disease prediction model to predict diseases on the consultation data uploaded by users and output the disease prediction results; The splitting module is specifically used to: aggregate the online consultation data collected by various medical platforms, filter out consultation data of multiple disease types from the online consultation data, and obtain consultation sample data containing different disease types; split the consultation sample data into unstructured text sentences of different text lengths according to the text attributes corresponding to the consultation sample data; perform modeling processing on the unstructured text sentences of different text lengths to obtain vector representation sequences of unstructured texts of different granularities; The splitting module is further used to: take the characters in the unstructured text sentences of different text lengths as units, use the embedding layer containing the first structural parameter to perform modeling processing on the characters in each unstructured text sentence, and obtain the vector representation sequence of the unstructured text sentence; take the vector representation sequence of the unstructured text sentences as units, use the embedding layer containing the second structural parameter to perform modeling processing on each unstructured text sentence, and obtain the vector representation sequence of the unstructured text; The splitting module is also used to: take the characters in the unstructured text sentences of different text lengths as units, splice special characters at the position before all the character representations of the unstructured text sentences, and form a character sequence of the unstructured text for each text sentence; input the character sequence of the unstructured text into an embedding layer including a first structural parameter, so that each character in the text sentence is converted into a vector of a first preset dimension, and obtain a vector representation sequence of the unstructured text sentence.
2. The device according to claim 1, characterized in that The splitting module is also used for: According to the text attributes corresponding to the medical consultation sample data, traverse each text sentence in the medical consultation sample data, and determine if the proportion of the length of each text sentence in the total text length reaches a preset value, then split the text sentence from the medical consultation sample data; Otherwise, the text sentence is merged into adjacent text sentences to form unstructured text sentences with different text lengths.
3. The device according to claim 1, characterized in that The splitting module is also used for: Taking the feature representation sequence of the unstructured text sentence as a unit, the vectors of the corresponding positions of the special characters are spliced before the feature representation sequence of all the unstructured text sentences, and the sentence sequence of the unstructured text is formed for all the text sentences, wherein the vectors of the corresponding positions of the special characters summarize the information of all the characters in the text sentences; The sentence sequence of the unstructured text is input into an embedding layer including a second structural parameter, so that each sentence in the text is converted into a vector of a second preset dimension, thereby obtaining a vector representation sequence of the unstructured text.
4. The device according to any one of claims 1 to 3, characterized in that The extraction module is specifically used for: According to the preset attribute tags, extracting structured text data matching the attribute tags from the medical consultation sample data; The structured text data is input into an embedding layer including a third structural parameter for modeling processing, so that each attribute label in the structured text data is converted into a vector of a second preset dimension, and a vector representation sequence of the structured text is obtained.
5. A disease prediction method based on machine learning, characterized in that: The method comprises: Obtaining sample data of medical consultations containing different disease types, splitting the sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the sample data, wherein the vector representation sequences use feature vectors to represent each sentence in the unstructured text and each word in the sentence; Extracting structured text data from the medical consultation sample data, and processing the structured text data into a vector representation sequence of structured text; splicing the vector representation sequence of the unstructured text and the vector representation sequence of the structured text and inputting them into a multi-prediction model for training and parameter learning to construct a disease prediction model; Use the constructed disease prediction model to predict diseases based on the medical consultation data uploaded by users and output the disease prediction results; The method of obtaining consultation sample data containing different disease types and splitting the consultation sample data into vector representation sequences of unstructured texts of different granularities according to text attributes corresponding to the consultation sample data specifically includes: aggregating online consultation data collected by various medical platforms, screening consultation data of multiple disease types from the online consultation data, and obtaining consultation sample data containing different disease types; splitting the consultation sample data into unstructured text sentences of different text lengths according to the text attributes corresponding to the consultation sample data; taking the characters in the unstructured text sentences of different text lengths as units, splicing special characters at positions before all the character representations of the unstructured text sentences, and forming a character sequence of unstructured text for each text sentence; inputting the character sequence of the unstructured text into an embedding layer containing a first structural parameter, so that each character in the text sentence is converted into a vector of a first preset dimension, and obtaining a vector representation sequence of the unstructured text sentence; taking the vector representation sequence of the unstructured text sentence as units, modeling each unstructured text sentence using an embedding layer containing a second structural parameter, and obtaining a vector representation sequence of the unstructured text.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to claim 5 are implemented.
7. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 5 are implemented.
