Data augmentation method, device and equipment for medical text data and medium

By clustering and weight sampling medical texts and combining them with a language generation model to generate similar texts, the problem of lack of diversity in medical text data augmentation is solved, and the performance and robustness of the model are improved.

CN116796205BActive Publication Date: 2026-04-07PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing medical text data augmentation methods lack diversity and richness, resulting in insignificant model training effects.

Method used

By clustering medical texts and obtaining the weight of each text, a sampling population is constructed for sampling. A language generation model is used to generate similar texts for data augmentation, ensuring that the generated texts are representative and diverse.

Benefits of technology

The generated similar medical texts are more diverse and richer, which can significantly improve the model's performance and robustness, and is suitable for model training on different tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116796205B_ABST
    Figure CN116796205B_ABST
Patent Text Reader

Abstract

This invention relates to the fields of artificial intelligence and smart healthcare, and discloses a method, apparatus, device, and medium for data augmentation of medical text data. The method includes: clustering existing medical texts to obtain clustering results; obtaining the weight of each existing medical text based on the clustering results; establishing a sampling population based on the weights of all existing medical texts; sampling from the sampling population to obtain sampled medical texts; generating similar medical texts corresponding to the sampled medical texts; and using the generated similar medical texts to augment the existing medical texts. This application, by sampling representative medical texts to generate similar medical texts, can enrich and diversify the data, achieving more diverse data augmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and smart healthcare, and in particular to a data augmentation method, apparatus, device, and medium for medical text data. Background Technology

[0002] Data augmentation is a technique used when training machine learning or deep learning models. It involves transforming, perturbing, or combining the original data to generate new training data, enabling the model to learn from more diverse situations and variations. The goal is to increase the quantity and diversity of training data, thereby improving model performance. In the field of smart healthcare, data augmentation techniques are widely used in model training because medical data is generally scarce, while machine learning and deep learning models require a certain amount of data for training. Therefore, data augmentation techniques are typically used to expand medical datasets.

[0003] Current technologies for augmenting medical texts primarily involve simply copying the text data to achieve data enhancement. However, this method only increases the quantity of medical text data, resulting in a monotonous approach that fails to enrich the diversity and richness of the data. Furthermore, the augmented medical text data obtained using this method cannot significantly improve model performance for different tasks. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and medium for data augmentation of medical text data, in order to solve the technical problem that the existing technology lacks richness and diversity in data augmentation of medical text.

[0005] Firstly, a data augmentation method for medical text data is provided, the method comprising:

[0006] Cluster existing medical texts to obtain clustering results;

[0007] Based on the clustering results, obtain the weight of each existing medical text;

[0008] Based on the weights of all existing medical texts, a sampling population is established, and samples are taken from the sampling population to obtain sampled medical texts. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to their weights.

[0009] Generate similar medical texts corresponding to the sampled medical texts;

[0010] Data augmentation of existing medical texts is performed using generated similar medical texts.

[0011] Secondly, a data enhancement device for medical text data is provided, the device comprising:

[0012] The clustering module is used to cluster existing medical texts and obtain clustering results.

[0013] The weight calculation module is used to obtain the weight of each existing medical text based on the clustering results;

[0014] The sampling module is used to establish a sampling population based on the weights of all existing medical texts, and to sample medical texts from the sampling population. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to their weights.

[0015] The text generation module is used to generate similar medical texts corresponding to sampled medical texts.

[0016] The data augmentation module is used to augment existing medical texts using generated similar medical texts.

[0017] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data augmentation method for the medical text data described above.

[0018] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the data augmentation method for the aforementioned medical text data.

[0019] In the aforementioned methods, apparatuses, devices, and media for data augmentation of medical text data, the weights of each existing medical text are obtained through clustering. A sampling population composed of existing medical texts is constructed based on these weights. Sampling is then performed from this population. Higher weights indicate that the existing medical text is more representative and accounts for a larger proportion of the sampling population, making it more likely to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, similar medical texts generated based on the sampled medical texts are also representative and diverse. Furthermore, this application does not augment data through simple copying but rather by generating similar medical texts. Therefore, the resulting similar medical texts are more diverse and richer than text copying. Augmenting existing medical texts with similar medical texts can significantly improve model performance and increase model robustness for different tasks. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of an application environment for a data augmentation method for medical text data according to an embodiment of the present invention;

[0022] Figure 2 This is a flowchart illustrating a data augmentation method for medical text data according to an embodiment of the present invention;

[0023] Figure 3 This is a flowchart illustrating a data augmentation method for medical text data in another embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of the structure of a data enhancement device for medical text data according to an embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of the structure of a data enhancement device for medical text data according to an embodiment of the present invention;

[0026] Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] The data augmentation method for medical text data provided in this embodiment of the invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server receives user instructions from the client and performs data augmentation on the existing medical text indicated by the user instructions. The server specifically executes the following steps: clustering the existing medical text to obtain clustering results; obtaining the weight of each existing medical text based on the clustering results; establishing a sampling population based on the weights of all existing medical texts, and sampling from the sampling population to obtain sampled medical texts, wherein the sampling population contains all existing medical texts, and the number of each existing medical text in the sampling population is configured according to weight; generating similar medical texts corresponding to the sampled medical texts; and using the generated similar medical texts to perform data augmentation on the existing medical texts. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0029] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a data augmentation method for medical text data provided in an embodiment of the present invention, the data augmentation method for medical text data including:

