Text enhancement method and device, equipment, medium and product

By enhancing and evolving the initial dialogue text, high-quality target dialogue text is generated, and the problem of low text enhancement efficiency caused by manual intervention in the prior art is solved, and efficient and automated text enhancement is achieved.

CN119830018APending Publication Date: 2025-04-15ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510022173.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, building high-quality data sets requires a lot of manual intervention, resulting in inefficient text enhancement.

Method used

By obtaining the initial dialogue text, applying preset enhancement rules for processing, generating the first data set, and performing data evolution processing through the evolution rules, generating the second data set, and finally filtering the target dialogue text according to the scoring rules.

Benefits of technology

It improves the text enhancement acquisition efficiency, and the generated target dialogue text has good diversity and complexity, which is suitable for the training needs of the dialogue model, and reduces human participation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830018A_ABST
    Figure CN119830018A_ABST
Patent Text Reader

Abstract

The invention discloses a text enhancement method and device, equipment, a medium and a product. The method comprises the following steps: acquiring a plurality of initial dialogue texts; performing enhancement processing on the plurality of initial dialogue texts through a preset enhancement rule to obtain a first data set, the first data set comprising a plurality of first dialogue texts, and a text quality score corresponding to the first data set being greater than or equal to a first threshold; performing data evolution processing on the plurality of first dialogue texts by adopting a pre-configured evolution rule to obtain a second data set, the second data set comprising a plurality of second dialogue texts; performing text quality evaluation on the plurality of second dialogue texts by adopting a scoring rule corresponding to the evolution rule to obtain a text quality score corresponding to the second data set; and if the text quality score corresponding to the second data set meets a preset condition, taking each second dialogue text in the second data set as a target dialogue text. Through the process, the acquisition efficiency of the enhanced text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and in particular, relates to a text enhancement method, device, equipment, medium and product. Background Art

[0002] In the field of Natural Language Processing (NLP), model training is highly dependent on large-scale, high-quality datasets. Currently, these datasets need to be constructed manually, for example, by obtaining dialogue text from human-computer dialogues, or obtaining dialogue text from query software, and then performing keyword replacement, sentence transformation, etc. based on the dialogue text. The entire process requires a lot of manpower and the efficiency of obtaining enhanced text is low. Summary of the invention

[0003] The embodiments of the present application provide a text enhancement method, apparatus, device, medium and product, which can improve the efficiency of obtaining enhanced text.

[0004] In a first aspect, an embodiment of the present application provides a text enhancement method, the method comprising:

[0005] Get multiple initial conversation texts;

[0006] Performing enhancement processing on the plurality of the initial dialogue texts according to a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold;

[0007] Performing data evolution processing on the plurality of first dialogue texts using a preconfigured evolution rule to obtain a second data set, wherein the second data set includes a plurality of second dialogue texts

[0008] Performing text quality assessment on a plurality of the second dialogue texts using a scoring rule corresponding to the evolution rule to obtain a text quality score corresponding to the second data set;

[0009] If the text quality score corresponding to the second data set meets a preset condition, each second dialogue text in the second data set is used as a target dialogue text, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

[0010] In a second aspect, an embodiment of the present application provides a text enhancement device, the device comprising:

[0011] A first acquisition module, used to acquire multiple initial dialogue texts;

[0012] A first enhancement module, configured to enhance the plurality of initial dialogue texts using a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold;

[0013] A second enhancement module, configured to perform data evolution processing on the plurality of first dialogue texts using a preconfigured evolution rule to obtain a second data set, wherein the second data set includes the plurality of second dialogue texts;

[0014] An evaluation module, configured to perform text quality evaluation on a plurality of the second dialogue texts using a scoring rule corresponding to the evolution rule, to obtain a text quality score corresponding to the second data set;

[0015] A determination module is used to use each second dialogue text in the second data set as a target dialogue text if the text quality score corresponding to the second data set meets a preset condition, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the text enhancement method as described in the first aspect is implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the text enhancement method as described in the first aspect is implemented.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the text enhancement method as described in the first aspect.

[0019] In this embodiment, two stages of enhancement processing are performed on multiple initial dialogue texts. On the one hand, the obtained target dialogue texts have better diversity and complexity (for example, more logical constraints, greater logical depth, and higher domain complexity), so that the quality of the target dialogue texts is better and more in line with the training text requirements of the dialogue model, which is conducive to the training of the dialogue model. On the other hand, the entire data enhancement process reduces human participation and improves the efficiency of obtaining the target dialogue text. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 It is a flowchart of a text enhancement method provided in an embodiment of the present application;

[0022] Figure 2a It is another flowchart of the text enhancement method provided in the embodiment of the present application;

[0023] Figure 2b It is a flowchart of the text enhancement method provided in the embodiment of the present application during the first stage of enhancement processing;

[0024] Figure 3 is a structural schematic diagram of a text enhancement device provided in an embodiment of the present application;

[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0028] In each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the disclosed embodiment will be obtained.

[0029] In order to solve the problems in the prior art, the embodiments of the present application provide a text enhancement method, device, equipment, medium and product. The text enhancement method provided by the embodiments of the present application is first introduced below.

[0030] Figure 1 FIG. 1 is a flow chart of a text enhancement method provided by an embodiment of the present application. Figure 1 As shown, the text enhancement method provided in the embodiment of the present application is applied to an electronic device and includes the following steps 101 to 105, wherein:

[0031] Step 101, obtaining multiple initial conversation texts.

[0032] The initial dialogue text may be collected from a human-computer dialogue (e.g., collecting text input by a user in a human-computer dialogue) or from a user's online search behavior (e.g., collecting search text input by a user), etc., without limitation. For example, the initial dialogue text may refer to a question that a user needs to consult, such as "How to optimize product design?", "How to optimize user registration process?", "What is the weather like today?", etc.

[0033] Step 102, performing enhancement processing on the plurality of the initial dialogue texts according to a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold.

[0034] The enhancement process is to transform the initial dialogue text and generate a new dialogue text. The enhancement rules can be preset. For example, the enhancement rules include at least two of dictionary replacement, word vector replacement, random noise injection and instance crossover. By performing enhancement process on multiple initial dialogue texts according to the enhancement rules, the diversity of multiple first dialogue texts can be improved. The first threshold can be set according to actual conditions and is not limited here.

[0035] The text quality score corresponding to the first data set may include at least one of the following:

[0036] (1) Semantic consistency score: a pre-trained language model (such as BERT or Sentence-BERT) can be used to calculate the semantic similarity between the initial dialogue text and the enhanced first dialogue text, and the semantic consistency score can be calculated based on the semantic similarity;

