Medical consultation data processing method and device, readable storage medium and electronic device
By preprocessing medical consultation data and secondary classification processing of K nearest neighbor model, the problems of low follow-up efficiency and insufficient data classification accuracy in online Internet hospitals are solved, and more efficient disease review and data management are achieved.
Patent Information
- Application Number
- CN202111371847.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-11-18
AI Technical Summary
In online Internet hospitals, doctors need to search for chat records during follow-up visits to recall the patient's health status, and the patient's description is not accurate enough, resulting in a large amount of useless information in the chat records, affecting the efficiency of doctors in reviewing the disease.
By preprocessing the medical consultation data, the feature vector is extracted and inputted into the preset K nearest neighbor model. After determining the target category, the K value is adjusted for secondary classification to improve the accuracy of data classification.
It improves the classification accuracy of medical consultation data, assists doctors in quickly finding relevant consultation records, and improves the efficiency of follow-up visits.
Smart Images

Figure CN114068028B_ABST
Abstract
Description
Background Art
[0002] In online Internet hospitals, doctors use text and picture chats to understand patients' symptoms and make diagnostic suggestions. Many diseases require multiple follow-up visits, and doctors often need to search through chats to recall patients' previous health conditions. Since patients are not professional doctors and cannot accurately describe their health problems in one or two sentences, there will be a lot of useless information during the chat process, which affects the efficiency of doctors' review of symptoms.
[0003] Therefore, medical consultation data can be classified and saved to improve the efficiency of follow-up consultations.
[0004] The K-Nearest Neighbor model (KNN) is simple and effective, and is suitable for automatic classification of class domains with relatively large samples. However, the existing K-Nearest Neighbor model has low classification accuracy due to the limitation of K value selection.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a medical consultation data processing method and device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent improving the problems of low efficiency of follow-up visits and low accuracy of consultation data classification.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, a method for processing medical inquiry data is provided, comprising: preprocessing inquiry data to be processed to determine a feature vector corresponding to the inquiry data to be processed; inputting the feature vector into a preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence in the category to which K samples adjacent to the inquiry data to be processed belong; determining a feature value corresponding to the target category in the feature vector corresponding to the inquiry data to be processed to generate a target feature vector corresponding to the inquiry data to be processed; adjusting the K value in the preset K nearest neighbor model, and inputting the target feature vector corresponding to the inquiry data to be processed into the preset K nearest neighbor model after the K value is adjusted to classify the inquiry data to be processed.
[0009] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the feature vector corresponding to the medical inquiry data to be processed is used to indicate the frequency of occurrence of keywords corresponding to each preset category in the medical inquiry data to be processed; the preprocessing of the medical inquiry data to be processed to determine the feature vector corresponding to the medical inquiry data to be processed includes: performing word segmentation on the medical inquiry data to be processed; matching the word segmentation results of the medical inquiry data to be processed with the keywords in the vocabulary corresponding to each preset category to determine the frequency of occurrence of the keywords corresponding to each preset category in the medical inquiry data to be processed; and obtaining the feature vector corresponding to the medical inquiry data to be processed based on the frequency of occurrence.
[0010] In an exemplary embodiment of the present disclosure, based on the above-mentioned scheme, the preset K nearest neighbor model is predetermined in the following manner: multiple initial K nearest neighbor models are obtained based on different preset initial K values; a training data set is obtained, and the training data set is divided into a test data set and a sample data set; the recognition accuracy of each of the initial K nearest neighbor models is determined according to the test data set and the sample data set; the K nearest neighbor model with the highest recognition accuracy is selected from the multiple initial K nearest neighbor models to obtain the preset K nearest neighbor model; wherein, for each of the initial K nearest neighbor models, the recognition accuracy of the initial K nearest neighbor model is determined by executing the following process: for each test data in the test data set, the recognition accuracy of the initial K nearest neighbor model is determined by The test data is input into the initial K nearest neighbor model to determine the top N candidate categories with the highest frequency of occurrence in the categories to which the K sample data adjacent to the test data belong; in the feature vector corresponding to the test data, the feature value corresponding to the candidate category is determined to generate a target feature vector corresponding to the test data; the preset initial K value in the initial K nearest neighbor model is adjusted to obtain the target K value; with the sample data set as the sample in the initial K nearest neighbor model, based on the target feature vector of the test data and the target K value, the recognition category corresponding to the test data is determined; based on the recognition category corresponding to each of the test data and the label corresponding to each of the test data, the recognition accuracy of the initial K nearest neighbor model is determined.
[0011] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the adjusting of the preset initial K value in the initial K nearest neighbor model to obtain the target K value includes: reducing the preset initial K value in the initial K nearest neighbor model to obtain the target K value corresponding to the preset initial K value.
[0012] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the adjusting of the K value in the preset K nearest neighbor model includes: obtaining a target K value corresponding to the initial K value in the preset K nearest neighbor model; adjusting the K value in the preset K nearest neighbor model from the initial K value to the target K value; the target K value is obtained by adjusting the preset initial K value corresponding to the preset K nearest neighbor model during the model training process.
[0013] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the preset categories include one or more of symptom description, diagnosis result, drug use, and related examinations.
[0014] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the method also includes: saving the classification results of the medical inquiry data to be processed in a database; when the medical inquiry data to be processed has a marking attribute, selecting other medical inquiry data that belong to the same patient and have the same category as the medical inquiry data to be processed from the database; displaying the other medical inquiry data in the target client to prompt the user of the target client whether to mark the other medical inquiry data; and in response to the marking operation on the other medical inquiry data, adding a mark to the other medical inquiry data in the database.
[0015] According to a second aspect of the present disclosure, a medical inquiry data processing device is provided, comprising: a feature extraction module, configured to pre-process inquiry data to be processed, so as to determine a feature vector corresponding to the inquiry data to be processed; an initial classification module, configured to input the feature vector into a preset K nearest neighbor model, so as to determine the top N target categories with the highest frequency of occurrence in the category to which K samples adjacent to the inquiry data to be processed belong; a target feature determination module, configured to determine a feature value corresponding to the target category in the feature vector corresponding to the inquiry data to be processed, so as to generate a target feature vector corresponding to the inquiry data to be processed; and a secondary classification module, configured to adjust the K value in the preset K nearest neighbor model, and input the target feature vector corresponding to the inquiry data to be processed into the preset K nearest neighbor model after the K value is adjusted, so as to classify the inquiry data to be processed.
[0016] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the medical consultation data processing method as described in the first aspect of the above embodiment is implemented.
[0017] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the medical consultation data processing method as described in the first aspect of the above embodiment.
[0018] It can be seen from the above technical solutions that the medical consultation data processing method, medical consultation data processing device, and computer-readable storage medium and electronic device for implementing the medical consultation data processing method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0019] In the technical solutions provided by some embodiments of the present disclosure, first, the inquiry data to be processed is preprocessed to determine the feature vector corresponding to the inquiry data to be processed, and then the feature vector is input into the preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence in the category to which the K samples adjacent to the inquiry data to be processed belong, and the feature value corresponding to the target category is determined in the feature value corresponding to the inquiry data to be processed to generate the target feature vector corresponding to the inquiry data to be processed; finally, the K value in the preset K nearest neighbor model is adjusted, and the target feature vector is input into the preset K nearest neighbor model after the K value is adjusted to classify the inquiry data to be processed. Compared with the related art, on the one hand, the present disclosure can improve the accuracy of medical inquiry data classification by performing secondary processing on the classification results of the K nearest neighbor model; on the other hand, the present disclosure can assist doctors in quickly viewing corresponding inquiry records from different categories by classifying the medical inquiry data, thereby improving the efficiency of follow-up visits.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A schematic diagram showing a flow chart of a method for processing medical text data in an exemplary embodiment of the present disclosure;
[0023] Figure 2A schematic flow chart showing a method for determining a feature vector of medical inquiry data to be processed in an exemplary embodiment of the present disclosure;
[0024] Figure 3 A schematic flow chart showing a method for determining a preset K nearest neighbor model in an exemplary embodiment of the present disclosure;
[0025] Figure 4 A schematic flow chart showing a method for determining the recognition accuracy of an initial K nearest neighbor model in an exemplary embodiment of the present disclosure;
[0026] Figure 5 A schematic flow chart showing a method for marking classified medical inquiry data in an exemplary embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram showing the structure of a medical consultation data processing device in an exemplary embodiment of the present disclosure is shown;
[0028] Figure 7 A schematic diagram showing the structure of a computer storage medium in an exemplary embodiment of the present disclosure; and
[0029] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0031] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0033] Online Internet hospitals have gradually become popular. For many users who do not have time or are inconvenient to go to the hospital for treatment, they can chat with doctors through online Internet hospitals. Doctors can understand the patient's condition through text and picture chat and make diagnostic suggestions.
[0034] In reality, many diseases require multiple follow-up visits. For online Internet hospitals, doctors often need to look through previous chat records to recall the patient's previous health conditions. During the chat, since the patient is not a professional doctor and cannot accurately describe his or her health problems in one or two sentences, there is often a lot of useless information in the chat process, which affects the efficiency of the doctor's review of the symptoms.
[0035] Therefore, the chat content can be analyzed and similar chat content can be intelligently grouped. When the doctor needs to view the corresponding content, the doctor will be intelligently prompted with the chat content that he may need to view, thereby improving the efficiency of the doctor's follow-up consultation.
[0036] Machine learning classification algorithm is a widely used classification method. Common machine learning classification algorithms include SVM (support vector machines) algorithm and LR (logistic regression) algorithm. However, when the sample data volume is too large, the SVM algorithm will take up a lot of machine memory and computing time. The amount of chat information between doctors and patients is huge, and the SVM algorithm is too heavyweight to process. The output of the LR algorithm is not an exact value but a probability between 0 and 1. This probabilistic result sometimes easily leads to confusion in data classification. In addition, due to the probabilistic result, the LR algorithm is prone to underfitting problems.
[0037] The K nearest neighbor model is simple and effective in calculation, and is suitable for automatic classification of class domains with relatively large samples. However, the accuracy of the traditional K nearest neighbor model depends largely on the selection of the K value, so the accuracy of its classification results is still relatively low.
[0038] In the embodiments of the present disclosure, a method for processing medical consultation data is first provided, which overcomes the defects existing in the above-mentioned related technologies at least to a certain extent.
[0039] Figure 1 A flowchart of a method for processing medical consultation data in an exemplary embodiment of the present disclosure is shown. Figure 1 , the method comprising:
[0040] Step S110, pre-processing the medical inquiry data to be processed to determine a feature vector corresponding to the medical inquiry data to be processed;
[0041] Step S120, inputting the feature vector into a preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence among the categories to which the K samples adjacent to the medical consultation data to be processed belong;
[0042] Step S130, determining the characteristic value corresponding to the target category in the characteristic vector corresponding to the to-be-processed medical inquiry data, so as to generate a target characteristic vector corresponding to the to-be-processed medical inquiry data;
[0043] Step S140, adjusting the K value in the preset K nearest neighbor model, inputting the target feature vector corresponding to the medical inquiry data to be processed into the preset K nearest neighbor model after the K value is adjusted, so as to classify the medical inquiry data to be processed.
[0044] exist Figure 1 In the technical solution provided by the illustrated embodiment, first, the inquiry data to be processed is preprocessed to determine the feature vector corresponding to the inquiry data to be processed, and then the feature vector is input into the preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence in the category to which the K samples adjacent to the inquiry data to be processed belong, and in the feature vector corresponding to the inquiry data to be processed, the feature value corresponding to the target category is determined to generate the target feature vector corresponding to the inquiry data to be processed; finally, the K value in the preset K nearest neighbor model is adjusted, and the target feature vector is input into the preset K nearest neighbor model after the K value is adjusted to classify the inquiry data to be processed. Compared with the related art, on the one hand, the present disclosure can improve the accuracy of medical inquiry data classification by performing secondary processing on the classification results of the K nearest neighbor model; on the other hand, the present disclosure can assist doctors in quickly viewing corresponding inquiry records from different categories by classifying the medical inquiry data, thereby improving the efficiency of follow-up visits.
[0045] The following Figure 1 The specific implementation methods of each step in the embodiment shown are described in detail:
[0046] Step S110 , pre-processing the medical inquiry data to be processed to determine a feature vector corresponding to the medical inquiry data to be processed.
[0047] In an exemplary embodiment, the consultation data to be processed may include chat record information during the online medical consultation process. The chat record information may be in a picture format, a text format, a voice format, etc. This exemplary embodiment does not specifically limit this.
[0048] The feature vector corresponding to the medical inquiry data to be processed is used to indicate the frequency of occurrence of keywords corresponding to each preset category in the medical inquiry data to be processed. Among them, the preset categories may include one or more of symptom description, diagnosis results, drug use, and related examinations. For example, when the preset categories include symptom description, diagnosis results, drug use, and related examinations, for the medical inquiry data to be processed, it is ultimately necessary to determine which of the four preset categories of symptom description, diagnosis results, drug use, and related examinations the medical inquiry data to be processed specifically belongs to. Of course, the preset categories can also be configured according to actual needs, and this exemplary embodiment does not make any special limitations on this.
[0049] For example, Figure 2 A flow chart showing a method for determining a feature vector of the medical inquiry data to be processed in an exemplary embodiment of the present disclosure is shown. Figure 2 , the method may include steps S210 to S230. Wherein:
[0050] In step S210, word segmentation processing is performed on the medical inquiry data to be processed.
[0051] Exemplarily, performing word segmentation processing on the medical inquiry data to be processed may be understood as performing word segmentation processing on text information corresponding to the medical inquiry data to be processed.
[0052] When the to-be-processed medical consultation data is an image, text recognition can be performed on the image first to determine the text information in the image, and then the recognized text information can be segmented. When the to-be-processed medical consultation data is voice, the voice data can be converted into text first, and then the converted text can be segmented.
[0053] The method of performing word segmentation processing on the medical inquiry data to be processed may refer to the existing word segmentation technology, which will not be described in detail in this exemplary embodiment.
[0054] In step S220, the word segmentation results of the medical inquiry data to be processed are matched with the keywords in the vocabulary corresponding to each preset category to determine the occurrence frequency of the keywords corresponding to each preset category in the medical inquiry data to be processed.
[0055] After word segmentation processing is performed on the medical inquiry data to be processed, the words in the medical inquiry data to be processed may be matched with keywords in the vocabulary corresponding to each preset category.
[0056] For example, word segmentation extraction can be performed in the existing medical consultation data to pre-generate a vocabulary of each preset category, and the vocabulary of each preset category stores the keywords corresponding to the medical consultation data of the preset category. For example, medical consultation chat information is obtained from a database storing medical consultation chat information, and then word segmentation processing is performed on it, and each word segmentation is classified into the categories of symptom description, diagnosis results, drug use, and related examinations according to its meaning or the specific content represented, thereby generating a vocabulary of each category. For the vocabulary corresponding to drug use, the names of conventional drugs or all drug nouns can also be stored as keywords in the vocabulary corresponding to the drug use category. For the vocabulary corresponding to the related examination category, the names of conventional examinations can also be pre-stored as keywords in the vocabulary corresponding to the related examination category. The method for generating the vocabulary corresponding to each preset category is not limited to this.
[0057] Exemplarily, the word library corresponding to each preset category can be obtained in step S220. Then, the words obtained after the word segmentation processing of the to-be-processed medical inquiry data are matched with the keywords in the word library corresponding to each preset category, and the number of successful matches between all the word segments in the to-be-processed medical inquiry data and the keywords in the word library corresponding to each preset category is counted, and the number can be understood as the frequency of occurrence of the keywords corresponding to each preset category in the to-be-processed medical inquiry data.
[0058] In step S230, a feature vector corresponding to the medical inquiry data to be processed is obtained according to the occurrence frequency.
[0059] In an exemplary embodiment, the frequency of occurrence of a keyword corresponding to a preset category in the medical inquiry data to be processed can be used to characterize the feature value of the medical inquiry data to be processed under the preset category. The feature values of the medical inquiry data to be processed under each preset category can be combined together and represented by a feature vector, thereby generating a feature vector corresponding to the medical inquiry data to be processed.
[0060] Exemplarily, a specific implementation of step S230 may be: determining a feature vector corresponding to the to-be-processed medical inquiry data according to feature values corresponding to each preset category and a preset representation order of the feature values of each preset category in the feature vector.
[0061] For example, if it is pre-specified that the order of representation of the feature values of each preset category in the feature vector is, in sequence, symptom description, diagnosis result, drug use, and related examination, and after the medical consultation data to be processed is segmented, 5 words are obtained, of which 2 are successfully matched with the keywords in the vocabulary corresponding to the drug use category, 2 are successfully matched with the keywords in the vocabulary corresponding to the symptom description category, 0 are successfully matched with the keywords in the vocabulary corresponding to the diagnosis result category, and 0 are successfully matched with the keywords in the vocabulary corresponding to the related examination category. Then the feature vector corresponding to the medical consultation data to be processed is [2, 0, 2, 0].
[0062] Continue to refer Figure 1 Next, in step S120, the feature vector is input into a preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence among the categories to which the K samples adjacent to the medical consultation data to be processed belong.
[0063] The K-nearest neighbor model, or KNN (K-NearestNeighbor) algorithm model, means K nearest neighbors, that is, each data to be classified can be represented by its closest K neighboring values. In other words, the distance from the data to be classified to each sample point of the known category can be calculated, and then each distance is sorted, the first K sample points closest to the data to be classified are selected, the frequency of occurrence of the categories where the first K sample points are located is counted, and the category with the highest frequency of the first K sample points is used as the classification result of the data to be classified.
[0064] In the K nearest neighbor model, the choice of K value has a crucial impact on classification accuracy. If the K value is too large, more interference samples may be selected, thereby reducing the accuracy of model classification; if the K value is too small, overfitting is likely to occur.
[0065] In the present disclosure, a secondary classification is performed on the initial classification results of the K nearest neighbor model, and the K value is selected according to the accuracy after the secondary classification, and then a preset K nearest neighbor model is determined to improve the classification accuracy of the K nearest neighbor model.
[0066] For example, Figure 3 A flow chart showing a method for determining a preset K nearest neighbor model in an exemplary embodiment of the present disclosure is shown, with reference to Figure 3 , the method may include steps S310 to S340.
[0067] In step S310, multiple initial K nearest neighbor models are obtained based on different preset initial K values.
[0068] Exemplarily, multiple different preset initial K values can be preconfigured to obtain multiple initial K nearest neighbor models accordingly. For example, the K values are 7, 8, 9, and 10 respectively to determine 4 K nearest neighbor models. The number of initial K nearest neighbor models and the preset initial K value of each initial K nearest neighbor model can be customized according to needs, and this exemplary embodiment does not make any special restrictions on this.
[0069] Next, in step S320, a training data set is obtained, and the training data set is divided into a test data set and a sample data set.
[0070] Exemplarily, historical medical consultation chat information can be obtained from a storage database of medical consultation chat record information, and each historical medical consultation record information can be labeled to determine the category corresponding to each historical medical consultation record information, thereby generating a category label corresponding to each medical consultation record information. Then, the historical medical consultation chat record information can be processed in a similar manner to the above-mentioned steps S210 to S230 to determine the feature vector corresponding to each historical medical consultation chat record information. That is, the method of determining the feature vector corresponding to the historical medical consultation chat record information can refer to the above-mentioned steps S210 to S230, which will not be repeated here.
[0071] In other words, each training data in the training data set may include a feature vector and a label corresponding to the feature vector. After obtaining the training data set, the training data set may be divided into a test data set and a sample data set. The division ratio of the test data set and the sample data set may be determined according to demand, such as 60% as a test data set and 40% as a sample data set. This exemplary embodiment does not specifically limit this. The test data set is used to test the recognition accuracy of each initial K nearest neighbor model in subsequent steps, and the sample data set may be used as a sample point in each initial K nearest neighbor model.
[0072] Next, in step S330, the recognition accuracy of each of the initial K nearest neighbor models is determined based on the test data set and the sample data set.
[0073] Exemplarily, the specific implementation of step S330 can be understood as taking the data in the test data set as the data to be classified and taking the data in the sample data set as the sample points in each initial K nearest neighbor model. Then, each test data is classified using the sample points in each initial K nearest neighbor model to determine the recognition accuracy of each initial K nearest neighbor model.
[0074] Among them, for each initial K nearest neighbor model, the method for determining its recognition accuracy can refer to Figure 4 As shown, the method may include steps S410 to S450. Among them:
[0075] In step S410, for each test data in the test data set, the test data is input into the initial K nearest neighbor model to determine the top N candidate categories with the highest occurrence frequency among the categories to which K sample data adjacent to the test data belong.
[0076] In an exemplary embodiment, N is greater than or equal to 2 and less than the number of preset categories, and N is a positive integer. For example, if it is necessary to determine the category to which the to-be-processed medical consultation data belongs from among 4 preset categories, then N is greater than or equal to 2 and less than 4. The sample points in the initial K nearest neighbor model may include the data in the sample data set determined in the above step S320.
[0077] Exemplarily, a specific implementation of step S410 may be that, for each test data in the test data set, the test data is input into the initial K nearest neighbor model, the distance between the test data and each sample point in the initial K nearest neighbor model is calculated, and based on the distance, the top N candidate categories with the highest frequency of occurrence in the category to which the top K sample points most adjacent to the test data belong are determined.
[0078] The distance metric may include any one of Euclidean distance, Manhattan distance, Chebyshev distance, standardized Euclidean distance, Mahalanobis distance, Hamming distance, Bhattacharyya distance, etc., and this exemplary embodiment does not specifically limit this.
[0079] For example, if the eigenvector corresponding to the test data is [4,5,2,1], the eigenvector corresponding to a sample point is [4,10,1,1], and the distance metric is Euclidean distance, then the distance between the test data and the sample point is
[0080] Take the initial K nearest neighbor model when the preset initial K value is 8 as an example, then input the test data into the initial K nearest neighbor model, calculate the distance between the test data and each sample point in the initial K nearest neighbor model, sort the distance corresponding to each sample point in descending or ascending order, and select the first 8 sample points with the smallest distance to the test data. Count the frequency of occurrence of the categories to which these 8 sample points belong. Taking N=2 as an example, select the first 2 categories with the highest frequency of occurrence of the categories to which these 8 sample points belong and use them as the candidate categories.
[0081] For example, among these 8 sample points, there are 3 sample points belonging to the symptom description category, that is, the occurrence frequency of the symptom description category is 3, there are 4 sample points belonging to the diagnosis result category, that is, the occurrence frequency of the diagnosis result category is 4, there is 1 sample point belonging to the drug use category, that is, the occurrence frequency of the drug use category is 1, and there are 0 sample points belonging to the related examination category, that is, the occurrence frequency of the related examination category is 0, then the diagnosis result category and the symptom description category can be taken as candidate categories.
[0082] In step S420, the eigenvalue corresponding to the to-be-selected category is determined in the eigenvector corresponding to the test data to generate a target eigenvector corresponding to the test data.
[0083] Continuing with the example of the feature vector corresponding to the above test data being [4,5,2,1], 4 represents the feature value corresponding to the symptom description category, 5 represents the feature value corresponding to the diagnosis result category, 2 represents the feature value corresponding to the drug use category, and 1 represents the feature value corresponding to the related examination category. After determining the category to be selected, only the feature value corresponding to the category to be selected can be retained in the feature vector corresponding to the test data, thereby generating the target feature vector corresponding to the test data.
[0084] Continuing with the above example where the candidate categories include the diagnosis result category and the symptom description category, the target feature vector corresponding to the test data can be expressed as [4, 5, 0, 0].
[0085] Exemplarily, a specific implementation of step S420 may be to retain the feature value corresponding to the to-be-selected category in the feature vector corresponding to the test data to generate a target feature vector corresponding to the test data.
[0086] Next, in step S430, the preset initial K value in the initial K nearest neighbor model is adjusted to obtain a target K value.
[0087] Exemplarily, a specific implementation of adjusting the preset initial K value in the initial K nearest neighbor model to obtain the target K value may be to reduce the preset initial K value in the initial K nearest neighbor model to obtain the target K value corresponding to the preset initial K value.
[0088] After the target K value is obtained, in step S440, the sample data set is used as the sample in the initial K nearest neighbor model, and the recognition category corresponding to the test data is determined based on the target feature vector corresponding to the test data and the target K value.
[0089] For example, the preset initial K value can be adjusted to half of the original value to obtain a target K value. Taking the above preset initial K value of 8 as an example, a target K value of 4 can be obtained. Then, the eigenvalues corresponding to the eigenvalues in the target eigenvector and the eigenvalues corresponding to the selected categories in the sample points of the initial K nearest neighbor model are subtracted to calculate the distance between the test data and the sample points, and each distance is sorted. The first four sample points with the smallest distance are selected, and the category with the highest frequency of occurrence among the categories to which the first four sample points belong is determined as the identification category corresponding to the test data. The identification category can be understood as the category identified by the test data through the initial K nearest neighbor model.
[0090] Continuing with the example that the feature vector corresponding to the test data is [4,5,2,1], the feature vector corresponding to a sample point is [4,10,1,1], and the distance metric is Euclidean distance, in step S440, the distance between the test data and the sample point can be expressed as It can also be expressed as That is to say, the eigenvalues corresponding to the selected category can be directly selected from the test data and sample points, that is, the eigenvalues corresponding to the selected category in the test data and sample points are retained, and then the distance between the test data and the sample points is calculated. Alternatively, the eigenvalues corresponding to the selected category in the test data and sample points can be determined as 0 to formally delete other features except the eigenvalues corresponding to the selected category, and then the distance between the test data and the sample points is calculated. Then, based on the calculated distance and the target K value, the recognition category corresponding to the test data is determined.
[0091] Continue to refer Figure 4 In step S450, based on the recognition category corresponding to each of the test data and the label corresponding to each of the test data, the recognition accuracy of the initial K nearest neighbor model is determined.
[0092] Exemplarily, for each test data, the recognition category of the test data can be obtained based on the initial K nearest neighbor model in the above steps S410 to S440. Then, the recognition category of each test data and its corresponding label can be matched or compared to determine whether the two are the same. If they are the same, it can be determined that the test data is successfully recognized. Finally, the recognition accuracy of the initial K nearest neighbor model is determined based on the percentage of successfully recognized test data to all test data.
[0093] Furthermore, for the same preset initial K value, multiple target K values can be determined respectively, and then the target K value with the highest accuracy after secondary identification of the multiple target K values is selected as the target K value finally corresponding to the preset initial K value.
[0094] For example, in the above step S430, the preset initial K value may be reduced to To obtain the first target K value, for example, the preset initial K value of 8 is reduced to 4, and 4 is used as the first target K value corresponding to the preset initial K value of 8, and then through the above steps S440 and S450, the recognition accuracy when the target K value is 4 is determined. Going back to step S430, the target K value is increased to That is, 5 is taken as the second target K value, and the above steps S440 and S450 are repeated to determine the recognition accuracy when the target K value is 5. Then, the recognition accuracy corresponding to the first target K value and the recognition accuracy corresponding to the second target K value are compared, and it is determined whether to continue to determine the third target K value based on the size relationship between the two.
[0095] If the recognition accuracy of the first target K value is greater than that of the second target K value, there is no need to continue to determine the third target K value; if the recognition accuracy of the first target K value is less than that of the second target K value, the target K value can be increased to To determine the third target K value, and then compare the recognition accuracy of the third target K value with the recognition accuracy of the second target K value, and repeat this cycle until the recognition accuracy corresponding to the M+1th target K value is less than the recognition accuracy of the Mth target K value. In this case, the Mth target K value can be determined as the target K value that finally corresponds to the preset initial K value.
[0096] It should be noted that if the M+1th target K value is the preset initial K value minus 1, that is, K-1, and the recognition accuracy corresponding to the M+1th target K value is greater than the recognition accuracy of the Mth target K value, if adjustments are made further at this time, the target K value will be equal to the preset initial K value, then there is no need to continue to increase the target K value, and K-1 can be directly determined as the target K value corresponding to the preset initial K value.
[0097] After obtaining the recognition accuracy of each initial K nearest neighbor model through the above steps S410 to S450, next, continue to refer to Figure 3 In step S340, the K nearest neighbor model with the highest recognition accuracy is selected from the multiple initial K nearest neighbor models to obtain the preset K nearest neighbor model.
[0098] Exemplarily, when comparing the recognition accuracy rates of multiple initial K nearest neighbor models, the recognition accuracy rates corresponding to the target K values finally corresponding to each of the above-mentioned initial K nearest neighbor models can be used for comparison, so that the initial K nearest neighbor model with the highest recognition accuracy can be determined as the preset K nearest neighbor model.
[0099] It should be noted that the conditions that the recognition accuracy of the preset K nearest neighbor model that is finally determined needs to meet can be determined according to business needs. For example, if the business needs require the recognition accuracy to be greater than 75%, then the recognition accuracy of the preset K nearest neighbor model that is finally determined needs to be greater than or equal to 75%. When determining the preset K nearest neighbor model, multiple groups of test data sets and sample data sets can also be obtained according to different partitioning methods or partitioning strategies. Each group of test data sets and sample data sets are used to test the initial K nearest neighbor model multiple times to determine the model with the highest recognition accuracy, which is used as the preset K nearest neighbor model.
[0100] After the preset K nearest neighbor model is determined, the preset K nearest neighbor model can be used to classify and identify the medical consultation data to be processed.
[0101] For example, in step S120 , the initial K value of the preset K nearest neighbor model may be used to perform a first recognition on the inquiry data to be processed, so as to determine the target category from the preset categories.
[0102] For example, after determining the feature vector corresponding to the to-be-processed medical consultation data in step S110, the distance between the feature vector and the feature vector corresponding to each sample point in the preset K nearest neighbor model can be calculated, such as the Euclidean distance mentioned above, and then the calculated distances are sorted to determine the first K sample points with the smallest distances, where K is the initial K value of the preset K nearest neighbor model. Determine the first N target categories with the highest frequency of occurrence among the categories to which these K sample points belong.
[0103] Taking the initial K value of 8 and N of 2 as an example, the 8 sample points with the smallest distance to the consultation data to be processed are determined, and the first 2 categories with the highest occurrence frequency are selected as the target categories according to the categories to which these 8 sample points belong. For example, among the categories to which these 8 sample points belong, the occurrence frequency of the symptom description category is 3, the occurrence frequency of the diagnosis result category is 3, the occurrence frequency of the drug use category is 2, and the occurrence frequency of the related examination category is 0, then the symptom description and diagnosis result can be determined as the target categories.
[0104] Next, in step S130, the characteristic value corresponding to the target category is determined in the characteristic vector corresponding to the to-be-processed medical inquiry data, so as to generate a target characteristic vector corresponding to the to-be-processed medical inquiry data.
[0105] Exemplarily, after determining the target category, the feature value corresponding to the target category can be retained in the feature vector corresponding to the to-be-processed medical consultation data, and the feature values corresponding to other categories can be configured as invalid or set to 0, so as to perform distance calculation based on the target feature vector in step S140. The feature value configured as invalid does not participate in the distance calculation.
[0106] For example, the feature vector of the medical inquiry data to be processed is [6, 3, 4, 1], where 6 and 4 are the feature values corresponding to the target category respectively. Then the target feature vector of the medical inquiry data to be processed can be [6, 0, 4, 0], or the feature values 3 and 1 in the target feature vector of the medical inquiry data to be processed can be configured to an invalid state so that they do not participate in the distance calculation in step S140.
[0107] Next, in step S140, the K value in the preset K nearest neighbor model is adjusted, and the target feature vector is input into the preset K nearest neighbor model after the K value is adjusted, so as to classify the to-be-processed medical consultation data.
[0108] In an exemplary embodiment, a specific implementation of adjusting the K value in the preset K nearest neighbor model may be to reduce the K value in the K nearest neighbor model. The amount to which the K value is reduced may be determined according to user needs, such as reducing the K value to half of the initial K value.
[0109] In another exemplary embodiment, the above Figure 3 The process of determining the preset K nearest neighbor model can be understood as a model training process. Based on this, the specific implementation method of adjusting the K value in the preset K nearest neighbor model can also be: obtaining the target K value corresponding to the initial K value in the preset K nearest neighbor model; adjusting the K value in the preset K nearest neighbor model from the initial K value to the target K value; wherein, the target K value is obtained by adjusting the preset initial K value corresponding to the preset K nearest neighbor model during the model training process.
[0110] In other words, after the preset K nearest neighbor model is determined, the initial K value of the preset K nearest neighbor model and the target K value corresponding to the initial K value are determined accordingly. In step S120, the initial K value can be used to perform a first classification on the to-be-processed medical inquiry data to determine the target category, and then determine the target feature vector corresponding to the to-be-processed medical inquiry data based on the target category. Then, in step S140, the to-be-processed medical inquiry data is classified for a second time using the target feature vector and the target K value to determine the category to which the to-be-processed medical inquiry data belongs.
[0111] Exemplarily, the specific implementation process of performing a second classification on the inquiry data to be processed according to the target feature vector and the target K value to determine the category to which the inquiry data to be processed belongs may be: select the feature value corresponding to the target category from the feature vectors corresponding to the sample points of the preset K nearest neighbor model to obtain the target feature vector corresponding to each sample point. Then calculate the distance between the target feature vector corresponding to each sample point and the target feature vector corresponding to the inquiry data to be processed, sort each distance, determine the category with the highest frequency among the categories to which the first target K value sample points with the smallest distance belong, and determine the category as the category to which the inquiry data to be processed finally belongs. Among them, the specific implementation method of determining the target feature vector corresponding to each sample point is exactly the same as the specific implementation method of determining the target feature vector corresponding to the inquiry data to be processed, and will not be repeated here.
[0112] Taking the feature vector of the above-mentioned inquiry data to be processed as [6,3,4,1], the feature vector corresponding to a sample point in the preset K nearest neighbor model is [10,2,5,4], and the order of representation of the feature values of each preset category in the feature value is symptom description, drug use, diagnosis result, related examination, and after the first classification, the target category determined is symptom description and diagnosis result as an example, when the inquiry data to be processed is classified in step S140, the calculated distance between the inquiry data to be processed and the sample point can be
[0113] Through the above-mentioned steps S110 to S140, based on the secondary classification of the inquiry data to be processed, the problem of inaccurate classification results caused by excessively large eigenvalues can be avoided. Specifically, for example, the category to which the sample point with the smallest distance from the inquiry data to be processed belongs may be category A. If only the initial K value is used for one classification, due to the excessive initial K value, it may result in the largest number of sample points belonging to category B among the first K sample points with the smallest distance from the inquiry data to be processed, thereby incorrectly classifying the inquiry data to be processed into category B. In the present application, on the basis of the first classification, the K value is reduced to perform a secondary classification of the inquiry data to be processed. Due to the reduction of the K value, it is possible to avoid determining more erroneous sample points as sample points with the smallest distance, and thus it is possible to avoid participating in the voting selection of the category to which the inquiry data to be processed belongs based on the category to which the erroneous sample points belong, thereby avoiding the occurrence of large errors and improving the accuracy of the classification of the inquiry data to be processed.
[0114] In an exemplary application scenario, historical chat data can be obtained from a database storing online medical consultation chat records, and after the historical chat data is segmented by a word segmentation algorithm, an index keyword library corresponding to four preset categories, namely, symptom description, diagnosis result, drug use, and related examinations, is established according to the actual meaning represented by each segmentation word. And according to the frequency of occurrence of keywords corresponding to each preset category in each historical chat data, the feature vector corresponding to each historical chat data is determined. At the same time, the label of each historical chat data is determined based on the category to which each historical chat data actually belongs. The corresponding label can be determined manually according to the actual meaning represented by each historical chat record, or it can be determined directly according to the frequency of occurrence of keywords of each preset category in the historical chat data. If the keyword of a preset category has the highest frequency of occurrence in the historical chat data, the label of the historical chat data can be directly determined as the category, thereby generating sample points in the K nearest neighbor model.
[0115] Exemplarily, when generating sample points, chat data that is not related to the consultation data can also be excluded first. For example, whether the chat data is useful chat data can be determined based on whether the number of matches between each chat data and the keyword library corresponding to the preset category is greater than the preset value. If the sum of the frequencies of occurrence of keywords in each preset category of a chat data is greater than the preset value, it can be determined that the chat data is useful chat data and is retained. Otherwise, the chat data is determined to be useless chat data, for example, it may just be words of thanks from the patient to the doctor. It is only necessary to determine the feature vectors and labels corresponding to the useful chat data to generate sample points in the K nearest neighbor model.
[0116] When a new consultation chat record is generated, after the chat is finished, the new chat record can be obtained from the database storing the chat record, and then for each chat data in the new chat record, based on the above steps S110 to S140, the category corresponding to the chat data is determined to group and store the chat data. In this way, when the patient has a follow-up visit, the doctor can directly query the condition information he wants to view from the corresponding group as needed, thereby improving the efficiency of the follow-up visit.
[0117] Each consultation process is a process of continuous communication between the doctor and the patient, which will generate multiple consultation data. Each consultation data can be regarded as a consultation data to be processed and can be processed based on the above steps S110 to S140.
[0118] Exemplarily, when determining the category of medical inquiry data, it is also possible to first determine whether the sum of the occurrence frequencies of keywords of each preset category in the medical inquiry data is greater than a preset value. If it is greater than the preset value, it is then classified. Otherwise, the chat data can be considered to be useless information and need not be classified.
[0119] In order to further assist doctors and patients to improve the efficiency of follow-up consultation, the to-be-processed consultation data can also be marked according to the classification results of the to-be-processed consultation data. In this way, during the follow-up consultation, the marked medical consultation data of the target patient can be quickly displayed according to the user's needs.
[0120] For example, Figure 5 A flowchart of a method for marking classified medical consultation data in an exemplary embodiment of the present disclosure is shown. Figure 5 , the method may include steps S510 to S540. Wherein:
[0121] In step S510, the classification result of the medical inquiry data to be processed is stored in a database.
[0122] Exemplarily, after the classification result of each medical inquiry data to be processed is determined, the category corresponding to the medical inquiry data to be processed may be stored in a database.
[0123] In step S520, when the to-be-processed medical inquiry data has a tag attribute, other medical inquiry data belonging to the same patient and of the same category as the to-be-processed medical inquiry data are selected from the database.
[0124] In step S530, the other medical inquiry data are displayed in the target client to prompt the user of the target client whether to mark the other medical inquiry data.
[0125] In step S540, in response to the marking operation on the other medical inquiry data, a mark is added to the other medical inquiry data in the database.
[0126] For example, each consultation process is a process of continuous communication between the doctor and the patient, which will generate multiple consultation data. After each consultation, the doctor or the patient can add marks to some key consultation data in this consultation process according to their own needs. For example, the doctor adds marks to some key consultation data in this consultation process according to his own needs. After obtaining the key consultation data marked by the doctor, the mark state corresponding to the consultation data can be configured as a valid state, so that the consultation data has a mark attribute.
[0127] Then, other medical inquiry data belonging to the same patient and of the same category as the medical inquiry data with the marked attribute are selected, and the other medical inquiry data are sent to the doctor's corresponding client to recommend other medical inquiry data that can be marked to the doctor; all medical inquiry data with determined categories among the multiple medical inquiry data generated during this medical inquiry process can also be determined from the database, and then medical inquiry data belonging to the same category as the medical inquiry data with the marked attribute are selected from them, and the selected medical inquiry data are sent to the doctor's corresponding client to recommend other medical inquiry data that can be marked to the doctor.
[0128] The recommendation information may include information reminding the doctor whether the recommended medical consultation data needs to be marked. Then, the doctor can select part or all of the recommended medical consultation data to add marks to them, so that the corresponding medical consultation data is added with marking attributes in the database according to the doctor's choice. In this way, when the doctor has a follow-up visit in the future, the medical consultation data with the marked attributes added can be directly displayed to the doctor according to the doctor's needs, so that the doctor can quickly review the patient's condition. For example, in response to the doctor's triggering operation on a certain control on his client, the medical consultation data with the marked attributes added to the historical medical consultation data of the current patient is displayed in the doctor's client.
[0129] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided by the present invention are performed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk.
[0130] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0131] Figure 6 FIG. 2 is a schematic diagram showing the structure of a medical consultation data processing device in an exemplary embodiment of the present disclosure. Figure 6 The device 600 may include a feature extraction module 610, an initial classification module 620, a target feature determination module 630, and a secondary classification module 640. Among them:
[0132] The feature extraction module 610 is configured to pre-process the medical inquiry data to be processed to determine a feature vector corresponding to the medical inquiry data to be processed;
[0133] The initial classification module 620 is configured to input the feature vector into a preset K nearest neighbor model to determine the top N target categories with the highest frequency among the categories to which the K samples adjacent to the medical consultation data to be processed belong;
[0134] The target feature determination module 630 is configured to determine the feature value corresponding to the target category in the feature vector corresponding to the medical inquiry data to be processed, so as to generate a target feature vector corresponding to the medical inquiry data to be processed;
[0135] The secondary classification module 640 is configured to adjust the K value in the preset K nearest neighbor model, and input the target feature vector corresponding to the inquiry data to be processed into the preset K nearest neighbor model after the K value is adjusted to classify the inquiry data to be processed.
[0136] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the feature vector corresponding to the medical inquiry data to be processed is used to indicate the occurrence frequency of keywords corresponding to each preset category in the medical inquiry data to be processed.
[0137] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the feature extraction module 610 may also be configured to: perform word segmentation on the medical inquiry data to be processed; match the word segmentation results of the medical inquiry data to be processed with the keywords in the vocabulary corresponding to each preset category to determine the frequency of occurrence of the keywords corresponding to each preset category in the medical inquiry data to be processed; and obtain a feature vector corresponding to the medical inquiry data to be processed based on the frequency of occurrence.
[0138] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the preset K nearest neighbor model is predetermined in the following manner: obtaining multiple initial K nearest neighbor models based on different preset initial K values; obtaining a training data set, and dividing the training data set into a test data set and a sample data set; determining the recognition accuracy of each of the initial K nearest neighbor models based on the test data set and the sample data set; and selecting the K nearest neighbor model with the highest recognition accuracy from the multiple initial K nearest neighbor models to obtain the preset K nearest neighbor model. Among them, for each of the initial K nearest neighbor models, the recognition accuracy of the initial K nearest neighbor model is determined by executing the following process: for each test data in the test data set, the test data is input into the initial K nearest neighbor model to determine the top N candidate categories with the highest frequency of occurrence in the category to which the K sample data adjacent to the test data belong; in the feature vector corresponding to the test data, the feature value corresponding to the candidate category is determined to generate a target feature vector corresponding to the test data; the preset initial K value in the initial K nearest neighbor model is adjusted to obtain the target K value; with the sample data set as the sample in the initial K nearest neighbor model, based on the target feature vector and the target K value of the test data, the recognition category corresponding to the test data is determined; based on the recognition category corresponding to each of the test data and the label corresponding to each of the test data, the recognition accuracy of the initial K nearest neighbor model is determined.
[0139] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the adjusting of the preset initial K value in the initial K nearest neighbor model to obtain the target K value includes: reducing the preset initial K value in the initial K nearest neighbor model to obtain the target K value corresponding to the preset initial K value.
[0140] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the secondary classification module 640 can also be specifically configured to: obtain a target K value corresponding to the initial K value in the preset K nearest neighbor model; adjust the K value in the preset K nearest neighbor model from the initial K value to the target K value; the target K value is obtained by adjusting the preset initial K value corresponding to the preset K nearest neighbor model during the model training process.
[0141] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the preset categories include one or more of symptom description, diagnosis result, drug use, and related examinations.
[0142] In some exemplary embodiments of the present disclosure, based on the aforementioned embodiments, the medical inquiry data processing device 600 may further include a marking module, which is specifically configured to: save the classification results of the inquiry data to be processed in a database; when the inquiry data to be processed has a marking attribute, select other inquiry data belonging to the same inquiry patient and of the same category as the inquiry data to be processed from the database; display the other inquiry data in the target client to prompt the user of the target client whether to mark the other inquiry data; and in response to the marking operation on the other inquiry data, add a mark to the other inquiry data in the database.
[0143] The specific details of each unit in the above-mentioned medical consultation data processing device have been described in detail in the corresponding medical consultation data processing method, so they will not be repeated here.
[0144] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0145] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0146] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0147] In the exemplary embodiments of the present disclosure, a computer storage medium capable of implementing the above method is also provided. A program product capable of implementing the above method of this specification is stored thereon. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0148] refer to Figure 7 As shown, a program product 700 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0149] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0150] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0151] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0152] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0153] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0154] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0155] Refer to the following Figure 8 The electronic device 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0156] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0157] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 810 can perform the following steps: Figures 1 to 5 The steps shown.
[0158] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0159] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0160] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0161] The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0162] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0163] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0164] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A method for processing medical consultation data, characterized in that: include: Preprocessing the medical inquiry data to be processed to determine a feature vector corresponding to the medical inquiry data to be processed, wherein the feature vector is used to indicate the occurrence frequency of the keywords corresponding to each preset category in the medical inquiry data to be processed, and the occurrence frequency of the keywords corresponding to each preset category in the medical inquiry database to be processed is determined according to the matching of the word segmentation of the medical inquiry data to be processed and the keywords in the vocabulary of each preset category; Inputting the feature vector into a preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence among the categories to which the K samples adjacent to the medical consultation data to be processed belong; Retaining the feature value corresponding to the target category in the feature vector corresponding to the medical inquiry data to be processed to generate a target feature vector corresponding to the medical inquiry data to be processed, wherein the feature value corresponding to the target category is determined according to the frequency of occurrence of the keyword of the target category in the medical inquiry data to be processed; The K value in the preset K nearest neighbor model is adjusted, and the target feature vector corresponding to the medical inquiry data to be processed is input into the preset K nearest neighbor model after the K value is adjusted, so as to classify the medical inquiry data to be processed.
2. The medical consultation data processing method according to claim 1, characterized in that: The preprocessing of the to-be-processed medical inquiry data to determine the feature vector corresponding to the to-be-processed medical inquiry data includes: Performing word segmentation processing on the medical consultation data to be processed; Matching the word segmentation results of the to-be-processed medical inquiry data with the keywords in the vocabulary corresponding to each preset category to determine the frequency of occurrence of the keywords corresponding to each preset category in the to-be-processed medical inquiry data; According to the occurrence frequency, a feature vector corresponding to the medical inquiry data to be processed is obtained.
3. The medical consultation data processing method according to claim 1, characterized in that: The preset K nearest neighbor model is predetermined in the following manner: Multiple initial K nearest neighbor models are obtained based on different preset initial K values; Obtain a training data set, and divide the training data set into a test data set and a sample data set; Determining the recognition accuracy of each of the initial K nearest neighbor models according to the test data set and the sample data set; Selecting the K nearest neighbor model with the highest recognition accuracy from the multiple initial K nearest neighbor models to obtain the preset K nearest neighbor model; For each of the initial K nearest neighbor models, the recognition accuracy of the initial K nearest neighbor model is determined by performing the following process: For each test data in the test data set, the test data is input into the initial K nearest neighbor model to determine the top N candidate categories with the highest occurrence frequency among the categories to which the K sample data adjacent to the test data belong; In the feature vector corresponding to the test data, determining the feature value corresponding to the to-be-selected category to generate a target feature vector corresponding to the test data; Adjusting a preset initial K value in the initial K nearest neighbor model to obtain a target K value; Taking the sample data set as samples in the initial K nearest neighbor model, based on the target feature vector of the test data and the target K value, determining the recognition category corresponding to the test data; Based on the recognition category corresponding to each of the test data and the label corresponding to each of the test data, the recognition accuracy of the initial K nearest neighbor model is determined.
4. The medical consultation data processing method according to claim 3, characterized in that: The adjusting the preset initial K value in the initial K nearest neighbor model to obtain a target K value includes: The preset initial K value in the initial K nearest neighbor model is reduced to obtain a target K value corresponding to the preset initial K value.
5. The medical consultation data processing method according to any one of claims 1 to 3, characterized in that: The adjusting the K value in the preset K nearest neighbor model includes: Obtain a target K value corresponding to an initial K value in the preset K nearest neighbor model; Adjusting the K value in the preset K nearest neighbor model from the initial K value to the target K value; The target K value is obtained by adjusting the preset initial K value corresponding to the preset K nearest neighbor model during the model training process.
6. The medical consultation data processing method according to claim 2, characterized in that: The preset categories include one or more of symptom description, diagnosis result, medication use, and related examinations.
7. The medical consultation data processing method according to claim 1, characterized in that: The method further comprises: The classification results of the medical consultation data to be processed are stored in a database; When the to-be-processed medical inquiry data has a tag attribute, selecting from the database other medical inquiry data belonging to the same patient and of the same category as the to-be-processed medical inquiry data; Displaying the other medical inquiry data in the target client to prompt the user of the target client whether to mark the other medical inquiry data; In response to the marking operation on the other medical inquiry data, a mark is added to the other medical inquiry data in the database.
8. A medical consultation data processing device, characterized in that: include: A feature extraction module is configured to pre-process the medical inquiry data to be processed to determine a feature vector corresponding to the medical inquiry data to be processed, wherein the feature vector is used to indicate the frequency of occurrence of keywords corresponding to each preset category in the medical inquiry data to be processed, and the frequency of occurrence of keywords corresponding to each preset category in the medical inquiry database to be processed is determined based on the matching of the word segmentation of the medical inquiry data to be processed and the keywords in the vocabulary of each preset category; An initial classification module is configured to input the feature vector into a preset K nearest neighbor model to determine the top N target categories with the highest frequency of occurrence among the categories to which the K samples adjacent to the medical consultation data to be processed belong; A target feature determination module is configured to retain a feature value corresponding to the target category in a feature vector corresponding to the medical inquiry data to be processed, so as to generate a target feature vector corresponding to the medical inquiry data to be processed, wherein the feature value corresponding to the target category is determined according to the frequency of occurrence of a keyword of the target category in the medical inquiry data to be processed; The secondary classification module is configured to adjust the K value in the preset K nearest neighbor model, and input the target feature vector corresponding to the inquiry data to be processed into the preset K nearest neighbor model after the K value is adjusted to classify the inquiry data to be processed.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the medical consultation data processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the medical consultation data processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Text classification method, device and apparatus and computer readable storage medium
CN110287328A