[0030] S101: Cluster existing medical texts to obtain clustering results.

[0031] Specifically, clustering is the process of dividing a dataset into different classes or clusters according to a specific criterion (such as distance), so that the similarity of data objects within the same cluster is as high as possible, while the difference between data objects in different clusters is also as high as possible. In other words, after clustering, data of the same class should be grouped together as much as possible, while data of different classes should be separated as much as possible.

[0032] In one specific embodiment, a density-based clustering algorithm, such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise), can be used. This clustering method is used to cluster existing medical texts, resulting in multiple clusters. Each cluster includes at least one existing medical text, and the existing medical texts contained in different clusters do not overlap.

[0033] More specifically, the existing SBERT (Sentence-BERT) model is applied to represent the existing medical texts as vectors. The cosine distance or Euclidean distance between each pair of existing medical texts is calculated based on the vector representation. Clustering is then performed based on the cosine distance or Euclidean distance using a clustering algorithm.

[0034] Of course, other clustering algorithms can also be used, such as partitioning clustering algorithms (k-means, k-means++, etc.), and this application does not limit this.

[0035] S102: Based on the clustering results, obtain the weight of each existing medical text.

[0036] Specifically, each existing medical text corresponds to a weight, and in this embodiment, the weight represents the representativeness of the existing medical text. The higher the weight, the more representative the text is.

[0037] The weights of existing medical texts are determined based on the relationships between clusters in the clustering results and the relationships between existing medical texts within the same cluster.

[0038] S103: Based on the weights of all existing medical texts, establish a sampling population, sample from the sampling population to obtain sampled medical texts, wherein the sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to their weights.

[0039] Specifically, the weight represents the representativeness of the existing medical texts. The higher the weight, the higher the representativeness. Since our goal is to extract representative existing medical texts, the higher the weight of the existing medical texts, the greater their distribution in the constructed sampling population. This increases the probability of extracting the existing medical text with the high weight.

[0040] Based on this, a sampling population containing all existing medical texts is constructed according to the weights of all existing medical texts. The number of all existing medical texts in this sampling population is configured according to their weights, so that the proportion of existing medical texts in the sampling population is proportional to their weights.

[0041] Then, sampling is performed from this population according to the preset sampling method to obtain the sampled medical text.

[0042] The preset sampling method can be random sampling with replacement or random sampling without replacement. This application does not impose any restrictions on this. Additionally, the number of samples can be set to, for example, 50. The specific number of samples can be configured according to the actual application scenario, and this application does not impose any restrictions on this.

[0043] S104: Generate similar medical texts corresponding to the sampled medical texts.

[0044] Specifically, a trained language generation model can be used to generate similar medical texts corresponding to sampled medical texts. Each sampled medical text can generate multiple different similar medical texts.

[0045] The trained language generation model can be, for example, the GPT model (Generative Pre-Trained Transformer).

[0046] The sampled medical text is given to the GPT model along with the natural language instruction "similar text generation". The GPT model can then automatically generate one or more similar medical texts corresponding to the sampled medical text.

[0047] S105: Use generated similar medical texts to perform data augmentation on existing medical texts.

[0048] Specifically, similar medical texts generated in part or all can be mixed into existing medical texts through preset filtering methods to obtain data-enhanced medical texts.

[0049] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, and the more likely it is to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Expanding existing medical texts with similar medical texts can help model training for different tasks achieve significant model performance improvements and increase model robustness.

[0050] Please see Figure 3 As shown, Figure 3 A flowchart illustrating a method for data augmentation of medical text data according to another embodiment of the present invention includes the following steps:

[0051] S201: Group existing medical texts based on attribute tags.

[0052] Specifically, there are multiple existing medical documents, and each document may have multiple different attribute tags. For example, attribute tags include text type, diagnosis result, business type, patient information, etc. Among them, text type specifically includes various types such as chief complaint, present illness history, past medical history, and hospitalization summary; diagnosis result includes various types such as upper respiratory tract infection, diarrhea, and influenza; business type includes various types such as inpatient, outpatient, and emergency; and patient information includes gender and age.

[0053] You can choose one attribute tag to group all existing medical texts, or you can choose multiple attribute tags to group all existing medical texts, resulting in multiple groups, each group containing several existing medical texts.

[0054] For example, if the existing medical text describes the diagnosis result, the existing medical text can be grouped according to the attribute label of diagnosis result. The existing medical text with the diagnosis result of upper respiratory tract infection can be grouped into one group, the existing medical text with the diagnosis result of diarrhea can be grouped into another group, and the existing medical text with the diagnosis result of influenza can be grouped into yet another group.

[0055] Of course, existing medical texts can also be grouped based on a combination of multiple attribute tags, and this application does not impose any restrictions on this.

