Text enhancement method, electronic device, storage medium

By segmenting and modifying the original text, the target text fields are generated and integrated, which solves the problem of insufficient sample quality in the existing technology and improves the sample data quality and model training effect of text augmentation.

CN115270736BActive Publication Date: 2026-02-06CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211056940.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-02-06
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

In existing technologies, the synonym replacement method based on thesaurus cannot generate sufficiently rich and high-quality text augmentation samples, resulting in low sample quality.

Method used

By performing text segmentation on the original text information, using a language processing model to delete and modify the original text fields, generating target text fields, and integrating them with the original text information, an enhanced text information is formed.

Benefits of technology

It improved the quality of sample data in the text enhancement process, increased the number of different types of training samples, and improved the training effect of the target model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115270736B_ABST
    Figure CN115270736B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, in particular to a text enhancement method, an electronic device and a storage medium. In the text enhancement method, original text information is acquired first, text segmentation processing is performed on the original text information to obtain an original text field, the original text field is subjected to deletion and modification processing via a language processing model to obtain a target text field, and the language processing model is obtained by optimizing and training a basic language model. Further, target text information is generated according to the target text field obtained after the deletion and modification processing, and the original text information and the target text information are integrated to form enhanced text information. In the text enhancement method, the original text field is subjected to deletion and modification processing via the language processing model to obtain the target text field, and then the original text information and the target text information are integrated to form the enhanced text information, so that the quality of sample data is improved in the text enhancement process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a text enhancement method, an electronic device and a storage medium. BACKGROUND

[0002] Text enhancement refers to a method of generating more category training samples in a text processing task (such as a text classification task) through technical means. The purpose of text enhancement is to improve the training effect on the target model by increasing the number of different types of training samples. In related technologies, a certain amount of labeled samples is usually required to generate more similar samples through technical means. For example, by replacing some words in the original sample or randomly deleting some words in the synonym table, new sample materials are obtained. However, the synonym replacement based on the synonym table is often limited by the size of the same table itself, and cannot obtain sufficient and high-quality samples. Therefore, how to improve the quality of sample data in the process of text enhancement has become a major problem to be solved in the industry. SUMMARY

[0003] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application provides a text enhancement method, an electronic device and a storage medium, which can improve the quality of sample data in the process of text enhancement.

[0004] The text enhancement method according to the first aspect of the present application comprises:

[0005] Obtaining original text information and performing text segmentation processing on the original text information to obtain an original text field;

[0006] Performing deletion and modification processing on the original text field via a language processing model to obtain a target text field, wherein the language processing model is obtained by optimizing and training a basic language model;

[0007] Generating target text information according to the target text field obtained after the deletion and modification processing;

[0008] Integrating the original text information and the target text information to form enhanced text information.

[0009] According to some embodiments of the present application, the deletion and modification processing on the original text field via the language processing model to obtain the target text field comprises:

[0010] Determining a deletion and modification target field from the original text field based on a preset deletion and modification benchmark;

[0011] Performing deletion and modification processing on the deletion and modification target field in the original text field via the language processing model;

[0012] The original text field after the deletion and modification processing is determined as a target text field.

[0013] According to some embodiments of the present application, the deletion and modification target field is determined from the original text field based on a preset deletion and modification criterion, comprising:

[0014] When the preset deletion and modification criterion is a keyword deletion and modification, the original text field is parsed by part of speech.

[0015] The original text field identified as a keyword in the part-of-speech parsing is divided into the deletion and modification target field.

[0016] According to some embodiments of the present application, before the original text field is processed by the language processing model, the method further comprises:

[0017] Obtain a set of sentences, which is a text information with complete sentence structure;

[0018] Obtain a set of non-sentences, which is a text information with incomplete sentence structure;

[0019] Based on the set of sentences and the set of non-sentences, the basic language model is optimized and trained to obtain the language processing model.

[0020] According to some embodiments of the present application, the basic language model is optimized and trained based on the set of sentences and the set of non-sentences to obtain the language processing model, comprising:

[0021] The set of sentences and the set of non-sentences are input into the basic language model for iterative training;

[0022] After each round of iterative training, the accuracy of sentence recognition of the basic language model is calculated and the basic language model is updated;

[0023] The change of the accuracy of sentence recognition after each round of iterative training is counted, and when the accuracy of sentence recognition converges to a constant value, the iterative training is stopped and the trained language processing model is obtained.

[0024] According to some embodiments of the present application, before the target text field obtained after the deletion and modification processing is used to generate target text information, the method further comprises:

[0025] The original text information is identified by the language processing model to obtain the original sentence probability.

[0026] According to some embodiments of the present application, the generating target text information according to the target text field after the deletion and modification processing comprises:

[0027] The target text field after the deletion and modification processing is formed into pending text information.

[0028] The pending text information is subjected to sentence probability recognition via the language processing model to obtain target sentence probability.

[0029] When the difference between the target sentence probability and the original sentence probability is less than a first preset threshold, the pending text information is determined as target text information.

[0030] According to some embodiments of the present application, the integrating the original text information and the target text information to form enhanced text information comprises:

[0031] The original text information is subjected to semantic recognition via a semantic recognition model to obtain original semantic information.

[0032] The target text information is subjected to semantic recognition via a semantic recognition model to obtain target semantic information.

[0033] The original semantic information and the target semantic information are compared to obtain a semantic comparison result.

[0034] The original text information and the target text information with the same semantic comparison result are integrated to form enhanced text information.

[0035] In a second aspect, the embodiments of the present application provide an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the text enhancement method according to any one of the embodiments of the first aspect of the present application when executing the computer program.

[0036] In a third aspect, the embodiments of the present application provide a computer readable storage medium, the storage medium stores a program, and the program is executed by a processor to implement the text enhancement method according to any one of the embodiments of the first aspect of the present application.

