Text generation method and device for eliminating AI trace, medium and product

By training the text generator and dual discriminator in generative adversarial training, the problem of AI-generated text not conforming to human handwriting characteristics was solved, and semantically consistent text generation conforming to human handwriting characteristics was achieved.

CN121580984APending Publication Date: 2026-02-27SHANGHAI HAIYAN XINZHI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511697658.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing AI-based text generation methods for removing handwriting often damage the core semantics of the original text when mimicking human handwriting, and the generated text does not conform to the characteristics of human handwriting.

Method used

By classifying text content and using a pre-trained text generator and dual discriminator for generative adversarial training, text that conforms to human handwriting characteristics is generated, ensuring semantic consistency.

Benefits of technology

The generated text not only conforms to the characteristics of human handwriting, but also maintains the semantic consistency of the original text, thus improving the effectiveness of text generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580984A_ABST
    Figure CN121580984A_ABST
Patent Text Reader

Abstract

The invention discloses an AI trace elimination text generation method and device, a medium and a product. The method comprises the steps of obtaining a first text generated by a model and classifying the first text to obtain a second text of a first type and a third text of a second type; inputting the third text into a pre-trained text generator to obtain a fourth text of the first type; taking the second text and the fourth text as target generation texts; the first type is a type conforming to artificial writing features, the second type is a type not conforming to the artificial writing features, the text generator is determined by performing generative adversarial training with a first discriminator and a second discriminator, the first discriminator is used for discriminating whether the text belongs to the first type, and the second discriminator is used for discriminating text semantics. According to the technical scheme, the problem that the text generated by the current model does not conform to the artificial writing feature is solved, the text which is consistent in semantics but has the artificial writing feature can be generated according to the text generated by the model, and the text generation effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a text generation method, device, medium and product for AI trace removal. Background Technology

[0002] Currently, existing AI-based text generation methods that remove traces, such as back-translation or paraphrasing, while mimicking human writing, often damage the core semantics of the original text, and their types still tend to favor the features of model-generated text. Summary of the Invention

[0003] This invention provides a text generation method, device, medium, and product for AI trace removal, which solves the problem that the text generated by the current model does not conform to the characteristics of human handwriting. It can generate text with semantic consistency but human handwriting characteristics based on the text generated by the model, thereby improving the quality of generated text.

[0004] In a first aspect, embodiments of the present invention provide a text generation method for AI trace removal, the method comprising:

[0005] Obtain the first text, which is generated based on a pre-trained natural language model;

[0006] The text content of the first text is classified to obtain the second text belonging to the first type and the third text belonging to the second type;

[0007] The third text is input into a pre-trained text generator to obtain the fourth text, which belongs to the first type of text.

[0008] Generate text by using the second and fourth texts as target texts corresponding to the first text;

[0009] The first type is the type that conforms to the characteristics of human handwriting, and the second type is the type that does not conform to the characteristics of human handwriting. The text generator is determined through adversarial training with the first discriminator and the second discriminator. The first discriminator is used to determine whether the text generated by the text generator belongs to the first type, and the second discriminator is used to determine whether the text generated by the text generator has the same semantics as the corresponding input text.

[0010] Secondly, embodiments of the present invention also provide a text generation apparatus for AI trace removal, the apparatus comprising:

[0011] The text acquisition module is used to acquire the first text, which is generated based on a pre-trained natural language model.

[0012] The content classification module is used to classify the text content of the first text, and obtain the second text belonging to the first type and the third text belonging to the second type.

[0013] The text generator module is used to input the third text into a pre-trained text generator to obtain the fourth text, which is a text belonging to the first type.

[0014] The target text generation determination module is used to determine the second and fourth texts as target texts corresponding to the first text.

[0015] The first type is the type that conforms to the characteristics of human handwriting, and the second type is the type that does not conform to the characteristics of human handwriting. The text generator is determined through adversarial training with the first discriminator and the second discriminator. The first discriminator is used to determine whether the text generated by the text generator belongs to the first type, and the second discriminator is used to determine whether the text generated by the text generator has the same semantics as the corresponding input text.

[0016] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the AI ​​trace removal text generation method according to any embodiment of the present invention.

[0020] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute and implement the AI ​​trace removal text generation method described in any embodiment of the present invention.