[0037] (2) language fluency score: using a language model (such as GPT) to perform probability calculation on the enhanced first dialogue text to evaluate its language fluency, thereby calculating a language fluency score;

[0038] (3) a lexical diversity score, which evaluates the lexical diversity of the first dialogue text obtained by enhancement, and obtains a diversity score using an entropy value or a lexical diversity metric;

[0039] (4) Expert experience scoring: set a quality review task, manually check a small amount of text, and obtain expert experience scores through a scoring mechanism.

[0040] The specific calculation methods of the above-mentioned semantic consistency score, language fluency score, vocabulary diversity score, and expert experience score can be found in the relevant records of formulas (11) to (14) below.

[0041] Step 103, performing data evolution processing on the plurality of first dialogue texts using preconfigured evolution rules to obtain a second data set, wherein the second data set includes the plurality of second dialogue texts.

[0042] The evolution rule can be understood as a rule for performing text transformation on the first dialogue text to obtain the second dialogue text. Exemplarily, the evolution rule includes at least one of a deep evolution rule and a wide evolution rule.

[0043] The deep evolution rule is used to transform a simple problem (i.e., the first dialogue text) into a complex problem with higher complexity (i.e., the second dialogue text) by adding logical constraints, deepening the problem level, and concretizing the semantics. The deep evolution rule includes evolving the first dialogue text in at least one of the number of logical constraints, logical depth, and domain complexity to obtain the second dialogue text. The definitions of the number of logical constraints, logical depth, and domain complexity can be found in the following description and will not be elaborated here.

[0044] The breadth evolution rule is used to expand the coverage of the initial question (i.e., the first dialogue text) to generate diversified questions (i.e., the second dialogue text) covering multiple fields, multiple roles, and multiple structures. The breadth evolution rule includes evolving the first dialogue text in at least one of the number of fields, the number of role perspectives, and the number of sentence patterns to obtain the second dialogue text. The definitions of the number of fields, the number of role perspectives, and the number of sentence patterns can be found in the following description and will not be elaborated here.

[0045] Step 104: Perform text quality assessment on the plurality of second dialogue texts using a scoring rule corresponding to the evolution rule to obtain a text quality score corresponding to the second data set.

[0046] Specifically, if the evolution rule includes a deep evolution rule, the scoring rule corresponding to the deep evolution rule is: scoring the complexity of multiple second dialogue texts to obtain a complexity score corresponding to the second data set. In this case, the text quality score corresponding to the second data set includes a complexity score.

[0047] If the evolution rule includes a breadth evolution rule, the scoring rule corresponding to the breadth evolution rule is: scoring the diversity of multiple second dialogue texts to obtain a diversity score corresponding to the second data set. In this case, the text quality score corresponding to the second data set includes a diversity score.

[0048] Step 105: If the text quality score corresponding to the second data set meets a preset condition, each second dialogue text in the second data set is used as a target dialogue text, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

[0049] Exemplarily, if the text quality score corresponding to the second data set includes a complexity score, the preset condition includes: the complexity score corresponding to the second data set is greater than the second threshold corresponding to the deep evolution rule, wherein the complexity score is determined based on at least one of the number of logical constraints, logical depth, and domain complexity of all second dialogue texts in the second data set. The calculation method of the complexity score can be referred to the introduction of formula (3) below, which will not be elaborated here.

[0050] Alternatively, if the text quality score corresponding to the second data set includes a diversity score, the preset condition includes: the diversity score corresponding to the second data set is greater than a third threshold corresponding to the breadth evolution rule, wherein the diversity score is determined according to at least one of the number of fields, the number of character perspectives, and the number of sentences of all second dialogue texts in the second data set. The calculation method of the diversity score can be referred to in the following formula (4), which will not be described in detail here.

[0051] In the above, the second threshold and the third threshold can be set according to actual conditions and are not limited here.

[0052] The target dialogue text can be used to train dialogue models used in intelligent devices such as robots and vehicle-mounted devices. The better the quality of the target dialogue text, the better the intent recognition effect of the trained dialogue model.

[0053] In this embodiment, a plurality of initial dialogue texts are enhanced in two stages. For example, in the first stage, a plurality of initial dialogue texts can be enhanced by using traditional enhancement methods, such as dictionary replacement, word vector replacement, random noise injection, and instance crossover, etc., to obtain a plurality of first dialogue texts; in the second stage, an evolution rule is used to perform data evolution processing on the plurality of first dialogue texts to obtain a second data set. On the one hand, the entire data enhancement process reduces human participation, which can improve the efficiency of obtaining the target dialogue text; on the other hand, the target dialogue text obtained by the data enhancement processing in the above two stages has better diversity (for example, more covered fields, more role perspectives, and more sentence patterns) and complexity (for example, more logical constraints, greater logical depth, and higher field complexity), so that the quality of the target dialogue text is better, more in line with the training text requirements of the dialogue model, and is conducive to the training of the subsequent dialogue model.

[0054] In an embodiment of the present application, the enhancement rule includes M sub-rules, where M is an integer greater than 1; the enhancement process is performed on the plurality of initial dialogue texts by using the preset enhancement rule to obtain a first data set, including:

[0055] Get the weight corresponding to each sub-rule in this round of iteration;

[0056] According to the weight corresponding to each of the sub-rules, the iterative text corresponding to each of the sub-rules is obtained from the text set to be enhanced, wherein in a first round of iteration, the text set to be enhanced includes a plurality of the initial dialogue texts;

[0057] Using each of the sub-rules to perform data enhancement processing on the iterative text corresponding to the sub-rule, to obtain enhanced text corresponding to the sub-rule;

[0058] Adding the enhanced text corresponding to each of the sub-rules to the temporary text set;

[0059] If the text quality score corresponding to the temporary text set is less than the first threshold, the temporary text set is used as the text set to be enhanced, and the process jumps to the step of obtaining the weight corresponding to each sub-rule in this iteration;

[0060] If the text quality score corresponding to the temporary text set is greater than or equal to the first threshold, the temporary text set is used as the first data set.

[0061] Specifically, during the first stage of enhancement processing, multiple iterations are required until the text quality score corresponding to the enhanced temporary text set is greater than or equal to the first threshold. In each round of iteration, the weight corresponding to each sub-rule and the text set to be enhanced need to be determined. In the first round of iteration, the text set to be enhanced includes multiple initial dialogue texts. In the second and subsequent rounds of iterations, the text set to be enhanced is replaced by the temporary text set obtained in the previous round of iteration.