[0056] Attribute tags can be used to roughly group existing medical texts, and data augmentation can be performed on various types of medical texts in a targeted and uniform manner based on these groups. Compared with blind copying, this method can better enhance the diversity of the data.

[0057] S202: Cluster the existing medical texts in the same group to obtain the clustering results for each group.

[0058] Specifically, clustering is the process of dividing a dataset into different classes or clusters according to a specific criterion (such as distance), so that the similarity of data objects within the same cluster is as high as possible, while the difference between data objects in different clusters is also as high as possible. In other words, after clustering, data of the same class should be grouped together as much as possible, while data of different classes should be separated as much as possible.

[0059] In one specific embodiment, a density-based clustering algorithm can be used, such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise). This clustering method clusters existing medical texts within the same group, obtaining the clustering results corresponding to that group. These clustering results are the multiple clusters corresponding to that group. Each cluster includes at least one existing medical text from that group, and the existing medical texts contained in different clusters do not overlap.

[0060] More specifically, the existing SBERT (Sentence-BERT) model is applied to represent the existing medical texts in the group as vectors. Based on the vector representation, the cosine distance or Euclidean distance between every two existing medical texts in the same group is calculated. Based on the clustering algorithm, clustering is performed according to the cosine distance or Euclidean distance.

[0061] Of course, other clustering algorithms can also be used, such as partitioning clustering algorithms (k-means, k-means++, etc.), and this application does not limit this.

[0062] S203: Based on the clustering results of the target group, obtain the weight of each existing medical text in the target group, where the target group is any one of the groups.

[0063] Specifically, a target group is selected, and each existing medical text in the target group corresponds to a weight. In this embodiment, the weight represents the representativeness of the existing medical text in the group. The higher the weight, the higher the representativeness.

[0064] The weights of existing medical texts are determined based on the relationships between clusters in the clustering results and the relationships between existing medical texts within the same cluster.

[0065] The weight of each existing medical text contained in any group can be obtained through step S203.

[0066] S204: Based on the weights of all existing medical texts in the target group, establish a sampling population corresponding to the target group, and sample from the sampling population of the target group to obtain the sampled medical texts corresponding to the target group. The sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights.

[0067] Specifically, the weight represents the representativeness of the existing medical text in its group. The higher the weight, the higher the representativeness. Since our goal is to extract representative existing medical texts, the larger the distribution of existing medical texts with higher weights in the constructed sampling population, the greater the probability of extracting existing medical texts with high weights.

[0068] Based on this, one group is randomly selected from all groups as the target group. According to the weight of all existing medical texts in the target group, a sampling population containing all existing medical texts of the target group is constructed. The number of all existing medical texts in the sampling population of the target group is configured according to the weight, so that the proportion of existing medical texts in the sampling population is proportional to the weight.

[0069] Then, sampling is performed from the sampling population corresponding to the target group according to the preset sampling method to obtain the sampled medical text corresponding to the target group.

[0070] The preset sampling method can be random sampling with replacement or random sampling without replacement. This application does not impose any restrictions on this. Additionally, the number of samples can be set to, for example, 50. The specific number of samples can be configured according to the actual application scenario, and this application does not impose any restrictions on this.

[0071] Any group can obtain its corresponding sampled medical text through step S204.

[0072] S205: Generate similar medical texts corresponding to the sampled medical texts.

[0073] Specifically, a trained language generation model can be used to generate similar medical texts corresponding to sampled medical texts. Each sampled medical text can generate multiple different similar medical texts.

[0074] The trained language generation model can be, for example, the GPT model (Generative Pre-Trained Transformer).

[0075] The sampled medical text is given to the GPT model along with the natural language instruction "similar text generation". The GPT model can then automatically generate one or more similar medical texts corresponding to the sampled medical text.

[0076] S206: Use generated similar medical texts to perform data augmentation on existing medical texts.

[0077] Specifically, similar medical texts generated in part or all can be mixed into existing medical texts through preset filtering methods to obtain data-enhanced medical texts.

[0078] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, making it more likely to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Furthermore, this embodiment pre-groups the existing medical texts and performs data augmentation according to the groups. The resulting similar medical texts are closer to the existing medical texts, ensuring data richness while also ensuring that the generated data is representative and similar to the existing medical texts. Expanding the existing medical texts with similar medical texts, the data-augmented medical texts can help the training of models for different tasks achieve significant model performance improvements and increase the robustness of the models.

[0079] In one embodiment, before step S105 or step S206, the method further includes:

[0080] Perform semantic similarity checks between similar medical texts and their corresponding sampled medical texts;

[0081] Based on the obtained inspection results, similar medical texts with semantic similarity below the similarity threshold will be removed.

[0082] Specifically, in order to ensure that the similar medical text used for data augmentation has a high degree of similarity with the corresponding sampled medical text, this embodiment checks the semantic similarity between the two.