[0021] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the AI ​​trace removal text generation method as described in any of the embodiments of the present invention.

[0022] In this embodiment of the invention, a first text is obtained, which is generated based on a pre-trained natural language model. The text content of the first text is classified to obtain a second text belonging to a first type and a third text belonging to a second type. The third text is input into a pre-trained text generator to obtain a fourth text, which belongs to the first type. The second and fourth texts are used as target generated texts corresponding to the first text. The first type is a type that conforms to human handwriting characteristics, and the second type is a type that does not conform to human handwriting characteristics. The text generator is determined through adversarial training with a first discriminator and a second discriminator. The first discriminator is used to determine whether the text generated by the text generator belongs to the first type, and the second discriminator is used to determine whether the text generated by the text generator has the same semantics as the corresponding input text. The technical solution of this embodiment of the invention solves the problem that the text generated by the current model does not conform to human handwriting characteristics. It can generate text with semantic consistency but human handwriting characteristics based on the text generated by the model, thereby improving the quality of generated text. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating an AI-based text generation method for trace removal, provided in an embodiment of the present invention;

[0025] Figure 2 A flowchart illustrating an AI-based text generation method for trace removal, provided in an embodiment of the present invention;

[0026] Figure 3 A schematic diagram illustrating an AI-based text generation method for trace removal provided in an embodiment of the present invention;

[0027] Figure 4 This is a schematic diagram of the structure of a text generation device for AI trace removal provided in an embodiment of the present invention;

[0028] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0030] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.

[0031] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the relevant content of the solution.

[0032] Figure 1 This is a flowchart illustrating an AI-based text generation method for removing traces, provided as an embodiment of the present invention. This embodiment is applicable to text generation scenarios. The method can be executed by an AI-based text generation device for removing traces, which can be implemented in software and / or hardware and integrated into an electronic device.

[0033] like Figure 1 As shown, the AI-based text generation method for removing traces includes the following steps:

[0034] S110, Obtain the first text.

[0035] The first text is generated based on a pre-trained natural language model. Natural language models, such as large language models (LLMs), can be trained on massive amounts of text data and can understand and generate human language. Artificial intelligence content generation technology is widely used in the field of document writing, but the generated text often does not conform to the characteristics of human-written text. Existing AI trace removal technologies, when attempting to "humanize" text, often sacrifice semantic accuracy, and the processed text still does not conform to the characteristics of human-written text.

[0036] Therefore, after obtaining the first text in this embodiment, the content in the first text that does not conform to the characteristics of human-written text is reconstructed so that the final text conforms to the characteristics of human-written text.

[0037] S120. Classify the text content of the first text to obtain the second text belonging to the first type and the third text belonging to the second type.

[0038] The first type is the type that conforms to the characteristics of human writing, and the second type is the type that does not conform to the characteristics of human writing. The type that does not conform to the characteristics of human writing is the type that conforms to the characteristics of AI-generated traces.

[0039] Classification can be based on preset classification rules, determining the probability or score of text features, such as word features and sentence features, belonging to the first type. If the probability exceeds a preset threshold, it is determined to belong to the first type; otherwise, it belongs to the second type. After classifying all content of the first text, the second text belonging to the first type and the third text belonging to the second type are obtained.

[0040] S130. Input the third text into the pre-trained text generator to obtain the fourth text, which belongs to the first type of text.

[0041] The text generator is determined through generative adversarial training against a first discriminator and a second discriminator. The first discriminator determines whether the text generated by the generator belongs to a first type, and the second discriminator determines whether the text generated by the generator is semantically identical to the corresponding input text. During training, the text generator aims to make the text generated by the first discriminator belong to the first type and to make the text generated by the second discriminator semantically consistent with the third text.

[0042] S140. Generate target texts corresponding to the first text, using the second and fourth texts as the target texts.

[0043] By replacing the third text in the first text with the fourth text, the target generated text is obtained by combining the second and fourth texts. All text content of the target generated text belongs to the first type of text.