[0062] Exemplarily, the obtaining of the weight corresponding to each sub-rule in the current iteration includes the following two cases:

[0063] Case 1: If the current iteration is the first or second iteration, the weight corresponding to each sub-rule in the current iteration is set using the preset configuration value. For example, the weight corresponding to each sub-rule in the preset configuration value is the same. In addition, the weight corresponding to each sub-rule in the preset configuration value may also be different, which is not limited here;

[0064] Case 2: If the current iteration is the t-th iteration, the weight of each sub-rule used in the current iteration (i.e., the t-th iteration) is calculated based on the text quality score corresponding to the temporary text set in the t-1-th iteration, the text quality score corresponding to the temporary text set in the t-2-th iteration, and the weight corresponding to each sub-rule, where t is an integer greater than or equal to 3. Genetic algorithms, particle swarm optimization, etc. can be used for weight adjustment.

[0065] Specifically, the weight of the tth iteration is calculated according to the following formula (1):

[0066]

[0067] in, is the weight of the ith sub-rule in the tth iteration, is the weight of the ith sub-rule in the t-1th round, α i is the learning rate corresponding to the ith sub-rule, Score the text quality corresponding to the temporary text set in the t-1th iteration, Score the text quality of the temporary text set in the t-2th iteration. It should be noted that the sum of the weights corresponding to each sub-rule is 1. total It can be calculated according to formula (2):

[0068]

[0069] Where Q refers to the number of scoring methods, which may include at least one of semantic consistency scoring, language fluency scoring, lexical diversity scoring, and expert experience scoring.q is the weight corresponding to the qth scoring method, S q is the score obtained when the temporary text set is processed by the qth scoring method. The scoring method corresponding to each scoring method can be calculated by referring to the following formulas (11) to (14).

[0070] In an embodiment of the present application, according to the weight corresponding to each sub-rule, obtaining the iterative text corresponding to each sub-rule from the to-be-enhanced text set includes:

[0071] Dividing the text in the to-be-enhanced text set according to the weight corresponding to each of the sub-rules, to obtain iterative text corresponding to each of the sub-rules;

[0072] or,

[0073] The weights corresponding to each of the sub-rules are sorted, and the first sub-rule corresponding to the weight ranked first is selected; the second sub-rule used in conjunction with the first sub-rule is obtained from a plurality of pre-set matching rules; the text in the to-be-enhanced text set is divided according to the weights corresponding to the first sub-rule and the second sub-rule, and the iterative texts corresponding to the first sub-rule and the second sub-rule are obtained, and the number of iterative texts corresponding to the sub-rules in the enhanced rule except the first sub-rule and the second sub-rule is a preset value, wherein each of the matching rules includes N sub-rules in the enhanced rule, and N is an integer greater than 1 and less than M;

[0074] or,

[0075] The texts in the to-be-enhanced text set are divided according to the weights corresponding to each third sub-rule to obtain iterative texts corresponding to each third sub-rule, wherein the third sub-rule is a sub-rule in the enhanced rule except the sub-rule used in the previous iteration.

[0076] Specifically, the present embodiment provides the above three methods to obtain the iterative text corresponding to each of the sub-rules. Dictionary replacement generates diverse texts, instance crossover generates complex and diverse texts, word vector replacement generates semantically stable texts, and noise injection provides additional disturbances. In the above, multiple matching rules can be pre-set. For example, the matching rules include dictionary replacement and instance crossover, and diverse sentences are generated by dictionary replacement, and more complex structures are generated by instance crossover to ensure semantic consistency and diversity; or, the matching rules include word vector replacement and dictionary replacement, or, the matching rules include random noise injection and instance crossover; or, the matching rules include word vector replacement and random noise injection.

[0077] Exemplarily, the enhancement rules include dictionary replacement, word vector replacement, random noise injection and instance crossover. If the weight of dictionary replacement ranks first, the dictionary replacement is the first sub-rule and the instance crossover is the second sub-rule. The corresponding iterative text is obtained from the text set to be enhanced according to the weights corresponding to the dictionary replacement and the instance crossover. The number of iterative texts corresponding to the word vector replacement and the random noise injection is 0 (that is, the preset value is 0). In this case, only dictionary replacement and instance crossover are used for data enhancement processing. The second sub-rule can include one sub-rule or multiple sub-rules. When the second sub-rule can include one sub-rule, M is greater than or equal to 3.

[0078] In this round of iteration, the sub-rule (i.e., the third sub-rule) not used in the previous round of iteration is used for enhancement processing. For example, if the previous round of iteration is sorted from large to small according to the weight, it is determined to use the dictionary replacement and instance crossover that are sorted first, then in this round of iteration, word vector replacement and random noise injection are used for data enhancement processing. By alternating different sub-rules for data enhancement in each round of iteration, the local optimal solution can be effectively avoided. Exemplarily, if the text quality score Stotal of the temporary text set after the previous round of iteration is 0.6, and the first threshold value 0.8 is not reached, the weight is adjusted by the gradient descent algorithm to obtain a new weight, wherein the weight of the dictionary replacement w1=0.3, the weight of the word vector replacement w2=0.4, the weight of the random noise injection w3=0.15, and the weight of the instance crossover w4=0.15. In this round of iteration, word vector replacement and dictionary replacement will be preferred, and in the next round of iteration, random noise injection and instance crossover will be used to increase data diversity. For sub-rules with larger weights, more dialogue samples are processed in the next iteration; for sub-rules with lower weights, fewer dialogue samples are processed in the next iteration, or even temporarily not used.

[0079] The text enhancement processing of the second stage is introduced below. In another embodiment of the present application, after the text quality of the plurality of second dialogue texts is evaluated using the scoring rule corresponding to the evolution rule to obtain the text quality score corresponding to the second data set, the method further includes:

[0080] If the text quality score corresponding to the second data set does not meet the preset condition, enhancing the evolution degree of the evolution rule to obtain a first evolution rule;

[0081] The first evolution rule is used as a preconfigured evolution rule, and the multiple second dialogue texts are used as multiple first dialogue texts, and the step of jumping to the step of performing data evolution processing on the multiple first dialogue texts using the preconfigured evolution rule to obtain a second data set is executed.

[0082] Specifically, the text quality score corresponding to the second data set does not meet the preset conditions including: the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, and / or the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule.

[0083] If the text quality score corresponding to the second data set does not meet the preset condition, the evolution degree of the evolution rule is enhanced and the next iteration is entered until the text quality score corresponding to the second data set obtained in the last iteration meets the preset condition. Different second data sets are generated by continuously adjusting the evolution degree of the evolution rule until the text quality score corresponding to the generated second data set meets the preset condition. In this way, a second data set with higher quality can be obtained.