[0037] The text enhancement method according to the embodiments of the present application has at least the following beneficial effects:

[0038] In the text enhancement method, original text information is first obtained, and text segmentation processing is performed on the original text information to obtain an original text field. Then, the original text field is processed by a language processing model to obtain a target text field. The language processing model is obtained by optimizing and training a basic language model. Further, the target text field obtained after the processing is used to generate target text information. The original text information and the target text information are integrated to form enhanced text information. In the text enhancement method, the original text field is processed by the language processing model to obtain the target text field, and then the original text information and the target text information are integrated to form the enhanced text information, thereby improving the quality of sample data in the text enhancement process.

[0039] Additional aspects and advantages of the application will be made apparent by the following description and the appended claims. BRIEF DESCRIPTION OF DRAWINGS

[0040] The above and / or additional aspects and advantages of the application will become apparent and be readily understood by considering the following detailed description, including the accompanying drawings, in which:

[0041] Figure 1 A text enhancement method flowchart provided for an embodiment of the application;

[0042] Figure 2 Another text enhancement method flowchart provided for an embodiment of the application;

[0043] Figure 3 Another text enhancement method flowchart provided for an embodiment of the application;

[0044] Figure 4 Another text enhancement method flowchart provided for an embodiment of the application;

[0045] Figure 5 Another text enhancement method flowchart provided for an embodiment of the application;

[0046] Figure 6 Another text enhancement method flowchart provided for an embodiment of the application;

[0047] Figure 7 Another text enhancement method flowchart provided for an embodiment of the application;

[0048] Figure 8 A schematic diagram of an electronic device for performing the text enhancement method of the embodiments of the application. DETAILED DESCRIPTION

[0049] Embodiments of the present application are described below in detail with reference to the accompanying drawings, wherein like or similar elements are denoted by like or similar reference symbols throughout the drawings. The embodiments described below are examples in which the present application is applied, and are merely for the purpose of explaining the present application, and should not be understood as limiting the present application.

[0050] In the description of the present application, the meaning of one or more is one or more, the meaning of multiple is two or more, greater than, less than, more than, etc. are understood as not including the number, above, below, within, etc. are understood as including the number. If it is described as first, second, it is only for the purpose of distinguishing technical features, and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of indicated technical features.

[0051] In the description of the present application, it should be understood that, in relation to the description of the position, for example, the position or location relationship indicated by up, down, left, right, front, back, etc. is based on the position or location relationship shown in the drawings, and is only for the purpose of describing the present application and simplifying the description, and should not be understood as indicating or implying that the device or element indicated must have a specific position, be constructed and operated in a specific position, and therefore should not be understood as limiting the present application.

[0052] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0053] In the description of the present application, it should be noted that, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and those skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution. In addition, the identification of the specific steps in the following does not represent the limitation of the order and execution logic of the steps, and the execution order and execution logic between the steps should be understood and inferred with reference to the content expressed in the embodiments.

[0054] Text enhancement refers to a method of generating more category training samples in a text processing task (such as a text classification task) through technical means. The purpose of text enhancement is to improve the training effect on the target model by increasing the number of different types of training samples. In related technologies, a certain amount of labeled samples is usually required to generate more similar samples through technical means. For example, by replacing part of the words in the original sample or randomly deleting part of the words in the synonym table, new sample materials are obtained. However, the synonym replacement based on the synonym table is often limited by the size of the synonym table itself, and cannot obtain sufficient and rich samples, so that the quality of the samples is low. Therefore, how to improve the quality of sample data in the process of text enhancement has become a big problem to be solved in the industry.

[0055] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application proposes a text enhancement method, an electronic device and a storage medium, which can improve the quality of sample data in the process of text enhancement.

[0056] Further description is made below with reference to the accompanying drawings.

[0057] Reference Figure 1 According to the text enhancement method of the first aspect of the present application, the method comprises:

[0058] In step S101, the original text information is obtained, and the original text information is subjected to text segmentation processing to obtain the original text field;

[0059] According to some embodiments provided in the present application, the original text information refers to the text information obtained before text enhancement. It should be understood that, since text enhancement is a method of generating more category training samples in a text processing task (such as a text classification task) through technical means, and the purpose of text enhancement is to improve the training effect on the target model by increasing the number of different types of training samples. Therefore, the original text information serves as the raw material for text enhancement, aiming to provide a data basis for the specific implementation process of text enhancement. In some embodiments of the present application, the original text information is subjected to text segmentation processing to obtain the original text field, which aims to facilitate further deletion and modification processing of the original text information after it is disassembled into several original text fields. It should be understood that there are various ways to perform text segmentation processing on the original text information. For example, specific delimiters (such as hollow bullets, solid bullets, semicolons, colons, etc.) can be used to divide the entire text into multiple sentences; or regular expressions can be used to cut the text, wherein a regular expression is a logical formula for operating on strings (including ordinary characters (such as letters between a and z) and special characters (referred to as "meta characters")), which is a "rule string" composed of some specific characters and combinations of these specific characters, and this "rule string" is used to express a filtering logic for strings. A regular expression is a text pattern that describes one or more strings to be matched when searching for text. It should be understood that text segmentation processing on the original text information to obtain the original text field can include, but is not limited to, the specific embodiments mentioned above.

[0060] In step S102, the original text field is subjected to deletion and modification processing via a language processing model to obtain a target text field, and the language processing model is obtained by optimizing and training a basic language model.

