Data enhancement method and system based on Chinese characteristics and semantic consistency

Through a data enhancement method based on Chinese characteristics and semantic consistency, the shortcomings of Chinese text data processing in the prior art are solved, and Chinese data that is closer to the real world are generated, which improves the generalization ability and stability of the model.

CN120449888APending Publication Date: 2025-08-08WUHAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510555392.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing natural language processing methods lack the analysis of Chinese characteristics in the fields of malicious text recognition and semantic alignment, which leads to the inability to effectively learn the generated data. The traditional data augmentation method ignores global semantic consistency, resulting in unnatural and inappropriate data generated.

Method used

Data augmentation methods based on Chinese characteristics and semantic consistency are adopted, including synonym substitution, random insertion, word-level entity substitution, noise enhancement and sentence back-translation, to ensure that the generated data remains semantically consistent and conform to Chinese characteristics.

Benefits of technology

It significantly improves the generalization ability and stability of the model, enables the model to better understand the complex context and diversity of Chinese text, and improves the practicality of the data and the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449888A_ABST
    Figure CN120449888A_ABST
Patent Text Reader

Abstract

The invention provides a data enhancement method and system based on Chinese characteristics and semantic consistency, and the method comprises the steps: obtaining original data, carrying out the synonym replacement and random insertion based on semantic consistency on the original data, and carrying out the noise enhancement based on the Chinese characteristics, comprising the steps of noise enhancement based on word granularity and noise enhancement based on lexical granularity; and generating enhanced data and outputting the enhanced data. The method not only deeply considers the inherent characteristics of the Chinese language, but also emphasizes to ensure the consistency of the data in the semantic level, and aims to promote the efficient learning of the model on the global semantic coherence in the training stage. The algorithms are used for processing cross-vocabulary and sentence dimension data from the real world, an existing data set is more effectively enhanced and balanced, the practicability of the data in the model training process is enhanced, and therefore optimization and improvement of model performance are further promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a data enhancement method and system based on Chinese characteristics and semantic consistency. Background Art

[0002] Natural language processing tasks, especially in the areas of malicious text identification and semantic alignment, face numerous complex and severe challenges. Malicious text is often highly diverse and creative, and its manifestations may include unique expressions, peculiar syntactic structures, and obscure intent. These characteristics make traditional text processing methods unable to capture its complex features, resulting in suboptimal recognition accuracy. In the actual malicious text identification task, the scarcity of high-quality annotated data is undoubtedly a major challenge that needs to be addressed. Due to the diversity and dynamic evolution of malicious content, manually annotating large amounts of data is not only time-consuming and labor-intensive, but also subject to subjective bias by the annotator. The lack of annotated data directly restricts the effectiveness of model training, making it difficult for the model to demonstrate strong generalization and robustness in practical applications.

[0003] In the field of natural language processing, data augmentation techniques have been widely applied in many tasks, such as text classification, sentiment analysis, and machine translation. However, existing data augmentation methods still face significant limitations in the areas of malicious text detection and semantic alignment. For example, when processing Chinese text data, they lack analysis of Chinese language characteristics and are unable to generate data that conforms to Chinese language characteristics, resulting in the generated data being poorly trained and learned by models. Furthermore, traditional data augmentation methods ignore the global semantic consistency of the generated data and only evaluate similarity at the lexical level, resulting in the generation of sentences with inappropriate context and unnaturalness.

[0004] The emergence of data enhancement methods based on Chinese characteristics and semantic consistency aims to solve the above problems and provide a more targeted and effective solution. Summary of the Invention

[0005] To address the technical issues existing in the existing technology, this paper proposes a data enhancement method and system based on the characteristics and semantic consistency of Chinese. Compared with traditional data enhancement methods, this method deeply integrates the unique properties of Chinese and can generate authentic Chinese data that is closer to the real world, thereby significantly improving the practicality and value of the data. In addition, this method combines the global semantic consistency of the data to ensure that the coherence and integrity of the semantic information are maintained during the data enhancement process, enabling the model to better learn the global semantics of the data, significantly improving the model's generalization ability and stability.