[0044] The technical solution of this embodiment involves acquiring a first text, which is generated based on a pre-trained natural language model; classifying the text content of the first text to obtain a second text belonging to a first type and a third text belonging to a second type; inputting the third text into a pre-trained text generator to obtain a fourth text, which belongs to the first type; and using the second and fourth texts as target generated texts corresponding to the first text. The first type is a type that conforms to human handwriting characteristics, and the second type is a type that does not conform to human handwriting characteristics. The text generator is determined through adversarial training with a first discriminator and a second discriminator. The first discriminator determines whether the text generated by the text generator belongs to the first type, and the second discriminator determines whether the text generated by the text generator has the same semantics as the corresponding input text. This embodiment of the invention solves the problem that text generated by current models does not conform to human handwriting characteristics, and can generate semantically consistent text with human handwriting characteristics based on the model-generated text, thereby improving the quality of generated text.

[0045] Figure 2 This is a flowchart illustrating an AI-based text generation method for removing traces, provided as an embodiment of the present invention. This embodiment belongs to the same inventive concept as the AI-based text generation method for removing traces described above, and further describes the process of generating the first text. This method can be executed by an AI-based text generation device for removing traces, which can be implemented in software and / or hardware and integrated into an electronic device with application development capabilities.

[0046] like Figure 2 As shown, the AI-based text generation method for trace removal in this embodiment includes the following steps:

[0047] S210. In response to the client's text generation requirement information input operation, determine the requirement information and generate a first text outline based on the requirement information.

[0048] like Figure 3 As shown, in response to the client's input of text generation requirements, the requirements information is determined. The text generation requirements information can be generated by filling out a form or by the user directly entering descriptive text. The requirements information may include the topic, document type, target audience, and chapter text requirements for at least one chapter. Chapter text requirements information may include the core arguments, word count range, writing style, and logical relationship with other chapters. The first text outline generated from the requirements information includes chapter information for at least one chapter.

[0049] Specifically, a large language model fine-tuned by the outline generation task can be invoked, and hierarchical prompting engineering technology can be used to generate a structured initial outline, namely the first text outline, which includes multi-level headings, core points of each chapter, logical relationships, and estimated length.

[0050] S220. In response to the client's modification operation based on the first text outline, determine the second text outline.

[0051] The initial text outline can be presented to the client in an interactive tree structure. The client can adjust the structure, order, and content of the outline by dragging, adding, deleting, and modifying, and can set importance weights for different chapters. This process gives the user complete control over the final structure of the document.

[0052] User feedback on the outline can also serve as a feedback signal to update the large language model after fine-tuning the outline generation task.

[0053] S230. Determine the constraints of each chapter in the text to be generated based on the second text outline, and input the constraints into the pre-trained natural language model to obtain the first text.

[0054] The chapters in the second text outline, with their importance weights assigned, are encoded into machine-readable structured constraints. In subsequent constrained content generation, a pre-trained natural language model based on the constrained content generation algorithm strictly adheres to these constraints to ensure the consistency and logical coherence of the generated first text with the user's intent. Chapters with higher weights are likely to be transformed into more precise or stringent constraints, ensuring their content is more detailed and better aligns with the user's expected focus.

[0055] The encoding process for structured constraints can involve parsing the second text outline, determined through human-machine collaboration, using natural language processing techniques such as named entity recognition and relation extraction, and encoding it into machine-readable structured constraints. These constraints can be JSON objects, precisely defining each chapter's title, the core arguments that must be covered, the word count range, the writing style, and its logical relationships with other chapters. The natural language model is trained using these sample constraints, controlling the content structure and expression norms under their guidance, gradually learning the ability to generate text that meets preset requirements, and ultimately outputting text that is structurally complete, logically coherent, and conforms to the constraints.

[0056] After the constraints are input into the pre-trained natural language model, the model employs a segmented constraint generation algorithm. This algorithm ensures that the corresponding constraints are strictly followed when generating each chapter. Simultaneously, it possesses context-aware capabilities, meaning that when generating the current paragraph, it references the preceding text and the structure of the chapters to be generated, ensuring the logical coherence and consistency of the entire text.

[0057] The system can also perform quality assessments on the generated text. For generated results that do not meet the quality assessment criteria, such as relevance or logical consistency, the system will automatically rewrite them iteratively until they pass the quality assessment. The quality assessment can serve as a feedback signal to update the pre-trained natural language model based on the constraint-based content generation algorithm.

[0058] S240, Obtain the first text.

[0059] The first text was generated based on a pre-trained natural language model.