[0061] According to some embodiments provided in the present application, the language processing model refers to an artificial intelligence model obtained by optimizing training of a basic language model. It needs to be made clear that the language processing model is used to obtain target text information corresponding to original text information by performing editing and processing on the original text field, and the basic language model is an artificial intelligence model with general language processing capability. In some more specific embodiments of the present application, the selection scheme of the basic language model is various, which can include, but is not limited to, an ELMo (Embeddings from Language Models) pre-training model, a Bert (Bidirectional Encoder Representation from Transformers) pre-training model, a DeBERTa (Decoding-enhanced Bert with Disentangled Attention) pre-training model, and an ALBERT (ALite Bert) pre-training model.

[0062] According to some embodiments provided in the present application, before the original text field is processed by the language processing model, the basic language model needs to be optimized and trained to obtain the language processing model. It should be clear that the role of the language processing model is to obtain the target text information corresponding to the original text information by processing the original text field, and the basic language model is an artificial intelligence model with general language processing capability. It should be noted that the processing of the original text field includes deleting the original text field and modifying the original text field. Among them, the deletion of the original text field by the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields are deleted from the plurality of original text fields, so that the remaining text fields can still form a complete sentence; and the modification of the original text field by the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields in the plurality of original text fields are modified, so that the modified text fields can still form a complete sentence. Therefore, in some exemplary embodiments of the present application, the language processing model needs to determine whether the remaining text fields or the modified text fields can still form a complete sentence, so the optimization and training of the basic language model specifically refers to the optimization of the sentence detection capability of the basic language model. It should be clear that before the basic language model is formally optimized and trained, a sentence text set and a non-sentence text set need to be obtained. The sentence text set includes text information with complete sentence structure, and the non-sentence text set includes text information with incomplete sentence structure. It should be understood that training the basic language model by the sentence text set and the non-sentence text set can enable the basic language model to accurately determine whether the sentence structure of a piece of to-be-tested information is complete, thereby optimizing the sentence detection capability of the basic language model.

[0063] According to some embodiments provided in the present application, after the sentence text set and the non-sentence text set are obtained, the basic language model is further optimized and trained. During the optimization and training process, the sentence text set and the non-sentence text set need to be input into the basic language model for iterative training. After each round of iterative training, the sentence recognition accuracy of the basic language model is calculated and the basic language model is updated, the change of the sentence recognition accuracy after each round of iterative training is counted, and when the sentence recognition accuracy converges to a constant value, the iterative training is stopped and the trained language processing model is obtained. It should be understood that the trained language processing model can accurately determine whether the sentence structure of a piece of to-be-tested information is complete and has good sentence detection capability.

[0064] Step S103, generating target text information according to the target text field obtained after the processing.

[0065] According to some embodiments provided in the present application, the target text information refers to the text information generated after text enhancement. It should be understood that text enhancement is a method for generating more types of training samples in a text processing task (such as a text classification task) through technical means, and the purpose of text enhancement is to improve the training effect on the target model by increasing the number of different types of training samples. Therefore, the target text information generated as the text information generated by text enhancement can contain various sentence meanings. In some exemplary embodiments, the target text information similar or identical to the sentence meaning reflected by the original text information is referred to as positive target text, and the target text information greatly different from the sentence meaning reflected by the original text information is referred to as noise target text. It should be emphasized that the target text information can contain both positive target text and noise target text. The positive target text as sample data helps to positively guide the training direction, and the noise target text as sample data helps to improve the robustness or anti-interference of the training. In some embodiments, the proportion of positive target text and noise target text in the target text information can be flexibly adjusted through semantic recognition.

[0066] It should be noted that the modification of the original text field through the language processing model includes the deletion of the original text field through the language processing model and the modification of the original text field through the language processing model.

[0067] According to some embodiments provided in the present application, the deletion of the original text field through the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields are deleted from the plurality of original text fields, so that the remaining text fields can still form a complete sentence. In some exemplary embodiments, the function words such as prepositions, conjunctions, auxiliary words, and interjections can be selected to be deleted from the plurality of original text fields. Since function words refer to words without complete meaning, deleting function words such as prepositions, conjunctions, auxiliary words, and interjections does not generally affect the remaining text fields to form a complete sentence. More typical function words include: de, le, zhe, ba, a, etc. For example, when the original text information is “I have eaten rice”, the original text information is processed by text segmentation to obtain the original text fields “I”, “is”, “eat rice”, and “of”, and some of the original text fields are modified, i.e., “I” is deleted, “is” is deleted, or “of” is deleted, so that the modified text fields can still form a complete sentence, such as “is eat rice”, “I eat rice”, “I eat rice”, and a series of target text information. It should be understood that the deletion of the original text field through the language processing model can include, but is not limited to, the specific embodiments described above.

[0068] According to some embodiments provided in the present application, the original text fields are modified via the language processing model, specifically, after the original text information is text segmented to obtain a plurality of original text fields, some of the original text fields are modified so that the modified text fields can still form complete sentences. In some exemplary embodiments, the modification of some of the original text fields is mainly achieved by replacement, for example, when the original text information is "How are you today?", the original text information is text segmented to obtain the original text fields "you", "today", "have", and "how", then some of the original text fields are modified by replacing "you" with "you", "today" with "today" or "how" with "how", so that the modified text fields can still form complete sentences such as "How are you today?", "How are you today?", "How are you today?", and a series of target text information are generated. It should be understood that the modification of the original text fields via the language processing model can include, but is not limited to, the specific embodiments described above.

[0069] In some exemplary embodiments of the present application, when the language processing model is a Bert pre-training model, there is a Masked Language Model model in the Bert pre-training model to randomly delete or change some tokens from [MASK] to form a variety of result data. It should be understood that if the plurality of original text fields are replaced with [MASK], and based on the Masked Language Model model, the result data after the original text fields are deleted or modified can be obtained, and if the remaining text fields or the modified text fields can still form complete sentences, the target text fields are formed based on the remaining text fields or the modified text fields. In some embodiments provided in the present application, it is necessary to determine in the language processing model whether the remaining text fields or the modified text fields can still form complete sentences, therefore, before the original text fields are deleted or modified via the language processing model, the basic language model needs to be optimized and trained to obtain the language processing model, wherein the optimization and training refers to the optimization of the sentence detection ability of the basic language model.