[0006] The technical solution adopted in the present invention is as follows: In a first aspect, a data enhancement method based on Chinese characteristics and semantic consistency is provided, comprising the following steps: Obtaining original data, performing synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics, wherein the noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word-unit granularity; Generate enhanced data and output.

[0007] In one embodiment, the synonym replacement and random insertion based on semantic consistency includes: Input a set of raw data in the form of sentence pairs, which contains two related sentences; In the data preprocessing stage, text segmentation is performed on each sentence in the sentence pair to generate the word sequence of each sentence; Go through the sentences in the sentence pair one by one, use the semantic consistency evaluation mechanism to determine the importance of each word in the sentence, and sort them accordingly; According to the importance ranking, based on the masked language model, the more important words in the sentence are selected for masking; Use the pre-trained masked language model to predict the masked part. The prediction result contains multiple candidate replacement words. If the candidate replacement word meets the filtering conditions and the similarity between the new sentence formed by replacing the masked part with the predicted result and the original sentence exceeds the similarity threshold, the new sentence is added to the candidate replacement sentence list. Select the sentence with the highest similarity in the candidate replacement sentence list to replace the original sentence; Until the traversal of the sentence pairs is completed, if all sentences in the sentence pairs have been replaced, the replaced sentences will form a new sentence pair as the data after data enhancement; otherwise, no data after data enhancement will be generated.

[0008] In one embodiment, the noise enhancement based on Chinese characteristics includes: Input the original dataset, homophones, similar words and threshold data; Perform text segmentation on all sentence pairs in the dataset to obtain word lists for all sentences; Iterate through the sentence pairs in the dataset one by one, and traverse the word list for each sentence in the sentence pair, and obtain random numbers through the random method Compared with the threshold, if Greater than or equal to the threshold , then word-granular noise enhancement is performed on the sentence pairs in the original data; otherwise, word-granular noise enhancement is skipped.

[0009] In one embodiment, performing word-granular noise enhancement on sentence pairs in the original data includes: Redundant word replacement operations, word omission replacement operations, word order error replacement operations, and word selection error replacement operations are performed to build a replacement dictionary; Traverse the words in the current sentence and get random numbers through random methods ,if Greater than or equal to the threshold , then perform word-unit granularity noise enhancement operation on the sentence pairs in the original data; otherwise, skip the word-unit granularity noise enhancement operation.

[0010] In one embodiment, performing word-unit granular noise enhancement on sentence pairs in the original data includes: Redundant word replacement operations, word omission replacement operations, word order error replacement operations, and word selection error replacement operations are performed to build a replacement dictionary; According to the replacement dictionary, the current sentence is replaced to generate a new sentence with noise enhancement, and the new sentence is used to replace the corresponding current sentence in the original sentence pair to form a new sentence pair, and the new sentence pair is added to the data set after data enhancement; Until the program traverses all the sentence pairs in the dataset, the final data-enhanced dataset is obtained.

[0011] In one embodiment, the data enhancement based on Chinese characteristics and semantic consistency of the original data further includes: word-level entity replacement, wherein the word-level entity replacement includes: Input raw text data and use the BERT model for data preprocessing to obtain word embeddings in the text; An entity recognition model is used to identify entities in text data. The bidirectional long short-term memory network model is used to calculate the probability of a character being emitted as a candidate label, and the conditional random field layer is used to determine the final entity label result. It should be noted that the bidirectional long short-term memory network Bi-LSTM and the conditional random field CRF are used as an entity recognition model to perform sentence entity recognition, which is the basis for entity replacement. Use the replacement algorithm to replace the identified entities in the text data with other entities of the same type to generate new text data.

[0012] In one embodiment, the entity recognition model is a model composed of a bidirectional long short-term memory network Bi-LSTM + conditional random field CRF, which is a BiLSTM-CRF model. The BiLSTM-CRF model combines the forward and reverse directions of the LSTM model to process sequence data. One processes the input sequence in normal order, and the other processes it in reverse. The bidirectional processing mechanism enables the Bi-LSTM model to simultaneously capture the contextual information before and after each time point, thereby constructing a more comprehensive and in-depth understanding of the entire sequence.