[0060] S250. Classify the text content of the first text to obtain the second text belonging to the first type and the third text belonging to the second type.

[0061] Text content can be classified using multiple dimensions of text features. In one optional implementation, classifying the text content of a first text may involve: determining at least one dimension of text features for each paragraph of the first text; determining a conformity score for the text features to belong to a first type based on the text features and the corresponding preset feature judgment rules; determining that the paragraph belongs to the first type in response to the sum of the conformity scores for each dimension of the text features being greater than a preset threshold, or determining that the paragraph belongs to a second type in response to the sum of the conformity scores for each dimension of the text features being less than or equal to a preset threshold; wherein the text features include at least one of lexical features, syntactic features, and paragraph features.

[0062] Specifically, we analyze lexical diversity, such as the Type-Token Ratio (TTR), the unusual frequency of use of specific conjunctions like "in addition" and "in short," and the semantic density reflected by information entropy. AI-generated text typically exhibits a different distribution pattern on these metrics than human writing. Therefore, we calculate the first-type conformity score or probability in the lexical feature dimension based on the analysis results of the above metrics.

[0063] Dependency parsing is used to model the regularity and complexity of sentence structure. AI-generated sentences often exhibit characteristics such as overly uniform sentence length distribution and simple sentence structure. Therefore, the first-type conformity score or probability in the sentence feature dimension is calculated based on the analysis results of the above indicators.

[0064] Graph neural networks or Markov chains are used to analyze logical transition patterns between paragraphs. AI may exhibit fixed, predictable transition patterns in paragraph connections. Therefore, the results of the logical transition pattern analysis are used to determine the first-type conformity score or probability in the paragraph feature dimension.

[0065] S260. Input the third text into the pre-trained text generator to obtain the fourth text, which belongs to the first type of text.

[0066] For text fragments identified as having obvious AI traces, the system activates a specially designed Generative Adversarial Network (GAN) to reconstruct them in anthropomorphic form, resulting in a fourth text.

[0067] A text generator can be a text rewriting network based on the Transformer architecture, whose task is to rewrite input AI-style text into text written in a human style.

[0068] Dual discriminators consist of a style discriminator and a semantic discriminator. The style discriminator, or first discriminator, distinguishes whether the input text is human-written or AI-generated, aiming to force the generator to produce text that it cannot recognize as AI. The semantic discriminator, or second discriminator, ensures semantic consistency during the reconstruction process by calculating the semantic vector similarity between the reconstructed text and the original text.

[0069] Through adversarial training, the text generator, under the joint supervision of the style discriminator and the semantic discriminator, learns to eliminate AI text features to the greatest extent possible while keeping the core semantics unchanged, and introduces sentence diversity and adjusts the writing rhythm, thereby converting the received third text into the first type of fourth text.

[0070] S270. Generate target texts corresponding to the first text, using the second and fourth texts as the target texts.

[0071] In this embodiment, to further improve the matching degree between the target generated text and the user's intent, the user is allowed to interact with the fourth text to determine the final text. In an optional implementation, the difference text between the third and fourth texts is determined, and the third and fourth texts are compared and displayed based on the difference text; in response to the client's text interaction operation based on the comparison display input, the fifth text is determined; the second and fifth texts are used as the target generated text corresponding to the first text; wherein, the text interaction operation is an acceptance or rejection operation of a text fragment of the third text.

[0072] The system presents the original text (the second text) and the anthropomorphized, reconstructed text (the fourth text) side-by-side, highlighting the changes. Users can choose to accept, reject, or partially adopt the optimization results, sentence by sentence or paragraph by paragraph.

[0073] In one optional implementation, the training process of the text generator may involve: inputting sample text belonging to the second type into the text generator to obtain reconstructed text; inputting the reconstructed text into a first discriminator to obtain a type discrimination result; inputting the reconstructed text and the sample text into a second discriminator to obtain a semantic discrimination result; calculating a first loss value based on the type discrimination result, the semantic discrimination result, a preset type discrimination result, and a preset semantic discrimination result; adjusting the parameters of the text generator based on the first loss value until the first loss value is less than a preset first threshold, thereby completing the training of the text generator; wherein, the preset type discrimination result is the first type, and the preset semantic discrimination result is that the reconstructed text and the sample text are semantically consistent.