[0070] Step S104, integrating the original text information and the target text information to form enhanced text information.

[0071] According to some embodiments provided by the present application, the original text information refers to the text information obtained before text augmentation, and the original text information serves as the raw material for text augmentation, aiming to provide a data basis for the specific implementation process of text augmentation. The target text information refers to the text information generated after text augmentation. It should be understood that, since text augmentation is a method for generating more category training samples through technical means in a text processing task (such as a text classification task), and the purpose of text augmentation is to improve the training effect on the target model by increasing the number of different types of training samples. Therefore, according to some embodiments provided by the present application, the integration of the original text information and the target text information refers to the inclusion of the original text information and the target text information in the same data set, thereby forming augmented text information. Therefore, the use of the augmented text information for training the target model can achieve a better training effect. It should be understood that the augmented text information is sample data for training the target model. In some exemplary embodiments of the present application, when the original text information is "Did you have a good day today?", a series of sentences semantically and structurally similar to the original text information can be generated, such as "Did you have a good day today?", "Did you have a good day today?", "Did you have a good day today?", etc. These sentences are determined as target text information, and then the original text information and the target text information can be included in the same data set, thereby completing the integration of the original text information and the target text information, and forming augmented text information. It should be understood that the integration of the original text information and the target text information is not limited to the specific embodiments described above.

[0072] It needs to be clear that the base language model is an artificial intelligence model with general language processing capability, the language processing model refers to an artificial intelligence model obtained by optimizing and training the base language model, and the target model is an artificial intelligence model to be trained as the augmented text information of the sample data. The relationship among the base language model, the language processing model and the target model is clarified as follows: firstly, in order to train the target model, the sample data needs to be expanded based on the original text information by the text augmentation method of the present application to obtain the augmented text information; secondly, the text augmentation method of the present application needs to modify the original text field through the language processing model to obtain the target text field, and then generate the target text information according to the target text field obtained after the modification, and integrate the original text information and the target text information to form the augmented text information, thereby realizing the expansion of the sample data; thirdly, the base language model is an artificial intelligence model with general language processing capability, and the language processing model is an artificial intelligence model obtained by optimizing and training the base language model. Therefore, it can be clear that the language processing model is obtained by optimizing and training the base language model, the target text information is obtained based on the language processing model, and the original text information and the target text information are integrated to form the augmented text information, which aims to expand the sample data to train the target model.

[0073] In the text augmentation method of the present application, the original text information needs to be obtained first, and the original text information is subjected to text segmentation processing to obtain the original text field, and then the original text field is subjected to modification processing through the language processing model to obtain the target text field, and the language processing model is obtained by optimizing and training the base language model. Further, the target text information is generated according to the target text field obtained after the modification, so as to integrate the original text information and the target text information to form the augmented text information. The text augmentation method of the present application subjects the original text field to modification processing through the language processing model to obtain the target text field, and then integrates the original text information and the target text information to form the augmented text information, thereby improving the quality of the sample data in the process of text augmentation.

[0074] Referring to Figure 2 According to some embodiments of the present application, the modification processing of the original text field through the language processing model to obtain the target text field comprises:

[0075] Step S201, determining a modification target field from the original text field based on a preset modification criterion;

[0076] According to some embodiments provided in the present application, the preset deletion and modification criterion refers to a selection criterion followed by determining the deletion and modification target field from the original text field, and the deletion and modification target field refers to the original text field as the deletion and modification target. It should be noted that the preset deletion and modification criterion can include, but is not limited to, randomly selecting the deletion and modification target field from the original text field, selecting the key vocabulary as the deletion and modification target field from the original text field, selecting the non-key vocabulary as the deletion and modification target field from the original text field, and various types of selection criteria. It should be clear that the key vocabulary refers to the original text field that determines the meaning of the sentence in the original text information.

[0077] In step S202, the deletion and modification target field in the original text field is processed via a language processing model.

[0078] In step S203, the original text field after the deletion and modification processing is determined as the target text field.

[0079] The trained artificial intelligence model needs to be clear that the role of the language processing model is to obtain target text information corresponding to the original text information by editing the original text field, and the basic language model is an artificial intelligence model with general language processing capability. The target text information refers to the text information generated after text enhancement. It should be understood that text enhancement is a method of generating more category training samples in a text processing task (such as a text classification task) through technical means, and the purpose of text enhancement is to increase the number of different types of training samples to improve the training effect on the target model. In some embodiments of the present application, after determining the deletion and modification target field from the original text field based on the preset deletion and modification criterion, the language processing model can further perform deletion and modification processing on the deletion and modification target field in the original text field, thereby obtaining the target text information corresponding to the original text information. In some exemplary embodiments, the target text information similar or identical to the meaning of the sentence reflected by the original text information is called positive target text, and the target text information greatly different from the meaning of the sentence reflected by the original text information is called noise target text. It should be understood that if the deletion and modification target field is randomly selected from the original text field, the proportion of positive target text and noise target text in the corresponding generated target text field is also randomly generated. The target text field may be dominated by positive target text, or may be dominated by noise target text, or positive target text and noise target text may be evenly distributed; if the key words are selected as the deletion and modification target field from the original text field, the deletion and modification of the key words is easy to cause the change of the meaning of the sentence, so that the proportion of positive target text in the corresponding generated target text field is usually lower than that of noise target text; if non-key words are selected as the deletion and modification target field from the original text field, and other selection criteria, since the deletion and modification of non-key words is not easy to cause the change of the meaning of the sentence, so that the proportion of positive target text in the corresponding generated target text field is usually higher than that of noise target text.