[0083] In one specific embodiment, after generating multiple similar medical texts for each sampled medical text, in order to check the consistency or similarity of the data, the sampled medical text and the generated similar medical texts are used as inputs to the GPT model. At the same time, a natural language instruction for "data semantic similarity check" is issued to the GPT model, and the GPT model outputs the check results. The check results can clearly indicate whether the semantic similarity between the two is high or low. High semantic similarity means that the semantic similarity between the two is higher than the similarity threshold, and low semantic similarity means that the semantic similarity between the two is lower than the similarity threshold.

[0084] In another specific embodiment, vector representations of similar medical texts and their corresponding sampled medical texts are obtained. Euclidean or cosine distances between the similar medical texts and their corresponding sampled medical texts are calculated based on these vector representations. The actual semantic similarity between the two texts is represented by the Euclidean or cosine distance. If the actual semantic similarity exceeds a similarity threshold, the two texts are deemed to meet the similarity standard, and the similar medical text is retained. If the actual semantic similarity is below the similarity threshold, the two texts are deemed not to meet the similarity standard, and the similar medical text is removed; that is, the similar medical text is no longer used for data augmentation.

[0085] By examining the semantic similarity between sampled medical texts and their similar medical texts, the quality of the generated medical text data can be effectively detected. Removing similar medical texts with low data quality ensures, to a certain extent, the similarity and consistency between the data used for data augmentation and the original data, thereby guaranteeing the reliability of data augmentation.

[0086] In one embodiment, a clustering result includes multiple clusters, and step S203 specifically includes:

[0087] The cluster weight of the target cluster is obtained by calculating the ratio of the number of existing medical texts contained in the target cluster to the number of existing medical texts contained in the target group corresponding to the target cluster. The target cluster is any cluster in the clustering results of the target group.

[0088] The distance between the target existing medical text and the cluster center of the target cluster is calculated as the first distance. The farthest distance from the existing medical text to the cluster center in the target cluster is calculated. The ratio of the reciprocal of the first distance to the farthest distance is calculated to obtain the text weight of the target existing medical text. The target existing medical text is any existing medical text in the target cluster.

[0089] The weight of the target existing medical text is obtained by multiplying the cluster weight and the text weight corresponding to the target existing medical text.

[0090] Specifically, for example, a group contains m existing medical texts, and the clustering result of this group includes n clusters. Taking one of the clusters as the target cluster, the number of existing medical texts contained in the target cluster is p, where p is less than m.

[0091] The cluster weight of the target cluster is p / m.

[0092] The target cluster contains p existing medical texts. The distance between each of these p existing medical texts and the cluster center of the target cluster is calculated, yielding the first distance for each existing medical text. The furthest distance from each existing medical text in the target cluster to the cluster center is calculated; this furthest distance is the maximum first distance. Any existing medical text selected from the target cluster is then chosen as the target existing medical text. The ratio of the reciprocal of the first distance to this target existing medical text to the furthest distance is calculated, yielding the text weight of this target existing medical text.

[0093] The weight of an existing medical text for the same target is obtained by multiplying its text weight by the cluster weight of the target cluster to which it belongs.

[0094] The weight of any existing medical text in any cluster of any group can be calculated using this embodiment.

[0095] This embodiment calculates the cluster weight by determining the proportion of existing medical texts contained in a cluster to the total number of existing medical texts contained in its group. The text weight of each existing medical text within the cluster is obtained by calculating the ratio of the inverse of the first distance between each existing medical text and the cluster center to the farthest distance from the existing medical text to the cluster center. The weight of each existing medical text is then calculated using both text weight and cluster weight. This weight effectively reflects the representativeness of existing medical texts within the group. Existing medical texts with higher weights are more representative, occupy a larger proportion in the sampling, and are more likely to be selected, thus ensuring that the obtained sampled medical texts are as representative as possible.

[0096] In another specific embodiment, a preset number of existing medical texts with the shortest first distance from the cluster center can be selected as sampled medical texts for that cluster based on the first distance from the existing medical texts in each cluster within the same group. The preset number for each cluster is determined based on the proportion of existing medical texts contained in it to all existing medical texts.

[0097] In one embodiment, the clustering result includes multiple clusters. Step S102 specifically includes: calculating the ratio of the number of existing medical texts contained in the target cluster to the total number of all existing medical texts to obtain the cluster weight of the target cluster, wherein the target cluster is any cluster in the clustering result.

[0098] The distance between the target existing medical text and the cluster center of the target cluster is calculated as the first distance. The farthest distance from the existing medical text to the cluster center in the target cluster is calculated. The ratio of the reciprocal of the first distance to the farthest distance is calculated to obtain the text weight of the target existing medical text. Here, the target existing medical text is any existing medical text in the target cluster.

[0099] The weight of the target existing medical text is obtained by multiplying the cluster weight and the text weight corresponding to the target existing medical text.

[0100] This embodiment calculates the cluster weight of a cluster by determining the proportion of existing medical texts contained within that cluster relative to the total number of existing medical texts. The text weight of each existing medical text within the cluster is obtained by calculating the ratio of the inverse of the first distance between each existing medical text and the cluster center to the furthest distance from the existing medical text to the cluster center. The weight of each existing medical text is then calculated using both text weight and cluster weight. This weight effectively reflects the representativeness of the existing medical texts. Existing medical texts with higher weights are more representative, occupy a larger proportion in the sampling, and are more likely to be selected, thus ensuring that the obtained sampled medical texts are as representative as possible.