[0013] In one embodiment, the data enhancement based on Chinese characteristics and semantic consistency of the original data further includes: sentence back translation; the sentence back translation includes: Translate the original input sentence into another language and then translate the translated sentence back to the original language to generate a new sentence.

[0014] In a second aspect, the present invention provides a data enhancement system based on Chinese characteristics and semantic consistency, comprising: Data acquisition module, used to obtain original data; A data enhancement module is used to perform synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics on the original data. The noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word granularity; The data output module is used to generate and output enhanced data.

[0015] In a third aspect, the present invention provides an electronic device, comprising: At least one processor, at least one memory and a communication interface; wherein the processor, memory and communication interface communicate with each other; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute a data enhancement method based on Chinese characteristics and semantic consistency provided by any one of the various implementation methods of the first aspect.

[0016] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows: The present invention provides a data enhancement method and system based on Chinese characteristics and semantic consistency, which combines multiple technologies, including a word-level entity replacement algorithm, a synonym replacement and random insertion algorithm based on semantic consistency, a noise enhancement algorithm based on Chinese characteristics, and a sentence back-translation algorithm. The word-level entity replacement algorithm enhances the robustness of the model to entity changes, so that the model can better handle changes in different entities. The synonym replacement and random insertion algorithm based on semantic consistency improves the model's ability to understand synonyms and contexts, and also enhances the model's ability to handle complex contexts. The noise enhancement algorithm based on Chinese characteristics enhances the model's robustness to noise, so that the model can better handle non-standard or erroneous inputs. The sentence back-translation algorithm increases the diversity of data, so that the model can handle sentences with different expressions and improve the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 A structural diagram of a data enhancement method based on Chinese characteristics and semantic consistency provided by an embodiment of the present invention; Figure 2 A flowchart of a semantically consistent synonym replacement and random insertion algorithm provided by an embodiment of the present invention; Figure 3 A flowchart of a noise enhancement algorithm based on Chinese characteristics provided by an embodiment of the present invention; Figure 4 A flowchart of a word-level entity replacement algorithm provided by an embodiment of the present invention; Figure 5 A structural diagram of a word-level entity replacement algorithm provided by an embodiment of the present invention; Figure 6 A word importance calculation formula based on semantically consistent synonym replacement and random insertion algorithm provided in an embodiment of the present invention; Figure 7 This is a flowchart of a sentence back-translation algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0020] In addition, the technical features of the various embodiments or single embodiments provided by the present invention can be arbitrarily combined with each other to form a feasible technical solution. Such combination is not restricted by the sequence of steps and / or structural composition pattern, but must be based on the ability of ordinary technicians in this field to implement it. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0021] The embodiment of the present invention provides a data enhancement method based on Chinese characteristics and semantic consistency, specifically as follows Figure 1 As shown, the method includes: Obtaining original data, performing synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics, wherein the noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word-unit granularity; Generate enhanced data and output.

[0022] In the specific implementation process, the original data is: sentence pairs ,in They are respectively represented as a sentence; for example, "How is the weather today" and "How is the weather today?". The commonly used original data here is the BQ corpus containing question matching data from online banking system logs, and the LCQMC dataset comes from questions raised by users in the Baidu Knows community.