[0080] Referring to Figure 3 According to some embodiments of the present application, based on the preset deletion and modification criterion, the deletion and modification target field is determined from the original text field, comprising:

[0081] Step S301, when the preset deletion and modification criterion is key word deletion and modification, performing part-of-speech analysis on the original text field;

[0082] According to some embodiments provided in the present application, the preset deletion and modification criterion can include, but is not limited to, randomly selecting a deletion and modification target field from the original text field, selecting a key word from the original text field as the deletion and modification target field, selecting a non-key word from the original text field as the deletion and modification target field, and the like. In some exemplary embodiments, if the preset deletion and modification criterion is specifically selecting a key word from the original text field as the deletion and modification target field, when the preset deletion and modification criterion is the key word deletion and modification, the part-of-speech analysis of the original text field needs to be performed first. It should be noted that Chinese words can be divided into 12 categories, among which nouns, verbs, adjectives, numerals, classifiers and pronouns are real words, and adverbs, prepositions, conjunctions, auxiliary words, onomatopoeic words and exclamatory words are virtual words. The so-called real word refers to a word with actual meaning in Chinese, and the virtual word refers to a word without complete meaning. Therefore, in some embodiments of the present application, the original text field is divided into different types based on the part-of-speech analysis, so as to determine the specific type of the original text field. If a certain original text field belongs to the real word of noun, verb, adjective, numeral, classifier and pronoun, it can be determined that this original text field belongs to the key word. Similarly, if a certain original text field belongs to the virtual word of adverb, preposition, conjunction, auxiliary word, onomatopoeic word and exclamatory word, it can be determined that this original text field belongs to the non-key word. It should be emphasized that in the embodiments provided in the present application, in addition to being able to determine the key word from the perspective of part-of-speech, the key word can also be determined by means of semantic recognition, sentence structure analysis and the like. It should be understood that the determination of the key word by means of semantic recognition, sentence structure analysis and the like usually needs to rely on an artificial intelligence model, which consumes a high cost. However, the determination of the key word by means of part-of-speech analysis only needs to compare a certain specific original text field with the part-of-speech of the corresponding word in the dictionary in most cases, for example, the part-of-speech of the noun, the classifier and the adjective often plays an important role in expressing the meaning of the sentence, and the part-of-speech judgment of the noun, the classifier and the adjective can be completed by comparing the part-of-speech of the corresponding word in the dictionary. Therefore, the determination of the key word from the original text field by means of part-of-speech analysis is the preferred embodiment of the present application. It should be emphasized that there are various ways to determine the key word, which can include, but is not limited to, the specific embodiments mentioned above.

[0083] In step S302, the original text field identified as the key word in the part-of-speech analysis is divided into the deletion and modification target field.

[0084] According to some embodiments provided in the present application, when the preset deletion and modification reference is a key vocabulary, after the original text field is parsed by the part-of-speech, the original text field identified as the key vocabulary in the part-of-speech parsing can be divided into the deletion and modification target field. It should be noted that since the deletion and modification of the key vocabulary can easily lead to changes in the meaning of the sentence, the proportion of the positive target text in the generated target text field corresponding to the key vocabulary as the deletion and modification target field is often lower than that of the noise target text. However, the positive target text formed based on the deletion and modification of the key vocabulary is often higher-quality sample data, in which the sentence with similar semantics and structure to the original text information can be identified as high-quality sample data. For example, when the original text information is “your performance today is very good”, based on the part-of-speech parsing, it can be determined that the original text field of the noun property has “you”, “today”, and “performance”, the original text field of the adjective property has “very good”, and the original text field of the function word property has “of”. At this time, replacing the noun property “you”, “today”, and “performance” or the adjective property “very good” can obtain higher-quality positive target text, such as “you perform very well today”, “you perform very well today”, and “you perform very well today”, which are sentences with similar semantics and structure to the original text information “your performance today is very good”. Therefore, in some example embodiments, dividing the original text field identified as the key vocabulary in the part-of-speech parsing into the deletion and modification target field helps to obtain higher-quality sample data to train the target model.

[0085] Referring to Figure 4 According to some embodiments of the present application, before the original text field is processed by the language processing model, the method further comprises:

[0086] Step S401, obtaining a set of sentences, the set of sentences being text information with complete sentence structure;

[0087] Step S402, obtaining a set of un-sentences, the set of un-sentences being text information with incomplete sentence structure;

[0088] According to some embodiments provided in the present application, before the original text field is processed by the language processing model, the base language model needs to be optimized and trained to obtain the language processing model. It should be noted that the role of the language processing model is to obtain the target text information corresponding to the original text information by processing the original text field, and the base language model is an artificial intelligence model with general language processing capability. According to some embodiments provided in the present application, the deletion processing of the original text field by the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields are deleted from the plurality of original text fields, so that the remaining text fields can still form a complete sentence; and the modification processing of the original text field by the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields in the plurality of original text fields are modified, so that the modified text fields can still form a complete sentence. Therefore, in some exemplary embodiments, the language processing model needs to determine whether the remaining text fields or the modified text fields can still form a complete sentence, and therefore, the base language model is optimized and trained, wherein the optimization and training refers to optimizing the sentence detection capability of the base language model. For the above reasons, before the base language model is formally optimized and trained, a sentence text set and a non-sentence text set need to be obtained first, wherein the sentence text set includes text information with complete sentence structure, the non-sentence text set includes text information with incomplete sentence structure, and the sentence text set and the non-sentence text set are used to optimize the sentence detection capability of the base language model.

[0089] In step S403, the base language model is optimized and trained based on the sentence text set and the non-sentence text set to obtain the language processing model.