[0101] In one embodiment, step S105 or step S206 specifically includes:

[0102] All similar medical texts are blended into all existing medical texts to obtain data-enhanced medical texts;

[0103] or,

[0104] While keeping the number of existing medical texts unchanged, similar medical texts and existing medical texts are mixed according to a preset mixing ratio to obtain data-enhanced medical texts.

[0105] Specifically, in one embodiment, all obtained similar medical texts are mixed with all existing medical texts to perform data augmentation on the existing medical texts. The mixing in this application refers to treating both similar medical texts and existing medical texts as independent sample data and mixing them to obtain a dataset, which includes both similar and existing medical texts.

[0106] Alternatively, similar medical texts with low similarity can be removed, and the remaining similar medical texts can be mixed with existing medical texts to perform data augmentation on the existing medical texts.

[0107] In one specific embodiment, while keeping the number of existing medical texts unchanged, similar medical texts and existing medical texts are mixed according to a preset mixing ratio to obtain data-enhanced medical texts.

[0108] or,

[0109] While keeping the number of existing medical texts unchanged, the similar medical texts that are retained after removing similar medical texts with low similarity are mixed with the existing medical texts according to a preset mixing ratio to obtain data-enhanced medical texts.

[0110] The preset mixing ratio can be set so that the proportion of similar medical text is less than or equal to the proportion of existing medical text. If the number of similar medical texts is insufficient, the text can be supplemented by copying similar medical texts.

[0111] For example, the ratio of similar medical texts to existing medical texts may be 3:7, 4:6, or 2:8, etc., and this application does not impose any restrictions on this.

[0112] This embodiment achieves data enhancement of the original medical text through different hybrid methods.

[0113] In one embodiment, step S201 specifically includes:

[0114] Based on the model task objective, a target attribute label combination for classification is determined, wherein the target attribute label combination includes at least one attribute label;

[0115] Group existing medical texts based on the combination of target attribute tags.

[0116] Specifically, different datasets may be used for model training for different tasks. In this embodiment, the target attribute label combination for grouping can be determined according to the specific model task objective. The existing medical texts are grouped using the target attribute label combination to better fit the actual model training task.

[0117] For example, existing medical texts are texts describing diagnostic results, and these existing medical texts are grouped according to the diagnostic results and the age in the patient information.

[0118] Existing medical records diagnosing upper respiratory tract infection in patients aged 1-5 years were grouped into one group; those diagnosing upper respiratory tract infection in patients aged 6-18 years were grouped into another group; those diagnosing upper respiratory tract infection in patients aged 19-40 years were grouped into another group; those diagnosing upper respiratory tract infection in patients aged 41-60 years were grouped into another group; and those diagnosing upper respiratory tract infection in patients aged 60 years and older were grouped into yet another group.

[0119] Existing medical texts diagnosing diarrhea and patients aged 1-5 years were grouped into one group; those diagnosing diarrhea and patients aged 6-18 years were grouped into another group; those diagnosing diarrhea and patients aged 19-40 years were grouped into another group; those diagnosing diarrhea and patients aged 41-60 years were grouped into another group; and those diagnosing diarrhea and patients aged 60 years and older were grouped into yet another group.

[0120] Existing medical records diagnosing influenza in patients aged 1-5 years were grouped into one group; those diagnosing influenza in patients aged 6-18 years were grouped into another group; those diagnosing influenza in patients aged 19-40 years were grouped into another group; those diagnosing influenza in patients aged 41-60 years were grouped into another group; and those diagnosing influenza in patients aged 60 years and older were grouped into yet another group.

[0121] Attribute tags can be used to roughly group existing medical texts, and data augmentation can be performed on various types of medical texts in a targeted and uniform manner based on these groups. Compared with blind copying, this method can better enhance the diversity of the data.

[0122] In one embodiment, step 206 specifically includes:

[0123] While keeping the number of existing medical texts in the target group unchanged, similar medical texts and existing medical texts in the target group are mixed according to the pre-set data distribution ratio corresponding to the target group to obtain the data-enhanced medical texts of the target group. The target group is any one of the groups.

[0124] Specifically, based on the grouping and according to the corresponding data distribution ratio, all similar medical texts obtained in a group are mixed with all existing medical texts in that group to perform data augmentation on the existing medical texts.

[0125] Alternatively, by grouping similar medical texts with low similarity according to the corresponding data distribution ratio, the similar medical texts retained in a group can be mixed with all existing medical texts to perform data augmentation on the existing medical texts.

[0126] If there are not enough similar medical texts, the text can be supplemented by copying similar medical texts.

[0127] The proportions of data distribution for different groups can be the same or different.

[0128] In addition, all the grouped augmented medical texts are blended to obtain the data-augmented medical text.

[0129] This embodiment can mix different groups in different proportions according to the data distribution ratio of the group to achieve targeted data augmentation.