[0084] In another embodiment of the present application, if the text quality score corresponding to the second data set does not meet the preset condition, the evolution degree of the evolution rule is enhanced to obtain a first evolution rule, including:

[0085] If the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, enhancing the evolution degree of the deep evolution rule to obtain a first evolution rule;

[0086] Alternatively, if the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, the evolution degree of the breadth evolution rule is enhanced to obtain the first evolution rule.

[0087] It should be noted that if the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, and the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, then the evolution degree of both the deep evolution rule and the breadth evolution rule can be enhanced to obtain the first evolution rule.

[0088] The complexity score S corresponding to the second data set co According to the following formula (3), it is calculated:

[0089]

[0090] Among them, N constra : The number of logical constraints, including the number of logical conditions and restrictions involved in all second dialogue texts in the second data set; the acquisition method is exemplified as follows:

[0091] Use regular expressions to detect keywords and phrases related to logic such as "conditions", "constraints", and "restrictions" in the data, for example:

[0092] "If", "in the case of", "limited by", "require"; count the number of occurrences of these phrases as the number of logical constraints.

[0093] L depth : logical depth, including the nesting depth or hierarchical depth of all second conversation texts in the second data set;

[0094] The logical depth indicates the hierarchical depth of nested logical conditions. The acquisition methods include: 1. Parsing the sentence (using dependency syntax analysis or syntax tree); 2. Calculating the logical nesting depth and detecting the level of "nested conditions in conditions". 3. Counting the depth of the sentence's logical tree. The more layers there are, the higher the logical depth.

[0095] C domain : Domain complexity, including the number and coverage of domain-specific terms and professional vocabulary contained in all second dialogue texts in the second dataset; the acquisition method is as follows:

[0096] 1. Build a domain terminology dictionary, including specific terms (also called proper nouns) in the fields of finance, education, healthcare, technology, etc.

[0097] 2. Detect specific terms in all second dialogue texts.

[0098] 3. Count the number of proper nouns detected,

[0099] N max , L max , C max They are the maximum possible values ​​of the number of logical constraints, logical depth, and domain complexity, respectively. These values ​​can be set in advance;

[0100] a1, a2, and a3 are weighting coefficients that control the contribution of each part to the complexity score.

[0101] The diversity score S corresponding to the second dataset di According to the following formula (4), it is calculated:

[0102]

[0103] D coverage : The number of fields, including the number of fields involved in all the second dialogue texts in the second data set; it can be obtained by the following steps:

[0104] 1. Extract all the domain keywords involved in the second dialogue text, such as "education", "banking", "insurance", "manufacturing", etc.

[0105] 2. Detect the field to which each second dialogue text belongs.

[0106] 3. Count the number of areas covered by all second dialogue texts.

[0107] R per : The number of character perspectives, including the number of character perspectives involved in all the second dialogue texts in the second data set;

[0108] The number of role perspectives indicates the number of dialogue texts generated from the perspectives of different user roles. The number of role perspectives can be obtained by:

[0109] 1. Define identifiable role keywords, such as "user", "customer", "administrator", "developer", "operation and maintenance personnel", etc.

[0110] 2. Use keyword matching method to detect these role words in all second dialogue texts;

[0111] 3. Count the number of character perspectives involved in all second dialogue texts.

[0112] S stru : Structural diversity, also known as sentence quantity, measures the number of transformed grammatical structures and can be quantified using the lexical entropy or transformation form of the language. In this embodiment, S stru It may include the number of sentence patterns involved in all second dialogue texts in the second data set;

[0113] Structural diversity refers to the variation in sentence structure of the data, which can be measured by lexical entropy. The acquisition methods include:

[0114] 1. Model the sentence structure of all second dialogue texts and analyze the structure of the dependency syntax tree.

[0115] 2. Calculate the distribution entropy of the words in each second dialogue text. The higher the entropy value, the more diverse the structure.

[0116] D max , R max , S max They are the maximum possible values ​​for the number of domains, the number of role perspectives, and the number of sentences, respectively. These values ​​can be set in advance;

[0117] a4, a5, and a6 are weighting coefficients that control the contribution of each part to the diversity score.

[0118] In the above, the need to perform deep evolution enhancement and / or breadth evolution enhancement on the second data set can be determined based on the text quality score of the second data set to improve the quality of the target dialogue text, so that the target dialogue text better meets the sample requirements of the model training, thereby improving the effect of model training.

[0119] The following introduces how to enhance the evolution degree of deep evolution rules.

[0120] In an embodiment of the present application, if the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, the evolution degree of the deep evolution rule is enhanced to obtain the first evolution rule, including:

[0121] If the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, a first adjustment factor is calculated according to the complexity score corresponding to the second data set and the second threshold, wherein the first adjustment factor includes at least one of a logic constraint quantity adjustment factor, a logic depth adjustment factor, and a domain complexity adjustment factor;

[0122] The first adjustment factor is used to enhance the evolution degree of the deep evolution rule to obtain a first evolution rule.

[0123] Specifically, the first adjustment factor can be calculated using the following formula:

[0124]

[0125] Among them, T co is the second threshold, S co is the complexity score corresponding to the second data set;

[0126] ΔN is the logical constraint quantity adjustment factor, η N is the learning rate for the number of logical constraints;

[0127] ΔL is the logic depth adjustment factor, η L is the learning rate of logic depth. By increasing ΔL, it can guide the generation of multi-level logic dialogue text;

[0128] ΔC is the domain complexity adjustment factor, η C is the learning rate of domain complexity. For example, by increasing domain complexity, we can introduce background and conditions in a specific domain and improve the professionalism of the conversation text.

[0129] When the first adjustment factor is used to enhance the evolution degree of the deep evolution rule, if the first adjustment factor includes a logical constraint quantity adjustment factor, the logical constraint quantity of the deep evolution rule is added to the logical constraint quantity adjustment factor to obtain the logical constraint quantity of the first evolution rule; if the first adjustment factor includes a logical depth adjustment factor, the logical depth of the deep evolution rule is added to the logical depth adjustment factor to obtain the logical depth of the first evolution rule; if the first adjustment factor includes a domain complexity adjustment factor, the domain complexity of the deep evolution rule is added to the domain complexity adjustment factor to obtain the domain complexity of the first evolution rule.

[0130] By continuously iterating and enhancing the degree of evolution of deep evolution rules, for example, increasing the number of logical constraints and improving the recursive level, thereby guiding the generation of multi-level logical dialogue texts, introducing background and conditions in specific fields, and improving the professionalism of dialogue texts, the quality of the evolved dialogue texts can be gradually improved.