[0074] The training process of the text generator revolves around an adversarial learning framework. The core objective is to enable the model to generate text that conforms to the first type without altering the original semantics. Specifically, the text generator is fed with sample text of the second type, and it reconstructs the text based on initial parameters, outputting a candidate reconstructed text.

[0075] To verify the reconstruction effect, the training system introduces a dual discriminator mechanism: the first discriminator focuses on text type recognition, and outputs the type determination result after receiving the reconstructed text; the second discriminator focuses on semantic matching degree, and generates a semantic consistency score between the two by comparing the reconstructed text with the original sample text.

[0076] The two discrimination results are compared with the preset target. The preset type discrimination result is the first type, meaning the reconstructed text is expected to be classified as the target type. The preset semantic discrimination result is complete consistency, meaning the reconstructed text is required to be semantically identical to the sample text. Based on the difference between the two, a first loss value is calculated using a loss function. This value comprehensively reflects the accuracy of type conversion and the completeness of semantic preservation.

[0077] During training, the parameters of the text generator are continuously optimized iteratively based on the first loss value. If the loss value is high, it indicates that the type conversion has not met the standard or that the semantics have shifted, and the model needs to adjust the generation strategy. The training is completed when the loss value drops below the preset first threshold, meaning that the generator can stably output text that conforms to the first type and is semantically faithful to the sample. This process achieves the dual goals of "type conversion" and "semantic fidelity" through the collaborative constraints of the two discriminators.

[0078] In this embodiment, the user's selection of the fourth text will serve as a feedback signal for the text generator's continuous learning and personalized adjustments, forming an adaptive optimization loop. In an optional implementation, at least one first semantic feature of the first text fragment corresponding to the accept operation and the second semantic feature of the second text fragment corresponding to the reject operation are extracted during the text generation process; the text generator is updated based on the first semantic feature, the reward label corresponding to the first semantic feature, the second semantic feature, and the penalty label corresponding to the second semantic feature.

[0079] During the text generation process of multiple text generators, the first text fragment corresponding to the "accept" operation and the second text fragment corresponding to the "reject" operation are collected. Semantic features are extracted from these text fragments to obtain first and second semantic features. Based on the first semantic feature, the reward label corresponding to the first semantic feature, and the penalty label corresponding to the second semantic feature, the reward and penalty mechanism of the text generator based on semantic features is updated to further optimize the generation effect of the text generator and make it conform to user preferences.

[0080] In one optional implementation, the text generator is updated based on the first semantic feature, the reward label corresponding to the first semantic feature, the second semantic feature, and the penalty label corresponding to the second semantic feature. This can be achieved by inputting new sample text into the text generator to obtain new reconstructed text; calculating the first semantic similarity and the second semantic similarity between the new reconstructed text and the first and second semantic features, respectively; calculating a second loss value based on the first weight of the reward label, the second weight of the penalty label, the first semantic similarity, and the second semantic similarity; adding the second loss value to a third loss value to obtain the total loss, where the third loss value is calculated based on the discrimination results of the first and second discriminators on the new reconstructed text; and adjusting the parameters of the text generator based on the total loss until the total loss is less than a preset second threshold, thus completing the update of the text generator.

[0081] The new sample text is input into the trained text generator to obtain a new reconstructed text, which serves as the base output for this round of updates. The first semantic similarity between the reconstructed text and the first semantic feature (i.e., the positive target feature), as well as the second semantic similarity (such as cosine similarity) with the second semantic feature and the negative avoidance feature, are calculated to quantify the degree of fit of the generated text in key semantic dimensions.

[0082] The second loss value is calculated by combining the first weight of the reward label and the second weight of the penalty label. The higher the first semantic similarity and the lower the second semantic similarity, the smaller this loss value. At the same time, a third loss value is calculated based on the type determination result of the first discriminator and the semantic consistency result of the second discriminator. This third loss value is added to the second loss value to obtain the total loss that reflects the overall performance.

[0083] During the update phase, the generator parameters are continuously adjusted iteratively. If the total loss is high, it indicates that the generated text has deviations in semantic reward and punishment targets or types, and semantic consistency, and needs to be optimized in a targeted manner. The update process is completed when the total loss drops below the preset second threshold, which means that the generator can not only meet the requirements of type conversion and semantic fidelity, but also accurately match positive semantic features and avoid negative semantic features.

