A data enhancement method and system for electric power text
The BERT generative model is used to perform emotional attitude annotation and part-of-speech tag extraction, combined with selective masking and synonym replacement, to generate a balanced enhanced data set, which solves the problem of insufficient annotation data and high logic requirements in electric power texts, and improves the efficiency of text enhancement. Accuracy and diversity enhance the effect of model training.
Patent Information
- Application Number
- CN202111301344.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-11-04
AI Technical Summary
When existing text data enhancement methods process electric power texts, they face problems such as semantic and logical gaps caused by too few annotated sample data, difficulty in synonym matching, and high logic requirements, which affects model training and search accuracy.
The BERT generative model is used for emotional attitude annotation and part-of-speech tag extraction. Through selective masking and synonym replacement, positive, derogatory and neutral enhanced data sets are generated, combined with the tendency grouping and word segmentation of sentences until the number of sentences reaches a balance to ensure semantics. and logical consistency.
It improves the accuracy and diversity of the power text enhancement process, avoids the limitation of the synonym list, solves the problem that the back-translation method cannot guarantee the diversity of sentences, and enhances the effect of model training.
Smart Images

Figure CN114003733B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to a data enhancement method and system applied to electric power text. Background Art
[0002] Supervised learning methods are currently the main methods for automatically constructing knowledge graphs and extracting natural language knowledge. Currently, most text data processing tasks are classification tasks. Therefore, in tasks that use supervised learning to process text data, data with classification labels are usually required to train deep learning models.
[0003] In the field of natural language processing, one of the biggest challenges is that there are too few labeled sample data, especially for low-resource fields such as the power sector, where there are basically no labeled, public, and rich power datasets. Manually collecting and annotating additional data is a time-consuming, labor-intensive, and challenging task.
[0004] Existing text data enhancement methods mainly include synonym replacement, back translation, and text order reversal. For example, while maintaining the original semantics of the enhanced sentence, some words in the parent sentence are replaced with synonyms from an authoritative dictionary. However, most power texts contain many professional terms, and there are few synonyms that can be matched, and there is often a phenomenon of no words to replace. The back translation enhancement method is to translate the parent sentence between the source language and multiple target languages multiple times, and finally translate it back to the source language. However, this method cannot guarantee the diversity of the translation result clauses. In addition, since the logic requirements of power texts are very high, the method of reversing the text order often causes a large gap between the previous and the next logic, which has a great impact on the training of subsequent models, thereby causing a great impact on the accuracy of the search. Summary of the invention
[0005] The present application provides a data enhancement method and system for electric power texts to solve the problems faced during supplier access, such as inconsistent data standards, different status codes, time-consuming access, and the inability to continuously monitor, analyze, feedback, and correct data quality.
[0006] The present invention is achieved through the following technical solutions:
[0007] A data enhancement method applied to electric power text, comprising the following steps:
[0008] Use annotation software to annotate the sentiment attitude of the augmented dataset and generate sample data;
[0009] The BERT generative model extracts part-of-speech tags from sample data;
[0010] The BERT generative model is used to selectively mask the sample data and combine it with the part-of-speech tags to predict the sentences of the sample data and obtain an enhanced data set.
[0011] The one-time augmentation dataset is grouped according to the tendency of the sentences to obtain the commendatory one-time augmentation dataset, the derogatory one-time augmentation dataset and the neutral one-time augmentation dataset.
[0012] Synonym replacement is performed on the commendatory first-enhanced dataset, the derogatory first-enhanced dataset, and the neutral first-enhanced dataset until the number of sentences in the three datasets is balanced to obtain the second-enhanced dataset.
[0013] Furthermore, before extracting the part-of-speech tags in the sample data, the BERT generative model includes the following steps: the BERT generative model fine-tunes itself using the dataset to be enhanced until the model converges.
[0014] Furthermore, the step of obtaining an enhanced data set specifically includes:
[0015] Randomly select a sentence from the sample data;
[0016] Randomly mask a word in the extracted sentence as a mask word;
[0017] The BERT generative model determines whether the replacement of masked words affects the description of the part-of-speech tag;
[0018] If yes, reselect the masking word;
[0019] Otherwise, the BERT generative model is used to predict the masked words and obtain a new generated sentence;
[0020] Add the newly generated sentences to the sample data;
[0021] Determine whether the size of the existing sample data meets the requirements;
[0022] If yes, the existing sample data is output as an enhanced data set;
[0023] Otherwise repeat the above steps.
[0024] Furthermore, the method for obtaining a secondary enhanced data set specifically comprises the following steps:
[0025] The positive first-enhanced dataset, the negative first-enhanced dataset, and the neutral first-enhanced dataset are segmented and marked with parts of speech to obtain secondary phrases.
[0026] Randomly select a word in the secondary phrase that has not been replaced as the word to be replaced, and the part of speech of the replacement word is one of noun, verb, adjective or adverb;
[0027] Perform synonym search on the words to be replaced and obtain a synonym list;
[0028] Arrange the synonyms in the synonym list in descending order according to their semantic relevance, and use the words with the highest relevance as replacement words;
[0029] Use the replacement words to replace the words to be replaced, and then add the obtained sentences to the original positive enhancement dataset, negative enhancement dataset, and neutral enhancement dataset;
[0030] Determine whether the number of sentences in the positive augmented dataset, the negative augmented dataset, and the neutral augmented dataset is balanced;
[0031] If yes, the final positive first-enhanced dataset, negative first-enhanced dataset and neutral first-enhanced dataset are combined as the second-enhanced dataset for output;
[0032] Otherwise repeat the above steps.
[0033] Furthermore, the word segmentation process uses the spaCy library for word segmentation.
[0034] Furthermore, the specific steps of the synonym query include:
[0035] Find synonyms of the word to be replaced from WordNet;
[0036] If found, a synonym list is generated;
[0037] If not found, search for synonyms of the word to be replaced in the power corpus;
[0038] If found, a synonym list is generated;
[0039] If the search fails, a new phrase is selected from the secondary phrases.
[0040] Furthermore, after obtaining the enhanced data set, the method further includes:
[0041] The augmented dataset is randomly divided into training set and test set in a ratio of 8:2;
[0042] The training set is grouped according to the tendency of the sentences to obtain a positive augmented dataset, a negative augmented dataset, and a neutral augmented dataset.
[0043] After obtaining the secondary enhanced data set, the method further includes:
[0044] The secondary enhanced data set and the test set are respectively input into the classification model for training, and the classification results are used to verify whether the text data is correct;
[0045] If it is correct, the training sentence will be retained in the secondary augmentation dataset;
[0046] If an error occurs, the training sentence will be deleted from the secondary augmentation dataset.
[0047] The second aspect of the present application provides a data enhancement system applied to electric power texts. The data enhancement method applied to electric power texts described in the first aspect includes: a tagging module, a BERT module, a part-of-speech classification module, a commendatory processing module, a derogatory processing module, a neutral processing module, and a secondary enhancement data receiving module;
[0048] The annotation module is configured to annotate sentiment attitudes, generate sample data, and pass it to the BERT module;
[0049] The BERT module is configured to predict sentences in the sample data by combining part-of-speech tags through selective masking, and pass the obtained primary enhanced data set to the part-of-speech classification module;
[0050] The part-of-speech classification module is configured to group the primary enhancement data set by using the tendency of the sentence, and transmit the obtained positive primary enhancement data set to the positive processing module, transmit the negative primary enhancement data set to the negative processing module, and transmit the neutral primary enhancement data set to the neutral processing module;
[0051] The positive meaning processing module is configured to replace the words whose part of speech is noun, verb, adjective or adverb and has not been replaced in the positive meaning primary enhancement data set to obtain the positive meaning secondary enhancement data set;
[0052] The derogatory processing module is configured to replace the words whose part of speech is noun, verb, adjective or adverb and has not been replaced in the derogatory primary enhancement data set to obtain a derogatory secondary enhancement data set;
[0053] The neutral processing module is configured to replace the words whose parts of speech are nouns, verbs, adjectives or adverbs that have not been replaced in the neutral primary enhancement data set to obtain a neutral secondary enhancement data set;
[0054] The secondary enhancement data receiving module is configured to receive a commendatory secondary enhancement data set, a derogatory secondary enhancement data set, and a neutral secondary enhancement data set, compare the number of sentences in the three data sets, and output a final secondary enhancement data set.
[0055] Furthermore, the BERT module is configured to fine-tune itself using the dataset to be enhanced before extracting sample labels until the model converges.
[0056] Furthermore, the data enhancement device applied to the power text also includes a verification system;
[0057] The inspection system is configured to randomly divide the primary augmented data set into a training set and a test set in a ratio of 8:2; and pass the training set to the part-of-speech classification module;
[0058] The part-of-speech classification module groups the training set according to the tendency of the sentences to obtain a commendatory enhanced dataset, a derogatory enhanced dataset and a neutral enhanced dataset;
[0059] The inspection system is also configured to compare and verify the secondary enhanced data set and the test set to determine the accuracy of the result.
[0060] The present invention has the following beneficial effects:
[0061] 1. The present invention effectively improves the accuracy and effectiveness of the text obtained in the process of power text enhancement by adding a method of part-of-speech tag analysis to the BERT generative model.
[0062] 2. The present invention ensures that the semantics and logic of the original power text sentences will not be significantly changed, while enhancing the diversity of sentence expressions.
[0063] 3. The present invention avoids the limitation of synonym lists on vocabulary in the electric power field and solves the problem that the back translation method cannot ensure sentence diversity. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0065] Figure 1 A schematic diagram of the steps of a data enhancement method applied to electric power text in this application;
[0066] Figure 2 A schematic diagram of the steps for obtaining an enhanced dataset for this application;
[0067] Figure 3 A schematic diagram of the steps for obtaining a secondary enhanced dataset for this application;
[0068] Figure 4 A schematic diagram of the synonym search step of this application;
[0069] Figure 5 This is a schematic diagram of the validation steps for the dataset in this application;
[0070] Figure 6A schematic diagram of a data enhancement device applied to electric power text in the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of the present invention.
[0072] Supervised learning methods are currently the main methods for automatically building knowledge graphs and extracting natural language knowledge. Currently, most text data processing tasks are classification tasks. Therefore, in tasks that use supervised learning to process text data, data with classification labels is usually required to train deep learning models. In the field of natural language processing, one of the biggest challenges is that there are too few labeled sample data, especially for low-resource fields such as the power industry. There are basically no labeled, public, and data-rich power data sets. Manually collecting and labeling additional data is a time-consuming, labor-intensive, and challenging task.
[0073] Existing text data enhancement methods mainly include synonym replacement, back translation, and text order reversal. For example, while maintaining the original semantics of the enhanced sentence, some words in the parent sentence are replaced with synonyms from an authoritative dictionary. However, most power texts contain many professional terms, and there are few synonyms that can be matched, and there is often a phenomenon of no words to replace. The back translation enhancement method is to translate the parent sentence between the source language and multiple target languages multiple times, and finally translate it back to the source language. However, this method cannot guarantee the diversity of the translation result clauses. In addition, since the logic requirements of power texts are very high, the method of reversing the text order often causes a large gap between the previous and the next logic, which has a great impact on the training of subsequent models, thereby causing a great impact on the accuracy of the search.
[0074] A data enhancement method applied to power text, reference Figure 1 , including the following steps:
[0075] S101. Use annotation software to annotate the sentiment attitude of the enhanced dataset to generate sample data.
[0076] It should be noted that the annotation software can mark the emotional attitude of a sentence, such as positive, negative, or neutral, and at the same time, mark the part of speech of each word in the sentence, and use the annotation label and the original sentence as sample data.
[0077] S102, BERT generative model extracts part-of-speech tags from sample data;
[0078] It should be noted that the BERT generative model is based on the original training model BERT and provides an MLM (masked language model) task mechanism. It can randomly mask part of the words in the original sentence through MLM, and then predict new words at the masked position based on their context, thereby generating new sentences and ultimately increasing the number of samples.
[0079] The words covered by the original MLM are likely to be words containing emotional attitudes. For example, in "In recent years, the performance of power terminal equipment has been very good...", the word covered by the MLM mechanism may be "good". In this case, the accuracy of the prediction result will be very low, and the predicted result may be "bad, bad", etc., which will have a negative impact on sentence enhancement.
[0080] Therefore, the present invention modifies the input content and processing method of the original BERT's MLM mechanism, and adds a new limiting factor to the original input: the part-of-speech tag. The BERT generative model determines whether the word is an adjective or adverb of the sentiment attitude category based on the part-of-speech tag. If so, the word is not masked. In this way, the low accuracy of the prediction results of the original training model BERT is effectively reduced.
[0081] S103, using the BERT generative model to selectively mask the sample data and combine it with the part-of-speech tags to predict the sentences of the sample data, thereby obtaining an enhanced data set;
[0082] It should be noted that the once-enhanced data set is a set that is continuously expanded during the prediction behavior, and the once-enhanced data set passed to the subsequent data grouping step is the total set of all prediction results.
[0083] S104, grouping the once-enhanced data set according to the tendency of the sentences to obtain a commendatory once-enhanced data set, a derogatory once-enhanced data set, and a neutral once-enhanced data set;
[0084] It should be noted that, while the grouping is performed, the number of each set of the positive one-time enhanced data set, the negative one-time enhanced data set and the neutral one-time enhanced data set will also be counted.
[0085] S105, performing synonym replacement on the commendatory first-enhanced data set, the derogatory first-enhanced data set, and the neutral first-enhanced data set until the number of sentences in the three data sets reaches a balance, thereby obtaining a second-enhanced data set.
[0086] It should be noted that the number of sentences in the three data sets is balanced, which means that the number of new sentences obtained after synonym replacement is one third of the set where the original data is located (the positive once enhanced data set, the negative once enhanced data set and the neutral once enhanced data set), which meets the requirements.
[0087] The positive first-enhanced data set, the negative first-enhanced data set and the neutral first-enhanced data set are all sets that are continuously expanded during the replacement process, and the second-enhanced data set is the sum of the positive first-enhanced data set, the negative first-enhanced data set and the neutral first-enhanced data set finally obtained after the number of sentences in the above three data sets reaches a balance.
[0088] According to a data enhancement method applied to electric power text according to claim 1, before extracting the part-of-speech tags in the sample data, the BERT generative model includes the following steps: the BERT generative model fine-tunes itself using the data set to be enhanced until the model converges.
[0089] Example 1
[0090] The data set to be enhanced contains the sentence "electric terminal equipment has been very well developed". Taking this sentence as an example, a data enhancement method for electric power text of the present invention is introduced:
[0091] S101`, mark the sentences;
[0092] Positive meaning; power terminal equipment → noun; get → verb; very good → adjective; of → preposition; develop → noun.
[0093] S102`, the BERT generative model extracts the two information "positive meaning; power terminal equipment → noun; get → verb; very good → adjective; of → preposition; development → noun" and "power terminal equipment has developed very well".
[0094] S103`, BERT generative model masks and predicts words.
[0095] The words that are covered are indicated by brackets "()".
[0096] The power terminal equipment has been developed (), and the masked words are analyzed as adjectives, which will have an impact on emotional attitudes, so no prediction is made.
[0097] The power terminal equipment () has developed very well. The analysis shows that the masked word is a verb and will not affect the emotional attitude, so a prediction is made. The prediction result is yes, and the sentence "The power terminal equipment has developed very well" is added to the enhanced data set.
[0098] The specified one-time enhanced data set only needs to contain two sentences, so the one-time enhanced data set containing "electric terminal equipment has very good development" and "electric terminal equipment has been very well developed" is output as one-time enhanced data set.
[0099] S104`, grouping the primary enhancement data;
[0100] Positive meaning: "Power terminal equipment has developed very well", "Power terminal equipment has developed very well";
[0101] Derogatory: None;
[0102] Neutral: None;
[0103] S105`, replace;
[0104] Replace very good with poor and very good with some, and we get the following statement.
[0105] Positive meaning: "Power terminal equipment has developed very well", "Power terminal equipment has developed very well"
[0106] Derogatory meaning: "Power terminal equipment has poor development", "Power terminal equipment has been poorly developed"
[0107] Neutral: "Power terminal equipment has some development", "Power terminal equipment has some development"
[0108] The number of the above sentences has reached a balance, and all the above sentences are output as secondary enhanced data sets.
[0109] according to Figure 2 , the step of obtaining an enhanced data set specifically includes:
[0110] S301, randomly extract a sentence from the sample data;
[0111] S302, randomly masking a word in the extracted sentence as a masking word;
[0112] S303, the BERT generative model determines whether the replacement of the masked word affects the description of the part-of-speech tag. If so, step S302 is executed to reselect a word for masking. Otherwise, step S304 is executed.
[0113] S304, using the BERT generative model to predict the masked words to obtain a newly generated sentence;
[0114] S305, adding the newly generated sentence to the sample data;
[0115] S306: Determine whether the size of the existing sample data meets the requirements. If yes, execute step S307; otherwise, repeat step S301;
[0116] S307, outputting the existing sample data as a primary enhanced data set;
[0117] Through the above limitations, the high accuracy of the enhanced data set is guaranteed, and inaccurate predictions caused by incorrect semantics are effectively avoided.
[0118] according to Figure 3 The method for obtaining a secondary enhanced data set specifically comprises the following steps:
[0119] S501, segmenting the positive primary enhancement data set, the negative primary enhancement data set, and the neutral primary enhancement data set, and marking the parts of speech to obtain secondary phrases;
[0120] It should be noted that the secondary phrases include three parts: a positive primary enhanced data set, a negative primary enhanced data set and a neutral primary enhanced data set.
[0121] S502, randomly selecting a word in the secondary phrase that has not been replaced as the word to be replaced, wherein the part of speech of the word to be replaced is one of noun, verb, adjective or adverb;
[0122] S503, performing a synonym search on the word to be replaced to obtain a synonym list;
[0123] S504, arranging the synonyms in the synonym list in descending order according to semantic relevance, and taking the word with the highest relevance as the replacement word;
[0124] S505, using a replacement word to replace the word to be replaced, and then adding the obtained sentence to the original positive first-enhanced data set, the negative first-enhanced data set, and the neutral first-enhanced data set;
[0125] S506, determining whether the number of sentences in the positive first-enhanced data set, the negative first-enhanced data set, and the neutral first-enhanced data set is balanced, if so, executing step S507, otherwise repeating step S502;
[0126] S507: Combine the final positive primary enhancement data set, negative primary enhancement data set, and neutral primary enhancement data set as a secondary enhancement data set for output.
[0127] The word segmentation process in step S104 uses the spaCy library to perform word segmentation.
[0128] The specific steps of the synonym search in step S503 include:
[0129] Search for synonyms of the word to be replaced in WordNet; if found, generate a synonym list;
[0130] If not found, search for synonyms of the word to be replaced in the power corpus; if found, generate a synonym list; if not found, reselect a phrase from the secondary phrase.
[0131] according to Figure 4 After obtaining the enhanced data set, the method further includes:
[0132] S201, randomly divide the primary augmented data set into a training set and a test set in a ratio of 8:2;
[0133] S202, grouping the training set according to the tendency of the sentences to obtain a positive one-time enhanced data set, a negative one-time enhanced data set, and a neutral one-time enhanced data set;
[0134] It should be noted that after the training set is split into the positive first-enhanced data set, the negative first-enhanced data set and the neutral first-enhanced data set, the words are replaced according to the method of step S502 to step S507.
[0135] It should be noted that if verification is not required, there is no need to split the enhanced data set, and all the data contained in the enhanced data set can be directly enhanced. If verification is required, the enhanced data set is divided into a training set and a test set in a ratio of 8:2, and then only the training set is enhanced.
[0136] After obtaining the secondary enhanced data set, the method further includes:
[0137] S203, inputting the secondary enhanced data set and the test set into the classification model for training respectively, and verifying whether the text data is correct through the classification result, if it is correct, executing step S204, otherwise executing step S205;
[0138] S204, retaining the trained sentences in the secondary enhanced data set;
[0139] S205: Delete the trained sentences from the secondary enhanced data set.
[0140] By adding the above steps, the accuracy of the secondary enhancement data is further improved.
[0141] The above is an embodiment and principle analysis of a data enhancement method applied to power text provided in an embodiment of the present application. The following is an embodiment of a data enhancement system applied to power text provided in an embodiment of the present application.
[0142] A data enhancement system applied to electric power text, comprising: a tagging module, a BERT module, a part-of-speech classification module, a commendatory processing module, a derogatory processing module, a neutral processing module and a secondary enhancement data receiving module;
[0143] The annotation module is configured to annotate sentiment attitudes, generate sample data, and pass it to the BERT module;
[0144] The BERT module is configured to predict sentences in the sample data by combining part-of-speech tags through selective masking, and pass the obtained primary enhanced data set to the part-of-speech classification module;
[0145] The part-of-speech classification module is configured to group the primary enhancement data set by using the tendency of the sentence, and transmit the obtained positive primary enhancement data set to the positive processing module, transmit the negative primary enhancement data set to the negative processing module, and transmit the neutral primary enhancement data set to the neutral processing module;
[0146] The positive meaning processing module is configured to replace the words whose part of speech is noun, verb, adjective or adverb and has not been replaced in the positive meaning primary enhancement data set to obtain the positive meaning secondary enhancement data set;
[0147] The derogatory processing module is configured to replace the words whose part of speech is noun, verb, adjective or adverb and has not been replaced in the derogatory primary enhancement data set to obtain a derogatory secondary enhancement data set;
[0148] The neutral processing module is configured to replace the words whose parts of speech are nouns, verbs, adjectives or adverbs that have not been replaced in the neutral primary enhancement data set to obtain a neutral secondary enhancement data set;
[0149] The secondary enhancement data receiving module is configured to receive a commendatory secondary enhancement data set, a derogatory secondary enhancement data set, and a neutral secondary enhancement data set, compare the number of sentences in the three data sets, and output a final secondary enhancement data set.
[0150] At the same time, the BERT module is configured to fine-tune itself using the dataset to be enhanced before extracting sample labels until the model converges.
[0151] Meanwhile, the data enhancement device applied to the power text also includes a verification system;
[0152] The inspection system is configured to randomly divide an enhanced data set into a training set and a test set in a ratio of 8:2; and pass the training set to the part-of-speech classification module; the 8:2 ratio is the application scheme in this embodiment. In the actual verification process, the ratio of the training set and the test set is not limited to the above-mentioned expression.
[0153] The part-of-speech classification module groups the training set according to the tendency of the sentences to obtain a commendatory enhanced dataset, a derogatory enhanced dataset and a neutral enhanced dataset;
[0154] The inspection system is also configured to compare and verify the secondary enhanced data set with the test set to determine the accuracy of the results.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the method described above can refer to the corresponding process in the aforementioned device embodiment, and will not be repeated here.
[0156] The present invention effectively improves the accuracy and effectiveness of the text obtained in the process of power text enhancement by adding a method of part-of-speech tag analysis to the BERT generative model. At the same time, combined with the secondary classification and replacement of the power text, the capacity of the power text is further improved. While ensuring that the semantics and logic of the original power text sentences will not change significantly, the diversity of sentence expressions is enhanced, and there is no need to worry about the limitations of the synonym table on the vocabulary in the power field, and the problem that the back translation method cannot guarantee sentence diversity is solved.
[0157] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present invention are indicated by the claims of the present application.
Claims
1. A data enhancement method applied to power text, It is characterized in that The following steps are involved: Use annotation software to annotate the sentiment attitude of the augmented dataset and generate sample data; The BERT generative model extracts part-of-speech tags from sample data; The BERT generative model is used to selectively mask the sample data and combine it with the part-of-speech tags to predict the sentences of the sample data and obtain an enhanced data set. The one-time augmentation dataset is grouped according to the tendency of the sentences to obtain the commendatory one-time augmentation dataset, the derogatory one-time augmentation dataset and the neutral one-time augmentation dataset. Perform synonym replacement on the positive first-enhanced dataset, the negative first-enhanced dataset, and the neutral first-enhanced dataset until the number of sentences in the three datasets is balanced to obtain the second-enhanced dataset. The step of obtaining an enhanced data set specifically includes: Randomly select a sentence from the sample data; Randomly mask a word in the extracted sentence as a mask word; The BERT generative model determines whether the replacement of masked words affects the description of the part-of-speech tag; If yes, reselect the masking word; Otherwise, the BERT generative model is used to predict the masked words and obtain a new generated sentence; Add the newly generated sentences to the sample data; Determine whether the size of the existing sample data meets the requirements; If yes, the existing sample data is output as an enhanced data set; Otherwise, repeat the above steps; The method for obtaining the secondary enhanced data set specifically comprises the following steps: The positive, negative and neutral enhanced datasets are segmented and marked with parts of speech to obtain secondary phrases. Randomly select a word in the secondary phrase that has not been replaced as the word to be replaced, where the part of speech of the word to be replaced is one of noun, verb, adjective or adverb; Perform synonym search on the words to be replaced and obtain a synonym list; Arrange the synonyms in the synonym list in descending order according to their semantic relevance, and use the words with the highest relevance as replacement words; Use the replacement words to replace the words to be replaced, and then add the obtained sentences to the original positive enhancement dataset, negative enhancement dataset, and neutral enhancement dataset; Determine whether the number of sentences in the positive augmented dataset, the negative augmented dataset, and the neutral augmented dataset is balanced; If yes, the final positive first-enhanced dataset, negative first-enhanced dataset and neutral first-enhanced dataset are combined as the second-enhanced dataset for output; Otherwise repeat the above steps.
2. According to the data enhancement method applied to electric power text according to claim 1, It is characterized in that Before extracting part-of-speech tags from sample data, the BERT generative model includes the following steps: the BERT generative model fine-tunes itself using the dataset to be enhanced until the model converges.
3. According to the data enhancement method applied to electric power text according to claim 1, It is characterized in that The word segmentation is performed using the spaCy library.
4. According to claim 1, a data enhancement method applied to electric power text, It is characterized in that The specific steps of the synonym query include: Find synonyms of the word to be replaced from WordNet; If found, a synonym list is generated; If not found, search for synonyms of the word to be replaced in the power corpus; If found, a synonym list is generated; If the search fails, a new phrase is selected from the secondary phrases.
5. According to the data enhancement method applied to electric power text according to claim 1, It is characterized in that After obtaining the enhanced data set, the method further includes: The augmented dataset is randomly divided into training set and test set in a ratio of 8:2; The training set is grouped according to the tendency of the sentences to obtain a positive augmented dataset, a negative augmented dataset, and a neutral augmented dataset. After obtaining the secondary enhanced data set, the method further includes: The secondary enhanced data set and the test set are respectively input into the classification model for training, and the classification results are used to verify whether the text data is correct; If it is correct, the training sentence will be retained in the secondary augmentation dataset; If an error occurs, the training sentence will be deleted from the secondary augmentation dataset.
6. A data enhancement system for power text, It is characterized in that A data enhancement method applied to power text as claimed in any one of claims 1 to 5, comprising: a tagging module, a BERT module, a part-of-speech classification module, a commendatory processing module, a derogatory processing module, a neutral processing module and a secondary enhancement data receiving module; The annotation module is configured to annotate sentiment attitudes, generate sample data, and pass it to the BERT module; The BERT module is configured to predict sentences in the sample data by combining part-of-speech tags through selective masking, and pass the obtained primary enhanced data set to the part-of-speech classification module; The part-of-speech classification module is configured to group the primary enhancement data set by using the tendency of the sentence, and transmit the obtained positive primary enhancement data set to the positive processing module, transmit the negative primary enhancement data set to the negative processing module, and transmit the neutral primary enhancement data set to the neutral processing module; The positive meaning processing module is configured to replace the words whose parts of speech are nouns, verbs, adjectives or adverbs and have not been replaced in the positive meaning primary enhancement data set to obtain a positive meaning secondary enhancement data set; The derogatory processing module is configured to replace the words whose part of speech is noun, verb, adjective or adverb and has not been replaced in the derogatory primary enhancement data set to obtain a derogatory secondary enhancement data set; The neutral processing module is configured to replace the words whose parts of speech are nouns, verbs, adjectives or adverbs that have not been replaced in the neutral primary enhancement data set to obtain a neutral secondary enhancement data set; The secondary enhancement data receiving module is configured to receive a commendatory secondary enhancement data set, a derogatory secondary enhancement data set, and a neutral secondary enhancement data set, compare the number of sentences in the three data sets, and output a final secondary enhancement data set.
7. A data enhancement system for electric power text according to claim 6, It is characterized in that The BERT module is configured to fine-tune itself using the dataset to be augmented before extracting sample labels until the model converges.
8. A data enhancement system for electric power text according to claim 6, It is characterized in that The data enhancement system applied to power text also includes a verification system; The verification system is configured to randomly divide the primary augmented data set into a training set and a test set in a ratio of 8:2; and pass the training set to the part-of-speech classification module; The part-of-speech classification module groups the training set according to the tendency of the sentences to obtain a commendatory enhanced dataset, a derogatory enhanced dataset and a neutral enhanced dataset; The inspection system is also configured to compare and verify the secondary enhanced data set and the test set to determine the accuracy of the result.