[0090] According to some embodiments provided in the present application, after the sentence text set and the non-sentence text set are obtained, the base language model is further optimized and trained. In the optimization and training process, the sentence text set and the non-sentence text set are input into the base language model for iterative training. After each round of iterative training, the sentence recognition accuracy of the base language model is calculated and the base language model is updated, the change of the sentence recognition accuracy after each round of iterative training is counted, and when the sentence recognition accuracy converges to a constant value, the iterative training is stopped and the trained language processing model is obtained. It should be understood that the trained language processing model can accurately determine whether the sentence structure of a piece of to-be-tested information is complete and has good sentence detection capability.

[0091] It should be noted that the basic language model is an artificial intelligence model with general language processing capability. In some preferred embodiments, the basic language model is a pre-trained model, and the pre-trained model specifically refers to an artificial intelligence model trained by a large amount of data and saved to form sample data by pre-training the training data before formal training of the target model. It should be clear that there are many options for selecting the basic language model, which can include, but is not limited to, ELMo pre-trained model, Bert pre-trained model, DeBERTa pre-trained model, and ALBERT pre-trained model. According to some exemplary embodiments of the present application, the basic language model is optimized and trained based on the sentence text set and the non-sentence text set to obtain a language processing model. Specifically, the sentence detection capability of the Bert pre-trained model with general language processing capability is optimized by using the training data set composed of the sentence text set and the non-sentence text set to further optimize the training of the Bert pre-trained model.

[0092] Referring to Figure 5 According to some embodiments of the present application, the basic language model is optimized and trained based on the sentence text set and the non-sentence text set to obtain a language processing model, which includes:

[0093] In step S501, the sentence text set and the non-sentence text set are input into the basic language model for iterative training.

[0094] According to some embodiments provided by the present application, the original text field is deleted by the language processing model, specifically referring to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields are deleted from the plurality of original text fields, so that the remaining text fields can still form a complete sentence. The original text field is modified by the language processing model, specifically referring to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields in the plurality of original text fields are modified, so that the modified text fields can still form a complete sentence. Therefore, in some exemplary embodiments, the language processing model needs to determine whether the remaining text fields or the modified text fields can still form a complete sentence, so the basic language model is optimized and trained, and the optimization and training refers to the optimization of the sentence detection capability of the basic language model. For the above reasons, before the formal optimization and training of the basic language model, the sentence text set and the non-sentence text set need to be obtained first, wherein the sentence text set includes text information with complete sentence structure, and the non-sentence text set includes text information with incomplete sentence structure, and the sentence text set and the non-sentence text set are used to optimize the sentence detection capability of the basic language model.

[0095] According to some example embodiments provided in the present application, the purpose of inputting the sentence set and the non-sentence set into the basic language model for iterative training is to gradually improve the sentence recognition accuracy of the basic language model through several rounds of sentence recognition training. According to some embodiments provided in the present application, the optimization training of the basic language model includes: inputting the training data set composed of the sentence set and the non-sentence set into the basic language model for iterative training, calculating the sentence recognition accuracy of the basic language model and updating the basic language model after each round of iterative training, further, counting the change of the sentence recognition accuracy after each round of iterative training, and stopping the iterative training and obtaining the trained language processing model when the sentence recognition accuracy converges to a constant value. Wherein, the basic language model can be obtained by pre-training from an original preset model without sentence recognition capability, or a preset model with certain sentence recognition capability can be selected. It should be noted that the purpose of iterative training is to continuously optimize the ability of the basic language model to determine whether the remaining text field or the modified text field can still form a complete sentence.

[0096] Step S502, after each round of iterative training, the sentence recognition accuracy of the basic language model is calculated and the basic language model is updated;

[0097] It should be understood that the updating of the basic language model after each round of iterative training is mainly completed by adjusting the parameters of the basic language model, that is, the internal parameters of the basic language model related to the sentence recognition accuracy.

[0098] Step S503, counting the change of the sentence recognition accuracy after each round of iterative training, and stopping the iterative training and obtaining the trained language processing model when the sentence recognition accuracy converges to a constant value.

[0099] It should be noted that when the sentence recognition accuracy converges to a constant value, the iterative training is stopped and the trained language processing model is obtained, wherein the constant value refers to the convergence value of the sentence recognition accuracy of the basic language model after several rounds of adjustment of the internal parameters of the basic language model. In some embodiments provided in the present application, the sentence recognition accuracy of the basic language model will be stable within a certain error interval, for example, the sentence recognition accuracy fluctuates within the interval of 84% to 86%, and then the constant value can be considered as 85%. It should be understood that the constant value is not an exact and unchanging value, but a value that will change with the training conditions. When the sentence recognition accuracy converges to the constant value, it is determined that the optimization training has reached a better effect, and the iterative training can be stopped. Wherein, the basic language model obtained after stopping the iterative training is the language processing model, and the language processing model obtained through optimization training will have more accurate sentence recognition accuracy.

[0100] Reference Figure 6According to some embodiments of the present application, before generating the target text information according to the target text field obtained after the deletion and modification processing, and during the process of generating the target text information according to the target text field obtained after the deletion and modification processing, the method further comprises:

[0101] Step S601: identifying the sentence probability of the original text information via a language processing model to obtain an original sentence probability;