[0084] This embodiment overturns the traditional one-step generation model, proposing a two-stage paradigm of structure first, content second. By moving user control forward to the document structure design stage, it fundamentally solves the problem of matching AI-generated content with the user's deep intent, transforming the human-machine relationship from "instruction-execution" to a deep collaboration of "design-implementation." It is the first to propose and implement an AI text feature recognition framework based on a three-dimensional framework of "vocabulary-syntax-paragraph," significantly improving the accuracy and robustness of recognition compared to existing single-dimensional methods. Combined with a dual-discriminator GAN with semantic preservation constraints for anthropomorphic reconstruction, it achieves an efficient balance between eliminating AI traces and maintaining semantic integrity. It constructs a full-process human-machine collaborative mechanism from outline design and content review to trace elimination. At each key node, the system adopts an "AI proposal-user decision" model, ensuring that the user is always in a dominant position in creation, achieving a deep integration of human and machine intelligence. By explicitly converting the natural language outline into machine-processable structured constraints, it achieves precise control over the content generation process, ensuring not only a high degree of consistency between content and outline but also making the generation process transparent and controllable.

[0085] The technical solution of this embodiment, in response to the client's input operation of text generation requirement information, determines the requirement information and generates a first text outline based on the requirement information. The first text outline includes chapter information of at least one chapter. In response to the client's modification operation based on the first text outline, a second text outline is determined. Based on the second text outline, the constraints of each chapter in the text to be generated are determined, and the constraints are input into a pre-trained natural language model to obtain the first text. The natural language model is trained using sample constraints. The first text is obtained. The first text is generated based on the pre-trained natural language model. The text content of the first text is classified to obtain the... A text generator is used to generate a second text belonging to a first type and a third text belonging to a second type. The third text is input into a pre-trained text generator to obtain a fourth text, which belongs to the first type. The second and fourth texts are used as target generated texts corresponding to the first text. The first type is defined as conforming to human handwriting characteristics, and the second type is defined as not conforming to human handwriting characteristics. The text generator is determined through adversarial training with a first discriminator and a second discriminator. The first discriminator determines whether the text generated by the text generator belongs to the first type, and the second discriminator determines whether the text generated by the text generator has the same semantics as the corresponding input text. This invention solves the problem that text generated by current models does not conform to human handwriting characteristics. It can generate text with consistent semantics but human handwriting characteristics based on the model-generated text. By first generating an outline and then generating content, and by generating and adjusting the outline based on interactive operations, it ensures that the generated content conforms to the user's intent, further improving the quality of the generated text.

[0086] Figure 4 This is a schematic diagram of the structure of the AI-based text generation device for trace removal provided in an embodiment of the present invention. This embodiment is applicable to text generation scenarios. The device can be implemented by software and / or hardware and integrated into an electronic device.

[0087] like Figure 4 As shown, the AI ​​trace removal text generation device includes: a text acquisition module 310, a content classification module 320, a text generator generation module 330, and a target text generation determination module 340.

[0088] The system includes a text acquisition module 310 for acquiring a first text, which is generated based on a pre-trained natural language model; a content classification module 320 for classifying the text content of the first text to obtain a second text belonging to a first type and a third text belonging to a second type; a text generator module 330 for inputting the third text into a pre-trained text generator to obtain a fourth text, which belongs to the first type; and a target text generation determination module 340 for using the second and fourth texts as target texts corresponding to the first text. The first type is a type that conforms to human handwriting characteristics, and the second type is a type that does not conform to human handwriting characteristics. The text generator is determined through adversarial training with a first discriminator and a second discriminator. The first discriminator determines whether the text generated by the text generator belongs to the first type, and the second discriminator determines whether the text generated by the text generator has the same semantics as the corresponding input text.