[0130] The dataset formed from the medical text obtained after data augmentation can be used for model training in different tasks, such as training models for disease diagnosis and drug recommendation. For disease diagnosis models, where the amount of training data is limited, the data augmentation method proposed in this solution can obtain additional, representative, and diverse data. Using the augmented data for model training can improve the diagnostic accuracy of the model.

[0131] This application proposes a data augmentation method for medical text data, based on advanced language generation models and sentence semantic similarity calculation methods. Compared to existing technologies that simply copy medical text for data augmentation, resulting in unrepresentative and diverse data, this application addresses the shortcomings of existing technologies by generating more representative and diverse data, enriching the types and quantity of data, thereby improving the generalization ability and accuracy of models using the augmented data. The proposed data augmentation method for medical text data has wide applications; the augmented dataset can be used to train models for different tasks such as disease diagnosis, drug recommendation, and symptom recognition, improving model performance compared to using the original dataset.

[0132] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0133] In one embodiment, a data enhancement device for medical text data is provided, which corresponds one-to-one with the data enhancement methods for medical text data described in the above embodiments. For example... Figure 4 As shown, the data augmentation device for the medical text data includes: a clustering module 101, a weight calculation module 102, a sampling module 103, a text generation module 104, and a data augmentation module 105. Detailed descriptions of each functional module are as follows:

[0134] Clustering module 101 is used to cluster existing medical texts to obtain clustering results;

[0135] The weight calculation module 102 is used to obtain the weight of each existing medical text based on the clustering results;

[0136] The sampling module 103 is used to establish a sampling population based on the weights of all existing medical texts, and to sample from the sampling population to obtain sampled medical texts. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to the weights.

[0137] Text generation module 104 is used to generate similar medical texts corresponding to sampled medical texts;

[0138] The data augmentation module 105 is used to augment existing medical texts with generated similar medical texts.

[0139] In one embodiment, a data enhancement device for medical text data is provided, which corresponds one-to-one with the data enhancement methods for medical text data described in the above embodiments. For example... Figure 5 As shown, the data augmentation device for the medical text data includes: a grouping module 201, a clustering module 202, a weight calculation module 203, a sampling module 204, a text generation module 205, and a data augmentation module 206. Detailed descriptions of each functional module are as follows:

[0140] Grouping module 201 is used to group existing medical text according to attribute tags;

[0141] Clustering module 202 is used to cluster existing medical texts in the same group to obtain the clustering results corresponding to each group;

[0142] The weight calculation module 203 is used to obtain the weight of each existing medical text in the target group based on the clustering results of the target group, wherein the target group is any one of the groups;

[0143] The sampling module 204 is used to establish a sampling population corresponding to the target group based on the weights of all existing medical texts in the target group, and to sample from the sampling population of the target group to obtain the sampled medical texts corresponding to the target group. The sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights.

[0144] Text generation module 205 is used to generate similar medical texts corresponding to sampled medical texts;

[0145] The data augmentation module 206 is used to augment existing medical texts using generated similar medical texts.

[0146] In one embodiment, the device further includes:

[0147] The similarity check module is used to perform semantic similarity checks between similar medical texts and their corresponding sampled medical texts.

[0148] The filtering module is used to remove similar medical texts with semantic similarity below a similarity threshold based on the obtained inspection results.

[0149] In one embodiment, a clustering result includes multiple clusters, and the weight calculation module 203 specifically includes:

[0150] The first calculation module is used to calculate the ratio of the number of existing medical texts contained in the target cluster to the number of existing medical texts contained in the target group corresponding to the target cluster, so as to obtain the cluster weight of the target cluster, wherein the target cluster is any cluster in the clustering results of the target group;

[0151] The second calculation module is used to calculate the distance between the target existing medical text and the cluster center of the target cluster as the first distance, calculate the farthest distance from the existing medical text to the cluster center in the target cluster, calculate the ratio of the reciprocal of the first distance to the farthest distance, and obtain the text weight of the target existing medical text. Here, the target existing medical text is any existing medical text in the target cluster.

[0152] The third calculation module is used to multiply the cluster weight and text weight corresponding to the target existing medical text to obtain the weight of the target existing medical text.

[0153] In one embodiment, the data augmentation module 105 or the data augmentation module 206 specifically includes:

[0154] The first data augmentation module is used to blend all similar medical texts into all existing medical texts to obtain data-augmented medical texts;

[0155] or,

[0156] The second data augmentation module is used to mix similar medical texts and existing medical texts according to a preset mixing ratio while keeping the number of existing medical texts unchanged, so as to obtain data-enhanced medical texts.

[0157] In one embodiment, the grouping module 201 specifically includes:

[0158] A label combination unit is used to determine a combination of target attribute labels for classification based on the model task objective, wherein the combination of target attribute labels includes at least one attribute label;

[0159] Grouping units are used to group existing medical text based on target attribute tag combinations.