[0131] The following introduces how to enhance the evolution degree of breadth evolution rules.

[0132] In another embodiment of the present application, if the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, the evolution degree of the breadth evolution rule is enhanced to obtain the first evolution rule, including:

[0133] If the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, a second adjustment factor is calculated according to the diversity score corresponding to the second data set and the third threshold, wherein the second adjustment factor includes at least one of a field quantity adjustment factor, a role perspective quantity adjustment factor, and a sentence quantity adjustment factor;

[0134] The second adjustment factor is used to enhance the evolution degree of the breadth evolution rule to obtain a first evolution rule.

[0135] Specifically, the second adjustment factor can be calculated using the following formula:

[0136]

[0137] Among them, T di is the third threshold, S di is the diversity score corresponding to the second data set;

[0138] ΔD is the field quantity adjustment factor, η D is the learning rate of the number of domains. The number of domains involved in the problem is expanded by ΔD;

[0139] ΔR is the character's perspective adjustment factor, η R is the learning rate of the number of role perspectives. We adjust ΔR to increase the number of dialogue texts generated from different role perspectives, such as re-phrasing dialogue texts from the perspective of users, developers, or managers;

[0140] ΔS is the sentence quantity adjustment factor, η S is the learning rate of the number of sentences. By adjusting the number of sentences, we can increase the grammar or expression form of the dialogue text and improve the sentence diversity.

[0141] When the second adjustment factor is used to enhance the evolution degree of the breadth evolution rule, if the second adjustment factor includes a field quantity adjustment factor, the field quantity adjustment factor is added to the field quantity adjustment factor of the breadth evolution rule to obtain the field quantity of the first evolution rule; if the second adjustment factor includes a role perspective quantity adjustment factor, the role perspective quantity factor is added to the role perspective quantity of the breadth evolution rule to obtain the role perspective quantity of the first evolution rule; if the second adjustment factor includes a sentence quantity adjustment factor, the sentence quantity adjustment factor is added to the sentence quantity of the breadth evolution rule to obtain the sentence quantity of the first evolution rule.

[0142] By continuously iterating and enhancing the degree of evolution of the breadth evolution rules, for example, increasing the number of fields, the number of role perspectives, the number of sentence patterns, etc., the quality of the evolved dialogue text can be gradually improved.

[0143] The following is an example of the text enhancement method provided in the embodiment of the present application.

[0144] Figure 2a FIG. 1 is a flow chart of a text enhancement method provided in an embodiment of the present application. Figure 2a As shown, the text enhancement method provided in the embodiment of the present application includes the following steps:

[0145] Step 201, obtaining an initial data set, the initial data set including a plurality of initial conversation texts;

[0146] Step 202, using a plurality of sub-rules to perform data enhancement on the initial dialogue text in the initial data set to obtain a first data set, where the first data set includes a plurality of first dialogue texts;

[0147] Step 203, performing a quality assessment on the first dialogue text in the first data set to obtain a text quality score of the first data set;

[0148] Step 204, determining whether the text quality score of the first data set is greater than or equal to a first threshold, if so, proceeding to step 205, if not, proceeding to step 205';

[0149] Step 205', adjust the weight of each sub-rule, and use the first data set as the initial data set, and go to step 202 for execution;

[0150] Step 205, evolving the first dialogue text in the first data set according to the evolution rule to obtain a second data set, wherein the second data set includes a plurality of second dialogue texts;

[0151] Step 206, performing text quality assessment on the plurality of second dialogue texts to obtain text quality scores corresponding to the second data set, where the text quality scores include complexity scores and diversity scores;

[0152] Step 207, determining whether the text quality score corresponding to the second data set meets the preset conditions, if yes, proceed to step 208, if no, proceed to step 208'. The preset conditions include: the complexity score corresponding to the second data set is greater than the second threshold, and the diversity score corresponding to the second data set is greater than the third threshold;

[0153] Step 208', increasing the evolution degree of the evolution rule, and taking the second data set as the first data set, and going to step 205 for execution;

[0154] Step 208: Use the multiple dialogue texts in the second data set as target dialogue texts.

[0155] Figure 2b FIG. 1 is a flow chart of text enhancement in the first stage of the text enhancement method provided in the embodiment of the present application. Figure 2b As shown, W1, W2, W3 and W4 are the weights of the four sub-rules, namely vocabulary replacement, word vector replacement, random noise injection and instance crossover. According to each sub-rule, the constructed data D1, constructed data D2, constructed data D3 and constructed data D4 constructed by each sub-rule are obtained. The data quality verification and review module is used to determine the text quality score of the constructed data from four aspects: semantic consistency score, language fluency score, vocabulary diversity score and expert experience score.

[0156] The data quality verification and review module includes:

[0157] (1) Calculate the semantic consistency score S semantic :

[0158] Use a pre-trained language model (such as BERT or Sentence-BERT) to calculate the semantic similarity between the original text (i.e., the conversation text in the text set to be enhanced. In the first round of iteration, the text set to be enhanced includes the initial conversation text) and the enhanced text (i.e., the conversation text obtained after the sub-rule enhancement process). Then, the semantic consistency score is calculated according to formula (11):

[0159]

[0160] Among them, E(x i ) and E(y i ) represent the original text x i Embedding vector of the enhanced text y i The embedding vector of cosine_similarity(E(x i ), E(y i )) represents the original text x i The embedding vector and augmented text y iThe cosine similarity between the embedding vectors of , where N is the number of texts in the text set to be enhanced;

[0161] (2) Calculate the language fluency score S fluency .

[0162] A language model (such as GPT) can be used to perform probability calculation on the enhanced text to evaluate its language fluency, and the language fluency score can be calculated using formula (12).

[0163]

[0164] Among them, L i is the length of the i-th enhanced text, y ij is the jth word of the i-th enhanced text, P(y ij ) is the probability of the jth word of the i-th augmented text generated by the language model.

[0165] (3) Calculate the vocabulary diversity score S diversity The vocabulary diversity score is calculated according to formula (13):

[0166]

[0167] Where V is the number of words in the predefined vocabulary, P k is the frequency of the kth word in the vocabulary in the augmented text.

[0168] (4) Receive manual review results and calculate expert experience score S expert The expert experience score is calculated according to formula (14):

[0169]

[0170] Where M is the number of enhanced texts reviewed by humans, S i is the score obtained by manual review of the i-th enhanced text.