[0089] The technical solution of this invention involves acquiring a first text, generated based on a pre-trained natural language model; classifying the text content of the first text to obtain a second text belonging to a first type and a third text belonging to a second type; inputting the third text into a pre-trained text generator to obtain a fourth text, which belongs to the first type; and using the second and fourth texts as target generated texts corresponding to the first text. The first type is defined as conforming to human handwriting characteristics, and the second type is defined as not conforming to human handwriting characteristics. The text generator is determined through adversarial training with a first discriminator and a second discriminator. The first discriminator determines whether the text generated by the text generator belongs to the first type, and the second discriminator determines whether the text generated by the text generator has the same semantics as the corresponding input text. This technical solution solves the problem that text generated by current models does not conform to human handwriting characteristics, and can generate semantically consistent text with human handwriting characteristics based on the model-generated text, thus improving the quality of generated text.

[0090] In one alternative embodiment, the apparatus further includes:

[0091] The first text generation module is used to respond to the client's input operation of text generation requirement information, determine the requirement information, and generate a first text outline based on the requirement information. The first text outline includes chapter information of at least one chapter. In response to the client's modification operation based on the first text outline, it determines a second text outline. Based on the second text outline, it determines the constraints of each chapter in the text to be generated, and inputs the constraints into a pre-trained natural language model to obtain the first text. The natural language model is trained through sample constraints.

[0092] In one alternative embodiment, the apparatus further includes:

[0093] The fifth text determination module is used to determine the difference text between the third and fourth texts, and to compare and display the third and fourth texts based on the difference text; in response to the client's text interaction operation based on the comparison display input, the fifth text is determined; the second and fifth texts are used as target texts corresponding to the first text; wherein, the text interaction operation is an acceptance operation or rejection operation of the text fragment of the third text.

[0094] In one optional implementation, the content classification module 320 is specifically configured to: determine at least one dimension of text features for each paragraph of the first text; determine the conformity score of the text features belonging to a first type based on the text features and the preset feature judgment rules corresponding to the text features; determine that the paragraph belongs to the first type in response to the sum of the conformity scores of the text features in each dimension being greater than a preset threshold, or determine that the paragraph belongs to a second type in response to the sum of the conformity scores of the text features in each dimension being less than or equal to a preset threshold; wherein the text features include at least one of lexical features, syntactic features, and paragraph features.

[0095] In one alternative embodiment, the apparatus further includes:

[0096] The text generator training module is used to input sample text belonging to the second type into the text generator to obtain reconstructed text; input the reconstructed text into the first discriminator to obtain the type discrimination result; input the reconstructed text and the sample text into the second discriminator to obtain the semantic discrimination result; calculate the first loss value based on the type discrimination result, the semantic discrimination result, the preset type discrimination result, and the preset semantic discrimination result; adjust the parameters of the text generator according to the first loss value until the first loss value is less than the preset first threshold, thus completing the training of the text generator; wherein, the preset type discrimination result is the first type, and the preset semantic discrimination result is that the reconstructed text and the sample text are semantically consistent.

[0097] In one optional implementation, the text generator training module is further configured to extract a first semantic feature of a first text segment corresponding to an accept operation and a second semantic feature of a second text segment corresponding to a reject operation obtained during at least one text generation process; and update the text generator according to the first semantic feature, the reward label corresponding to the first semantic feature, the second semantic feature, and the penalty label corresponding to the second semantic feature.

[0098] In one optional implementation, the text generator training module is further configured to input new sample text into the text generator to obtain new reconstructed text; calculate the first semantic similarity and the second semantic similarity between the new reconstructed text and the first semantic feature and the second semantic feature, respectively; calculate a second loss value based on the first weight of the reward label, the second weight of the penalty label, the first semantic similarity and the second semantic similarity; add the second loss value and the third loss value to obtain the total loss, the third loss value being calculated based on the discrimination results of the first discriminator and the second discriminator on the new reconstructed text; and adjust the parameters of the text generator based on the total loss until the total loss is less than a preset second threshold, thereby completing the update of the text generator.

[0099] The AI ​​trace removal text generation device provided in this embodiment of the invention can execute the AI ​​trace removal text generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0100] Figure 5 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0101] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0102] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0103] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as AI trace removal text generation methods.

[0104] In some embodiments, the AI ​​trace removal text generation method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the AI ​​trace removal text generation method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the AI ​​trace removal text generation method by any other suitable means (e.g., by means of firmware).

[0105] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0106] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0107] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0109] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0110] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0111] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0112] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the AI ​​trace removal text generation method as provided in any embodiment of this application.