[0102] According to some embodiments provided by the present application, before generating the pending text information according to the target text field obtained after the deletion and modification processing, the original text information needs to be identified for sentence probability via a language processing model to obtain an original sentence probability. It should be noted that the original sentence probability refers to the probability that the original text information can form a complete sentence, while the target sentence probability refers to the probability that the pending text information formed by the target text field can form a complete sentence. It should be understood that the deletion and modification processing of the original text field via the language processing model can obtain the target text field, and based on the pending text information corresponding to part of the target text field, there are some cases where the target sentence probability and the original sentence probability differ greatly. For the case where the target sentence probability and the original sentence probability differ greatly, it can be determined that the pending text information formed in this case is greatly different from the sentence meaning of the original text information, and therefore the pending text information formed in this case cannot form high-quality sample data. It needs to be clear that a sentence with similar semantics and structure to the original text information can be identified as high-quality sample data. Therefore, in some more preferred embodiments of the present application, the original text information needs to be identified for sentence probability via a language processing model to obtain an original sentence probability, so as to compare with the target sentence probability in the subsequent steps.

[0103] Step S602: forming a pending text information according to the target text field obtained after the deletion and modification processing;

[0104] According to some embodiments provided in the present application, the pending text information refers to the text information composed of the target text fields. It should be noted that the deletion and modification of the original text fields via the language processing model includes the deletion of the original text fields via the language processing model and the modification of the original text fields via the language processing model. According to some embodiments provided in the present application, the deletion of the original text fields via the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields are deleted from the plurality of original text fields, so that the remaining text fields can still compose a complete sentence. According to some embodiments provided in the present application, the modification of the original text fields via the language processing model specifically refers to: after the original text information is processed by text segmentation to obtain a plurality of original text fields, some of the original text fields in the plurality of original text fields are modified, so that the modified text fields can still compose a complete sentence. Therefore, in some embodiments mentioned above in the present application, it is necessary to determine whether the remaining text fields or the modified text fields can still compose a complete sentence in the language processing model, so that, before the target text information is determined via the language processing model, the pending text information needs to be formed according to the target text fields obtained after the deletion and modification, to provide a data basis for the sentence probability recognition of the language processing model.

[0105] In step S603, the sentence probability recognition of the pending text information is performed via the language processing model to obtain a target sentence probability;

[0106] It should be emphasized that the target sentence probability refers to the probability that the pending text information composed of the target text fields can compose a complete sentence. It should be understood that the deletion and modification of the original text fields via the language processing model can obtain target text fields, and based on the target text fields, various pending text information can be formed, and various pending text information also corresponds to a plurality of target sentence probabilities. Among the plurality of target sentence probabilities, there are some target sentence probabilities that differ greatly from the original sentence probability. For the case where the target sentence probability differs greatly from the original sentence probability, it can be determined that the pending text information formed in this case differs greatly from the sentence meaning of the original text information, and therefore the pending text information formed in this case cannot form high-quality sample data. It needs to be clear that a sentence with a semantic approximation and a structural approximation to the original text information can be identified as high-quality sample data. According to some exemplary embodiments provided in the present application, the language processing model is an artificial intelligence model obtained by optimizing the training of a basic language model, and the optimization training refers to the optimization of the sentence detection ability of the basic language model. Therefore, the language processing model obtained by the optimization training can sequentially perform sentence probability recognition on the pending text information to obtain the target sentence probability corresponding to the pending text information.

[0107] Step S604, when the difference between the target sentence probability and the original sentence probability is less than a first preset threshold, determining the pending text information as the target text information.

[0108] It should be understood that the target sentence probabilities of various pending text information combined by the target text fields are different, and therefore, in some exemplary embodiments of the present application, the target text information is determined as the pending text information with a target sentence probability that is less different from the original sentence probability. It should be noted that the first preset threshold is a value that is preset to determine whether the target sentence probability is less different from the original sentence probability. In some embodiments of the present application, after the language processing model identifies the sentence probabilities of various pending text information, the target sentence probability is compared with the corresponding original sentence probability. When the difference between the target sentence probability and the original sentence probability is less than the first preset threshold, it can be determined that the pending text information formed in this case is less different from the original text information in terms of semantic meaning, and therefore, the pending text information formed in this case is sufficient to form high-quality sample data. It should be emphasized that the sentence with a semantic meaning similar to the original text information and a structure similar to the original text information can be determined as high-quality sample data. It should be understood that generating the target text information from the target text field after the deletion and modification processing can include, but is not limited to, the specific embodiments described above.

[0109] With reference to Figure 7 According to some embodiments of the present application, the original text information and the target text information are integrated to form enhanced text information, including:

[0110] Step S701, performing semantic recognition on the original text information via a semantic recognition model to obtain original semantic information;

[0111] Step S702, performing semantic recognition on the target text information via the semantic recognition model to obtain target semantic information;

[0112] Step S703, comparing the original semantic information with the target semantic information to obtain a semantic comparison result;

[0113] Step S704, integrating the original text information and the target text information with the same semantic comparison result to form enhanced text information.

[0114] It should be noted that text enhancement is a method of generating more training samples of different categories in a text processing task (such as a text classification task) through technical means, and the purpose of text enhancement is to improve the training effect on the target model by increasing the number of different types of training samples. Therefore, the target text information generated by text enhancement can contain various sentence meanings. In some exemplary embodiments, the target text information that is similar or identical to the sentence meaning reflected by the original text information is referred to as positive target text, and the target text information that is quite different from the sentence meaning reflected by the original text information is referred to as noise target text. It should be emphasized that the target text information can contain both positive target text and noise target text. Positive target text as sample data helps to positively guide the training direction, and noise target text as sample data helps to train robustness or anti-interference. In some embodiments, the proportion of positive target text and noise target text in the target text information can be flexibly adjusted through semantic recognition. Therefore, according to some preferred embodiments of the present application, in the process of integrating the original text information and the target text information to form enhanced text information, the semantic recognition model can be used to match the sentence meanings in the original text information and the target text information. Specifically, the semantic recognition model is used to perform semantic recognition on the original text information and the target text information to obtain original semantic information and target semantic information. The original semantic information is the sentence meaning information in the original text information, and the target semantic information is the sentence meaning information in the target text information. Further, the original semantic information and the target semantic information are compared to obtain a semantic comparison result. The target text information that is similar or identical to the sentence meaning reflected by the original text information is positive target text, and the target text information that is quite different from the sentence meaning reflected by the original text information is noise target text. Further, the original text information and the target text information with consistent semantic comparison results are integrated to form enhanced text information. It should be emphasized that positive target text as sample data helps to positively guide the training direction, and noise target text as sample data helps to train robustness or anti-interference. Therefore, in some exemplary embodiments of the present application, the semantic recognition model is used to divide the positive target text and the noise target text in the target text information, and then the proportion of positive target text in the target text information and the proportion of noise target text in the target text information are flexibly adjusted to adapt to the needs of different application scenarios. It should be understood that there are various ways to integrate the original text information and the target text information to form enhanced text information, which can include, but is not limited to, the specific embodiments described above.