[0160] In one embodiment, the data augmentation module 206 is specifically used to mix similar medical texts and existing medical texts of the target group according to the pre-set data distribution ratio corresponding to the target group while keeping the number of existing medical texts of the target group unchanged, so as to obtain medical texts after data augmentation of the target group, wherein the target group is any one of the groups.

[0161] Specific limitations regarding the data augmentation device for medical text data can be found in the limitations of the data augmentation method for medical text data described above, and will not be repeated here. Each module in the aforementioned data augmentation device for medical text data can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0162] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of a data augmentation method for medical text data.

[0163] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0164] Cluster existing medical texts to obtain clustering results;

[0165] Based on the clustering results, obtain the weight of each existing medical text;

[0166] Based on the weights of all existing medical texts, a sampling population is established, and samples are taken from the sampling population to obtain sampled medical texts. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to their weights.

[0167] Generate similar medical texts corresponding to the sampled medical texts;

[0168] Data augmentation of existing medical texts is performed using generated similar medical texts.

[0169] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, and the more likely it is to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Expanding existing medical texts with similar medical texts can help model training for different tasks achieve significant model performance improvements and increase model robustness.

[0170] or,

[0171] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0172] Group existing medical texts based on attribute tags;

[0173] Cluster the existing medical texts in the same group to obtain the clustering results for each group;

[0174] Based on the clustering results of the target group, obtain the weight of each existing medical text in the target group, where the target group is any one of the groups;

[0175] Based on the weights of all existing medical texts in the target group, a sampling population corresponding to the target group is established. Samples are taken from the sampling population of the target group to obtain the sampled medical texts corresponding to the target group. The sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights.

[0176] Generate similar medical texts corresponding to the sampled medical texts;

[0177] Data augmentation of existing medical texts is performed using generated similar medical texts.

[0178] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, making it more likely to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Furthermore, this embodiment pre-groups the existing medical texts and performs data augmentation according to the groups. The resulting similar medical texts are closer to the existing medical texts, ensuring data richness while also ensuring that the generated data is representative and similar to the existing medical texts. Expanding the existing medical texts with similar medical texts, the data-augmented medical texts can help the training of models for different tasks achieve significant model performance improvements and increase the robustness of the models.

[0179] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0180] Cluster existing medical texts to obtain the corresponding clustering results;

[0181] Based on the clustering results, obtain the weight of each existing medical text;

[0182] Based on the weights of all existing medical texts, a sampling population is established, and samples are taken from the sampling population to obtain sampled medical texts. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to their weights.

[0183] Generate similar medical texts corresponding to the sampled medical texts;

[0184] Data augmentation of existing medical texts is performed using generated similar medical texts.

[0185] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, and the more likely it is to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Expanding existing medical texts with similar medical texts can help model training for different tasks achieve significant model performance improvements and increase model robustness.

[0186] or,

[0187] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0188] Group existing medical texts based on attribute tags;

[0189] Cluster the existing medical texts in the same group to obtain the clustering results for each group;

[0190] Based on the clustering results of the target group, obtain the weight of each existing medical text in the target group, where the target group is any one of the groups;

[0191] Based on the weights of all existing medical texts in the target group, a sampling population corresponding to the target group is established. Samples are taken from the sampling population of the target group to obtain the sampled medical texts corresponding to the target group. The sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights.

[0192] Generate similar medical texts corresponding to the sampled medical texts;

[0193] Data augmentation of existing medical texts is performed using generated similar medical texts.

[0194] This embodiment obtains the weight of each existing medical text through clustering, constructs a sampling population composed of existing medical texts based on the weights, and samples are taken from the sampling population. The higher the weight, the more representative the existing medical text is and the larger its proportion in the sampling population, making it more likely to be sampled. Therefore, the final sampled medical texts are representative and diverse. Similarly, the similar medical texts generated based on the sampled medical texts are also representative and diverse. In addition, this application does not expand the data by simple copying, but by generating similar medical texts. Therefore, the obtained similar medical texts are more diverse and richer than text copying. Furthermore, this embodiment pre-groups the existing medical texts and performs data augmentation according to the groups. The resulting similar medical texts are closer to the existing medical texts, ensuring data richness while also ensuring that the generated data is representative and similar to the existing medical texts. Expanding the existing medical texts with similar medical texts, the data-augmented medical texts can help the training of models for different tasks achieve significant model performance improvements and increase the robustness of the models.