[0171] (5) According to formula (15), the text quality score S of the enhanced text is calculated total :

[0172] S total =w s S semantic +w f S fluency +w d S diversity +w e S expert (15)

[0173] Among them, w s , w f , wd , w e are the weights of each scoring method.

[0174] For example, for the enhanced text obtained by dictionary replacement, the semantic consistency score can be calculated by the above formula (11), and the semantic consistency score is used as the text quality score of the enhanced text; for the enhanced text obtained by word vector replacement, the language fluency score can be calculated by the above formula (12), and the language fluency score is used as the text quality score of the enhanced text; for the enhanced text obtained by random noise injection, the lexical diversity score can be calculated by the above formula (13), and the lexical diversity score is used as the text quality score of the enhanced text; for the enhanced text obtained by instance crossover, the text quality score of the enhanced text can be calculated by the above formulas (11) and (12).

[0175] The goal of the deep evolution algorithm (i.e., deep evolution rules) is to transform simple problems into complex problems with higher complexity by increasing the number of logical constraints, deepening the logical depth, and increasing the complexity of the domain. Exemplarily, the deep evolution algorithm includes the following process:

[0176] 1. Input data:

[0177] The initial problem set D(0) = {x1, x2,…, xn}.

[0178] 2. Add constraints:

[0179] Add additional conditions or restrictions to each initial question (i.e., the first dialogue text) so that the evolved questions have more dimensional restrictive requirements.

[0180] Implementation method: Extract relevant constraints from the domain knowledge base.

[0181] Randomly add constraints such as time, resources, scenarios, etc. based on the type of initial problem.

[0182] For example, the initial question: “How to improve user experience?”

[0183] After adding constraints: “How to improve user experience within a limited budget?”

[0184] 3. Deepen the logical depth:

[0185] Break the problem down into deeper levels by introducing recursive logic or step-by-step solutions.

[0186] Implementation:

[0187] Use logical reasoning modules to generate multi-level sub-questions.

[0188] Embed derived or related secondary questions within the initial question.

[0189] For example, the initial question: "How to optimize the user registration process?"

[0190] After deepening the logic: "How to optimize the user registration process to reduce the number of input steps while improving data security?"

[0191] 4. Specify the semantics of the problem, that is, increase the complexity of the domain:

[0192] Translate the problem from an abstract form into a more concrete context.

[0193] Implementation:

[0194] Map common problems to specific scenarios.

[0195] Use domain knowledge base to replace generalized words in the problem with specific entities.

[0196] For example: Initial question: "How to optimize product design?".

[0197] After being concretized: "How to optimize the user interface design of smart home products?".

[0198] The goal of the breadth evolution algorithm (i.e., breadth evolution rule) is to expand the coverage of the initial problem and generate diversified problems covering multiple fields, multiple roles, and multiple structures. Exemplarily, the breadth evolution algorithm includes the following process:

[0199] 1. Input data:

[0200] The initial problem set D(0) = {x1, x2,…, xn}.

[0201] 2. Number of expansion areas:

[0202] Map the initial problem to different domains and generate variant problems that are suitable for various scenarios.

[0203] Implementation:

[0204] Extract relevant domains from domain knowledge base.

[0205] Replace domain keywords based on the content of the initial question.

[0206] For example: Initial question: "How to optimize user experience?".

[0207] After the field is expanded: "How to optimize the user experience in the education field?", "How to optimize the customer experience in the banking industry?".

[0208] 3. Switch the character perspective, that is, increase the number of character perspectives:

[0209] Restate the problem from the perspective of different roles and expand the usage scenarios of the problem.

[0210] Implementation:

[0211] Generate multi-role perspective questions using role classifiers or rule templates.

[0212] For example: Initial question: "How to design an efficient registration process?".

[0213] After the role switch: "How can users simplify the registration process?", "How can developers design an efficient registration process?".

[0214] 4. Diversify the structure, that is, increase the number of sentences.

[0215] Change the grammatical structure or expression form of the initial question to generate diverse question statements.

[0216] Implementation: Use the syntactic transformation algorithm to adjust the sentence structure of the initial question.

[0217] Replace some keywords from the synonym dictionary.

[0218] Example: Initial question: "How can I optimize the loading speed of my website?"

[0219] After the structure is diversified: "What are the ways to optimize the website loading speed?", "What are the ways to optimize the website loading speed?".

[0220] The text enhancement method provided in the embodiment of the present application has the following beneficial effects:

[0221] High degree of automation: high-quality conversation text is automatically generated without much human intervention.

[0222] High data quality: Through the scoring mechanism and dynamic optimization, the quality of the generated dialogue text is significantly improved, and the diversity and complexity of the dialogue text are enhanced.

[0223] Low cost: It reduces the labor cost of dialogue text production and improves the efficiency of dialogue text generation.

[0224] Figure 3 FIG. 1 shows a structural diagram of a text enhancement device provided in an embodiment of the present application. Figure 3 As shown, the text enhancement device 300 includes:

[0225] A first acquisition module 301 is used to acquire a plurality of initial dialogue texts;

[0226] A first enhancement module 302, configured to enhance the plurality of initial dialogue texts using a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold;

[0227] A second enhancement module 303 is used to perform data evolution processing on the plurality of first dialogue texts using a preconfigured evolution rule to obtain a second data set, wherein the second data set includes a plurality of second dialogue texts;

[0228] An evaluation module 304 is used to perform text quality evaluation on the plurality of second dialogue texts using a scoring rule corresponding to the evolution rule to obtain a text quality score corresponding to the second data set;

[0229] The determination module 305 is used to use each second dialogue text in the second data set as a target dialogue text if the text quality score corresponding to the second data set meets a preset condition, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

[0230] In one embodiment of the present application, the enhanced rule includes M sub-rules, where M is an integer greater than 1;

[0231] The first enhancement module 302 includes:

[0232] The first acquisition submodule is used to obtain the weight corresponding to each sub-rule in this round of iteration;

[0233] A second acquisition submodule is used to acquire, according to the weight corresponding to each of the sub-rules, the iterative text corresponding to each of the sub-rules from the to-be-enhanced text set, wherein in a first round of iteration, the to-be-enhanced text set includes a plurality of the initial dialogue texts;

[0234] An enhancement submodule, used to perform data enhancement processing on the iterative text corresponding to the sub-rule using each of the sub-rules to obtain an enhanced text corresponding to the sub-rule;

[0235] An adding submodule, used for adding the enhanced text corresponding to each of the sub-rules to the temporary text set;

