Classification method and device based on multi-label prediction, equipment and storage medium
By using a multi-label prediction model in smart devices to predict and classify symptom text in medical text data, the problem that smart devices cannot accurately identify and classify symptom texts is solved, and the accuracy of symptom text classification results is improved.
Patent Information
- Application Number
- CN202411692074.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-07
AI Technical Summary
Existing smart devices cannot accurately identify and classify symptom texts in user consultation descriptions, resulting in a decrease in the accuracy of symptom text classification results.
The classification method based on multi-label prediction is adopted to predict physical symptoms and disease symptoms in the medical text data through the multi-label prediction model, obtain the probability value of each symptom text, and input it into the corresponding classification model for further classification.
It improves the accuracy of symptom text classification results, can more accurately identify and classify physical constitution descriptions and disease descriptions, and enhances the analytical ability of medical text data.
Smart Images

Figure CN119577514A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of machine learning and digital medicine, and in particular to a classification method, device, computer equipment and computer-readable storage medium based on multi-label prediction. Background Art
[0002] With the rise of machine learning technology and digital medical technology, machine learning models are being applied in more and more fields, such as speech recognition, medical diagnosis, and application testing. Specifically, intelligent questions can be used for intelligent diagnosis and treatment to obtain the user's medical description, and then use the machine learning model to make a medical diagnosis for the user based on the medical description. However, when describing the medical description, the user will mix the description of the constitution and the description of the disease, and the user's constitution usually affects the diagnosis of the disease. At present, when smart devices diagnose users, they cannot accurately identify and classify the symptoms in the user's medical description, thereby reducing the accuracy of the symptom text classification results. Therefore, how to improve the accuracy of the symptom text classification results has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the present invention is to provide a classification method, device, equipment and computer-readable storage medium based on multi-label prediction, aiming to improve the technical problem of the accuracy of symptom text classification results.
[0004] To achieve the above object, the present invention provides a classification method based on multi-label prediction, the method comprising:
[0005] Acquire medical text data of the current user, and segment the medical text data according to punctuation marks in the medical text data to obtain at least one sentence;
[0006] Using a multi-label prediction model, predicting the symptom category of each symptom text in a target sentence containing the symptom text, and obtaining a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom;
[0007] According to the probability value of each symptom text in the target sentence being a physical symptom and the probability value of a disease symptom, determining at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and the probability value of the disease symptom;
[0008] The target physical symptom text corresponding to the physical symptom and its corresponding probability value are input into the physical classification model to obtain the physical classification result of the current user; the target disease symptom text corresponding to the disease symptom and its corresponding probability value are input into the disease classification model to obtain the disease classification result of the current user.
[0009] In addition, to achieve the above-mentioned purpose, the present invention also provides a classification device based on multi-label prediction, and the classification device based on multi-label prediction includes:
[0010] A text data segmentation module, used to obtain medical text data of the current user, and segment the medical text data according to punctuation marks in the medical text data to obtain at least one sentence;
[0011] A symptom distribution prediction module is used to predict the symptom category of each symptom text in a target sentence containing the symptom text through a multi-label prediction model, and obtain a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom;
[0012] A symptom distribution determination module, for determining at least one target symptom text corresponding to the current user and the probability values of the target symptom texts being the physical symptoms and the disease symptoms, respectively, according to the probability values of each symptom text in the target sentence being the physical symptoms and the disease symptoms, respectively;
[0013] The classification result output module is used to input the target physical symptom text corresponding to the physical symptoms and the corresponding probability value into the physical classification model to obtain the physical classification result of the current user, and input the target disease symptom text corresponding to the disease symptoms and the corresponding probability value into the disease classification model to obtain the disease classification result of the current user.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes a processor, a memory, and a classification program based on multi-label prediction stored in the memory and executable by the processor, wherein when the classification program based on multi-label prediction is executed by the processor, the steps of the classification method based on multi-label prediction as described above are implemented.
[0015] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a classification program based on multi-label prediction is stored, wherein when the classification program based on multi-label prediction is executed by a processor, the steps of the classification method based on multi-label prediction as described above are implemented.
[0016] The present application provides a classification method based on multi-label prediction, the method obtains the medical text data of the current user, and according to the punctuation marks in the medical text data, the medical text data is segmented to obtain at least one sentence; through the multi-label prediction model, the symptom category is predicted for each symptom text in the target sentence containing the symptom text, and the probability value of each symptom text in the target sentence is obtained as a physical symptom and a probability value of a disease symptom; according to the probability value of each symptom text in the target sentence as a physical symptom and a probability value of a disease symptom, at least one target symptom text corresponding to the current user and the probability value of the target symptom text as a physical symptom and a probability value of a disease symptom are determined; the target physical symptom text corresponding to the physical symptom and its corresponding probability value are input into the physical classification model to obtain the physical classification result of the current user, and the target disease symptom text corresponding to the disease symptom and its corresponding probability value are input into the disease classification model to obtain the disease classification result of the current user. In the above manner, the present application segments the medical text data of the user to obtain sentences, and compares the sentences with symptom texts, and extracts the symptom texts in the sentences. Then, through the multi-label prediction model, based on the connection and difference between physical symptoms and disease symptoms, each symptom text in the sentence is predicted for physical symptoms and disease symptoms, and the probability value of each symptom text being a physical symptom and a disease symptom is obtained, so as to avoid the low accuracy of symptom classification caused by dividing the symptom text into a single symptom category. Thus, the physical description and disease description in the medical text data are accurately identified and classified. Finally, the user's physical constitution is classified through the physical classification model and the symptom text corresponding to the physical symptoms and their corresponding probability values, and the user's disease is classified through the disease classification model and the symptom text corresponding to the disease symptoms and their corresponding probability values, which improves the accuracy of physical classification and disease classification, that is, improves the accuracy of symptom text classification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a first embodiment of a classification method based on multi-label prediction according to the present invention;
[0018] Figure 2 It is a flow chart of a second embodiment of a classification method based on multi-label prediction according to the present invention;
[0019] Figure 3 This is a schematic diagram of BiLSTM model training of the present invention;
[0020] Figure 4 It is a flow chart of a third embodiment of a classification method based on multi-label prediction according to the present invention;
[0021] Figure 5A schematic diagram of a classification device based on multi-label prediction according to the present invention;
[0022] Figure 6 The figure is a schematic diagram of the hardware structure of a computer device involved in an embodiment of the present invention.
[0023] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0026] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0027] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] The classification method based on multi-label prediction involved in the embodiment of the present invention is mainly applied to computer equipment. The classification generation device based on multi-label prediction can be a PC, a portable computer, a mobile terminal or other device with display and processing functions.
[0029] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0030] Reference Figure 1 , Figure 1 It is a flowchart of the first embodiment of the classification method based on multi-label prediction of the present invention.
[0031] like Figure 1As shown, an embodiment of the present invention provides a classification method based on multi-label prediction, and the classification method based on multi-label prediction includes steps S10 to S40.
[0032] In this embodiment, the classification method based on multi-label prediction includes the following steps:
[0033] Step S10: obtaining medical text data of the current user, and segmenting the medical text data according to punctuation marks in the medical text data to obtain at least one sentence;
[0034] Constitution is a long-term chronic state, while disease is the user's most significant discomfort state at the moment. Since there is a correlation between constitution and disease (such as chronic disease), constitution will affect the diagnosis of disease. When making manual diagnosis, professional doctors will comprehensively consider the patient's description to distinguish between constitution symptoms and disease symptoms, and thus give the user's constitution and disease diagnosis results.
[0035] When describing their medical questions, users will mix descriptions of their physical constitution and diseases. However, when making diagnoses, smart devices are generally unable to analyze based on the correlation between physical constitution and disease, and only classify symptom text into physical constitution text or disease text, thereby reducing the accuracy of the diagnosis results.
[0036] In order to solve the above problems and improve the accuracy of symptom text classification results, in this embodiment, through a multi-label prediction model, based on the connection and distinction between physical symptoms and disease symptoms, each symptom text in the sentence is predicted for physical symptoms and disease symptoms, and the probability value of each symptom text being a physical symptom and the probability value of a disease symptom are obtained, thereby avoiding the low accuracy of symptom classification caused by dividing the symptom text into a single symptom category. In addition, this embodiment obtains the distribution of physical diseases for each sentence and its symptoms, and can also assist in organizing the user's medical consultation files, summarizing statements related to physical constitution and medical history as past information, and organizing statements related to diseases as current medical records, which is helpful for the user's subsequent treatment and intelligent diagnosis.
[0037] Specifically, the medical text data is the description information of the user's own physique or disease, such as the online consultation record of the current user describing his own physique or disease based on the question prompt of the smart device, "Do you feel unwell today?" "I usually feel anxious and upset, and the anxiety has worsened in the past two days" or "I usually have cold hands and feet, but I feel very hot these days, and my palms are sweating." According to the punctuation marks in the medical text data, the medical text data is divided into sentences and words to obtain each sentence, and each sentence includes each word that contains or does not contain symptoms.
[0038] Step S20: using a multi-label prediction model, predicting the symptom category of each symptom text in the target sentence containing the symptom text, and obtaining a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom;
[0039] In this embodiment, since there are cases where constitution and disease statements are mixed in medical text data, and the symptoms in a sentence may have reference value for both constitution and disease, it is not possible to simply classify the symptom text using a binary classification model. In this embodiment, a multi-label prediction model is used to label the symptom text into two categories: constitution symptoms and disease symptoms, and obtain the probability values of the symptom text in the constitution symptom category and the disease symptom category.
[0040] Specifically, the multi-label prediction model obtained through training with the training set can be used to predict the symptom text in the input sentence, and obtain the probability that the symptom text is a physical symptom, the probability that the symptom text is a physical symptom, the probability that the symptom text is a disease symptom, and the probability that the symptom text is a disease symptom. The sentence containing the symptom text (such as symptom words) is the target sentence, and the target sentence is input into the multi-label prediction model to predict the symptom category of the symptom text in the target sentence through the multi-label prediction model, and obtain the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom. For example, input "I usually have panic and irritability, and the panic has worsened in the past two days" into the multi-label prediction model, and the multi-label prediction model predicts the symptom text "panic" in the first sentence as a physical symptom, and predicts the symptom text "panic" in the second sentence as a disease symptom. Therefore, the physical disease label corresponding to the symptom text "panic" in the sentence is (1, 1), and the probability value of "panic" is a physical symptom and the probability value of the disease symptom are (0.73, 0.85); input "I have a fever of 38 degrees and a sore throat" into the multi-label prediction model, and the physical disease label corresponding to the symptom text "fever" and "sore throat" in the sentence is (0, 1), and "fever" and "sore throat" are the probability values of the physical symptom and the probability value of the disease symptom are (0, 1). In a specific embodiment, the symptom text for physical symptoms can be added with a physical symptom category label, and the symptom text for disease symptoms can be added with a disease symptom category label. For example, the "panic" in the sentence "I usually feel flustered and upset, and my panic has worsened in the past two days" has both physical symptom labels and disease symptom labels added; the "fever" and "sore throat" in the sentence "I have a fever of 38 degrees and a sore throat" only have disease symptom labels added. The symptoms "panic" and "easily frightened" are extracted from the first sentence (I often feel flustered and easily frightened), and the corresponding distribution is (0.9, 0.23), and the symptom "panic" is extracted from the second sentence (my panic has worsened in the past two days), and the corresponding distribution is (0.73, 0.85). For this sample, the final probability values corresponding to the symptom "panic" are 0.9 and 0.85, while the final probability values of "easily frightened" are 0.9 and 0.23.
[0041] Step S30, determining at least one target symptom text corresponding to the current user and the probability values of the target symptom texts being the physical symptoms and the disease symptoms, respectively, according to the probability values of each symptom text in the target sentence being the physical symptoms and the disease symptoms;
[0042] In this embodiment, each symptom text may appear in multiple target sentences, that is, each symptom text may appear multiple times in one target sentence or multiple target sentences. The average probability value or the maximum probability value corresponding to the multiple probability values of a symptom text being a physical symptom can be used as the probability value of the symptom text being a physical symptom, and the symptom text can be used as the target symptom text. That is, the target symptom text is unique, and there is no repeated target symptom text. The average probability value or the maximum probability value of the probability values of physical symptoms of each symptom text in multiple target sentences is used as the probability value of the symptom text (i.e., the target symptom text) being a physical symptom; the average probability value or the maximum probability value of the probability values of disease symptoms of each symptom text in multiple target sentences is used as the probability value of the symptom text (i.e., the target symptom text) being a disease symptom.
[0043] Specifically, according to the physical symptom label and the disease symptom label, each physical symptom text and each disease symptom text contained in each of the target sentences are determined; in each of the physical symptom texts, a first physical symptom text with a unique number of occurrences and a second physical symptom text with a non-unique number of occurrences are determined, and in each of the disease symptom texts, a first disease symptom text with a unique number of occurrences and a second disease symptom text with a non-unique number of occurrences are determined; according to the status text of the first physical symptom text in the corresponding target sentence, a first probability value corresponding to the first physical symptom text is determined, according to the status text of the second physical symptom text in each corresponding target sentence, at least two probability values corresponding to the second physical symptom text are determined, and the maximum probability value is determined among the probability values corresponding to the second physical symptom text as the probability value of the second physical symptom text. According to the status text of the first disease symptom text in the corresponding target sentence, determine the third probability value corresponding to the first disease symptom text; according to the status text of the second disease symptom text in each corresponding target sentence, determine at least two probability values corresponding to the second disease symptom text, and determine the maximum probability value among the probability values corresponding to the second disease symptom text as the fourth probability value corresponding to the second physical symptom text; according to the first physical symptom text and its corresponding first probability value, the second physical symptom text and its corresponding second probability value, the first disease symptom text and its corresponding third probability value, the second disease symptom text and its corresponding fourth probability value, determine each target symptom text corresponding to the current user and the probability values of the target symptom texts being physical symptoms and disease symptoms respectively.
[0044] Step S40, input the target physical symptom text corresponding to the physical symptom and its corresponding probability value into the physical classification model to obtain the physical classification result of the current user, input the target disease symptom text corresponding to the disease symptom and its corresponding probability value into the disease classification model to obtain the disease classification result of the current user.
[0045] In this embodiment, the target physical symptom text corresponding to the physical symptom and the target disease symptom text corresponding to the disease symptom can be screened out according to the category labels carried by each symptom text, such as physical symptom labels or disease symptom labels. And the probability value of the symptom text being a physical symptom is used as the probability value corresponding to the corresponding target physical symptom text, and the probability value of the symptom text being a disease symptom is used as the probability value corresponding to the corresponding target disease symptom text. The target physical symptom text corresponding to the physical symptom and its corresponding probability value are input as a set of input data into the physical classification model to obtain the physical classification result of the current user through the physical classification model. The target disease symptom text corresponding to the disease symptom and its corresponding probability value are input as a set of input data into the disease classification model to obtain the disease classification result of the current user through the disease classification model.
[0046] Specifically, the constitution symptom text features of the target constitution symptom text are extracted through the constitution classification model, and the constitution of the current user is classified according to the constitution symptom text features, the target constitution symptom text and its corresponding probability value, to obtain the constitution classification result; the disease symptom text features of the target disease symptom text are extracted through the disease classification model, and the disease of the current user is classified according to the disease symptom text features, the target disease symptom text and its corresponding probability value, to obtain the disease classification result. Thus, the constitution classification model and the disease classification model can be flexibly selected to flexibly perform constitution diagnosis or disease diagnosis according to different symptom text situations.
[0047] This embodiment provides a classification method based on multi-label prediction, the method obtains the medical text data of the current user, and according to the punctuation marks in the medical text data, the medical text data is segmented to obtain at least one sentence; through the multi-label prediction model, the symptom category prediction is performed on each symptom text in the target sentence containing the symptom text, and the probability value of each symptom text in the target sentence is obtained as a physical symptom and a probability value of a disease symptom; according to the probability value of each symptom text in the target sentence as a physical symptom and a probability value of a disease symptom, at least one target symptom text corresponding to the current user and the probability value of the target symptom text as a physical symptom and a probability value of a disease symptom are determined; the target physical symptom text corresponding to the physical symptom and its corresponding probability value are input into the physical classification model to obtain the physical classification result of the current user, and the target disease symptom text corresponding to the disease symptom and its corresponding probability value are input into the disease classification model to obtain the disease classification result of the current user. In the above manner, the present application segments the medical text data of the user to obtain sentences, and compares the sentences with symptom texts, and extracts the symptom texts in the sentences. Then, through the multi-label prediction model, based on the connection and difference between physical symptoms and disease symptoms, each symptom text in the sentence is predicted for physical symptoms and disease symptoms, and the probability value of each symptom text being a physical symptom and a disease symptom is obtained, so as to avoid the low accuracy of symptom classification caused by dividing the symptom text into a single symptom category. Thus, the physical description and disease description in the medical text data are accurately identified and classified. Finally, the user's physical constitution is classified through the physical classification model and the symptom text corresponding to the physical symptoms and their corresponding probability values, and the user's disease is classified through the disease classification model and the symptom text corresponding to the disease symptoms and their corresponding probability values, which improves the accuracy of physical classification and disease classification, that is, improves the accuracy of symptom text classification results.
[0048] Reference Figure 2 , Figure 2 It is a flowchart diagram of the second embodiment of the classification method based on multi-label prediction of the present invention.
[0049] Based on the above Figure 1 In the embodiment shown, in this embodiment, step S20 includes:
[0050] Step S21, using the multi-label prediction model, screening out at least one target sentence from each sentence, and extracting context information of each symptom text in the target sentence;
[0051] Step S22, performing constitution symptom prediction and / or disease symptom prediction on each symptom text in the target sentence based on the context information;
[0052] Step S23, adding a physical symptom label and / or a disease symptom label to each symptom text in the target sentence according to the prediction result, and obtaining a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom, respectively.
[0053] In this embodiment, judging the distribution of a symptom text needs to rely on the context information of the symptom text in the target sentence, so as to predict the symptom category through the context information of the symptom text in the target sentence. Specifically, the symptom category prediction can be performed based on the words that the symptom text represents the usual state or the present in the target sentence. For example, if the words "usually" and other words that represent the usual state appear in the above text, it means that the symptom text in the target sentence is a symptom text related to the physical symptom category, and if the words "this morning" and other words that represent the present appear in the above text, it means that the symptom text in the target sentence is a symptom text related to the disease symptom category. Specifically, a physical symptom category label can be added to the symptom text for physical symptoms, and a disease symptom category label can be added to the symptom text for disease symptoms. And the probability value of each symptom text in the target sentence is obtained as a physical symptom and a probability value of a disease symptom.
[0054] It is understandable that since the symptom text in a sentence may have multiple symptom category distributions, it is assumed that the symptom text appearing in a sentence (for example, a sentence divided by a period or comma) belongs to the same distribution. By performing multi-label prediction on each sentence, the distribution of the symptom text in each sentence can be obtained. Since the judgment of the symptom text in each sentence needs to rely on its contextual information in the sentence, each sentence cannot be treated as an independent sample, but should be jointly judged with the associated sentences.
[0055] Furthermore, before step S20, the method further includes:
[0056] The initial prediction model is trained according to the training set carrying the real labels until the loss function value of the initial prediction model is less than a preset threshold, the training of the initial prediction model is completed, and the multi-label prediction model is obtained.
[0057] The calculation formula of the loss function value is:
[0058]
[0059] Among them, s i is the number of sentences in the i-th sample, L is the number of label categories, n is the total number of samples, y ijk and f ijk are the true label and predicted value of the kth category of the jth sentence of the ith sample, respectively.
[0060] In this embodiment, Figure 3 As shown, the multi-label prediction model can use the BiLSTM model to learn the context information of the sentence, and then connect the Sigmoid classification layer at each separator (such as a comma or a period) to obtain the physical constitution and disease distribution prediction of the symptom text in the sentence, that is, the probability value of the symptom text in the sentence is the physical symptom category and the probability value of the disease symptom category. Since the two categories in the multi-label classification of the symptom text are not mutually exclusive, the loss function in the multi-label prediction model uses Binary cross entropy instead of Softmax cross entropy. Since the number of sentences corresponding to each training sample is inconsistent, the loss mean of the sentence is used as the loss function value of the training sample, that is, the loss function value of the training sample can be calculated by the calculation formula of the above loss function value. According to the training set carrying the real label, the initial prediction model is trained until the loss function value of the initial prediction model is less than the preset threshold, the training of the initial prediction model is completed, and the multi-label prediction model is obtained.
[0061] In this embodiment, by integrating the diagnosis of physical symptoms and disease symptoms, the contextual information in the medical text data is used to connect and distinguish the description content of physical constitution and disease symptoms, thereby improving the accuracy of the user's physical constitution diagnosis results and disease diagnosis results.
[0062] In the training of the multi-label prediction model, this embodiment can also be regarded as an end-to-end method to jointly learn features, multi-label distribution and diagnosis to avoid the error propagation problem of independent single tasks.
[0063] Reference Figure 4 , Figure 4 It is a flowchart diagram of the third embodiment of the classification method based on multi-label prediction of the present invention.
[0064] Based on the above Figure 1 In the embodiment shown, in this embodiment, before step S20, the following steps are further included:
[0065] Step S50, performing word segmentation on each of the sentences, and comparing the first data table with the word segmentation text in each sentence to obtain at least one symptom word segmentation in each sentence;
[0066] Step S60: According to the second data table, each of the symptom participles is converted into a corresponding normalized symptom participle as the symptom text in each sentence.
[0067] In this embodiment, the first data table and the second data table can be the same data table or different data tables. The first data table stores more colloquial symptom descriptions, such as sore throat, fever, etc., and the second data table stores standard terms corresponding to colloquial symptom descriptions, such as sore throat corresponding to sore throat, high fever, low fever, etc. for fever. First, each of the sentences is segmented, and each participle in the sentence is compared with the participle corresponding to each symptom description in the first data table, so as to obtain each symptom participle in each sentence. Thus, the symptom text in each sentence and its corresponding physical constitution and disease distribution are obtained through named entity recognition and normalization. Thus, the normalized symptom participle in each sentence is extracted through named entity recognition and normalization technology as the symptom text in each sentence.
[0068] It can be understood that the distribution of physical diseases of the symptom text in each sentence is equivalent to the distribution of physical diseases of the sentence. For symptom texts that appear multiple times, the maximum probability corresponding to the physical symptom category is used as the probability value of the symptom text being the physical symptom category, and the maximum probability corresponding to the disease symptom analogy is used as the probability value of the symptom text being the disease symptom category.
[0069] See also Figure 5 , Figure 5 The present invention provides a schematic diagram of functional modules of a classification device based on multi-label prediction according to an embodiment of the present application.
[0070] like Figure 5 As shown, the classification device 500 based on multi-label prediction includes:
[0071] The text data segmentation module 510 is used to obtain the medical text data of the current user and segment the medical text data according to the punctuation marks in the medical text data to obtain at least one sentence;
[0072] The symptom distribution prediction module 520 is used to predict the symptom category of each symptom text in the target sentence containing the symptom text through a multi-label prediction model, and obtain the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom;
[0073] The symptom distribution determination module 530 is used to determine at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and the probability value of the disease symptom, respectively, according to the probability value of each symptom text in the target sentence being a physical symptom and the probability value of the disease symptom, respectively;
[0074] The classification result output module 540 is used to input the target physical symptom text corresponding to the physical symptoms and the corresponding probability value into the physical classification model to obtain the physical classification result of the current user, and input the target disease symptom text corresponding to the disease symptoms and the corresponding probability value into the disease classification model to obtain the disease classification result of the current user.
[0075] Furthermore, the symptom distribution prediction module 520 is also used for:
[0076] By using the multi-label prediction model, at least one target sentence is selected from each sentence, and context information of each symptom text in the target sentence is extracted;
[0077] Based on the context information, perform constitution symptom prediction and / or disease symptom prediction on each symptom text in the target sentence;
[0078] According to the prediction result, a physical symptom label and / or a disease symptom label is added to each symptom text in the target sentence, and a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom are obtained respectively.
[0079] Furthermore, the symptom distribution determination module 530 is also used for:
[0080] According to the physical symptom label and the disease symptom label, determining each physical symptom text and each disease symptom text contained in each target sentence;
[0081] In each of the constitution symptom texts, determine a first constitution symptom text with a unique number of occurrences and a second constitution symptom text with a non-unique number of occurrences, and in each of the disease symptom texts, determine a first disease symptom text with a unique number of occurrences and a second disease symptom text with a non-unique number of occurrences;
[0082] Determine a first probability value corresponding to the first physical condition symptom text according to the status text of the first physical condition symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second physical condition symptom text according to the status text of the second physical condition symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second physical condition symptom text as the second probability value corresponding to the second physical condition symptom text;
[0083] Determine a third probability value corresponding to the first disease symptom text according to the status text of the first disease symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second disease symptom text according to the status text of the second disease symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second disease symptom text as the fourth probability value corresponding to the second physical condition symptom text;
[0084] Based on the first physical condition symptom text and its corresponding first probability value, the second physical condition symptom text and its corresponding second probability value, the first disease symptom text and its corresponding third probability value, and the second disease symptom text and its corresponding fourth probability value, determine the target symptom texts corresponding to the current user and the probability values of the target symptom texts as physical conditions and disease symptoms, respectively.
[0085] Furthermore, the classification device 500 based on multi-label prediction further includes a model training module, and the model training module is used to:
[0086] The initial prediction model is trained according to the training set carrying the real labels until the loss function value of the initial prediction model is less than a preset threshold, the training of the initial prediction model is completed, and the multi-label prediction model is obtained.
[0087] Furthermore, the classification result output module 540 is also used for:
[0088] Extracting the constitution symptom text features of the target constitution symptom text through the constitution classification model, and classifying the constitution of the current user according to the constitution symptom text features and the target constitution symptom text and the corresponding probability values, to obtain the constitution classification result;
[0089] The disease symptom text features of the target disease symptom text are extracted through the disease classification model, and the disease of the current user is classified according to the disease symptom text features and the target disease symptom text and its corresponding probability value to obtain the disease classification result.
[0090] Furthermore, the classification device 500 based on multi-label prediction further includes a text normalization module, and the text normalization module is used to:
[0091] Segmenting each of the sentences, and comparing the first data table with the segmented text in each sentence to obtain at least one symptom segmentation in each sentence;
[0092] According to the second data table, each of the symptom participles is converted into a corresponding normalized symptom participle as the symptom text in each sentence.
[0093] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0094] The above-mentioned device can be implemented in the form of a computer program. Figure 6 Runs on the computer device shown.
[0095] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0096] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0097] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any classification method based on multi-label prediction.
[0098] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0099] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any classification method based on multi-label prediction.
[0100] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0101] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0102] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0103] Acquire medical text data of the current user, and segment the medical text data according to punctuation marks in the medical text data to obtain at least one sentence;
[0104] Using a multi-label prediction model, predicting the symptom category of each symptom text in a target sentence containing the symptom text, and obtaining a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom;
[0105] According to the probability value of each symptom text in the target sentence being a physical symptom and the probability value of a disease symptom, determining at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and the probability value of the disease symptom;
[0106] The target physical symptom text corresponding to the physical symptom and its corresponding probability value are input into the physical classification model to obtain the physical classification result of the current user; the target disease symptom text corresponding to the disease symptom and its corresponding probability value are input into the disease classification model to obtain the disease classification result of the current user.
[0107] In one embodiment, the processor performs symptom category prediction on each symptom text in the target sentence containing the symptom text by using the multi-label prediction model, and obtains a probability value of a physical symptom and a probability value of a disease symptom for each symptom text in the target sentence, so as to achieve:
[0108] By using the multi-label prediction model, at least one target sentence is selected from each sentence, and context information of each symptom text in the target sentence is extracted;
[0109] Based on the context information, perform constitution symptom prediction and / or disease symptom prediction on each symptom text in the target sentence;
[0110] According to the prediction result, a physical symptom label and / or a disease symptom label is added to each symptom text in the target sentence, and a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom are obtained respectively.
[0111] In one embodiment, the processor determines at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and a disease symptom, respectively, according to the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom, to achieve:
[0112] According to the physical symptom label and the disease symptom label, determining each physical symptom text and each disease symptom text contained in each target sentence;
[0113] In each of the constitution symptom texts, determine a first constitution symptom text with a unique number of occurrences and a second constitution symptom text with a non-unique number of occurrences, and in each of the disease symptom texts, determine a first disease symptom text with a unique number of occurrences and a second disease symptom text with a non-unique number of occurrences;
[0114] Determine a first probability value corresponding to the first physical condition symptom text according to the status text of the first physical condition symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second physical condition symptom text according to the status text of the second physical condition symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second physical condition symptom text as the second probability value corresponding to the second physical condition symptom text;
[0115] Determine a third probability value corresponding to the first disease symptom text according to the status text of the first disease symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second disease symptom text according to the status text of the second disease symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second disease symptom text as the fourth probability value corresponding to the second physical condition symptom text;
[0116] Based on the first physical condition symptom text and its corresponding first probability value, the second physical condition symptom text and its corresponding second probability value, the first disease symptom text and its corresponding third probability value, and the second disease symptom text and its corresponding fourth probability value, determine the target symptom texts corresponding to the current user and the probability values of the target symptom texts as physical conditions and disease symptoms, respectively.
[0117] In one embodiment, before implementing the method of performing symptom category prediction on each symptom text in the target sentence containing the symptom text by the multi-label prediction model to obtain the probability value of each symptom text in the target sentence being a physical symptom and the probability value of a disease symptom, the processor is used to implement:
[0118] The initial prediction model is trained according to the training set carrying the real labels until the loss function value of the initial prediction model is less than a preset threshold, the training of the initial prediction model is completed, and the multi-label prediction model is obtained.
[0119] In one embodiment, the processor implements the step of inputting the target physical symptom text corresponding to the physical symptom and the corresponding probability value thereof into a physical classification model to obtain the physical classification result of the current user, and inputting the target disease symptom text corresponding to the disease symptom and the corresponding probability value thereof into a disease classification model to obtain the disease classification result of the current user, so as to implement:
[0120] Extracting the constitution symptom text features of the target constitution symptom text through the constitution classification model, and classifying the constitution of the current user according to the constitution symptom text features and the target constitution symptom text and the corresponding probability values, to obtain the constitution classification result;
[0121] The disease symptom text features of the target disease symptom text are extracted through the disease classification model, and the disease of the current user is classified according to the disease symptom text features and the target disease symptom text and its corresponding probability value to obtain the disease classification result.
[0122] In one embodiment, before implementing the method of performing symptom category prediction on each symptom text in the target sentence containing the symptom text by the multi-label prediction model to obtain the probability value of each symptom text in the target sentence being a physical symptom and the probability value of a disease symptom, the processor is used to implement:
[0123] Segmenting each of the sentences, and comparing the first data table with the segmented text in each sentence to obtain at least one symptom segmentation in each sentence;
[0124] According to the second data table, each of the symptom participles is converted into a corresponding normalized symptom participle as the symptom text in each sentence.
[0125] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any classification method based on multi-label prediction provided in an embodiment of the present application.
[0126] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A classification method based on multi-label prediction, characterized in that: The classification method comprises the following steps: Acquire medical text data of the current user, and segment the medical text data according to punctuation marks in the medical text data to obtain at least one sentence; Using a multi-label prediction model, predicting the symptom category of each symptom text in a target sentence containing the symptom text, and obtaining a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom; According to the probability value of each symptom text in the target sentence being a physical symptom and the probability value of a disease symptom, determining at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and the probability value of the disease symptom; The target physical symptom text corresponding to the physical symptom and its corresponding probability value are input into the physical classification model to obtain the physical classification result of the current user; the target disease symptom text corresponding to the disease symptom and its corresponding probability value are input into the disease classification model to obtain the disease classification result of the current user.
2. The classification method based on multi-label prediction according to claim 1, characterized in that: The multi-label prediction model is used to predict the symptom category of each symptom text in the target sentence containing the symptom text, and the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom is obtained, including: By using the multi-label prediction model, at least one target sentence is selected from each sentence, and context information of each symptom text in the target sentence is extracted; Based on the context information, perform constitution symptom prediction and / or disease symptom prediction on each symptom text in the target sentence; According to the prediction result, a physical symptom label and / or a disease symptom label is added to each symptom text in the target sentence, and a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom are obtained respectively.
3. The classification method based on multi-label prediction according to claim 2, characterized in that: The step of determining, based on the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom, at least one target symptom text corresponding to the current user and the probability value of the target symptom text being a physical symptom and a disease symptom, respectively, comprises: According to the physical symptom label and the disease symptom label, determining each physical symptom text and each disease symptom text contained in each target sentence; In each of the constitution symptom texts, determine a first constitution symptom text with a unique number of occurrences and a second constitution symptom text with a non-unique number of occurrences, and in each of the disease symptom texts, determine a first disease symptom text with a unique number of occurrences and a second disease symptom text with a non-unique number of occurrences; Determine a first probability value corresponding to the first physical condition symptom text according to the status text of the first physical condition symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second physical condition symptom text according to the status text of the second physical condition symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second physical condition symptom text as the second probability value corresponding to the second physical condition symptom text; Determine a third probability value corresponding to the first disease symptom text according to the status text of the first disease symptom text in the corresponding target sentence, determine at least two probability values corresponding to the second disease symptom text according to the status text of the second disease symptom text in each corresponding target sentence, and determine the maximum probability value among the probability values corresponding to the second disease symptom text as the fourth probability value corresponding to the second physical condition symptom text; Based on the first physical condition symptom text and its corresponding first probability value, the second physical condition symptom text and its corresponding second probability value, the first disease symptom text and its corresponding third probability value, and the second disease symptom text and its corresponding fourth probability value, determine the target symptom texts corresponding to the current user and the probability values of the target symptom texts as physical conditions and disease symptoms, respectively.
4. The classification method based on multi-label prediction according to claim 1, characterized in that: The method further includes: performing symptom category prediction on each symptom text in the target sentence containing the symptom text by using the multi-label prediction model, and obtaining the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom respectively. The initial prediction model is trained according to the training set carrying the real labels until the loss function value of the initial prediction model is less than a preset threshold, the training of the initial prediction model is completed, and the multi-label prediction model is obtained.
5. The classification method based on multi-label prediction according to claim 4, characterized in that: The calculation formula of the loss function value is: Among them, s i is the number of sentences in the i-th sample, L is the number of label categories, n is the total number of samples, y ijk and f ijk are the true label and predicted value of the kth category of the jth sentence of the ith sample, respectively.
6. The classification method based on multi-label prediction according to claim 1, characterized in that: The step of inputting the target physical symptom text corresponding to the physical symptom and the corresponding probability value thereof into a physical symptom classification model to obtain the physical symptom classification result of the current user, and inputting the target disease symptom text corresponding to the disease symptom and the corresponding probability value thereof into a disease classification model to obtain the disease classification result of the current user includes: Extracting the constitution symptom text features of the target constitution symptom text through the constitution classification model, and classifying the constitution of the current user according to the constitution symptom text features and the target constitution symptom text and the corresponding probability values, to obtain the constitution classification result; The disease symptom text features of the target disease symptom text are extracted through the disease classification model, and the disease of the current user is classified according to the disease symptom text features and the target disease symptom text and its corresponding probability value to obtain the disease classification result.
7. The classification method based on multi-label prediction according to any one of claims 1 to 6, characterized in that: The method further includes: performing symptom category prediction on each symptom text in the target sentence containing the symptom text by using the multi-label prediction model, and obtaining the probability value of each symptom text in the target sentence being a physical symptom and a disease symptom respectively. Segmenting each of the sentences, and comparing the first data table with the segmented text in each sentence to obtain at least one symptom segmentation in each sentence; According to the second data table, each of the symptom participles is converted into a corresponding normalized symptom participle as the symptom text in each sentence.
8. A classification device based on multi-label prediction, characterized in that: The classification device based on multi-label prediction includes: A text data segmentation module, used to obtain medical text data of the current user, and segment the medical text data according to punctuation marks in the medical text data to obtain at least one sentence; A symptom distribution prediction module is used to predict the symptom category of each symptom text in a target sentence containing the symptom text through a multi-label prediction model, and obtain a probability value of each symptom text in the target sentence being a physical symptom and a probability value of a disease symptom; A symptom distribution determination module, for determining at least one target symptom text corresponding to the current user and the probability values of the target symptom texts being the physical symptoms and the disease symptoms, respectively, according to the probability values of each symptom text in the target sentence being the physical symptoms and the disease symptoms, respectively; The classification result output module is used to input the target physical symptom text corresponding to the physical symptoms and the corresponding probability value into the physical classification model to obtain the physical classification result of the current user, and input the target disease symptom text corresponding to the disease symptoms and the corresponding probability value into the disease classification model to obtain the disease classification result of the current user.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a classification program based on multi-label prediction stored in the memory and executable by the processor, wherein when the classification program based on multi-label prediction is executed by the processor, the steps of the classification method based on multi-label prediction as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a classification program based on multi-label prediction, wherein when the classification program based on multi-label prediction is executed by a processor, the steps of the classification method based on multi-label prediction according to any one of claims 1 to 7 are implemented.