[0195] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0196] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0197] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0198] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A data augmentation method for medical text data, characterized in that, The method includes: Cluster existing medical texts to obtain clustering results; Based on the clustering results, obtain the weight of each existing medical text; A sampling population is established based on the weights of all existing medical texts. Sampled medical texts are obtained from the sampling population. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to the weights. Generate similar medical texts corresponding to the sampled medical texts; The existing medical text is augmented using the generated similar medical text. The step of clustering existing medical texts to obtain clustering results includes: grouping the existing medical texts according to attribute tags, clustering the existing medical texts in the same group, and obtaining the clustering result corresponding to each group; the existing medical texts are texts describing diagnostic results; The step of obtaining the weight of each existing medical text based on the clustering results includes: obtaining the weight of each existing medical text in the target group based on the clustering results of the target group, wherein the target group is any one of all groups; The step of establishing a sampling population based on the weights of all existing medical texts and sampling from the sampling population to obtain sampled medical texts includes: establishing a sampling population corresponding to the target group based on the weights of all existing medical texts in the target group, and sampling from the sampling population of the target group to obtain sampled medical texts corresponding to the target group, wherein the sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights; Wherein, a clustering result includes multiple clusters; the step of obtaining the weight of each existing medical text in the target group based on the clustering result of the target group includes: The cluster weight of the target cluster is obtained by calculating the ratio of the number of existing medical texts contained in the target cluster to the number of existing medical texts contained in the target group corresponding to the target cluster. The target cluster is any cluster in the clustering results of the target group. The distance between the target existing medical text and the cluster center of the target cluster is calculated as the first distance. The farthest distance from the existing medical text in the target cluster to the cluster center is calculated. The ratio of the reciprocal of the first distance to the farthest distance is calculated to obtain the text weight of the target existing medical text. The target existing medical text is any existing medical text in the target cluster. The weight of the target existing medical text is obtained by multiplying the cluster weight and the text weight corresponding to the target existing medical text.

2. The data augmentation method for medical text data as described in claim 1, characterized in that, Before performing data augmentation on the existing medical text using the generated similar medical text, the method further includes: Perform semantic similarity checks on the similar medical texts and the corresponding sampled medical texts; Based on the obtained inspection results, similar medical texts with semantic similarity below the similarity threshold will be removed.

3. The data augmentation method for medical text data as described in claim 1, characterized in that, The data augmentation of the existing medical text using the generated similar medical text includes: All similar medical texts are blended into all existing medical texts to obtain data-enhanced medical texts; or, While keeping the number of existing medical texts unchanged, similar medical texts and existing medical texts are mixed according to a preset mixing ratio to obtain data-enhanced medical texts.

4. The data augmentation method for medical text data as described in claim 1, characterized in that, The grouping of the existing medical text based on attribute tags includes: Based on the model task objective, a target attribute label combination for classification is determined, wherein the target attribute label combination includes at least one attribute label; Based on the target attribute tag combination, the existing medical texts are grouped.

5. The data augmentation method for medical text data as described in claim 4, characterized in that, The data augmentation of the existing medical text using the generated similar medical text includes: While keeping the number of existing medical texts in the target group unchanged, similar medical texts and existing medical texts in the target group are mixed according to the pre-set data distribution ratio corresponding to the target group to obtain medical texts after data augmentation of the target group, wherein the target group is any one of the groups.

6. A data enhancement device for medical text data, characterized in that, The device includes: The clustering module is used to cluster existing medical texts and obtain clustering results. The weight calculation module is used to obtain the weight of each existing medical text based on the clustering results; The sampling module is used to establish a sampling population based on the weights of all existing medical texts, and to sample from the sampling population to obtain sampled medical texts. The sampling population contains all existing medical texts, and the number of all existing medical texts in the sampling population is configured according to the weights. The text generation module is used to generate similar medical texts corresponding to the sampled medical texts; The data augmentation module is used to augment the existing medical text using the generated similar medical text; The clustering module is used to cluster existing medical texts to obtain clustering results. Specifically, it is used to: group the existing medical texts according to attribute tags, cluster the existing medical texts in the same group, and obtain the clustering result corresponding to each group; the existing medical texts are texts describing diagnostic results. The weight calculation module is used to obtain the weight of each existing medical text according to the clustering result. Specifically, it is used to obtain the weight of each existing medical text in the target group according to the clustering result of the target group, wherein the target group is any one of the groups. The sampling module is used to establish a sampling population based on the weights of all existing medical texts, and to sample from the sampling population to obtain sampled medical texts. Specifically, it is used to: establish a sampling population corresponding to the target group based on the weights of all existing medical texts in the target group, and to sample from the sampling population of the target group to obtain sampled medical texts corresponding to the target group. The sampling population of the target group contains all existing medical texts of the target group, and the number of all existing medical texts in the sampling population of the target group is configured according to the weights. A clustering result includes multiple clusters; the weight calculation module is used to obtain the weight of each existing medical text in the target group based on the clustering result of the target group, specifically for: The cluster weight of the target cluster is obtained by calculating the ratio of the number of existing medical texts contained in the target cluster to the number of existing medical texts contained in the target group corresponding to the target cluster. The target cluster is any cluster in the clustering results of the target group. The distance between the target existing medical text and the cluster center of the target cluster is calculated as the first distance. The farthest distance from the existing medical text in the target cluster to the cluster center is calculated. The ratio of the reciprocal of the first distance to the farthest distance is calculated to obtain the text weight of the target existing medical text. The target existing medical text is any existing medical text in the target cluster. The weight of the target existing medical text is obtained by multiplying the cluster weight and the text weight corresponding to the target existing medical text.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data augmentation method for medical text data as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data augmentation method for medical text data as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data enhancement method and device, equipment and storage medium

    CN114529778A

  • Data enhancement method and device, storage medium and electronic equipment

    CN114970516A