[0023] refer to Figure 2 As shown in the figure, the implementation process of the semantically consistent synonym replacement and random insertion algorithm includes: Input raw data, sentence pairs ,in Each is represented as a sentence; Data preprocessing, sentences Perform text segmentation to obtain a list of words corresponding to the sentence ,in Represented as words in a sentence; Calculating sentences The importance of each word in the word is calculated based on the word importance formula. For details of the formula, please refer to Figure 5 ,in Expressing sentences middle The importance of express Delete After the text, For input The confidence score output by the text similarity model M is used to effectively measure the semantic similarity between two sentences. According to the importance of the words, perform a descending sort operation on all the words to obtain the sorted sequence , which means that in the sorted sequence, words with higher importance will occupy the front position, while words with lower importance will be arranged in the back position. This sorting can help us select the most important words in the sentence to replace, thereby minimizing the interference with the text and preserving the original semantics to the greatest extent; Traverse the sorted word sequence , for the sentence Between the current word Perform mask operations on the corresponding words to generate corresponding masked sentences , and use a masked language model Predict the top K most likely words for the mask position , these words will be used as the current word Potential replacements for For each word in the predicted word set T , if the word meets the part-of-speech filter condition POS_Filter( , i), then Replace with mask sentence The position of the mask in , thereby generating a new complete sentence L[ ]; otherwise, no new sentence L[ ] and continue to determine whether the next word in the word set T meets the part-of-speech filtering condition until the entire word set T is traversed; If the newly generated sentence With the original sentence The similarity calculated as input by the text similarity model M ,in Expressed as the conditional threshold of similarity, the newly generated sentence L[ ] is returned as a candidate and added to the candidate list S; otherwise, continue to try other words in T for replacement until there are no other results to try; If there is a candidate return result in the candidate list S, the sentence with the greatest similarity to the original sentence will be used as the final return result , that is, the data after data enhancement based on semantically consistent synonym replacement and random insertion algorithm; if the candidate list S is an empty list, try to Perform masking and subsequent operations on the next word; If there is still no final return result after all operations in the above semantically consistent synonym replacement and random insertion algorithm, an empty result is returned as the final result of the semantically consistent synonym replacement and random insertion algorithm.

[0024] During the specific implementation process, refer to Figure 3 As shown in the figure, the implementation process of the noise enhancement algorithm based on Chinese characteristics includes: The input includes the original dataset D, a list of homophones, a list of homographs, a list of modal particles, and conversion probabilities. , Among them, the original dataset D consists of multiple sentence pairs , Each is represented as a sentence, y is represented as the data label, and the original data set can be represented as ; Data preprocessing: perform text segmentation on each sentence in the original dataset D and the sentences in SP to obtain a word list of all sentences ,in Represented as words in a sentence; The program will go through the sentence pairs in the dataset one by one , and perform the following detailed operations on each sentence in the sentence pair: Iterate over the word list For each word in , a random number is obtained by random method and conversion probability For comparison, if Greater than or equal to conversion probability , then the noise enhancement operation of word granularity is performed; otherwise, the noise enhancement operation of word granularity is skipped; The word-level noise enhancement operation consists of four parts: redundant word replacement, omitted word replacement, incorrect word order replacement, and incorrect word selection replacement. See the following sections for details: Redundant word replacement means extending the current word by inserting a random word; Word omission replacement means deleting the current word to simulate text omission errors; Word order error replacement means replacing the current word at random to simulate word order errors; Word selection error replacement involves random substitution using lists of homophones and homographs to simulate word selection errors. This method specifically considers possible grammatical errors caused by local dialects, such as changes in nasal sounds and differences between retroflex and flat tongue sounds. The text is first recognized in pinyin format, and then its consonants or finals are randomly replaced based on a list of homophones to mimic the pronunciation of the dialect. Finally, a replacement word with a similar pronunciation is selected. For example, the word "knowledge" is recognized in pinyin as "zhi-shi," where "zh" may be randomly replaced with "z," converting the pinyin to "zi-shi." Similar-sounding words are then selected, such as "posture" and "troublemaking."

[0025] Through the above word-granular noise enhancement operations, a conversion dictionary changeDict is constructed to record various operations; Similarly, traverse each word in the current sentence and obtain the random number by the random method and conversion probability For comparison, if Greater than or equal to conversion probability , then the noise enhancement operation of the word unit granularity is performed; otherwise, the noise enhancement operation of the word unit granularity is skipped; The noise enhancement operation at the word level consists of four parts: redundant word replacement, omitted word replacement, incorrect word order replacement, and incorrect word selection replacement. The details are as follows: Redundant word replacement means expanding the text by randomly inserting words. This involves selecting random modal particles from a list of modal particles and inserting them into the text, with the insertion position tending to be at the beginning and end of the sentence. Word omission replacement means deleting the current word to simulate text omission errors; Word order error replacement means replacing the current word at random to simulate word order errors; Word choice error substitution means simulating word choice errors using homophone lists and other random substitution methods.