[0236] A first determination submodule is configured to, if the text quality score corresponding to the temporary text set is less than the first threshold, use the temporary text set as the text set to be enhanced, and jump to the step of obtaining the weight corresponding to each sub-rule in this iteration;

[0237] The second determination submodule is configured to use the temporary text set as the first data set if the text quality score corresponding to the temporary text set is greater than or equal to the first threshold.

[0238] In an embodiment of the present application, the first acquisition submodule includes:

[0239] A first acquisition unit is used to set the weight corresponding to each sub-rule in the current iteration by using a preset configuration value if the current iteration is the first or second iteration;

[0240] The second acquisition unit is used to calculate the weight used by each sub-rule in the current round of iteration according to the text quality score corresponding to the temporary text set in the t-1 round of iteration, the text quality score corresponding to the temporary text set in the t-2 round of iteration, and the weight corresponding to each sub-rule, if the current round of iteration is the t-th round of iteration, where t is an integer greater than or equal to 3.

[0241] In an embodiment of the present application, the second acquisition submodule is specifically used to:

[0242] Dividing the text in the to-be-enhanced text set according to the weight corresponding to each of the sub-rules, to obtain iterative text corresponding to each of the sub-rules;

[0243] or,

[0244] The weights corresponding to each of the sub-rules are sorted, and the first sub-rule corresponding to the weight ranked first is selected; the second sub-rule used in conjunction with the first sub-rule is obtained from a plurality of pre-set matching rules; the text in the to-be-enhanced text set is divided according to the weights corresponding to the first sub-rule and the second sub-rule, and the iterative texts corresponding to the first sub-rule and the second sub-rule are obtained, and the number of iterative texts corresponding to the sub-rules in the enhanced rule except the first sub-rule and the second sub-rule is a preset value, wherein each of the matching rules includes N sub-rules in the enhanced rule, and N is an integer greater than 1 and less than M;

[0245] or,

[0246] The texts in the to-be-enhanced text set are divided according to the weights corresponding to each third sub-rule to obtain iterative texts corresponding to each third sub-rule, wherein the third sub-rule is a sub-rule in the enhanced rule except the sub-rule used in the previous iteration.

[0247] In one embodiment of the present application, if the text quality score corresponding to the second data set includes a complexity score, the preset condition includes: the complexity score corresponding to the second data set is greater than a second threshold corresponding to the deep evolution rule;

[0248] or,

[0249] If the text quality score corresponding to the second data set includes a diversity score, the preset condition includes: the diversity score corresponding to the second data set is greater than a third threshold corresponding to the breadth evolution rule;

[0250] The complexity score is determined based on at least one of the number of logical constraints, logical depth, and domain complexity of all second dialogue texts in the second data set, and the diversity score is determined based on at least one of the number of domains, the number of character perspectives, and the number of sentence patterns of all second dialogue texts in the second data set.

[0251] In one embodiment of the present application, the device further includes:

[0252] An adjustment module, configured to enhance the evolution degree of the evolution rule to obtain a first evolution rule if the text quality score corresponding to the second data set does not meet the preset condition;

[0253] A determination module is used to use the first evolution rule as a preconfigured evolution rule and multiple second dialogue texts as multiple first dialogue texts, and jump to the step of performing data evolution processing on the multiple first dialogue texts using the preconfigured evolution rule to obtain a second data set.

[0254] In an embodiment of the present application, the adjustment module includes:

[0255] a first adjustment submodule, configured to enhance the evolution degree of the deep evolution rule to obtain a first evolution rule if the complexity score corresponding to the second data set is less than a second threshold corresponding to the deep evolution rule;

[0256] The second adjustment submodule is used to enhance the evolution degree of the breadth evolution rule to obtain the first evolution rule if the diversity score corresponding to the second data set is less than a third threshold corresponding to the breadth evolution rule.

[0257] In an embodiment of the present application, the first adjustment submodule includes:

[0258] a first calculation unit, configured to calculate a first adjustment factor according to the complexity score corresponding to the second data set and the second threshold value if the complexity score corresponding to the second data set is less than the second threshold value corresponding to the deep evolution rule, wherein the first adjustment factor includes at least one of a logic constraint quantity adjustment factor, a logic depth adjustment factor, and a domain complexity adjustment factor;

[0259] The first adjustment unit is used to enhance the evolution degree of the deep evolution rule by using the first adjustment factor to obtain a first evolution rule.

[0260] In an embodiment of the present application, the second adjustment submodule includes:

[0261] a second calculation unit, configured to calculate a second adjustment factor according to the diversity score corresponding to the second data set and the third threshold value if the diversity score corresponding to the second data set is less than a third threshold value corresponding to the breadth evolution rule, wherein the second adjustment factor includes at least one of a domain quantity adjustment factor, a role perspective quantity adjustment factor, and a sentence quantity adjustment factor;

[0262] The second adjustment unit is used to enhance the evolution degree of the breadth evolution rule by using the second adjustment factor to obtain the first evolution rule.

[0263] The text enhancement device 300 provided in the embodiment of the present application can implement each process implemented in the aforementioned text enhancement method embodiment and achieve the same technical effect. To avoid repetition, it will not be described here.

[0264] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0265] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0266] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0267] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0268] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect or the second aspect of the present disclosure.

[0269] The processor 601 implements any one of the information auditing methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .

[0270] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 4 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0271] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0272] Bus 610 includes hardware, software or both, and the parts of information audit method or verification equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0273] In addition, in combination with the text enhancement method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the text enhancement methods in the above embodiment is implemented.

[0274] An embodiment of the present application may provide a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the text enhancement methods in the above embodiments.

[0275] An embodiment of the present application also provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the text enhancement methods in the above embodiments.

[0276] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiment, several specific steps are described as examples. However, the method process of the present application is not limited to the specific steps described, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0277] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0278] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0279] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0280] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A text enhancement method, characterized in that: The method comprises: Get multiple initial conversation texts; Performing enhancement processing on the plurality of the initial dialogue texts according to a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold; Performing data evolution processing on the plurality of first dialogue texts using a preconfigured evolution rule to obtain a second data set, wherein the second data set includes the plurality of second dialogue texts; Performing text quality assessment on a plurality of the second dialogue texts using a scoring rule corresponding to the evolution rule to obtain a text quality score corresponding to the second data set; If the text quality score corresponding to the second data set meets a preset condition, each second dialogue text in the second data set is used as a target dialogue text, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

