Data denoising method and device, electronic equipment and storage medium
By dynamically adjusting the cluster boundary and enhancing semantic information using large language models, the clustering results are optimized, which solves the problem of low accuracy caused by manual setting of cluster boundary in traditional methods, and achieves a more efficient data denoising effect.
Patent Information
- Application Number
- CN202411478311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional data denoising methods identify noise through unsupervised clustering strategies. However, clustering boundaries need to be manually set, resulting in low clustering accuracy and inability to effectively identify noise or introduce errors.
By obtaining the annotated data set, extracting sample features for clustering, generating reference labels to update cluster clusters, dynamically adjusting cluster boundaries, using large language models to enhance semantic information, and optimizing clustering results.
It improves the accuracy of clustering, enhances the denoising effect, reduces the consumption of computing resources, and reduces costs.
Smart Images

Figure CN119441723A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data denoising method, device, electronic device and storage medium. Background Art
[0002] At present, traditional data denoising methods use unsupervised clustering strategies to identify noise in samples. However, cluster boundaries usually need to be set manually. Since it is often difficult to accurately set appropriate cluster boundaries manually, the clustering accuracy is low. For example, when the cluster boundary is set too high, it may not be able to identify enough noise, resulting in too much noise remaining in the sample. For example, when the cluster boundary is set too low, it is easy to introduce too many errors, resulting in too much normal data being misjudged as noise. Therefore, the denoising effect of traditional methods is often not ideal. Summary of the invention
[0003] The following is a summary of the subject matter of the detailed description of the present disclosure. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present disclosure provide a data denoising method, device, electronic device and storage medium, which can improve the accuracy of clustering, thereby effectively improving the denoising effect.
[0005] On the one hand, an embodiment of the present disclosure provides a data denoising method, comprising:
[0006] Acquire a labeled data set, wherein the labeled data set includes a plurality of sample data and an original label corresponding to each of the sample data;
[0007] Extracting sample features corresponding to each of the sample data respectively, clustering each of the sample features to obtain at least one first clustering cluster, and determining target features based on the sample features that fail to be clustered;
[0008] Inputting the sample data corresponding to the first cluster into a first large language model for content generation to obtain a first reference label of the first cluster, concatenating the sample data corresponding to the first cluster with the first reference label to perform feature extraction, and updating the first cluster based on the feature extraction result;
[0009] Clustering the target feature with the updated first cluster to obtain a target cluster;
[0010] A second reference label of the target cluster is determined, and the annotated data set is denoised based on a difference between the original label and the second reference label.
[0011] On the other hand, the present disclosure also provides a data denoising device, including:
[0012] An acquisition module, used to acquire a labeled data set, wherein the labeled data set includes a plurality of sample data and an original label corresponding to each of the sample data;
[0013] A first clustering module, used to extract sample features corresponding to each of the sample data, cluster each of the sample features to obtain at least one first clustering cluster, and determine a target feature based on the sample features that fail to be clustered;
[0014] an updating module, configured to input the sample data corresponding to the first cluster into a first large language model for content generation, obtain a first reference label of the first cluster, perform feature extraction after concatenating the sample data corresponding to the first cluster with the first reference label, and update the first cluster based on the feature extraction result;
[0015] A second clustering module, used for clustering the target feature with the updated first cluster to obtain a target cluster;
[0016] The first denoising module is used to determine a second reference label of the target cluster, and denoise the annotated data set based on a difference between the original label and the second reference label.
[0017] Furthermore, the first clustering module is specifically used for:
[0018] Determine a first similarity between the sample feature that fails to be clustered and the cluster center of each of the first clustering clusters;
[0019] When the first similarity is less than a first threshold and greater than or equal to a second threshold, the sample feature for which clustering fails is determined as a target feature, wherein the first threshold is greater than the second threshold, and the second similarity between the sample feature in the first clustering cluster and the cluster center of the first clustering cluster is greater than or equal to the first threshold.
[0020] Furthermore, the above update module is specifically used for:
[0021] For each of the first clusters, when the first similarity corresponding to the first cluster is less than the first threshold and greater than or equal to the second threshold, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain a first reference label of the first cluster.
[0022] Furthermore, the second clustering module is specifically used for:
[0023] Determine a third similarity between the target feature and the updated cluster center of each of the first clustering clusters, and determine a first maximum value among the plurality of the third similarities;
[0024] When the first maximum value is greater than or equal to the first threshold, the target feature is added to the first cluster where the cluster center corresponding to the first maximum value is located.
[0025] Furthermore, the first clustering module is specifically used for:
[0026] Traversing each of the sample features, determining a fourth similarity between the traversed sample features and each cluster center, and determining a second maximum value among the plurality of fourth similarities, wherein the first traversed sample feature is used as the first cluster center;
[0027] When the second maximum value is greater than or equal to the first threshold, the traversed sample feature is added to the second cluster where the cluster center corresponding to the second maximum value is located; or, when the second maximum value is less than the first threshold, the traversed sample feature is used as a newly added cluster center;
[0028] For each of the second clusters, when the number of the sample features in the second cluster is greater than or equal to a third threshold, the second cluster is used as the first cluster.
[0029] Furthermore, the first clustering module is also used for:
[0030] When the number of the sample features in the second cluster is less than the third threshold, the sample features in the second cluster are used as the sample features for which clustering fails.
[0031] Furthermore, the first denoising module is specifically used for:
[0032] Voting for each of the original labels corresponding to the target cluster to obtain the number of votes for each of the original labels;
[0033] The original label corresponding to the maximum number of votes is determined as the second reference label of the target cluster.
[0034] Furthermore, the first denoising module is specifically used for:
[0035] Determining a fifth similarity between the sample features in the target cluster and the cluster center of the target cluster;
[0036] Inputting the fifth similarity into a weight prediction model for regression processing to obtain the voting weight of the original label corresponding to the sample feature;
[0037] Based on the voting weights, weighted voting is performed on each of the original labels corresponding to the target cluster to obtain the number of votes for each of the original labels.
[0038] Furthermore, the number of the first reference tags is multiple, and the updating module is specifically used for:
[0039] Extracting label features corresponding to each of the first reference labels, and determining a sixth similarity between each of the label features and a cluster center of the first cluster respectively;
[0040] In the descending order of the sixth similarity, each of the first reference tags is sequentially spliced with the sample data corresponding to the first cluster to obtain spliced data, and the spliced data is input into the feature extraction model for feature extraction.
[0041] Furthermore, the data denoising device further includes a second denoising module, which is specifically used for:
[0042] Inputting the sample data in the denoised labeled data set into the target model for classification processing to obtain a first prediction result;
[0043] Determine a model loss based on a difference between the first prediction result and the original label corresponding to the sample data, and train the target model based on the model loss;
[0044] Inputting the sample data in the denoised labeled data set into the trained target model for classification processing to obtain a second prediction result;
[0045] When the second prediction result is inconsistent with the original label corresponding to the sample data, or the confidence of the second prediction result is less than a fourth threshold, inputting the sample data into the second largest language model for label prediction to obtain a reference label for the sample data;
[0046] When the reference label is inconsistent with the original label corresponding to the sample data, the original label corresponding to the sample data is corrected to be consistent with the reference label.
[0047] Further, when the target model is a text classification model, the sample data is sample text data, and the original label is used to indicate that the sample text data belongs to an abnormal category or a normal category, the second denoising module is specifically used to:
[0048] Obtain keywords corresponding to the abnormal category;
[0049] Construct a prompt text for label prediction with reference to the keyword, concatenate the prompt text and the sample data and input them into the second largest language model for label prediction to obtain a benchmark label for the sample data, wherein the benchmark label is used to indicate that the sample text data belongs to the abnormal category or the normal category.
[0050] Furthermore, the second denoising module is specifically used for:
[0051] Acquire a plurality of test text data and a test label corresponding to each of the test text data, wherein the test label is used to indicate that the test text data belongs to the abnormal category or the normal category;
[0052] Inputting the test text data into the trained target model for classification processing to obtain a third prediction result;
[0053] Determining the prediction accuracy of the target model based on the difference between the third prediction result and the test label;
[0054] When the prediction accuracy is less than or equal to the fifth threshold, the sample data in the denoised labeled data set is input into the trained target model for classification processing to obtain a second prediction result.
[0055] On the other hand, an embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned data denoising method when executing the computer program.
[0056] On the other hand, an embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned data denoising method.
[0057] On the other hand, the embodiment of the present disclosure further provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned data denoising method.
[0058] The disclosed embodiment includes at least the following beneficial effects: by extracting sample features of sample data, then using each sample feature to obtain at least one first cluster through preliminary clustering, then inputting the sample data corresponding to the first cluster into the first large language model, because the first large language model has a wide range of knowledge reserves, the first large language model can use the semantic information of the sample data to generate a first reference label of the first cluster to enrich the semantic expression of the first cluster, then splicing the sample data corresponding to the first cluster with the first reference label to perform feature extraction, and then updating the first cluster based on the feature extraction result, that is, enhancing the semantic information of the first cluster through the first reference label, and then using the target feature and the updated first cluster through Further clustering obtains the target cluster cluster, and realizes the dynamic adjustment of the clustering boundary of the first cluster cluster based on the language understanding ability of the first largest language model to adapt to the change of data, so that the updated first cluster cluster can improve the judgment accuracy of the category attribution of the target feature. Since the target feature is determined based on the sample feature that failed clustering, the target cluster cluster is obtained by re-clustering the target feature that failed clustering based on the updated first cluster cluster, which can complete the clustering optimization and effectively improve the clustering accuracy. In the denoising process, it can not only identify enough noise, but also avoid introducing too many errors, thereby effectively improving the denoising effect. In addition, identifying noise through unsupervised clustering can effectively save computing resources and reduce costs.
[0059] Other features and advantages of the present disclosure will be set forth in the following description, and in part will be apparent from the description, or may be learned by practicing the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0061] Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present disclosure;
[0062] Figure 2 An optional flowchart of a data denoising method provided in an embodiment of the present disclosure;
[0063] Figure 3 An optional flowchart of similarity-based clustering provided in an embodiment of the present disclosure;
[0064] Figure 4 An optional flowchart of a weak and difficult noise sample identification and correction process provided by an embodiment of the present disclosure;
[0065] Figure 5 An optional flow chart of a training target model provided in an embodiment of the present disclosure;
[0066] Figure 6 An optional flow chart of determining a second prediction result provided in an embodiment of the present disclosure;
[0067] Figure 7 A schematic diagram of an optional process for determining a reference tag provided in an embodiment of the present disclosure;
[0068] Figure 8 Another optional flow chart of determining a reference tag provided in an embodiment of the present disclosure;
[0069] Fig. 9 An optional flow chart of determining prediction accuracy provided in an embodiment of the present disclosure;
[0070] Fig.10 An optional flowchart of a data denoising method provided in an embodiment of the present disclosure;
[0071] Fig.11 An optional structural diagram of a data denoising device provided in an embodiment of the present disclosure;
[0072] Fig.12 A partial structural block diagram of a terminal provided in an embodiment of the present disclosure;
[0073] Fig.13 A partial structural block diagram of a server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0075] It should be noted that in various specific embodiments of the present disclosure, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. Among them, the target object can be a user. In addition, when the embodiment of the present disclosure needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present disclosure will be obtained.
[0076] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0077] At present, traditional data denoising methods use unsupervised clustering strategies to identify noise in samples. However, cluster boundaries usually need to be set manually. Since it is often difficult to accurately set appropriate cluster boundaries manually, the clustering accuracy is low. For example, when the cluster boundary is set too high, it may not be able to identify enough noise, resulting in too much noise remaining in the sample. For example, when the cluster boundary is set too low, it is easy to introduce too many errors, resulting in too much normal data being misjudged as noise. Therefore, the denoising effect of traditional methods is often not ideal.
[0078] Based on this, the embodiments of the present disclosure provide a data denoising method, device, electronic device and storage medium, which can improve the accuracy of clustering, thereby effectively improving the denoising effect.
[0079] Reference Figure 1 , Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present disclosure, the implementation environment includes a terminal 101 and a server 102, wherein the terminal 101 and the server 102 are connected via a communication network.
[0080] Exemplarily, the server 102 can obtain a labeled data set sent by the terminal, wherein the labeled data set includes multiple sample data and original labels corresponding to each sample data, for example, the labeled data set includes sample data 1 to sample data N, and the labeled data set also includes original labels 1 to original labels N; extract sample features corresponding to each sample data respectively, cluster each sample feature to obtain at least one first clustering cluster, and determine the target feature based on the sample features that failed to cluster; input the sample data corresponding to the first clustering cluster into the first large language model for content generation to obtain a first reference label of the first clustering cluster, concatenate the sample data corresponding to the first clustering cluster with the first reference label to perform feature extraction, and update the first clustering cluster based on the feature extraction result; cluster the target feature with the updated first clustering cluster to obtain a target clustering cluster; determine the second reference label of the target clustering cluster, and denoise the labeled data set based on the difference between the original label and the second reference label.
[0081] The server 102 extracts sample features of the sample data, and then uses each sample feature to obtain at least one first cluster through preliminary clustering, and then inputs the sample data corresponding to the first cluster into the first large language model. Since the first large language model has a wide range of knowledge reserves, the first large language model can use the semantic information of the sample data to generate a first reference label of the first cluster to enrich the semantic expression of the first cluster, and then splices the sample data corresponding to the first cluster with the first reference label to perform feature extraction, and then updates the first cluster based on the feature extraction result, that is, enhances the semantic information of the first cluster through the first reference label, and then uses the target feature and the updated first cluster to further cluster. The target clustering cluster is obtained by classifying, and the clustering boundary of the first clustering cluster is dynamically adjusted based on the language understanding ability of the first language model to adapt to the change of data, so that the updated first clustering cluster can improve the judgment accuracy of the category attribution of the target feature. Since the target feature is determined based on the sample feature that failed to cluster, the target clustering cluster is obtained by clustering the target feature that failed to cluster based on the updated first clustering cluster. The clustering optimization can be completed and the clustering accuracy can be effectively improved. In the denoising process, sufficient noise can be identified and excessive errors can be avoided, thereby effectively improving the denoising effect. In addition, identifying noise through unsupervised clustering can effectively save computing resources and reduce costs.
[0082] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In addition, server 102 can also be a node server in a blockchain network.
[0083] The terminal 101 may be a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present disclosure.
[0084] Reference Figure 2 , Figure 2 An optional flow chart of a data denoising method provided in an embodiment of the present disclosure, the data denoising method can be executed by a server, or can also be executed by a terminal, or can also be executed by a server in cooperation with a terminal, the data denoising method includes but is not limited to the following steps 201 to 205.
[0085] Step 201: Obtain a labeled dataset.
[0086] The annotated data set includes multiple sample data and original labels corresponding to each sample data. The sample data may be in text form, image form, or voice form, for example, the sample data may be sample text data, sample image data, sample audio data, and the like.
[0087] It should be noted that the labeled dataset can be a dataset used to train the model. In supervised learning tasks, the original label represents the correct answer that the model should learn and output, that is, the ideal prediction result. The original label can have different forms of expression in different tasks, and the data form of the original label can also be text, image, or voice, etc. For example, in emotion recognition tasks, the original labels may include negative, positive, neutral, etc.
[0088] Optionally, in different types of training tasks, each sample data may correspond to a different number of original labels. The training tasks may include single-classification tasks and multi-classification tasks. Since the single-classification task is used to classify and identify the sample data and assign the sample data to one label, when the training task is a single-classification task, each sample data corresponds to one original label. Since the multi-classification task is used to classify and identify the sample data and assign the sample data to one or more labels, when the training task is a multi-classification task, each sample data may correspond to one or more original labels.
[0089] Specifically, the annotated data set can be read from the database of the server. For example, after the server completes automatic labeling of the sample data, the sample data and the corresponding original labels are associated and stored in the database. When the server receives a training request, the server reads multiple sample data and the original labels corresponding to each sample data from the database, that is, reads the annotated data set from the database; the annotated data set can also be received from the terminal. For example, when the terminal receives a training request, the terminal sends the annotated data set to the server.
[0090] In a possible implementation, the original labels corresponding to the sample data may be manually labeled or machine labeled, for example, the sample data is input into a label labeling model for automatic labeling. Optionally, the selection range of the original labels may be specified, for example, the labeler or the labeling machine needs to select the corresponding labels for the sample data from the pre-set candidate labels, and the selection range of the original labels may also be unspecified, for example, the labeler may label based on the subjective judgment of the sample data, and the labeling machine may also autonomously generate any labels.
[0091] Step 202: extracting sample features corresponding to each sample data respectively, clustering each sample feature to obtain at least one first cluster, and determining target features based on sample features that fail to be clustered.
[0092] Among them, extracting sample features corresponding to sample data is equivalent to extracting more abstract and more informative features from the sample data. When sample features are more informative, they can better capture the key patterns of sample data, which helps to cluster to obtain clearer and more effective clusters, and achieves similar sample features that can be more easily divided into the same first cluster, while the distance between sample features of different categories is more obvious, thereby improving the accuracy and discrimination of clustering.
[0093] It is worth noting that clustering refers to assigning each sample feature to different clusters according to the similarity between the sample features, so that the similarity between the sample features in the same cluster is high, and the similarity between the sample features in different clusters is low; assuming that the similarity of each sample feature is high, only one first cluster will be obtained by clustering, otherwise multiple first clusters will usually be obtained by clustering. Therefore, at least one first cluster can be obtained by clustering, and each first cluster contains multiple sample features.
[0094] It should be noted that the sample features in the first clustering cluster can be regarded as data points in the first clustering cluster, and the sample features in the first clustering cluster are also sample features of successful clustering, while the sample features that are not assigned to the first clustering cluster during the clustering process are sample features of failed clustering. Generally, the sample features of failed clustering are outliers or boundary points among the sample features. The outliers are sample features with low similarities with other sample features, so that the outliers cannot be assigned to any of the first clustering clusters, so the confidence of the outliers is low. The boundary points are sample features located in the boundary area of the first clustering cluster, so that the boundary points cannot be clearly assigned to a specific first clustering cluster, so the confidence of the boundary points is low, which is equivalent to that the sample features of failed clustering are usually sample features with confidence less than a preset condition; wherein the confidence can be determined based on the maximum value of the similarity between the sample features and the cluster centers of each first clustering cluster;
[0095] In addition, since the target feature is determined based on the sample features that failed clustering, the target feature is also the sample features that failed clustering. For example, all sample features that failed clustering can be used as the target feature, or only some sample features that failed clustering can be used as the target feature.
[0096] Step 203: Input the sample data corresponding to the first cluster into the first large language model for content generation, obtain the first reference label of the first cluster, concatenate the sample data corresponding to the first cluster with the first reference label, perform feature extraction, and update the first cluster based on the feature extraction result.
[0097] Among them, the first language model belongs to the large language model (Large Language Model l, LLM). The large language model is a deep learning model trained with a large amount of text data. It can generate natural language text or understand the meaning of language text. The large language model generally uses a recurrent neural network (RNN) or its variants, such as a long short-term memory network (LSTM) and a gated recurrent unit (GRU) to capture contextual information in a text sequence, thereby achieving tasks such as natural language text generation, language model evaluation, text classification, and sentiment analysis. In the field of natural language processing, large language models have been widely used, such as speech recognition, machine translation, automatic summarization, dialogue systems, intelligent question and answer, etc. Therefore, the first language model can effectively handle content generation tasks related to label generation.
[0098] It should be noted that the first reference label is used to indicate the semantic category of the first cluster. Since the first reference label is generated based on the sample data corresponding to the first cluster, the first reference label is usually the key content or theme content of the sample data corresponding to the first cluster. The first reference label can help understand the common characteristics of the first cluster, and therefore the semantic information of the first cluster can be enhanced through the first reference label.
[0099] Exemplarily, the first cluster corresponds to two sample data in text form, the first sample data is "Register now and enjoy a free trial", and the second sample data is "Join as a member immediately and enjoy more benefits". The sample data are concatenated and input into the first largest language model. The first largest language model can generate a first reference label of the first cluster as "promotion".
[0100] Based on this, the first reference label of the first cluster is first generated through the first language model with a deep knowledge reserve, and then the sample data corresponding to the first cluster is spliced with the first reference label and feature extraction is performed, which can update the sample features. Under the influence of the rich semantic information of the first reference label, the semantic information contained in the sample features can be enhanced. Then, the first cluster is updated based on the feature extraction result, which can effectively enhance the semantic information of the first cluster, thereby improving the accuracy of clustering. In addition, the compactness of the first cluster can be appropriately improved to avoid excessive dispersion of sample features in the same first cluster. While effectively distinguishing the difference and diversity of the data, it can effectively reveal the internal structure and pattern of the data and improve the accuracy of clustering. Moreover, the clustering boundary of the first cluster will also change with the update of the sample features. Therefore, it is realized to dynamically adjust the clustering scale based on the language understanding ability of the first language model, that is, to adjust the clustering boundary of the first cluster to adapt to the change of data.
[0101] In one possible implementation, the sample data corresponding to the first cluster is spliced with the first reference label and then feature extraction is performed. Specifically, the first reference label can be directly spliced to the head or tail of the sample data corresponding to the first cluster, and then feature extraction is performed on the splicing result. Alternatively, the first reference label, a preset connection symbol, and the sample data can be spliced in sequence, and then feature extraction is performed on the splicing result. In this way, the data pattern of the splicing result can be understood during feature extraction, thereby effectively understanding the relationship between the first reference label and the sample data, thereby improving the quality of feature extraction.
[0102] Step 204: clustering the target feature with the updated first cluster to obtain a target cluster.
[0103] Among them, the target clustering cluster is obtained by re-clustering the target features that failed to cluster based on the updated first clustering cluster. Some target features can be attributed to the specific updated first clustering cluster. Therefore, some target clustering clusters can include both updated sample features and target features.
[0104] Step 205: Determine a second reference label of the target cluster, and denoise the labeled data set based on the difference between the original label and the second reference label.
[0105] The second reference label is used to indicate the semantic category of the second cluster, that is, the second reference label can indicate the classification category of the target cluster, and the original label corresponding to the sample data is used to indicate the classification category of the sample data.
[0106] It is worth noting that, in an ideal situation, the original labels of each sample data corresponding to the same target cluster cluster will be consistent with the second reference label of the target cluster cluster; however, in actual situations, there are often original labels that are inconsistent with the second reference labels, that is, there are original labels with incorrect annotations, which is equivalent to when there is a difference between the original label and the second reference label, the sample data corresponding to the original label belongs to the noise in the annotated data set, and when there is no difference between the original label and the second reference label, the sample data corresponding to the original label does not belong to the noise. Then, after identifying the noise in the annotated data set, the annotated data set needs to be denoised, for example, the sample data corresponding to the original label with incorrect annotations is eliminated, or the original label with incorrect annotations is corrected to a label consistent with the second reference label, and the embodiments of the present disclosure are not limited here.
[0107] Based on this, by extracting sample features of sample data, and then using each sample feature to obtain at least one first cluster through preliminary clustering, the sample data corresponding to the first cluster is input into the first large language model. Since the first large language model has a wide range of knowledge reserves, the first large language model can use the semantic information of the sample data to generate a first reference label of the first cluster to enrich the semantic expression of the first cluster. The sample data corresponding to the first cluster is then spliced with the first reference label to perform feature extraction, and then the first cluster is updated based on the feature extraction result, that is, the semantic information of the first cluster is enhanced by the first reference label, and then the target feature is used to further enhance the semantic information of the first cluster with the updated first cluster. Clustering obtains the target cluster cluster, and realizes the dynamic adjustment of the cluster boundary of the first cluster cluster based on the language understanding ability of the first largest language model to adapt to the change of data, so that the updated first cluster cluster can improve the accuracy of the judgment of the category attribution of the target feature. Since the target feature is determined based on the sample feature that failed clustering, the target cluster cluster is obtained by re-clustering the target feature that failed clustering based on the updated first cluster cluster, which can complete the clustering optimization and effectively improve the accuracy of clustering. In the denoising process, it can not only identify enough noise, but also avoid introducing too many errors, thereby effectively improving the denoising effect. In addition, identifying noise through unsupervised clustering can effectively save computing resources.
[0108] Specifically, the target feature may be determined in a variety of ways, and the first way of determining the target feature is described in detail below.
[0109] In a possible implementation, the target feature is determined based on the sample feature that failed clustering. Specifically, the first similarity between the sample feature that failed clustering and the cluster center of each first clustering cluster is determined; when the first similarity is less than a first threshold and greater than or equal to a second threshold, the sample feature that failed clustering is determined as the target feature.
[0110] Among them, the cluster center of the first cluster cluster refers to the centroid of all data points in the first cluster cluster. The cluster center can usually be determined according to the mean of all sample features in the first cluster cluster. Therefore, the cluster center of the first cluster cluster can effectively represent the characteristics and main ideas of the cluster. For example, the cluster center of the first cluster cluster can represent the representative characteristics of the cluster and characterize the pattern of the cluster.
[0111] For example, the first cluster includes three sample features, and the calculation formula of the cluster center of the first cluster is as follows:
[0112] e ori =(e1+e2+e3) / 3
[0113] Among them, e ori is the cluster center of the first cluster, e1 is the first sample feature, e2 is the second sample feature, and e3 is the third sample feature.
[0114] Among them, the first threshold is greater than the second threshold, the second threshold is greater than 0, the second similarity between the sample features in the first clustering cluster and the cluster center of the first clustering cluster is greater than or equal to the first threshold, and the second similarity can indicate the confidence between the sample features of successful clustering and the first clustering cluster, while the first similarity is less than the first threshold, and the first similarity can indicate the confidence between the sample features of failed clustering and the first clustering cluster.
[0115] It is worth noting that when the first similarity is higher, the sample features representing clustering failure are closer to the representative features of the first clustering cluster, and when the first similarity is lower, the sample features representing clustering failure are less close to the representative features of the first clustering cluster; since the second similarity is greater than or equal to the first threshold, the first threshold can be regarded as the clustering boundary of the first clustering cluster, and since the sample features of clustering failure are not attributed to the first clustering cluster, the first similarity will be less than the first threshold.
[0116] Based on this, by setting a second threshold value less than the first threshold value, for each sample feature that fails to cluster, it is necessary to determine whether there is a first similarity that is less than the first threshold value and greater than or equal to the second threshold value. When the first similarity is less than the second threshold value, it can be considered that the sample feature that fails to cluster is too different from the representative feature of the first cluster cluster. When the first similarity is less than the first threshold value and greater than or equal to the second threshold value, the sample feature that fails to cluster is relatively similar to the cluster center of the first cluster cluster. It can be considered that the sample feature that fails to cluster is relatively close to the representative feature of the first cluster cluster. The sample feature that fails to cluster is likely to belong to the first cluster cluster. At this time, the sample feature that fails to cluster is determined as the target feature. It can be considered that the target feature is located in the fuzzy area, that is, the target feature can be regarded as a fuzzy point. Subsequently, it is only necessary to further determine the category attribution of the target feature, that is, to cluster the target feature again, without the need to cluster the sample feature that fails to cluster and is clearly considered not to belong to the first cluster cluster again. This can effectively improve the clustering efficiency, thereby improving the denoising efficiency while ensuring the denoising effect.
[0117] Exemplarily, the value range of the first similarity can be [0,1], the first threshold is set to 0.9, and the second threshold is set to 0.8. For each sample feature that failed to cluster, when the first similarity between the sample feature that failed to cluster and the cluster center of any first clustering cluster is less than 0.9 and greater than or equal to 0.8, the sample feature that failed to cluster is determined as the target feature; and when the first similarity between the sample feature that failed to cluster and the cluster center of any first clustering cluster is less than 0.8, the sample feature that failed to cluster is no longer processed and can be regarded as a new category.
[0118] It should be noted that the first similarity and the second similarity may both be cosine similarity, or may be calculated by other methods. In addition, the first threshold and the second threshold may be set to other values according to actual conditions, which is not limited in the embodiments of the present disclosure.
[0119] The second method for determining target features is described in detail below.
[0120] In one possible implementation, target features are determined based on features of samples that failed to cluster. Specifically, features of each sample that failed to cluster are taken as target features, and the features of each sample that failed to cluster are clustered again, which can ensure the accuracy of the re-clustering and thus improve the optimization effect of clustering.
[0121] Specifically, the first reference label may be determined in a variety of ways. The first way of determining the first reference label is described in detail below. Subsequently, only the first cluster around the target feature needs to be updated.
[0122] In a possible implementation, sample data corresponding to the first cluster is input into the first large language model for content generation to obtain a first reference label of the first cluster. Specifically, for each first cluster, when the first similarity corresponding to the first cluster is less than a first threshold and greater than or equal to a second threshold, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain a first reference label of the first cluster.
[0123] Among them, when the first similarity corresponding to the first cluster is less than the first threshold and greater than or equal to the second threshold, it means that the similarity between the target feature and the cluster center of the first cluster is high. At this time, the first cluster can be used as the first cluster around the target feature; conversely, when the first similarity corresponding to the first cluster is less than the second threshold, it means that the similarity between the target feature and the cluster center of the first cluster is low. At this time, the first cluster can be used as the first cluster far away from the target feature.
[0124] Based on this, since the target feature is closer to the surrounding first cluster and farther away from the first cluster, the target feature will usually only belong to the surrounding first cluster. Only the first cluster around the target feature needs to be updated. Specifically, the sample data is input into the first largest language model. The first largest language model uses the semantic information of the sample data to generate the first reference label of the surrounding first cluster to enrich the semantic expression of the surrounding first cluster, thereby improving the accuracy of the judgment on the category attribution of the target feature. Subsequently, the first cluster around the target feature can be updated without updating the first cluster far away from the target feature. The overall update efficiency of the first cluster can be improved, thereby improving the denoising efficiency while ensuring the denoising effect.
[0125] In a possible implementation, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain the first reference label of the first cluster. Specifically, the sample data corresponding to the first cluster is sorted in descending order according to the fourth similarity corresponding to each sample feature in the first cluster, and the sample data arranged in the first N are spliced and input into the first large language model for content generation to obtain the first reference label of the first cluster, wherein N is a positive integer. Based on this, the greater the fourth similarity, the closer the representative sample feature is to the representative feature of the first cluster. Therefore, after the sample data corresponding to the first cluster is sorted in descending order according to the fourth similarity, only the first N sample data are spliced and input into the first large language model for content generation. This can effectively improve the generation efficiency of the first reference label while ensuring the accuracy of the first reference label, thereby improving the denoising efficiency.
[0126] The second method of determining the first reference tag is described in detail below, and all first clusters need to be updated subsequently.
[0127] In one possible implementation, sample data corresponding to the first cluster is input into the first large language model for content generation to obtain a first reference label of the first cluster. Specifically, sample data corresponding to each first cluster is input into the first large language model for content generation to obtain a first reference label of each first cluster, and all first clusters are subsequently updated to ensure the accuracy of re-clustering, thereby improving the optimization effect of clustering.
[0128] In one possible implementation, the target feature is clustered with the updated first clustering cluster to obtain the target clustering cluster. Specifically, the third similarity between the target feature and the cluster centers of each updated first clustering cluster is determined, and a first maximum value is determined among multiple third similarities; when the first maximum value is greater than or equal to a first threshold, the target feature is added to the first clustering cluster where the cluster center corresponding to the first maximum value is located.
[0129] Based on this, after updating the first clustering cluster, since the cluster center of the first clustering cluster usually changes, it is necessary to redetermine the similarity. Specifically, it is necessary to determine the third similarity between the target feature and the cluster center of each updated first clustering cluster. The third similarity can indicate the confidence between the target feature and the updated first clustering cluster, and then determine whether the largest first maximum value in the third similarity is greater than or equal to the first threshold as the cluster boundary. When the first maximum value is greater than or equal to the first threshold, it means that the target feature is located in the first clustering cluster corresponding to the first maximum value, and then the target feature is added to the first clustering cluster where the cluster center corresponding to the first maximum value is located. After traversing all target features as fuzzy points, the category affiliation of each target feature can be determined, and the clustering optimization is completed. This optimization process can effectively improve the accuracy of clustering by introducing fuzzy points and using the first language model for semantic expansion.
[0130] It should be noted that the third similarity may be cosine similarity, or may be calculated by other methods, which is not limited in the embodiments of the present disclosure.
[0131] In a possible implementation, clustering the target feature with the updated first cluster to obtain the target cluster also includes: when the first maximum value is less than the first threshold, creating a new first cluster and assigning the target feature to the newly created first cluster, or removing the target feature.
[0132] In a possible implementation, each sample feature is clustered to obtain at least one first clustering cluster. Specifically, each sample feature may be traversed to determine the fourth similarity between the traversed sample feature and each cluster center, and a second maximum value is determined among multiple fourth similarities; when the second maximum value is greater than or equal to a first threshold, the traversed sample feature is added to the second clustering cluster where the cluster center corresponding to the second maximum value is located, or, when the second maximum value is less than the first threshold, the traversed sample feature is used as the newly added cluster center; for each second clustering cluster, when the number of sample features in the second clustering cluster is greater than or equal to a third threshold, the second clustering cluster is used as the first clustering cluster.
[0133] Among them, the first traversed sample feature is used as the first cluster center. The first cluster center can be determined in one of the following two ways: Method 1: Before traversing each sample feature, an empty second cluster cluster can be initialized. When traversing the first sample feature, the first traversed sample feature is attributed to the second cluster cluster, and the cluster center of the second cluster cluster is set to the first traversed sample feature; Method 2: When traversing the first sample feature, a new second cluster cluster will be created, and the first traversed sample feature will be attributed to the newly created second cluster cluster, and the cluster center of the newly created second cluster cluster will be set to the first traversed sample feature.
[0134] It should be noted that, since the first cluster center does not exist when the first sample feature is traversed, the fourth similarity corresponding to the first traversed sample feature can be considered to be equal to 0. Therefore, the second maximum value will be smaller than the first threshold, and then the first traversed sample feature will be used as the newly added cluster center.
[0135] It is worth noting that every time a new sample feature is added to the second cluster, the cluster center of the second cluster needs to be recalculated to ensure the accuracy of the cluster center of the second cluster. The cluster center of the second cluster refers to the centroid of all data points in the second cluster. The cluster center can usually be determined based on the mean of all sample features in the second cluster. Therefore, the cluster center of the second cluster can effectively represent the characteristics and main ideas of the cluster. For example, the cluster center of the second cluster can represent the representative characteristics of the cluster and the pattern that characterizes the cluster.
[0136] Based on this, the preliminary clustering can adopt the clustering based on similarity, which specifically needs to traverse each sample feature, calculate the fourth similarity between the currently traversed sample feature and the cluster center of each existing second cluster cluster, the fourth similarity can indicate the confidence between the sample feature and the updated second cluster cluster, and then find the second cluster cluster with the second maximum value of the sample feature. When the second maximum value is greater than or equal to the first threshold, the currently traversed sample feature is added to the second cluster cluster of the second maximum value. When the second maximum value is less than the first threshold, the currently traversed sample feature does not belong to any of the existing second cluster clusters, and a new second cluster cluster needs to be created. The traversed sample features are assigned to the newly created second clustering cluster, and the cluster center of the newly created second clustering cluster is set to the currently traversed sample features. According to the above method, all sample features are traversed. Since each sample feature only needs to be traversed once, the calculation speed is very fast, that is, the clustering efficiency is very high; then, since the clustering cluster will be more reasonable and effective when the scale of data points in the clustering cluster is large enough, the second clustering cluster will be used as the first clustering cluster when the number of sample features in the second clustering cluster is greater than or equal to the third threshold, which can ensure that the scale of data points in the first clustering cluster is large enough, that is, ensure that the first clustering cluster is reasonable and effective, and can improve the reliability of the clustering results.
[0137] Specifically, the third threshold can be preset to 2, that is, only the second clusters containing two or more will be used as the first cluster, and the second cluster containing a single sample feature will not be used as the first cluster. The third threshold can also be set to other values, which is not limited in the embodiments of the present disclosure.
[0138] It should be noted that the fourth similarity may be cosine similarity, or may be calculated by other methods, which is not limited in the embodiments of the present disclosure.
[0139] Specifically, refer to Figure 3 , Figure 3 An optional flowchart of similarity-based clustering provided in an embodiment of the present disclosure.
[0140] First, start traversing each sample feature in the feature list and first obtain the first sample feature in the feature list, where the feature list refers to a list composed of each sample feature;
[0141] Then, determine whether the current sample feature is the first traversed sample feature. If the current sample feature is the first traversed sample feature, create a new second cluster, assign the current sample feature to the newly created second cluster, and the cluster center of the newly created second cluster is the current sample feature v.
[0142] Then, determine whether the current sample feature is the last sample feature traversed. If the current sample feature is not the last sample feature traversed, obtain the next sample feature in the feature list, and determine again whether the current sample feature is the first sample feature traversed.
[0143] Then, when the current sample feature is not the first traversed sample feature, the fourth similarity between the current sample feature v and each cluster center is calculated, and the second maximum value s and the corresponding second cluster c are taken, wherein the second maximum value s is the maximum value among the fourth similarities, and the second cluster c is the second cluster where the cluster center corresponding to the second maximum value s is located;
[0144] Then, it is determined whether the second maximum value s is greater than or equal to the first threshold value. The first threshold value is equivalent to the similarity threshold value used in the clustering process. The first threshold value is usually larger. For example, the first threshold value can be set to 0.9. When s is greater than or equal to the first threshold value, a new second cluster is created, and the current sample feature is assigned to the newly created second cluster. The cluster center of the newly created second cluster is the current sample feature v. When s is less than the first threshold value, the current sample feature v is added to the second cluster c, and the cluster center of the second cluster c is updated.
[0145] Then, it is determined again whether the current sample feature is the last sample feature traversed, and clustering is completed when the current sample feature is the last sample feature traversed.
[0146] It should be noted that, in addition to the similarity-based clustering, the preliminary clustering may also be performed by hierarchical clustering, k-means clustering, etc., which is not limited in the embodiments of the present disclosure.
[0147] In a possible implementation, clustering each sample feature to obtain at least one first cluster further includes: when the number of sample features in the second cluster is less than a third threshold, using the sample features in the second cluster as sample features that failed clustering.
[0148] Based on this, when the number of sample features in the second cluster is less than the third threshold, the sample features in the second cluster will be used as sample features for clustering failure, which is equivalent to treating the sample features that are not assigned to the first cluster as sample features for clustering failure, so that the sample features for clustering failure are outliers or boundary points among the sample features. By comparing the number of sample features in the second cluster with the third threshold, the unreasonable or invalid second cluster can be accurately screened out, and then the sample features for clustering failure can be accurately determined.
[0149] Specifically, the second reference tag may be determined in a variety of ways, and a first way of determining the second reference tag is described in detail below.
[0150] In a possible implementation, the second reference label of the target cluster is determined by voting on the original labels corresponding to the target cluster to obtain the number of votes for each original label; and the original label corresponding to the largest number of votes is determined as the second reference label of the target cluster.
[0151] Specifically, each original label can be regarded as one vote or other number of votes, and the number of votes can be determined by one of the following methods: Method 1: traverse each original label, increase the number of votes for the category to which the traversed original label belongs, and after the traversal is completed, determine the number of votes for each original label as the number of votes for the category to which it belongs; Method 2: traverse each original label, and while increasing the number of votes for the traversed original label, increase the number of votes for other original labels that belong to the same category as the traversed original label. After the traversal is completed, the number of votes for each original label can be obtained.
[0152] Based on this, the voting method can quickly and accurately determine the main label of the target cluster. Specifically, each original label corresponding to the target cluster will participate in the voting, and the number of votes for each original label can be effectively determined. Finally, the original label with the largest number of votes will be determined as the second reference label of the target cluster. The second reference label is equivalent to the main label of the target cluster. Therefore, the second reference label can be used as a reference standard for correcting the incorrectly labeled original label. Assuming that the original label of the sample data corresponding to the target cluster is inconsistent with the second reference label of the target cluster, it means that the original label is incorrectly labeled. The original label can be corrected to a label consistent with the second reference label, which can ensure the reliability of the denoising result.
[0153] It should be noted that the determination of the second reference label of the target cluster by the voting method needs to meet the following assumption: the majority of the original labels corresponding to the target cluster are correctly labeled.
[0154] In one possible implementation, votes are cast on each original label corresponding to the target cluster to obtain the number of votes for each original label. Specifically, the fifth similarity between the sample features in the target cluster and the cluster center of the target cluster is determined; the fifth similarity is input into a weight prediction model for regression processing to obtain the voting weight of the original label corresponding to the sample features; and weighted voting is performed on each original label corresponding to the target cluster based on the voting weight to obtain the number of votes for each original label.
[0155] The target cluster will include the sample features in the first cluster, and may also include newly added target features. Since the target features also belong to the sample features, all the features included in the target feature cluster belong to the sample features.
[0156] The voting weight is used to indicate the number of votes for the original label. The greater the voting weight of the original label, the greater the influence of the original label on the final result. The smaller the voting weight of the original label, the smaller the influence of the original label on the final result.
[0157] Based on this, the fifth similarity between the sample features in the target cluster and the cluster center of the target cluster is calculated. The fifth similarity can indicate the confidence between the sample features and the target cluster. Then the fifth similarity is input into the weight prediction model. The weight prediction model can refer to the fifth similarity to determine the influence of the original label, and then predict the accurate voting weight. Then, weighted voting is performed on the original label based on the voting weight to obtain the accurate amount of votes.
[0158] It should be noted that the fifth similarity may be cosine similarity, or may be calculated by other methods, which is not limited in the embodiments of the present disclosure.
[0159] In one possible implementation, the weight prediction model is a trained regression model, and the training steps of the weight prediction model are as follows: first, obtain training samples, wherein the training samples include training similarities and training labels corresponding to the training similarities; then, input the training similarities into the weight prediction model for regression processing to obtain predicted weights; then, determine the training loss based on the difference between the predicted weights and the training labels, and train the weight prediction model based on the training loss, so that the weight prediction model can learn to determine the influence of the original labels with reference to the fifth similarity, and then predict accurate voting weights in the inference stage.
[0160] The second method for determining the second reference tag is described in detail below.
[0161] In a possible implementation, the second reference label of the target cluster is determined, specifically by inputting sample features in the target cluster into the third largest language model for label prediction to obtain the second reference label of the target cluster; based on this, since the third largest language model is a large language model with a wide range of knowledge reserves, it can further improve the accuracy of the second reference label, thereby further improving the denoising effect.
[0162] In a possible implementation, there are multiple first reference labels, and feature extraction is performed after the sample data corresponding to the first cluster is spliced with the first reference labels. Specifically, the label features corresponding to each first reference label are extracted, and the sixth similarity between each label feature and the cluster center of the first cluster is determined respectively; in descending order of the sixth similarity, each first reference label is spliced with the sample data corresponding to the first cluster in turn to obtain spliced data, and the spliced data is input into the feature extraction model for feature extraction.
[0163] Here, extracting the label feature corresponding to the first reference label is equivalent to extracting a more abstract and more informative feature from the first reference label.
[0164] It should be noted that when the label feature and the cluster center of the first cluster are located in the same feature space, the sixth similarity between the label feature and the cluster center of the first cluster can be directly calculated. However, when the label feature and the cluster center of the first cluster are located in different feature spaces, it is necessary to first project the label feature and the cluster center of the first cluster to the same feature space, and then determine the sixth similarity, thereby ensuring the reliability of the sixth similarity.
[0165] Based on this, the sixth similarity between the label feature and the cluster center of the first clustering cluster is calculated. The sixth similarity can indicate the confidence between the label feature and the first clustering cluster. When the sixth similarity is larger, the semantic information representing the first reference label is closer to the semantic information of the first clustering cluster. Then, in order of the sixth similarity from large to small, each first reference label is spliced with the sample data corresponding to the first clustering cluster in turn to obtain spliced data. When the spliced data is input into the feature extraction model for feature extraction, the feature extraction model can capture the rich semantic information of the first reference label and understand the relationship between each first reference label and the sample data, thereby enhancing the semantic information contained in the sample feature. Since the semantic enhancement effect of the first reference label closer to the sample data is greater, while ensuring the enhancement of the semantic information contained in the sample feature, the sample feature can also be made closer to the cluster center of the first clustering cluster, thereby further improving the compactness of the first clustering cluster and further improving the accuracy of clustering.
[0166] It should be noted that the sixth similarity may be cosine similarity, or may be calculated by other methods, which is not limited in the embodiments of the present disclosure.
[0167] It is worth noting that when the sample data is sample text data, the feature extraction model can be a pre-trained language model in the field of natural language processing, for example, the feature extraction model includes a language model represented by a bidirectional encoder (Bid irect iona lEncoder Representation from Transformers, BERT), a generative pre-training model (Generative Pre-Train ing Model l, GPT), a robustly optimized BERT Pretraining Approach (RoBERTa), etc.;
[0168] When the sample data is sample image data, the feature extraction model can be a pre-trained image model in the field of computer vision processing. For example, the feature extraction model includes a Visual Geometry Group Network (VGG) model, a Dense Convolutional Network (DenseNet) model, a Slow Fast Networks (SlowFast) model, a Long Short-Term Memory (LSTM) model, and the like.
[0169] When the sample content is sample audio data, the feature extraction model can be a pre-trained speech model in the field of audio processing. For example, the feature extraction model includes a network model, an acoustic model, a language model, etc. obtained based on a multi-head attention mechanism (MHA).
[0170] In a possible implementation, the data denoising method also includes: inputting the sample data in the denoised labeled data set into the target model for classification processing to obtain a first prediction result; determining the model loss based on the difference between the first prediction result and the original label corresponding to the sample data, and training the target model based on the model loss; inputting the sample data in the denoised labeled data set into the trained target model for classification processing to obtain a second prediction result; when the second prediction result is inconsistent with the original label corresponding to the sample data, or the confidence of the second prediction result is less than a fourth threshold, inputting the sample data into the second largest language model for label prediction to obtain a baseline label of the sample data; when the baseline label is inconsistent with the original label corresponding to the sample data, correcting the original label corresponding to the sample data to a label consistent with the baseline label.
[0171] Among them, the target model is used to complete the classification task, the target model is trained through supervised training, the first prediction result is used to indicate the classification category predicted by the sample data during the training process, and the second prediction result is used to indicate the classification category predicted by the sample data during the reasoning process.
[0172] Among them, similar to the first language model, the second language model is also a large language model. The second language model also has a wide range of knowledge reserves. The second language model can be used as an automatic annotation tool.
[0173] Based on this, the denoising process can be divided into three stages. First, in the first stage, the clustering boundary of the first cluster cluster is dynamically adjusted based on the language understanding ability of the first large language model, and then the labeled data set is denoised. It can correct the weak and difficult noise data in the labeled data set at a low cost, and realize the unsupervised correction of weak and difficult noise data based on the large language model. Weak and difficult noise data refers to the noise that can be identified by the unsupervised clustering strategy.
[0174] Then, in the second stage, the target model is trained using the denoised labeled data set, which is equivalent to using the labeled data set after the weak and difficult noise data has been corrected in the first stage to fine-tune the target model and obtain the initial version of the target model;
[0175] Then, in the third stage, since the trained target model has a certain classification ability, the prediction result of the trained target model can be used to determine whether the original label is correctly labeled. When the second prediction result obtained by the target model for classifying the sample data is consistent with the original label, and the confidence of the second prediction result is greater than or equal to the fourth threshold, it can be considered that the original label has been correctly labeled;
[0176] When the second prediction result output by the target model is inconsistent with the original label, it means that the original label may be incorrectly labeled or the target model makes an incorrect prediction due to insufficient model capability, and it cannot be determined that the original label has been correctly labeled. When the confidence of the second prediction result is less than the fourth threshold, it means that the target model cannot clearly classify the sample data into a certain category due to insufficient model capability, and the credibility of the second prediction result is low, and it cannot be determined that the original label has been correctly labeled.
[0177] Then, when it is impossible to determine whether the original label has been correctly labeled, the second largest language model is used to predict the baseline label of the sample data, which is equivalent to using the large language model to label only a part of the sample data that may have noise, rather than reasoning on the entire data, which greatly reduces the demand for computing resources; since the second largest language model has a strong content understanding ability, it can help judge the true category of the sample data based on understanding the semantics of the sample data, so the baseline label can be used as the correct labeling result of the sample data. When the baseline label is inconsistent with the original label corresponding to the sample data, it means that the original label is incorrectly labeled. At this time, the original label is corrected to a label consistent with the baseline label, realizing supervised strong and difficult noise data correction based on the large language model, which can further improve the denoising effect. Strong and difficult noise data is noise that can only be recognized after training the target model; therefore, the above three stages jointly provide a data denoising method for semi-supervised strong and weak difficult noise data correction based on a large language model.
[0178] Specifically, the fourth threshold can be preset to 0.5, that is, when the confidence of the second prediction result is less than 0.5, it means that the target model cannot clearly classify the sample data into a certain category, and the credibility of the second prediction result is low. It is impossible to determine whether the original label has been correctly labeled. It is necessary to use the benchmark label predicted by the second largest language model to determine whether the original label is correctly labeled. The fourth threshold can also be set to other values, which are not limited in the embodiments of the present disclosure.
[0179] Specifically, the above model loss can be calculated by a preset loss function, and the preset loss function can be at least one of a perceptual loss function, an exponential loss function, a cross entropy loss function, and the like.
[0180] The following takes the sample data as sample text data as an example to describe the three stages of the denoising process in detail.
[0181] The first stage is described in detail below.
[0182] In the first stage, reference Figure 4 , Figure 4 An optional flowchart of a weak and difficult noise sample identification and correction process provided in an embodiment of the present disclosure.
[0183] First, the text to be cleaned is obtained, specifically, a labeled data set is obtained, the labeled data set includes a plurality of sample text data and the original label corresponding to each sample text data;
[0184] Then, the text is vectorized, which can be done by extracting sample features corresponding to each sample text data. For example, the sample text data can be mapped to a 768-dimensional dense vector space V c ,The sample features can effectively express the semantic information in the sample text data;
[0185] Then, similarity clustering is performed, specifically, each sample feature is clustered to obtain at least one first clustering cluster, and the target feature is determined based on the sample features that failed to be clustered. In the figure, black data points are used to represent the sample features that have been successfully clustered, and gray data points are used to represent the sample features that have failed to be clustered. The sample features that have failed to be clustered can be used as the target feature;
[0186] Then, a first reference label is generated and concatenated. Specifically, the sample text data corresponding to the first cluster is input into the first large language model for content generation to obtain the first reference label of the first cluster, and the sample text data corresponding to the first cluster is concatenated with the first reference label. For example, the first cluster corresponds to 3 sample text data, namely "text 1", "text 2" and "text 3". Assuming that the first reference label is "label a", "text 1 label a", "text 2 label a" and "text 3 label a" are respectively obtained by concatenating the first reference labels.
[0187] Then, the first cluster is updated, specifically, the feature extraction is performed on the splicing result, and then the first cluster is updated based on the feature extraction result. For example, the cluster center of the updated first cluster can be set to e new Then, similarity calculation is performed, specifically, the third similarity between the target feature and the updated cluster center of each first clustering cluster can be determined, for example, the target feature and e new The cosine similarity between them is used as the third similarity; then, a first maximum value is determined among the multiple third similarities;
[0188] Then, the first threshold may be set to 0.9, and when the first maximum value is greater than or equal to 0.9, the target feature is added to the first cluster where the cluster center corresponding to the first maximum value is located;
[0189] Then, a voting correction method is performed, which can be specifically to vote on each original label corresponding to the target cluster to obtain the number of votes for each original label; the original label corresponding to the largest number of votes is determined as the second reference label of the target cluster, and the labeled data set is denoised based on the difference between the original label and the second reference label. For example, when the original label is inconsistent with the second reference label, the original label is corrected to a label consistent with the second reference label, thereby realizing the recognition and correction of weak and difficult noise samples and obtaining a preliminary cleaned text.
[0190] The second stage is described in detail below.
[0191] In the second stage, reference Figure 5 , Figure 5 An optional flowchart of a training target model provided in an embodiment of the present disclosure.
[0192] Specifically, the target model may include an encoder and a classifier. When the encoder is used to process the sample text data, a start tag [CLS] is spliced at the beginning of the sample text data, and an end tag [SEP] is spliced at the end of the sample text data. The sample text data can be divided into multiple words. For example, the sample text data can be divided into token1 to tokenN. The sample text data is input into the trained target model. The encoder can use a self-attention mechanism for encoding to determine the encoding vector corresponding to each word. The encoder uses BERT. The encoding vector corresponding to the start tag can pay attention to each word of the sample text data. Therefore, the dotted line in the figure indicates that the encoding layer does not need to output the encoding vector after the start tag. The maximum input number of the encoder is 512. The encoding vector corresponding to the start tag is input into the classifier for classification processing, and a first prediction result can be obtained. The classifier is used to process specific downstream classification tasks. For example, the downstream classification tasks may include sentiment classification tasks, topic classification tasks, etc.; then based on the difference between the first prediction result and the original label corresponding to the sample data, the model loss is determined, and then the target model is trained based on the model loss. For example, the encoder can be trained based on the model loss, or the encoder and the classifier can be jointly trained based on the model loss.
[0193] It should be noted that the encoder may also be other types of models, such as GPT, RoBERTa, etc., which is not limited in the embodiments of the present disclosure.
[0194] The third stage is described in detail below.
[0195] In the third stage, reference Figure 6 and Figure 7 , Figure 6 An optional flow chart of determining a second prediction result provided in an embodiment of the present disclosure is provided. Figure 7 An optional flowchart for determining a reference tag provided in an embodiment of the present disclosure.
[0196] First, the sample text data in the denoised annotated data set is input into the trained target model for classification processing to obtain the second prediction result;
[0197] Then, when the second prediction result is inconsistent with the original label corresponding to the sample text data, or the confidence of the second prediction result is less than a fourth threshold, the sample text data is input into the second largest language model for label prediction to obtain a reference label for the sample text data;
[0198] Finally, when the reference label is inconsistent with the original label corresponding to the sample text data, the original label corresponding to the sample text data is corrected to a label consistent with the reference label.
[0199] In a possible implementation, the data denoising method further includes: when the reference label is consistent with the original label corresponding to the sample data, and the second prediction result is inconsistent with the original label corresponding to the sample data, retraining the trained target model based on the sample data and the original label. Based on this, since the reference label can be used as the correct labeling result of the sample data, when the reference label is consistent with the original label corresponding to the sample data, it means that the original label is correctly labeled, but the second prediction result is inconsistent with the original label corresponding to the sample data, indicating that the second prediction result is an incorrect prediction, and the sample data and the original label belong to difficult samples that the target model needs to continue to learn. Therefore, retraining the trained target model based on the sample data and the original label can further improve the prediction accuracy of the target model.
[0200] In one possible implementation, reference Figure 8 , Figure 8 Another optional flow chart for determining a benchmark label provided in an embodiment of the present disclosure, when the target model is a text classification model, the sample data is sample text data, the original label is used to indicate that the sample text data belongs to an abnormal category or a normal category, the sample data is input into the second largest language model for label prediction, and a benchmark label for the sample data is obtained, which can specifically be a keyword corresponding to the abnormal category; a prompt text for label prediction with reference to the keyword is constructed, and the prompt text and the sample data are spliced and input into the second largest language model for label prediction to obtain a benchmark label for the sample data.
[0201] Among them, the benchmark label is used to indicate whether the sample text data belongs to an abnormal category or a normal category; the keyword is used to characterize the abnormal category.
[0202] Based on this, the target model can be a text classification model. When the text classification model is used to process the abnormal text recognition task, the text classification model can predict that the sample text data belongs to the abnormal category or the normal category. When the initial version of the text classification model is used to identify sample data that is still misclassified or has a low probability of being correct, the prompt text and the sample data need to be spliced and input into the second largest language model for label prediction. The prompt text can be regarded as a prompt instruction (Prompt), which can be understood as a way to start the large language model. Since the prompt text can prompt the second largest language model to refer to keywords for label prediction, and the keywords corresponding to the abnormal category will contain information related to the abnormal category, under the guidance of the prompt text, the second largest language model can have a deeper understanding of the characteristics and patterns of the abnormal category, thereby effectively improving the prediction accuracy of the second largest language model and obtaining accurate benchmark labels.
[0203] In one possible implementation, keywords can be determined from historical text data. For example, the frequency of historical words appearing in historical text data belonging to the abnormal category is counted, and each historical word is sorted in descending order of frequency, and the top k historical words are used as keywords.
[0204] Taking the text classification model used to identify abnormal advertising text as an example, the prompt text can be specifically constructed as: "The sub-items of the keyword include: 1. Mobile phone numbers and communication software identifiers used to establish contact; 2. Access links and guiding vocabulary used to guide contact; 3. Promotional products or part-time jobs; when any sub-item is hit, it may be an abnormal advertising text." Therefore, after the prompt text and sample text data are spliced and input into the second largest language model, under the guidance of the prompt text, the second largest language model can accurately predict the benchmark label; in addition, the sub-items of the keyword can also be regarded as detailed rules of the classification task. The definition and objectives of the task need to be clearly and detailed described through the prompt text in order to improve the prediction accuracy of the second largest language model.
[0205] Specifically, in order to improve data processing efficiency, the output format of the second largest language model can also be specified in the prompt text, for example, the output JSON format result of the second largest language model is specified, and the output result includes: whether the sample text data is abnormal advertising text, and the specific hit sub-items.
[0206] It should be noted that in addition to being a text classification model used to identify whether a text is abnormal, the target model can also be a text sentiment classification model. In this case, the sample data is sample text data, and the original label is used to indicate the sentiment category of the text content of the sample text data. For example, the original label may include positive, negative, neutral, etc.
[0207] In one possible implementation, when the target model is a road image classification model, the sample data is sample image data, and the original label is used to indicate the road condition category of the image content of the sample image data. For example, the original label may include unobstructed, busy, congested, etc. The target model may also be other types of models, which are not limited in the embodiments of the present disclosure.
[0208] In one possible implementation, reference Fig. 9 , Fig. 9An optional flow chart for determining prediction accuracy provided in an embodiment of the present disclosure, wherein sample data in a denoised annotated data set is input into a trained target model for classification processing to obtain a second prediction result, specifically, multiple test text data and test labels corresponding to each test text data are obtained, and the test label is used to indicate that the test text data belongs to an abnormal category or a normal category; the test text data is input into a trained target model for classification processing to obtain a third prediction result; based on the difference between the third prediction result and the test label, the prediction accuracy of the target model is determined; when the prediction accuracy is less than or equal to a fifth threshold, the sample data in the denoised annotated data set is input into the trained target model for classification processing to obtain a second prediction result.
[0209] Among them, the test label is the true category of the test text data. When the third prediction result is different from the test label, it means that the third prediction result is an incorrect prediction. For example, when the test label is negative and the third prediction result is positive, it means that the third prediction result is an incorrect prediction. For another example, when the test label is negative and the third prediction result is also negative, it means that the third prediction result is a correct prediction.
[0210] Among them, the prediction accuracy is the ratio of the number of correct predictions to the total number of predictions. The value range of the prediction accuracy is [0,1]. The prediction accuracy can characterize the model capability of the target model.
[0211] Based on this, by obtaining test text data and test labels, and then inputting the test text data into the trained target model for classification processing, the third prediction result is obtained, and then the prediction accuracy of the target model is determined by the difference between the third prediction result and the test label. When the prediction accuracy is less than or equal to the fifth threshold, it means that the target model may still have insufficient model capacity because some original labels may still be incorrectly labeled. At this time, it is necessary to use the second largest language model to locate and correct the strong and difficult noise data in the labeled data set. When the prediction accuracy is higher, there is no need to predict the second prediction result and the benchmark label, which can save computing resources.
[0212] Specifically, the fifth threshold can be set to 0.8, that is, when the prediction accuracy is less than or equal to 0.8, it is necessary to use the second largest language model to locate and correct the strong and difficult noise data in the labeled data set. The fifth threshold can also be set to other values, which is not limited in the embodiments of the present disclosure.
[0213] It can be seen that the data denoising method provided by the embodiments of the present disclosure can be applied to a variety of scenarios.
[0214] For example, in the scenario of barrage content recognition, the annotated dataset can be denoised through the above three stages, and then the target model can be trained using the denoised annotated dataset, and then the barrage text to be recognized is obtained, and then the barrage text is input into the trained target model for classification processing to obtain a first classification result of the barrage text, wherein the first classification result is used to indicate the classification category of the barrage text, for example, the first classification result may include normal or abnormal, when the first classification result is normal, it means that the barrage text does not contain sensitive content, and when the first classification result is abnormal, it means that the barrage text contains sensitive content.
[0215] For another example, in the scenario of product review optimization, first, obtain the review dataset to be optimized, where the review dataset includes multiple product review texts and the original labels corresponding to each product review text. Then, the above three stages can help identify and correct the noise in the review dataset and optimize the matching degree between the product review texts in the review dataset and the original labels.
[0216] For another example, in the scenario of news or article classification, the annotated dataset can be denoised through the above three stages, and then the target model can be trained using the denoised annotated dataset, which can effectively improve the classification accuracy of the target model. Then, the news text to be classified is obtained, and the news text is input into the trained target model for classification processing, which can obtain an accurate second classification result. Alternatively, the article text to be classified is obtained, and the article text is input into the trained target model for classification processing, which can obtain an accurate third classification result, so that relevant personnel can find the content of interest more accurately.
[0217] The complete process of the data denoising method is described in detail below.
[0218] Reference Fig.10 , Fig.10 An optional flowchart of the data denoising method provided in the embodiment of the present disclosure.
[0219] The first stage is described in detail below. The first stage is used for weak and difficult noise sample identification and correction.
[0220] First, obtain a labeled data set, wherein the labeled data set includes multiple sample data and original labels corresponding to each sample data; respectively extract sample features corresponding to each sample data, traverse each sample feature, determine the fourth similarity between the traversed sample feature and each cluster center, and determine the second maximum value among the multiple fourth similarities, wherein the first traversed sample feature is used as the first cluster center.
[0221] Then, when the second maximum value is greater than or equal to the first threshold, the traversed sample features are added to the second cluster where the cluster center corresponding to the second maximum value is located, or, when the second maximum value is less than the first threshold, the traversed sample features are used as the newly added cluster center.
[0222] Then, for each second clustering cluster, when the number of sample features in the second clustering cluster is greater than or equal to the third threshold, the second clustering cluster is used as the first clustering cluster; when the number of sample features in the second clustering cluster is less than the third threshold, the sample features in the second clustering cluster are used as sample features of clustering failure.
[0223] Then, determine the first similarity between the sample features that failed to cluster and the cluster centers of each first clustering cluster; when the first similarity is less than a first threshold and greater than or equal to a second threshold, determine the sample features that failed to cluster as target features, wherein the first threshold is greater than the second threshold, and the second similarity between the sample features in the first clustering cluster and the cluster centers of the first clustering cluster is greater than or equal to the first threshold.
[0224] Then, for each first cluster, when the first similarity corresponding to the first cluster is less than the first threshold and greater than or equal to the second threshold, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain the first reference label of the first cluster, and the sample data corresponding to the first cluster is concatenated with the first reference label to perform feature extraction, and the first cluster is updated based on the feature extraction result.
[0225] Then, determine the third similarity between the target feature and the updated cluster center of each first clustering cluster, and determine the first maximum value among multiple third similarities; when the first maximum value is greater than or equal to the first threshold, add the target feature to the first clustering cluster where the cluster center corresponding to the first maximum value is located.
[0226] Then, vote for each original label corresponding to the target cluster to obtain the number of votes for each original label; determine the original label corresponding to the largest number of votes as the second reference label of the target cluster; and denoise the labeled data set based on the difference between the original label and the second reference label.
[0227] The second stage is described in detail below. The second stage uses the target model for training the initial version.
[0228] Then, the sample data in the denoised labeled data set is input into the target model for classification processing to obtain a first prediction result; based on the difference between the first prediction result and the original label corresponding to the sample data, the model loss is determined, and the target model is trained based on the model loss.
[0229] The third stage is described in detail below. The third stage is used for strong and difficult noise sample identification and correction.
[0230] The sample data in the denoised labeled data set is input into the trained target model for classification processing to obtain a second prediction result; when the second prediction result is inconsistent with the original label corresponding to the sample data, or the confidence of the second prediction result is less than a fourth threshold, the sample data is input into the second largest language model for label prediction to obtain a benchmark label of the sample data; when the benchmark label is inconsistent with the original label corresponding to the sample data, the original label corresponding to the sample data is corrected to a label consistent with the benchmark label.
[0231] Taking the target model as a text classification model as an example, the sample data is sample text data, the original label is used to indicate that the sample text data belongs to an abnormal category or a normal category, and the sample data is input into the second largest language model for label prediction to obtain a benchmark label of the sample data, including: obtaining keywords corresponding to the abnormal category; constructing a prompt text for label prediction with reference to the keywords, splicing the prompt text and the sample data and inputting them into the second largest language model for label prediction to obtain a benchmark label of the sample data, wherein the benchmark label is used to indicate that the sample text data belongs to an abnormal category or a normal category.
[0232] In addition, the sample data in the denoised annotated data set is input into the trained target model for classification processing to obtain a second prediction result, including: obtaining multiple test text data and test labels corresponding to each test text data, the test label is used to indicate that the test text data belongs to an abnormal category or a normal category; inputting the test text data into the trained target model for classification processing to obtain a third prediction result; based on the difference between the third prediction result and the test label, determining the prediction accuracy of the target model; when the prediction accuracy is less than or equal to the fifth threshold, inputting the sample data in the denoised annotated data set into the trained target model for classification processing to obtain a second prediction result.
[0233] Based on this, by extracting sample features of sample data, and then using each sample feature to obtain at least one first cluster through preliminary clustering, the sample data corresponding to the first cluster is input into the first large language model. Since the first large language model has a wide range of knowledge reserves, the first large language model can use the semantic information of the sample data to generate a first reference label of the first cluster to enrich the semantic expression of the first cluster. The sample data corresponding to the first cluster is then spliced with the first reference label to perform feature extraction, and then the first cluster is updated based on the feature extraction result, that is, the semantic information of the first cluster is enhanced by the first reference label, and then the target feature is used to further cluster the updated first cluster. The target clustering cluster is obtained, and the clustering boundary of the first clustering cluster is dynamically adjusted based on the language understanding ability of the first language model to adapt to the change of data, so that the updated first clustering cluster can improve the judgment accuracy of the category attribution of the target feature. Since the target feature is determined based on the sample feature that failed to cluster, the target clustering cluster is obtained by re-clustering the target feature that failed to cluster based on the updated first clustering cluster, which can complete the clustering optimization and effectively improve the clustering accuracy. In the denoising process, it can not only identify enough noise, but also avoid introducing too many errors, thereby effectively improving the denoising effect. In addition, identifying noise through unsupervised clustering can effectively save computing resources and reduce costs.
[0234] It is to be understood that, although the steps in the above-mentioned various flow charts are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flow charts can include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
[0235] Reference Fig.11 , Fig.11 This is an optional structural diagram of a data denoising device provided in an embodiment of the present disclosure. The data denoising device 1100 includes:
[0236] An acquisition module 1101 is used to acquire a labeled data set, wherein the labeled data set includes a plurality of sample data and an original label corresponding to each sample data;
[0237] The first clustering module 1102 is used to extract sample features corresponding to each sample data, cluster each sample feature to obtain at least one first cluster, and determine the target feature based on the sample features that failed clustering;
[0238] An updating module 1103 is used to input the sample data corresponding to the first cluster into the first large language model for content generation, obtain a first reference label of the first cluster, perform feature extraction after concatenating the sample data corresponding to the first cluster with the first reference label, and update the first cluster based on the feature extraction result;
[0239] The second clustering module 1104 is used to cluster the target feature with the updated first cluster to obtain a target cluster;
[0240] The first denoising module 1105 is used to determine a second reference label of the target cluster, and denoise the labeled data set based on the difference between the original label and the second reference label.
[0241] Furthermore, the first clustering module 1102 is specifically used for:
[0242] Determine a first similarity between the sample features that failed clustering and the cluster centers of each first clustering cluster;
[0243] When the first similarity is less than a first threshold and greater than or equal to a second threshold, the sample feature that failed clustering is determined as a target feature, wherein the first threshold is greater than the second threshold, and the second similarity between the sample feature in the first cluster cluster and the cluster center of the first cluster cluster is greater than or equal to the first threshold.
[0244] Furthermore, the updating module 1103 is specifically used for:
[0245] For each first cluster, when the first similarity corresponding to the first cluster is less than the first threshold and greater than or equal to the second threshold, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain the first reference label of the first cluster.
[0246] Furthermore, the second clustering module 1104 is specifically used for:
[0247] Determine a third similarity between the target feature and the updated cluster center of each first clustering cluster, and determine a first maximum value among the multiple third similarities;
[0248] When the first maximum value is greater than or equal to the first threshold, the target feature is added to the first cluster where the cluster center corresponding to the first maximum value is located.
[0249] Furthermore, the first clustering module 1102 is specifically used for:
[0250] Traversing each sample feature, determining a fourth similarity between the traversed sample feature and each cluster center, and determining a second maximum value among multiple fourth similarities, wherein the first traversed sample feature is used as the first cluster center;
[0251] When the second maximum value is greater than or equal to the first threshold, the traversed sample features are added to the second cluster where the cluster center corresponding to the second maximum value is located; or, when the second maximum value is less than the first threshold, the traversed sample features are used as the newly added cluster center;
[0252] For each second cluster, when the number of sample features in the second cluster is greater than or equal to a third threshold, the second cluster is used as the first cluster.
[0253] Furthermore, the first clustering module 1102 is also used for:
[0254] When the number of sample features in the second cluster is less than the third threshold, the sample features in the second cluster are used as sample features for which clustering fails.
[0255] Furthermore, the first denoising module 1105 is specifically used for:
[0256] Vote for each original label corresponding to the target cluster to obtain the number of votes for each original label;
[0257] The original label corresponding to the maximum number of votes is determined as the second reference label of the target cluster.
[0258] Furthermore, the first denoising module 1105 is specifically used for:
[0259] Determine the fifth similarity between the sample features in the target cluster and the cluster center of the target cluster;
[0260] The fifth similarity is input into the weight prediction model for regression processing to obtain the voting weight of the original label corresponding to the sample feature;
[0261] Based on the voting weight, weighted voting is performed on each original label corresponding to the target cluster to obtain the number of votes for each original label.
[0262] Furthermore, the number of the first reference tags is multiple, and the updating module 1103 is specifically used for:
[0263] Extracting label features corresponding to each first reference label, and determining the sixth similarity between each label feature and the cluster center of the first cluster respectively;
[0264] In descending order of the sixth similarity, each first reference label is sequentially concatenated with the sample data corresponding to the first cluster to obtain concatenated data, and the concatenated data is input into the feature extraction model for feature extraction.
[0265] Furthermore, the data denoising device further includes a second denoising module (not shown in the figure), which is specifically used for:
[0266] Inputting the sample data in the denoised labeled data set into the target model for classification processing to obtain a first prediction result;
[0267] Determine a model loss based on a difference between the first prediction result and an original label corresponding to the sample data, and train a target model based on the model loss;
[0268] Inputting the sample data in the denoised labeled data set into the trained target model for classification processing to obtain a second prediction result;
[0269] When the second prediction result is inconsistent with the original label corresponding to the sample data, or the confidence of the second prediction result is less than a fourth threshold, the sample data is input into the second largest language model for label prediction to obtain a reference label for the sample data;
[0270] When the reference label is inconsistent with the original label corresponding to the sample data, the original label corresponding to the sample data is corrected to be consistent with the reference label.
[0271] Furthermore, when the target model is a text classification model, the sample data is sample text data, and the original label is used to indicate whether the sample text data belongs to an abnormal category or a normal category, the second denoising module is specifically used to:
[0272] Get the keywords corresponding to the exception category;
[0273] Construct a prompt text for label prediction with reference to keywords, concatenate the prompt text and sample data, and input them into the second largest language model for label prediction to obtain a benchmark label for the sample data, wherein the benchmark label is used to indicate whether the sample text data belongs to an abnormal category or a normal category.
[0274] Furthermore, the second denoising module is specifically used for:
[0275] Acquire multiple test text data and test labels corresponding to each test text data, where the test labels are used to indicate whether the test text data belongs to an abnormal category or a normal category;
[0276] Input the test text data into the trained target model for classification processing to obtain a third prediction result;
[0277] Determining the prediction accuracy of the target model based on the difference between the third prediction result and the test label;
[0278] When the prediction accuracy is less than or equal to the fifth threshold, the sample data in the denoised labeled data set is input into the trained target model for classification processing to obtain a second prediction result.
[0279] The above-mentioned data denoising device 1100 and the data denoising method are based on the same inventive concept, which extracts sample features of sample data, and then uses each sample feature to obtain at least one first cluster through preliminary clustering, and then inputs the sample data corresponding to the first cluster into the first large language model. Since the first large language model has a wide range of knowledge reserves, the first large language model can use the semantic information of the sample data to generate a first reference label of the first cluster to enrich the semantic expression of the first cluster, and then splice the sample data corresponding to the first cluster with the first reference label to perform feature extraction, and then update the first cluster based on the feature extraction result, that is, enhance the semantic information of the first cluster through the first reference label, and then use the target feature and the updated first cluster to generate a first reference label of the first cluster. A cluster cluster is further clustered to obtain a target cluster cluster, and the language understanding ability based on the first language model is used to dynamically adjust the clustering boundary of the first cluster cluster to adapt to the change of data, so that the updated first cluster cluster can improve the accuracy of judging the category attribution of the target feature. Since the target feature is determined based on the sample feature that failed to cluster, the target cluster cluster is obtained by clustering the target feature that failed to cluster based on the updated first cluster cluster. The clustering optimization can be completed and the clustering accuracy can be effectively improved. In the denoising process, sufficient noise can be identified and excessive errors can be avoided, thereby effectively improving the denoising effect. In addition, identifying noise through unsupervised clustering can effectively save computing resources and reduce costs.
[0280] The electronic device for executing the above-mentioned data denoising method provided in the embodiment of the present disclosure may be a terminal. Fig.12 , Fig.12 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure, and the terminal includes: a camera assembly 1210, a first memory 1220, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (Wi-Fi) module 1270, a first processor 1280, and a first power supply 1290. Those skilled in the art can understand that Fig.12 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0281] The camera assembly 1210 can be used to capture images or videos. Optionally, the camera assembly 1210 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtua l Reality) shooting function or other fusion shooting functions.
[0282] The first memory 1220 may be used to store software programs and modules. The first processor 1280 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the first memory 1220 .
[0283] The input unit 1230 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 1230 may include a touch panel 1231 and other input devices 1232 .
[0284] The display unit 1240 may be used to display input information or provided information and various menus of the terminal. The display unit 1240 may include a display panel 1241 .
[0285] The audio circuit 1260 , the speaker 1261 , and the microphone 1262 may provide an audio interface.
[0286] The first power source 1290 may be alternating current, direct current, a disposable battery, or a rechargeable battery.
[0287] The number of sensors 1250 may be one or more, and the one or more sensors 1250 include but are not limited to: acceleration sensors, gyroscope sensors, pressure sensors, optical sensors, etc. Among them:
[0288] The acceleration sensor can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor can be used to detect the components of gravity acceleration on the three coordinate axes. The first processor 1280 can control the display unit 1240 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor. The acceleration sensor can also be used for collecting game or user motion data.
[0289] The gyroscope sensor can detect the body direction and rotation angle of the terminal, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the terminal. The first processor 1280 can implement the following functions based on the data collected by the gyroscope sensor: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0290] The pressure sensor can be set in the side frame of the terminal and / or the lower layer of the display unit 1240. When the pressure sensor is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the first processor 1280 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor. When the pressure sensor is set in the lower layer of the display unit 1240, the first processor 1280 controls the operability controls on the UI interface according to the user's pressure operation on the display unit 1240. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0291] The optical sensor is used to collect the ambient light intensity. In one embodiment, the first processor 1280 can control the display brightness of the display unit 1240 according to the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 1240 is increased; when the ambient light intensity is low, the display brightness of the display unit 1240 is decreased. In another embodiment, the first processor 1280 can also dynamically adjust the shooting parameters of the camera assembly 1210 according to the ambient light intensity collected by the optical sensor.
[0292] In this embodiment, the first processor 1280 included in the terminal can execute the data denoising method of the previous embodiment.
[0293] The electronic device for executing the above-mentioned data denoising method provided in the embodiment of the present disclosure may also be a server. Fig.13 , Fig.13 This is a partial structural block diagram of a server provided in an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more second processors 1310 and a second memory 1330, and one or more storage media 1340 (e.g., one or more mass storage devices) storing application programs 1343 or data 1342. Among them, the second memory 1330 and the storage medium 1340 may be short-term storage or permanent storage. The program stored in the storage medium 1340 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the second processor 1310 may be configured to communicate with the storage medium 1340 to execute a series of instruction operations in the storage medium 1340 on the server.
[0294] The server may also include one or more second power supplies 1320, one or more wired or wireless network interfaces 1350, one or more input and output interfaces 1360, and / or one or more operating systems 1341, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0295] The second processor 1310 in the server may be configured to execute a data denoising method.
[0296] The embodiments of the present disclosure further provide a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the data denoising methods of the aforementioned embodiments.
[0297] The embodiment of the present disclosure also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned data denoising method.
[0298] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0299] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0300] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0301] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0302] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0303] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0304] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0305] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0306] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A data denoising method, characterized in that: include: Acquire a labeled data set, wherein the labeled data set includes a plurality of sample data and an original label corresponding to each of the sample data; Extracting sample features corresponding to each of the sample data respectively, clustering each of the sample features to obtain at least one first clustering cluster, and determining target features based on the sample features that fail to be clustered; Inputting the sample data corresponding to the first cluster into a first large language model for content generation to obtain a first reference label of the first cluster, concatenating the sample data corresponding to the first cluster with the first reference label to perform feature extraction, and updating the first cluster based on the feature extraction result; Clustering the target feature with the updated first cluster to obtain a target cluster; A second reference label of the target cluster is determined, and the annotated data set is denoised based on a difference between the original label and the second reference label.
2. The data denoising method according to claim 1, characterized in that: The determining of target features based on the sample features that fail clustering includes: Determine a first similarity between the sample feature that fails to be clustered and the cluster center of each of the first clustering clusters; When the first similarity is less than a first threshold and greater than or equal to a second threshold, the sample feature for which clustering fails is determined as a target feature, wherein the first threshold is greater than the second threshold, and the second similarity between the sample feature in the first clustering cluster and the cluster center of the first clustering cluster is greater than or equal to the first threshold.
3. The data denoising method according to claim 2, characterized in that: The step of inputting the sample data corresponding to the first cluster into a first large language model for content generation to obtain a first reference label of the first cluster includes: For each of the first clusters, when the first similarity corresponding to the first cluster is less than the first threshold and greater than or equal to the second threshold, the sample data corresponding to the first cluster is input into the first large language model for content generation to obtain a first reference label of the first cluster.
4. The data denoising method according to claim 2, characterized in that: The step of clustering the target feature with the updated first cluster to obtain a target cluster includes: Determine a third similarity between the target feature and the updated cluster center of each of the first clustering clusters, and determine a first maximum value among the plurality of the third similarities; When the first maximum value is greater than or equal to the first threshold, the target feature is added to the first cluster where the cluster center corresponding to the first maximum value is located.
5. The data denoising method according to claim 1, characterized in that: The clustering of the sample features to obtain at least one first cluster includes: Traversing each of the sample features, determining a fourth similarity between the traversed sample features and each cluster center, and determining a second maximum value among the plurality of fourth similarities, wherein the first traversed sample feature is used as the first cluster center; When the second maximum value is greater than or equal to the first threshold, the traversed sample feature is added to the second cluster where the cluster center corresponding to the second maximum value is located; or, when the second maximum value is less than the first threshold, the traversed sample feature is used as a newly added cluster center; For each of the second clusters, when the number of the sample features in the second cluster is greater than or equal to a third threshold, the second cluster is used as the first cluster.
6. The data denoising method according to claim 5, characterized in that: The clustering of the sample features to obtain at least one first cluster further includes: When the number of the sample features in the second cluster is less than the third threshold, the sample features in the second cluster are used as the sample features for which clustering fails.
7. The data denoising method according to claim 1, characterized in that: The determining of the second reference label of the target cluster includes: Voting for each of the original labels corresponding to the target cluster to obtain the number of votes for each of the original labels; The original label corresponding to the maximum number of votes is determined as the second reference label of the target cluster.
8. The data denoising method according to claim 7, characterized in that: Voting for each of the original labels corresponding to the target cluster to obtain the number of votes for each of the original labels includes: Determining a fifth similarity between the sample features in the target cluster and the cluster center of the target cluster; Inputting the fifth similarity into a weight prediction model for regression processing to obtain the voting weight of the original label corresponding to the sample feature; Based on the voting weights, weighted voting is performed on each of the original labels corresponding to the target cluster to obtain the number of votes for each of the original labels.
9. The data denoising method according to claim 1, characterized in that: The number of the first reference labels is multiple, and the step of concatenating the sample data corresponding to the first cluster with the first reference labels and then performing feature extraction includes: Extracting label features corresponding to each of the first reference labels, and determining a sixth similarity between each of the label features and a cluster center of the first cluster respectively; In the descending order of the sixth similarity, each of the first reference tags is sequentially spliced with the sample data corresponding to the first cluster to obtain spliced data, and the spliced data is input into the feature extraction model for feature extraction.
10. The data denoising method according to claim 1, characterized in that: The data denoising method further comprises: Inputting the sample data in the denoised labeled data set into the target model for classification processing to obtain a first prediction result; Determine a model loss based on a difference between the first prediction result and the original label corresponding to the sample data, and train the target model based on the model loss; Inputting the sample data in the denoised labeled data set into the trained target model for classification processing to obtain a second prediction result; When the second prediction result is inconsistent with the original label corresponding to the sample data, or the confidence of the second prediction result is less than a fourth threshold, inputting the sample data into the second largest language model for label prediction to obtain a reference label for the sample data; When the reference label is inconsistent with the original label corresponding to the sample data, the original label corresponding to the sample data is corrected to be consistent with the reference label.
11. The data denoising method according to claim 10, characterized in that: When the target model is a text classification model, the sample data is sample text data, the original label is used to indicate that the sample text data belongs to an abnormal category or a normal category, and the sample data is input into the second largest language model for label prediction to obtain a reference label of the sample data, including: Obtain keywords corresponding to the abnormal category; Construct a prompt text for label prediction with reference to the keyword, concatenate the prompt text and the sample data and input them into the second largest language model for label prediction to obtain a benchmark label for the sample data, wherein the benchmark label is used to indicate that the sample text data belongs to the abnormal category or the normal category.
12. The data denoising method according to claim 11, characterized in that: The step of inputting the sample data in the denoised labeled data set into the trained target model for classification processing to obtain a second prediction result includes: Acquire a plurality of test text data and a test label corresponding to each of the test text data, wherein the test label is used to indicate that the test text data belongs to the abnormal category or the normal category; Inputting the test text data into the trained target model for classification processing to obtain a third prediction result; Determining the prediction accuracy of the target model based on the difference between the third prediction result and the test label; When the prediction accuracy is less than or equal to the fifth threshold, the sample data in the denoised labeled data set is input into the trained target model for classification processing to obtain a second prediction result.
13. A data denoising device, characterized in that: include: An acquisition module, used to acquire a labeled data set, wherein the labeled data set includes a plurality of sample data and an original label corresponding to each of the sample data; A first clustering module, used to extract sample features corresponding to each of the sample data, cluster each of the sample features to obtain at least one first clustering cluster, and determine a target feature based on the sample features that fail to be clustered; an updating module, configured to input the sample data corresponding to the first cluster into a first large language model for content generation, obtain a first reference label of the first cluster, perform feature extraction after concatenating the sample data corresponding to the first cluster with the first reference label, and update the first cluster based on the feature extraction result; A second clustering module, used for clustering the target feature with the updated first cluster to obtain a target cluster; The first denoising module is used to determine a second reference label of the target cluster, and denoise the annotated data set based on a difference between the original label and the second reference label.
14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the data denoising method according to any one of claims 1 to 12 is implemented.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data denoising method according to any one of claims 1 to 12 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the data denoising method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Cell image pre-labeling method and device based on zero sample
CN120198719A