[0026] Through the above word-level noise enhancement operation, the conversion dictionary changeDict is supplemented to record various operations; The conversion dictionary changeDict is constructed based on the noise enhancement operation at the word granularity and the noise enhancement operation at the word granularity, and the noise enhancement operation is performed on the current sentence to generate the noise-enhanced sentence , use this sentence to replace the current sentence to generate a new sentence pair, such as or( , , y), and add the new sentence pair to the data augmentation dataset ; Once the program successfully traverses and processes all sentence pairs in the original dataset D, the final data-augmented dataset is obtained. It's important to emphasize that during the application of these data augmentation techniques, the program precisely controls the edit distance between the generated text and the original text, ensuring it remains within 3. This measure is primarily intended to prevent the introduction of excessive noise while also ensuring that the enhanced text fully retains the semantic information contained in the original text, thereby ensuring the reliability and effectiveness of the data augmentation effect.

[0027] The data enhancement based on Chinese characteristics and semantic consistency of the original data also includes: word-level entity replacement, specifically as follows Figure 4 As shown in the figure, the implementation process of the word-level entity replacement algorithm includes: Enter the original data text ,in Represents input text The Chinese text words; Original data text Perform data preprocessing. BERT is a pre-trained deep learning model based on the Transformer architecture that can capture the contextual information of words and is particularly suitable for natural language processing tasks. Therefore, the BERT model is used to encode each word in the text, generate the corresponding embedding vector, and convert the text into an embedding vector. ,in Representing words The corresponding embedding vector of The embedding vector E is used as input, and the entity recognition model performs entity recognition on the text and adds corresponding entity labels. For the specific entity recognition model, please refer to Figure 5 As shown in Figure 2. The Bi-LSTM model combines two directions of the LSTM model to process sequence data, one in normal order (the order is in Figure 5 The other processes the input sequence in reverse order (the order in Figure 5 (from bottom to top in the figure), this bidirectional processing mechanism enables the model to simultaneously capture the contextual information before and after each time point, thereby building a more comprehensive and in-depth understanding of the entire sequence; the CRF layer is a probabilistic graphical model used for sequence labeling and structured prediction. Because it can effectively encode the transition probability between adjacent labels, thereby improving the accuracy of labeling, it is widely used in sequence labeling tasks. By processing the sequence labeling task with the Bi-LSTM model, the label of each position can be predicted and the emission probability of each label can be obtained. These prediction results and emission probabilities are passed to the CRF layer, which determines the final sequence labeling result. In addition, the entity labeling of this model adopts the BIO labeling method, covering a range of entity types, including personal names (PER), locations (LOC), works (WOR), organizations (ORG), and other proper nouns (OTH). The entity recognition model mainly consists of two parts: a bidirectional long short-term memory network model (Bi-LSTM) and a conditional random field layer (CRF); By using a replacement algorithm, based on the entities identified by the entity recognition model and the label results, other entities with the same type of labels as these entities are found and replaced with the corresponding positions in the original text, thereby generating a series of new data samples and enriching the content of the original dataset.

[0028] The data enhancement based on Chinese characteristics and semantic consistency of the original data also includes: sentence back translation; specific reference Figure 6 ,The implementation process of the sentence back-translation algorithm includes: Compared to developing machine translation models independently, using the API of open translation platforms has shown significant advantages. These platforms benefit from in-depth training on large-scale data sets and can output more accurate and stable translation results, especially in the back-translation process. After comprehensively evaluating the performance of the three major platforms of Baidu Translate, Google Translate and Youdao Translation, it was found that Google Translate performed particularly well in maintaining the integrity of proper noun information. In contrast, Baidu Translate and Youdao Translation had certain inaccuracies when processing proper noun translation. Therefore, the Google Translate API was used as the translation model for the sentence back-translation algorithm; First, the input source language sentence (for example, "Is the weather good today?" in the lower left corner of Figure 7) is accurately converted into a target language sentence (such as the three sentences in different languages shown in the center of Figure 7) with the help of the translation model, and the target language must be different from the source language. Then, the target language sentence is back-translated into the source language sentence using the translation model again (such as the three sentences shown in the lower right corner of Figure 7). Through this process, new sentences can be generated that are semantically consistent with the original sentence but show differences in sentence structure and expression details, thereby achieving the effect of text diversification.

[0029] Compared with existing data augmentation methods, the data augmentation method of the present invention, based on the characteristics and semantic consistency of Chinese language, adopts a series of innovative hybrid strategies, including a word-level entity replacement algorithm, a synonym replacement and random insertion algorithm based on semantic consistency, a noise enhancement algorithm based on Chinese language characteristics, and a sentence back-translation algorithm. This method incorporates the unique properties of Chinese language, enabling this data augmentation method to exhibit superior performance when processing Chinese data. It also pays close attention to semantic consistency, ensuring that the content after data augmentation is highly consistent with the original text at the semantic level, allowing the enhanced data to be better learned by the model, improving not only the model's ability to understand context but also significantly enhancing the model's generalization and stability.

[0030] Therefore, in-depth research on data enhancement methods based on Chinese characteristics and semantic consistency is of great significance for improving data diversity and practicality in model training.

[0031] According to a second aspect of the present invention, the present invention provides a data enhancement system based on Chinese characteristics and semantic consistency, comprising: Data acquisition module, used to obtain original data; A data enhancement module is used to perform synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics on the original data. The noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word granularity; The data output module is used to generate and output enhanced data.

[0032] It can be understood that the data enhancement system based on Chinese characteristics and semantic consistency provided by the present invention corresponds to the data enhancement method based on Chinese characteristics and semantic consistency provided in the aforementioned embodiments. The relevant technical features of a data enhancement system based on Chinese characteristics and semantic consistency can refer to the relevant technical features of a data enhancement method based on Chinese characteristics and semantic consistency, which will not be repeated here.

[0033] The methods proposed in the embodiments of the present invention rely on electronic devices for execution, so the relevant electronic devices are described below. To this end, the embodiments of the present invention specifically provide an electronic device comprising: at least one processor, a communication interface, at least one memory, and a communication bus. These components enable data transmission and communication between them via the communication bus. The at least one processor is capable of invoking logic instructions stored in at least one memory to execute all or part of the method described in the aforementioned method embodiments.

[0034] Furthermore, when the logic instructions in the aforementioned memory are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, i.e., its contribution to the prior art, can be presented in the form of a software product, which is contained in a storage medium and contains a number of instructions for directing a computer device (including a personal computer, server, or network device, etc.) to execute all or part of the processes described in the various method embodiments of the present invention. The aforementioned storage media come in many types, including but not limited to USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, and optical disks, among other media capable of storing program code.

[0035] Through the description of the above embodiments, those skilled in the art will clearly recognize that each embodiment can be implemented through software combined with the necessary general hardware platform, or through pure hardware. Based on this understanding, the above technical solution, that is, its improvement over the existing technology, can exist in the form of a software product. This software product is stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and contains a number of instructions for driving a computer device (including a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or part of each embodiment.

[0036] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data enhancement method based on Chinese characteristics and semantic consistency, characterized in that: The following steps are involved: Obtaining original data, performing synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics, wherein the noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word-unit granularity; Generate enhanced data and output.

2. According to the data enhancement method based on Chinese characteristics and semantic consistency described in claim 1, it is characterized in that The synonym replacement and random insertion based on semantic consistency include: Input a set of raw data in the form of sentence pairs, which contains two related sentences; In the data preprocessing stage, text segmentation is performed on each sentence in the sentence pair to generate the word sequence of each sentence; Go through the sentences in the sentence pair one by one, use the semantic consistency evaluation mechanism to determine the importance of each word in the sentence, and sort them accordingly; According to the importance ranking, based on the masked language model, the more important words in the sentence are selected for masking; Use the pre-trained masked language model to predict the masked part. The prediction result contains multiple candidate replacement words. If the candidate replacement word meets the filtering conditions and the similarity between the new sentence formed by replacing the masked part with the predicted result and the original sentence exceeds the similarity threshold, the new sentence is added to the candidate replacement sentence list. Select the sentence with the highest similarity in the candidate replacement sentence list to replace the original sentence; Until the traversal of the sentence pairs is completed, if all sentences in the sentence pairs have been replaced, the replaced sentences will form a new sentence pair as the data after data enhancement; otherwise, no data after data enhancement will be generated.

3. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 1, characterized in that: The noise enhancement based on Chinese characteristics includes: Input the original dataset, homophones, similar words and threshold data; Perform text segmentation on all sentence pairs in the dataset to obtain word lists for all sentences; Iterate through the sentence pairs in the dataset one by one, and traverse the word list for each sentence in the sentence pair, and obtain random numbers through the random method Compared with the threshold, if Greater than or equal to the threshold , then word-granular noise enhancement is performed on the sentence pairs in the original data; otherwise, word-granular noise enhancement is skipped.

4. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 3, characterized in that: Performing word-granular noise enhancement on sentence pairs in the original data includes: Redundant word replacement operations, word omission replacement operations, word order error replacement operations, and word selection error replacement operations are performed to build a replacement dictionary; Traverse the words in the current sentence and get random numbers through random methods ,if Greater than or equal to the threshold , then perform word-unit granularity noise enhancement operation on the sentence pairs in the original data; otherwise, skip the word-unit granularity noise enhancement operation.

5. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 4, characterized in that: Performing word-level noise enhancement on sentence pairs in the original data includes: Redundant word replacement operations, word omission replacement operations, word order error replacement operations, and word selection error replacement operations are performed to build a replacement dictionary; According to the replacement dictionary, the current sentence is replaced to generate a new sentence with noise enhancement, and the new sentence is used to replace the corresponding current sentence in the original sentence pair to form a new sentence pair, and the new sentence pair is added to the data set after data enhancement; Until the program traverses all the sentence pairs in the dataset, the final data-enhanced dataset is obtained.

6. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 1, characterized in that: The data enhancement based on Chinese characteristics and semantic consistency of the original data further includes: word-level entity replacement; the word-level entity replacement includes: Input raw text data and use the BERT model for data preprocessing to obtain word embeddings in the text; Use the entity recognition model to identify entities in text data. The bidirectional long short-term memory network in the entity recognition model is used to calculate the emission probability of characters as candidate labels, and the conditional random field layer is used to determine the final entity label result. Use the replacement algorithm to replace the identified entities in the text data with other entities of the same type to generate new text data.

7. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 6, characterized in that: The entity recognition model is a BiLSTM-CRF model. The Bi-LSTM model combines the forward and reverse directions of the LSTM model to process sequence data. One processes the input sequence in normal order, and the other processes it in reverse. The bidirectional processing mechanism enables the Bi-LSTM model to simultaneously capture the contextual information before and after each time point, thereby building a more comprehensive and in-depth understanding of the entire sequence.

8. The data enhancement method based on Chinese characteristics and semantic consistency according to claim 1, characterized in that: The data enhancement based on Chinese characteristics and semantic consistency of the original data further includes: sentence back translation; the sentence back translation includes: Translate the original input sentence into another language and then translate the translated sentence back to the original language to generate a new sentence.

9. A data enhancement system based on Chinese characteristics and semantic consistency, characterized by: include: Data acquisition module, used to obtain original data; A data enhancement module is used to perform synonym replacement and random insertion based on semantic consistency and noise enhancement based on Chinese characteristics on the original data. The noise enhancement based on Chinese characteristics includes: noise enhancement based on word granularity and noise enhancement based on word granularity; The data output module is used to generate and output enhanced data.

10. An electronic device, characterized in that: include: At least one processor, at least one memory, and a communication interface; wherein the processor, memory, and communication interface communicate with each other; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the data enhancement method based on Chinese characteristics and semantic consistency as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Data processing method and device and related equipment

    CN121071097A

  • Data set construction method for collaborative iteration of antagonism enhancement and semantic consistency verification

    CN121660013A