2. The text enhancement method according to claim 1, characterized in that: The enhanced rule includes M sub-rules, where M is an integer greater than 1; The enhancing process is performed on the plurality of the initial dialogue texts by using a preset enhancing rule to obtain a first data set, including: Get the weight corresponding to each sub-rule in this round of iteration; According to the weight corresponding to each of the sub-rules, the iterative text corresponding to each of the sub-rules is obtained from the text set to be enhanced, wherein in the first round of iteration, the text set to be enhanced includes a plurality of the initial dialogue texts; Using each of the sub-rules to perform data enhancement processing on the iterative text corresponding to the sub-rule, to obtain enhanced text corresponding to the sub-rule; Adding the enhanced text corresponding to each of the sub-rules to the temporary text set; If the text quality score corresponding to the temporary text set is less than the first threshold, the temporary text set is used as the text set to be enhanced, and the process jumps to the step of obtaining the weight corresponding to each sub-rule in this iteration; If the text quality score corresponding to the temporary text set is greater than or equal to the first threshold, the temporary text set is used as the first data set.

3. The text enhancement method according to claim 2, characterized in that: The step of obtaining the weight corresponding to each sub-rule in the current iteration includes: If the current iteration is the first or second iteration, the weight corresponding to each sub-rule in the current iteration is set by using a preset configuration value; If the current iteration is the tth iteration, then the weight of each sub-rule used in the current iteration is calculated based on the text quality score corresponding to the temporary text set in the t-1th iteration, the text quality score corresponding to the temporary text set in the t-2th iteration, and the weight corresponding to each sub-rule, where t is an integer greater than or equal to 3.

4. The text enhancement method according to claim 3, characterized in that: According to the weight corresponding to each of the sub-rules, acquiring the iterative text corresponding to each of the sub-rules from the to-be-enhanced text set, including: Dividing the text in the to-be-enhanced text set according to the weight corresponding to each of the sub-rules, to obtain iterative text corresponding to each of the sub-rules; or, The weights corresponding to each of the sub-rules are sorted, and the first sub-rule corresponding to the weight ranked first is selected; the second sub-rule used in conjunction with the first sub-rule is obtained from a plurality of pre-set matching rules; the text in the to-be-enhanced text set is divided according to the weights corresponding to the first sub-rule and the second sub-rule, and the iterative text corresponding to the first sub-rule and the second sub-rule is obtained, and the number of iterative texts corresponding to the sub-rules in the enhanced rule except the first sub-rule and the second sub-rule is a preset value, wherein each of the matching rules includes N sub-rules in the enhanced rule, and N is an integer greater than 1 and less than M; or, The texts in the to-be-enhanced text set are divided according to the weights corresponding to each third sub-rule to obtain iterative texts corresponding to each third sub-rule, wherein the third sub-rule is a sub-rule in the enhancement rule except the sub-rule used in the previous iteration.

5. The text enhancement method according to claim 1, characterized in that: The evolution rule includes at least one of a deep evolution rule and a broad evolution rule; If the text quality score corresponding to the second data set includes a complexity score, the preset condition includes: the complexity score corresponding to the second data set is greater than a second threshold corresponding to the deep evolution rule; or, If the text quality score corresponding to the second data set includes a diversity score, the preset condition includes: the diversity score corresponding to the second data set is greater than a third threshold corresponding to the breadth evolution rule; The complexity score is determined based on at least one of the number of logical constraints, logical depth, and domain complexity of all second dialogue texts in the second data set, and the diversity score is determined based on at least one of the number of domains, the number of character perspectives, and the number of sentence patterns of all second dialogue texts in the second data set.

6. The text enhancement method according to claim 5, characterized in that: After evaluating the text quality of the plurality of second dialogue texts using the scoring rule corresponding to the evolution rule to obtain the text quality score corresponding to the second data set, the method further includes: If the text quality score corresponding to the second data set does not meet the preset condition, enhancing the evolution degree of the evolution rule to obtain a first evolution rule; The first evolution rule is used as a preconfigured evolution rule, and the multiple second dialogue texts are used as multiple first dialogue texts, and the step of jumping to the step of performing data evolution processing on the multiple first dialogue texts using the preconfigured evolution rule to obtain a second data set is executed.

7. The text enhancement method according to claim 6, characterized in that: If the text quality score corresponding to the second data set does not meet the preset condition, the evolution degree of the evolution rule is enhanced to obtain a first evolution rule, including: If the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, enhancing the evolution degree of the deep evolution rule to obtain a first evolution rule; or, If the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, the evolution degree of the breadth evolution rule is enhanced to obtain the first evolution rule.

8. The text enhancement method according to claim 7, characterized in that: If the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, enhancing the evolution degree of the deep evolution rule to obtain the first evolution rule includes: If the complexity score corresponding to the second data set is less than the second threshold corresponding to the deep evolution rule, a first adjustment factor is calculated according to the complexity score corresponding to the second data set and the second threshold, wherein the first adjustment factor includes at least one of a logic constraint quantity adjustment factor, a logic depth adjustment factor, and a domain complexity adjustment factor; The first adjustment factor is used to enhance the evolution degree of the deep evolution rule to obtain a first evolution rule.

9. The text enhancement method according to claim 7, characterized in that: If the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, the evolution degree of the breadth evolution rule is enhanced to obtain the first evolution rule, including: If the diversity score corresponding to the second data set is less than the third threshold corresponding to the breadth evolution rule, a second adjustment factor is calculated according to the diversity score corresponding to the second data set and the third threshold, wherein the second adjustment factor includes at least one of a field quantity adjustment factor, a role perspective quantity adjustment factor, and a sentence quantity adjustment factor; The second adjustment factor is used to enhance the evolution degree of the breadth evolution rule to obtain a first evolution rule.

10. A text enhancement device, characterized in that: The device comprises: A first acquisition module, used to acquire multiple initial dialogue texts; A first enhancement module, configured to enhance the plurality of initial dialogue texts using a preset enhancement rule to obtain a first data set, wherein the first data set includes a plurality of first dialogue texts, and a text quality score corresponding to the first data set is greater than or equal to a first threshold; A second enhancement module, configured to perform data evolution processing on the plurality of first dialogue texts using a preconfigured evolution rule to obtain a second data set, wherein the second data set includes the plurality of second dialogue texts; An evaluation module, configured to perform text quality evaluation on a plurality of the second dialogue texts using a scoring rule corresponding to the evolution rule, to obtain a text quality score corresponding to the second data set; A determination module is used to use each second dialogue text in the second data set as a target dialogue text if the text quality score corresponding to the second data set meets a preset condition, and the preset condition is determined according to a threshold value corresponding to the evolution rule.

11. An electronic device, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the text enhancement method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the text enhancement method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the text enhancement method as described in any one of claims 1-9.