[0113] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0114] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0115] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An AI trace-elimination text generation method, characterized by, The method comprises: obtaining a first text generated based on a pre-trained natural language model; classifying the text content of the first text to obtain second text belonging to a first type and third text belonging to a second type in the first text; inputting the third text into a pre-trained text generator to obtain fourth text, the fourth text being text belonging to the first type; taking the second text and the fourth text as target generated text corresponding to the first text; wherein the first type is a type conforming to artificial writing characteristics, the second type is a type not conforming to artificial writing characteristics, the text generator is determined through generation and adversarial training with a first discriminator and a second discriminator, the first discriminator is used to determine whether the text generated by the text generator belongs to the first type, and the second discriminator is used to determine whether the text generated by the text generator is semantically identical to the corresponding input text.

2. The method of claim 1, wherein, The first text generation process comprises: in response to a text generation demand information input operation of a client, determining demand information, and generating a first text outline according to the demand information, the first text outline comprising chapter information of at least one chapter; in response to a modification operation of the client based on the first text outline, determining a second text outline; determining a constraint condition of each chapter of the text to be generated according to the second text outline, and inputting the constraint condition into a pre-trained natural language model to obtain a first text; the natural language model is trained through sample constraint conditions.

3. The method of claim 1, wherein, The method further comprises: determining a difference text of the third text and the fourth text, and comparing and displaying the third text and the fourth text according to the difference text; in response to a text interaction operation input by the client based on the comparison and display, determining a fifth text; taking the second text and the fifth text as target generated text corresponding to the first text; wherein the text interaction operation is an acceptance operation or a rejection operation on a text segment of the third text.

4. The method of claim 1, wherein, The classification of the text content of the first text comprises: determining at least one dimension of text features of each paragraph of the first text; based on the text features and a preset feature judgment rule corresponding to the text features, determining a conformity score of the text features belonging to the first type; in response to a sum value of the conformity scores of the text features of each dimension being greater than a preset threshold, determining that the paragraph belongs to the first type, or in response to a sum value of the conformity scores of the text features of each dimension being less than or equal to a preset threshold, determining that the paragraph belongs to the second type; wherein the text features comprise at least one of lexical features, syntactic features and paragraph features.

5. The method of claim 3, wherein, The training process of the text generator comprises: inputting sample text belonging to the second type into the text generator to obtain reconstructed text; inputting the reconstructed text into the first discriminator to obtain a type discrimination result, and inputting the reconstructed text and the sample text into the second discriminator to obtain a semantic discrimination result; calculate a first loss value according to the type discrimination result, the semantic discrimination result, a preset type discrimination result, and a preset semantic discrimination result; adjust parameters of the text generator according to the first loss value until the first loss value is less than a preset first threshold, and complete training of the text generator; wherein the preset type discrimination result is the first type, and the preset semantic discrimination result is that the reconstructed text is consistent in semantics with the sample text.

6. The method of claim 5, wherein, The method further includes: extracting a first semantic feature of a first text segment corresponding to the acceptance operation and a second semantic feature of a second text segment corresponding to the rejection operation obtained in at least one text generation process; update the text generator according to the first semantic feature, a reward label corresponding to the first semantic feature, the second semantic feature, and a penalty label corresponding to the second semantic feature.

7. The method of claim 6, wherein, The updating of the text generator according to the first semantic feature, the reward label corresponding to the first semantic feature, the second semantic feature, and the penalty label corresponding to the second semantic feature includes: input a new sample text into the text generator to obtain a new reconstructed text; calculate a first semantic similarity and a second semantic similarity between the new reconstructed text and the first semantic feature and the second semantic feature, respectively; calculate a second loss value according to a first weight of the reward label, a second weight of the penalty label, the first semantic similarity, and the second semantic similarity, add the second loss value and a third loss value to obtain a total loss, the third loss value being calculated according to discrimination results of the new reconstructed text by the first discriminator and the second discriminator; adjust parameters of the text generator based on the total loss until the total loss is less than a preset second threshold, and complete updating of the text generator.

8. An electronic device, comprising: The computer program is executed by the processor to enable the at least one processor to perform the AI trace elimination text generation method of any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to perform the AI trace elimination text generation method of any one of claims 1-7 when executed by the processor.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the AI trace elimination text generation method of any one of claims 1-7.