[0115] Figure 8An electronic device 800 provided by an embodiment of the present application is shown. The electronic device 800 includes a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801, and the computer program, when executed, is configured to perform the text enhancement method described above.

[0116] The processor 801 and the memory 802 can be connected by a bus or other means.

[0117] The memory 802, as a non-transitory computer readable storage medium, can be configured to store non-transitory software programs and non-transitory computer executable programs, such as the text enhancement method described in the embodiments of the present application. The processor 801, by executing the non-transitory software programs and instructions stored in the memory 802, implements the text enhancement method described above.

[0118] The memory 802 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function. The data storage area can store the text enhancement method described above. In addition, the memory 802 can include a high-speed random access memory 802, and can also include a non-transitory memory 802, such as at least one storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 802 can optionally include a memory 802 remotely arranged with respect to the processor 801, and these remote memories 802 can be connected to the electronic device 800 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0119] The non-transitory software programs and instructions required to implement the text enhancement method described above are stored in the memory 802, and when executed by one or more processors 801, the text enhancement method described above is performed, for example, the method steps S101 to S104 in Figure 1 , the method steps S201 to S203 in Figure 2 , the method steps S301 to S302 in Figure 3 , the method steps S401 to S403 in Figure 4 , the method steps S501 to S503 in Figure 5 , the method steps S601 to S604 in Figure 6 , and the method steps S701 to S704 in Figure 7 .

[0120] The embodiments of the present application also provide a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are configured to perform the text enhancement method described above.

[0121] In one embodiment, the computer-readable storage medium stores computer-executable instructions that are executed by one or more control processors, for example, executing... Figure 1 Method steps S101 to S104 in the above method Figure 2 Method steps S201 to S203, Figure 3 Method steps S301 to S302, Figure 4 Method steps S401 to S403, Figure 5 Method steps S501 to S503, Figure 6 Method steps S601 to S604 in the above method Figure 7 The method steps S701 to S704.

[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0123] Those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, storage device storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. It should also be understood that the various implementation methods provided in this application can be arbitrarily combined to achieve different technical effects.

[0124] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the above-mentioned embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A text enhancement method characterized by, The method comprises the following steps: obtaining original text information, and performing text segmentation processing on the original text information to obtain an original text field; performing deletion and modification processing on the original text field through a language processing model to obtain a target text field, wherein the language processing model is obtained by optimizing and training a basic language model; forming pending text information according to the target text field obtained after the deletion and modification processing; performing sentence probability recognition on the pending text information through the language processing model to obtain a target sentence probability; when the difference between the target sentence probability and an original sentence probability is less than a first preset threshold, determining the pending text information as target text information; integrating the original text information and the target text information to form enhanced text information; wherein the language processing model is obtained by optimizing and training the basic language model through the following steps: obtaining a complete sentence text set, wherein the complete sentence text set is text information with complete sentence structure; obtaining an incomplete sentence text set, wherein the incomplete sentence text set is text information with incomplete sentence structure; inputting the complete sentence text set and the incomplete sentence text set into the basic language model for iterative training; after each round of the iterative training, calculating the sentence recognition accuracy of the basic language model and updating the basic language model; when the sentence recognition accuracy converges to a constant value, stopping the iterative training and obtaining the trained language processing model.

2. The method of claim 1, wherein, The deletion and modification processing on the original text field through the language processing model to obtain a target text field comprises the following steps: determining a deletion and modification target field from the original text field based on a preset deletion and modification benchmark; performing deletion and modification processing on the deletion and modification target field in the original text field through the language processing model; determining the original text field after the deletion and modification processing as the target text field.

3. The method of claim 2, wherein, When the preset deletion and modification benchmark is a keyword deletion and modification, performing part-of-speech analysis on the original text field; dividing the original text field identified as a keyword in the part-of-speech analysis into the deletion and modification target field. Before generating the target text information according to the target text field obtained after the deletion and modification processing, the method further comprises the following steps:

4. The method according to any one of claims 1 to 3, characterized in that, performing sentence probability recognition on the original text information through the language processing model to obtain an original sentence probability. The integration of the original text information and the target text information to form enhanced text information comprises the following steps:

5. The method of claim 1, wherein, performing semantic recognition on the original text information through a semantic recognition model to obtain original semantic information; performing semantic recognition on the target text information through a semantic recognition model to obtain target semantic information; comparing the original semantic information and the target semantic information to obtain a semantic comparison result; integrating the original text information and the target text information with the same semantic comparison result to form enhanced text information. The method comprises the following steps:

6. An electronic device, comprising: ​ A memory storing a computer program, and a processor, wherein the processor executes the computer program to implement the text enhancement method according to any one of claims 1 to 5.

7. A computer readable storage medium characterized by The storage medium stores a computer program, and the computer program is executed by a processor to implement the text enhancement method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method, data processing device and device for data processing

    CN109979435A

  • Method and device for automatically identifying and enhancing text

    CN113076952A