An AI-generated text post-processing method, device, medium, and equipment

By combining a text classifier model and an agent system, and utilizing integral gradient and Shapley value analysis methods, AI-generated text is refined and polished, solving the problems of insufficient naturalness and accuracy of AI-generated text and achieving efficient text quality improvement.

CN120181046BActive Publication Date: 2026-05-05HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
Filing Date
2025-02-19
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing AI-generated texts are insufficient in terms of naturalness and accuracy, making it difficult to detect and rewrite them with fine precision. In particular, in long texts, the AI-generated parts are well integrated with the human-written parts, making it difficult for existing tools to effectively distinguish and detect them, thus increasing the workload of human proofreading.

Method used

By using a pre-trained text classifier model combined with integral gradient method and Shapley value analysis, text units in AI-generated text are identified, and an agent system is used to refine the text, resulting in more natural and accurate text results.

Benefits of technology

It improves the naturalness and accuracy of AI-generated text, reduces the workload of manual proofreading, and enhances overall work efficiency, especially in industries with high text quality requirements, where it has significant application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120181046B_ABST
    Figure CN120181046B_ABST
Patent Text Reader

Abstract

This invention discloses a post-processing method, apparatus, medium, and device for AI-generated text. The application acquires the AI-generated text to be processed and inputs it into a pre-trained text classifier model. This model, trained on a pre-defined academic writing dataset and a social media text dataset, can accurately identify the portions of the AI-generated text that are generated by artificial intelligence software (the first text). Next, a pre-defined integral gradient method and Shapley value analysis method are used to perform fine-grained detection on the first text, accurately identifying each AI-generated text unit. Finally, these AI-generated text units are input into a pre-defined Agent system. The Agent system uses a generative language model to refine these units, outputting more natural and accurate text results. This application effectively solves the problems of insufficient naturalness and accuracy in existing AI-generated text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of post-processing of AI-generated text, and more particularly to a method, apparatus, medium, and device for post-processing AI-generated text. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, especially the advancements in natural language processing (NLP), AI-generated text has been widely applied in various fields such as content creation, translation, customer service, and marketing copywriting. However, although these texts have reached a certain level in terms of grammatical structure and information delivery, significant problems remain, particularly regarding naturalness and accuracy. AI-generated text often lacks the emotion, style, and personality of human writing, and may contain overly literal expressions, repetitive wording, or illogical statements. Furthermore, AI models, trained on large amounts of data, sometimes generate errors or misleading information, especially in professional fields such as medicine and law, affecting the credibility of the text. While existing AI detection tools can determine whether text was generated by AI, they have limitations in fine-grained analysis, struggling to capture subtle unnatural or erroneous parts, and lack effective post-editing mechanisms, increasing the workload and cost of manual proofreading.

[0003] Many industries have gradually recognized the importance of text quality control and proofreading, alongside the increased productivity of AI-generated text. Therefore, developing a technology capable of precisely detecting and rewriting errors in AI-generated text has become an urgent need. This would not only improve text quality and credibility but also reduce the workload of manual proofreading, thereby increasing overall efficiency. Current technology falls short in accurately detecting potential errors and unnatural parts in AI-generated text, especially in long texts where the AI-generated parts blend well with human-written parts, making effective differentiation and detection difficult. These issues result in insufficient naturalness and accuracy in existing AI-generated text technologies. Summary of the Invention

[0004] This invention provides a post-processing method, apparatus, medium, and device for AI-generated text to address the issues of insufficient naturalness and accuracy in existing AI-generated text.

[0005] Firstly, this application provides a post-processing method for AI-generated text, including:

[0006] Obtain the AI-generated text to be processed;

[0007] The AI-generated text is input into a pre-trained text classifier model so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software;

[0008] The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset.

[0009] Based on the preset integral gradient method and the preset Shapley value analysis method, the first text is detected to obtain each AI-generated text unit in the first text;

[0010] Each AI-generated text unit is input into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit.

[0011] This application acquires AI-generated text to be processed and then inputs it into a pre-trained text classifier model. This model, trained on pre-defined academic writing datasets and social media text datasets, accurately identifies the portions of the AI-generated text that are generated by artificial intelligence software (the first text). Next, a pre-defined integral gradient method and Shapley value analysis method are used to perform fine-grained detection on the first text, accurately identifying each AI-generated text unit. Finally, these AI-generated text units are input into a pre-defined Agent system. The Agent system uses a generative language model to refine these units, outputting a more natural and accurate text result. This process not only improves the naturalness and accuracy of the text but also reduces the workload of manual proofreading, improving overall work efficiency. This application effectively solves the problem of insufficient naturalness and accuracy in existing AI-generated text.

[0012] As a preferred embodiment of the first aspect, the text classifier model is trained on an initial text classifier based on a preset academic writing dataset and a preset social media text dataset, specifically as follows:

[0013] Obtain the preset academic writing dataset and the preset social media text dataset;

[0014] The preset academic writing dataset and the preset social media dataset are input into the initial text classifier so that the initial text classifier adjusts the weights and biases according to the preset supervised learning principle.

[0015] When the loss function of the initial text classifier reaches a preset threshold and no longer changes within a preset time period, training stops, and the text classifier model is obtained.

[0016] In this preferred embodiment, this application trains an initial text classifier using a pre-defined academic writing dataset and a social media text dataset, achieving efficient recognition and classification of AI-generated text. Specifically, these two datasets are first acquired and then input into the initial text classifier. Supervised learning principles are used to adjust the model's weights and biases. Training stops when the model's loss function reaches a preset threshold and remains unchanged within a preset time period, resulting in the final text classification model. This process not only ensures the model has strong generalization ability across different types of text but also improves its accuracy and reliability. The text classifier trained in this way can more accurately recognize AI-generated text, providing a solid foundation for subsequent fine-grained detection and polishing. This significantly improves the overall quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and increases work efficiency. It has significant application value, especially in industries with high text quality requirements, such as academia, law, and medicine.

[0017] As a preferred embodiment of the first aspect, the acquisition of the preset academic writing dataset and the preset social media text dataset specifically includes:

[0018] The preset academic writing dataset includes various academic papers, research reports, and technical documents;

[0019] The preset social media text dataset includes articles, blogs, and comments published on various social media platforms.

[0020] In this preferred embodiment, this application ensures the diversity and representativeness of the training data by selecting an academic writing dataset containing various academic papers, research reports, and technical documents, as well as a social media text dataset covering articles, blogs, and comments published on various social media platforms. This dataset selection allows the text classifier to learn across a wide range of text types, thereby improving its ability to distinguish between AI-generated text and human-created text. Specifically, the academic writing dataset provides rigorous language styles and structured text examples, while the social media text dataset contributes more free and flexible expressions. By combining these two types of datasets for training, the text classifier can more comprehensively understand and recognize different text features, thereby improving its accuracy and generalization ability in practical applications.

[0021] As a preferred embodiment of the first aspect, the step of detecting the first text according to a preset integral gradient method and a preset Shapley value analysis method to obtain each AI-generated text unit in the first text specifically involves:

[0022] Based on the preset integral gradient method, the gradients of each text unit in the first text for the output of the text classification model are calculated.

[0023] Based on the gradients, the importance scores of each text unit in the first text contributing to the output prediction of the text classification model are calculated.

[0024] Based on the preset Shapley value analysis method, the contribution of each text unit to the prediction result output by the text classification model is quantified, and the fair contribution value of each text unit is determined.

[0025] Based on the importance scores and the fair contribution values, each AI-generated text unit in the first text is identified.

[0026] The formula for quantifying the contribution of each text unit to the prediction result output by the text classification model, based on the preset Shapley value analysis method, is as follows:

[0027]

[0028] In the formula, P {AI} (S) represents the probability that the text classifier model predicts a text as belonging to the first text generated by the artificial intelligence software, given input from a subset S. {AI} (S∪{x i}) represents adding feature {x} to subset S. i Afterwards, the text classifier model predicts a second probability that the text belongs to the first text generated by the artificial intelligence software; φ i Representing feature {x i The Shapley value of} is used to quantify the feature {x}. i The contribution of} to the prediction results of the text classifier; Preset weights.

[0029] The formula for calculating the importance scores of each text unit in the first text to the output prediction of the text classification model based on the gradients is as follows:

[0030]

[0031] In the formula, x i This represents the $i$-th feature value of the input $x$; i ′ Indicates baseline input x i ′ The $i$-th eigenvalue; α represents a scaling factor from 0 to 1. Let F represent the partial derivative of the text classifier model F with respect to the i-th feature of the input x, i.e., each gradient.

[0032] In this preferred embodiment, this application employs a pre-defined integral gradient method and Shapley value analysis method to perform fine-grained detection on AI-generated text, enabling accurate identification of erroneous units in the text. Specifically, the integral gradient method is first used to calculate the gradient of each unit in the text with respect to the classification model's output, thereby deriving the importance score of these units' contribution to the model's prediction. Next, the Shapley value analysis method is used to quantify the contribution of each unit to the model's output prediction result, determining its fair contribution value. Combining the importance score and the fair contribution value, the system can accurately identify erroneous units in the text. This process not only improves the accuracy of text detection but also enhances the transparency and interpretability of model decisions, providing clear guidance for subsequent text optimization. This effectively improves the quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and improves overall work efficiency.

[0033] In a preferred embodiment of the first aspect, the step of inputting each AI-generated text unit into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit, specifically involves:

[0034] Each AI-generated text unit is input into a preset Agent system, which then calls various preset tools and preset generative language models to output the polished results of each AI-generated text unit.

[0035] In this preferred embodiment, this application achieves automated polishing and optimization of identified erroneous text units by inputting them into a pre-defined Agent system. Specifically, the Agent system utilizes various pre-defined tools and generative language models to generate more natural and accurate polished results for each erroneous text unit. This process not only significantly improves the naturalness and accuracy of the text but also reduces the need for manual intervention, thereby enhancing the efficiency and quality of text processing. In this way, this application not only solves the problems of unnaturalness and errors in AI-generated text but also improves the overall readability and professionalism of the text, especially in fields with high text quality requirements, such as academia, law, and medicine, where it has significant practical application value.

[0036] Secondly, this application provides a post-processing device for AI-generated text. The AI-generated text post-processing device includes an acquisition module, a first input / output module, a detection module, and a second input / output module;

[0037] The acquisition module is used to acquire the AI-generated text to be processed;

[0038] The first input / output module is used to input the AI-generated text into a pre-trained text classifier model, so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software;

[0039] The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset.

[0040] The detection module is used to detect the first text according to a preset integral gradient method and a preset Shapley value analysis method, and obtain each AI-generated text unit in the first text.

[0041] The second input / output module is used to input the text units generated by each AI into a preset Agent system, so that the Agent system outputs the polishing results of the text units generated by each AI.

[0042] This device utilizes four modules that work in a coordinated manner to process AI-generated text more accurately. The process involves acquiring the AI-generated text to be processed and then inputting it into a pre-trained text classifier model. This model, trained on pre-defined academic writing and social media text datasets, accurately identifies the portions of the AI-generated text that are generated by artificial intelligence software (the first text). Next, a pre-defined integral gradient method and Shapley value analysis method are used to perform fine-grained detection on the first text, accurately identifying each AI-generated text unit. Finally, these AI-generated text units are input into a pre-defined Agent system. The Agent system uses a generative language model to refine these units, outputting a more natural and accurate text result. This process not only improves the naturalness and accuracy of the text but also reduces the workload of manual proofreading, increasing overall efficiency. This application effectively solves the problem of insufficient naturalness and accuracy in existing AI-generated text technologies.

[0043] Thirdly, this application provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a post-processing method for AI-generated text as described above. Its beneficial effects are the same as those of the post-processing method for AI-generated text provided in the first aspect of this application.

[0044] Fourthly, this application provides a terminal device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement any of the AI-generated text post-processing methods described in the first aspect. Attached Figure Description

[0045] Figure 1 : A flowchart illustrating an embodiment of the post-processing method for AI-generated text provided in this application;

[0046] Figure 2 : A schematic flowchart of an embodiment of the AI-generated text post-processing apparatus provided in this application. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] Example 1

[0049] Please refer to Figure 1 This invention provides a post-processing method for AI-generated text.

[0050] In this embodiment, steps S01-S04 are used to describe in detail the post-processing method of AI-generated text in this application.

[0051] S01: Obtain the AI-generated text to be processed.

[0052] As a preferred embodiment of Embodiment 1, the AI-generated text refers to text content generated by artificial intelligence models (such as GPT, BERT, etc.). These texts are typically trained by learning from a large amount of data, thereby automatically generating language output related to the input.

[0053] S02: Input the AI-generated text into a pre-trained text classifier model so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software.

[0054] The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset.

[0055] As a preferred embodiment of Example 1, the text classifier model is obtained by training an initial text classifier based on a preset academic writing dataset and a preset social media text dataset, specifically as follows:

[0056] First, a text classification model is built based on a pre-trained language model. This model will be trained on two main datasets:

[0057] Academic Writing Dataset: This dataset contains various academic papers, research reports, technical documents, etc., and the texts usually have a clear structure and a rigorous language style.

[0058] Social Media Dataset: This dataset contains articles, blogs, comments, etc. published on social platforms. The text style is relatively free and the grammatical structure is relatively flexible.

[0059] The use of these two datasets ensures that the classifier can generalize well across different types of text, distinguishing between AI-generated text and human-created text.

[0060] During training, a labeled training dataset provides the basis for supervised learning for the model, enabling it to identify which parts of the text are more likely to be generated by AI. Once training is complete, the model is able to assign a label to each part of the input text (e.g., a sentence or phrase) indicating whether it is highly or lowly generated by AI.

[0061] In this preferred embodiment, this application trains an initial text classifier using a pre-defined academic writing dataset and a social media text dataset, achieving efficient recognition and classification of AI-generated text. Specifically, these two datasets are first acquired and then input into the initial text classifier. Supervised learning principles are used to adjust the model's weights and biases. Training stops when the model's loss function reaches a preset threshold and remains unchanged within a preset time period, resulting in the final text classification model. This process not only ensures the model has strong generalization ability across different types of text but also improves its accuracy and reliability. The text classifier trained in this way can more accurately recognize AI-generated text, providing a solid foundation for subsequent fine-grained detection and polishing. This significantly improves the overall quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and increases work efficiency. It has significant application value, especially in industries with high text quality requirements, such as academia, law, and medicine.

[0062] S03: Based on the preset integral gradient method and the preset Shapley value analysis method, the first text is detected to obtain each AI-generated text unit in the first text.

[0063] As a preferred embodiment of Example 1, the step of detecting the first text according to a preset integral gradient method and a preset Shapley value analysis method to obtain each AI-generated text unit in the first text specifically involves:

[0064] Based on the preset Integral Gradient Method, the gradients of each text unit in the first text for the output of the text classification model are calculated.

[0065] Based on the gradients, the importance scores of each text unit in the first text contributing to the output prediction of the text classification model are calculated.

[0066] Based on the preset Shapley value analysis method, the contribution of each text unit to the prediction result output by the text classification model is quantified, and the fair contribution value of each text unit is determined.

[0067] Based on the importance scores and the fair contribution values, each AI-generated text unit in the first text is identified.

[0068] The pre-defined integral gradient method assigns an importance score to each input feature by calculating the gradient of each input feature (such as words, sentences, etc.) relative to the model output. This score indicates the degree to which the feature contributes to the model's prediction result.

[0069] More specifically, for text data, integral gradients can be used to quantify the contribution of each part of the text (such as words or phrases) to AI predictions. The core idea is to determine the importance of each input feature by calculating the gradient integral of the model along a straight path between the input and the baseline (usually an all-zero vector or blank input).

[0070]

[0071] Where: x i Input the $i$-th feature value of $x$; i ′ Baseline input x i ′ The $i$-th eigenvalue; α: a scaling factor from 0 to 1 used for interpolation between the baseline input and the actual input; The partial derivative of model F with respect to the i-th feature of input x represents the instantaneous effect of that feature on the model output.

[0072] By calculating the integral gradient value of each feature, the contribution of each part of the text to the model's prediction can be quantified. The specific steps are as follows:

[0073] Choose a baseline input: Typically, choose a zero vector of the same length as the actual input, or another semantically neutral input.

[0074] Generate interpolated inputs and compute gradients: For each interpolated input, compute the partial derivative of the trained detector model output with respect to each input feature.

[0075] 1. Approximate integration: Average the gradients over all interpolated inputs and multiply by (xx). ′ This yields an approximate integral gradient value for each feature.

[0076] 2. Attribution analysis: Based on the magnitude of the integral gradient value, evaluate the contribution of each feature (i.e., each part of the text) to the model's prediction.

[0077] The pre-defined Shapley value analysis method quantifies the contribution of each input feature to the final prediction result by perturbing the input features and observing the changes in the model prediction. The Shapley value can provide a fairer and more transparent analysis, ensuring that the contribution of each input feature is reasonably evaluated.

[0078] More specifically, for the input text X = [x1, x2, ..., x...] n The text can be decomposed into n sub-words. The Shapley value of each sub-word quantifies its contribution to the model's prediction of the probability of AI-generated text. The formula is as follows:

[0079]

[0080] In this formula, P {AI} (S) represents the probability that the model predicts the text to be AI-generated given input from a subset S. S can be achieved by masking non-S sub-words (e.g., removing them). P {AI} (S∪{x i}) represents adding feature {x} to subset S. i After that, the model predicts the probability of the AI ​​generating text. The output result is φ. i Representing feature {x i The Shapley value of} is used to quantify the contribution of the feature to the prediction result. It is a weight that ensures the Shapley value contributes fairly to all combinations. For different levels of prediction input, such as word level, the input is text (breaking sentences into words), and the Shapley value φ for each word is... i The value indicates the magnitude of the word's contribution to the prediction. At the sentence level, the document is broken down into sentences, and the input text consists of each of these sentences. The Shapley value represents the contribution of each sentence to the prediction of the text paragraph.

[0081] In this preferred embodiment, this application employs a pre-defined integral gradient method and Shapley value analysis method to perform fine-grained detection on AI-generated text, enabling accurate identification of erroneous units in the text. Specifically, the integral gradient method is first used to calculate the gradient of each unit in the text with respect to the classification model's output, thereby deriving the importance score of these units' contribution to the model's prediction. Next, the Shapley value analysis method is used to quantify the contribution of each unit to the model's output prediction result, determining its fair contribution value. Combining the importance score and the fair contribution value, the system can accurately identify erroneous units in the text. This process not only improves the accuracy of text detection but also enhances the transparency and interpretability of model decisions, providing clear guidance for subsequent text optimization. This effectively improves the quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and improves overall work efficiency.

[0082] S04: Input each AI-generated text unit into a preset Agent system so that the Agent system outputs the polishing results of each AI-generated text unit.

[0083] As a preferred embodiment of Embodiment 1, the step of inputting each AI-generated text unit into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit, specifically involves:

[0084] After detecting portions of AI-generated text, the Agent system initiates and performs subsequent processing. The Agent can invoke various tools and models (such as generative models like GPT-4) to modify and refine the text.

[0085] The agent rewrites and polishes the AI-generated portion by producing more natural content that aligns with human language expression habits. Depending on the text's application scenario (such as academic, social media, or business copywriting), the agent adjusts the text's tone, structure, and vocabulary choices to better suit the target style.

[0086] If a section cannot be effectively modified, the Agent will provide alternative text or modification suggestions for human editors to refer to.

[0087] This application acquires AI-generated text to be processed and then inputs it into a pre-trained text classifier model. This model, trained on pre-defined academic writing datasets and social media text datasets, accurately identifies the portions of the AI-generated text that are generated by artificial intelligence software (the first text). Next, a pre-defined integral gradient method and Shapley value analysis method are used to perform fine-grained detection on the first text, accurately identifying each AI-generated text unit. Finally, these AI-generated text units are input into a pre-defined Agent system. The Agent system uses a generative language model to refine these units, outputting a more natural and accurate text result. This process not only improves the naturalness and accuracy of the text but also reduces the workload of manual proofreading, improving overall work efficiency. This application effectively solves the problem of insufficient naturalness and accuracy in existing AI-generated text.

[0088] Example 2

[0089] Please refer to Figure 2 This is a post-processing device for AI-generated text provided in the embodiments of this application.

[0090] In this embodiment, the post-processing device for AI-generated text includes an acquisition module 10, a first input / output module 20, a detection module 30, and a second input / output module 40.

[0091] The acquisition module 10 is used to acquire the AI-generated text to be processed.

[0092] As a preferred embodiment of Embodiment 2, the AI-generated text refers to text content generated by artificial intelligence models (such as GPT, BERT, etc.). These texts are usually trained by learning from a large amount of data, thereby automatically generating language output related to the input.

[0093] The first input / output module 20 is used to input the AI-generated text into a pre-trained text classifier model, so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software.

[0094] The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset.

[0095] As a preferred embodiment of Example 2, the text classifier model is trained on an initial text classifier based on a preset academic writing dataset and a preset social media text dataset, specifically as follows:

[0096] First, a text classification model is built based on a pre-trained language model. This model will be trained on two main datasets:

[0097] Academic Writing Dataset: This dataset contains various academic papers, research reports, technical documents, etc., and the texts usually have a clear structure and a rigorous language style.

[0098] Social Media Dataset: This dataset contains articles, blogs, comments, etc. published on social platforms. The text style is relatively free and the grammatical structure is relatively flexible.

[0099] The use of these two datasets ensures that the classifier can generalize well across different types of text, distinguishing between AI-generated text and human-created text.

[0100] During training, a labeled training dataset provides the basis for supervised learning for the model, enabling it to identify which parts of the text are more likely to be generated by AI. Once training is complete, the model is able to assign a label to each part of the input text (e.g., a sentence or phrase) indicating whether it is highly or lowly generated by AI.

[0101] In this preferred embodiment, this application trains an initial text classifier using a pre-defined academic writing dataset and a social media text dataset, achieving efficient recognition and classification of AI-generated text. Specifically, these two datasets are first acquired and then input into the initial text classifier. Supervised learning principles are used to adjust the model's weights and biases. Training stops when the model's loss function reaches a preset threshold and remains unchanged within a preset time period, resulting in the final text classification model. This process not only ensures the model has strong generalization ability across different types of text but also improves its accuracy and reliability. The text classifier trained in this way can more accurately recognize AI-generated text, providing a solid foundation for subsequent fine-grained detection and polishing. This significantly improves the overall quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and increases work efficiency. It has significant application value, especially in industries with high text quality requirements, such as academia, law, and medicine.

[0102] The detection module 30 is used to detect the first text according to a preset integral gradient method and a preset Shapley value analysis method, and obtain each AI-generated text unit in the first text.

[0103] As a preferred embodiment of Embodiment 2, the step of detecting the first text according to a preset integral gradient method and a preset Shapley value analysis method to obtain each AI-generated text unit in the first text specifically involves:

[0104] Based on the preset Integral Gradient Method, the gradients of each text unit in the first text for the output of the text classification model are calculated.

[0105] Based on the gradients, the importance scores of each text unit in the first text contributing to the output prediction of the text classification model are calculated.

[0106] Based on the preset Shapley value analysis method, the contribution of each text unit to the prediction result output by the text classification model is quantified, and the fair contribution value of each text unit is determined.

[0107] Based on the importance scores and the fair contribution values, each AI-generated text unit in the first text is identified.

[0108] The pre-defined integral gradient method assigns an importance score to each input feature by calculating the gradient of each input feature (such as words, sentences, etc.) relative to the model output. This score indicates the degree to which the feature contributes to the model's prediction result.

[0109] More specifically, for text data, integral gradients can be used to quantify the contribution of each part of the text (such as words or phrases) to AI predictions. The core idea is to determine the importance of each input feature by calculating the gradient integral of the model along a straight path between the input and the baseline (usually an all-zero vector or blank input).

[0110]

[0111] Where: x i Input the $i$-th feature value of $x$; i ′ Baseline input x i ′ The $i$-th eigenvalue; α: a scaling factor from 0 to 1 used for interpolation between the baseline input and the actual input; The partial derivative of model F with respect to the i-th feature of input x represents the instantaneous effect of that feature on the model output.

[0112] By calculating the integral gradient value of each feature, the contribution of each part of the text to the model's prediction can be quantified. The specific steps are as follows:

[0113] Choose a baseline input: Typically, choose a zero vector of the same length as the actual input, or another semantically neutral input.

[0114] Generate interpolated inputs and compute gradients: For each interpolated input, compute the partial derivative of the trained detector model output with respect to each input feature.

[0115] 1. Approximate integration: Average the gradients over all interpolated inputs and multiply by (xx). ′ This yields an approximate integral gradient value for each feature.

[0116] 2. Attribution analysis: Based on the magnitude of the integral gradient value, evaluate the contribution of each feature (i.e., each part of the text) to the model's prediction.

[0117] The pre-defined Shapley value analysis method quantifies the contribution of each input feature to the final prediction result by perturbing the input features and observing the changes in the model prediction. The Shapley value can provide a fairer and more transparent analysis, ensuring that the contribution of each input feature is reasonably evaluated.

[0118] More specifically, for the input text X = [x1, x2, ..., x...] n The text can be decomposed into n sub-words. The Shapley value of each sub-word quantifies its contribution to the model's prediction of the probability of AI-generated text. The formula is as follows:

[0119]

[0120] In this formula, P {AI} (S) represents the probability that the model predicts the text to be AI-generated given input from a subset S. S can be achieved by masking non-S sub-words (e.g., removing them). P {AI} (S∪{x i}) represents adding feature {x} to subset S. i After that, the model predicts the probability of the AI ​​generating text. The output result is φ. i Representing feature {x i The Shapley value of} is used to quantify the contribution of the feature to the prediction result. It is a weight that ensures the Shapley value contributes fairly to all combinations. For different levels of prediction input, such as word level, the input is text (breaking sentences into words), and the Shapley value φ for each word is... i The value indicates the magnitude of the word's contribution to the prediction. At the sentence level, the document is broken down into sentences, and the input text consists of each of these sentences. The Shapley value represents the contribution of each sentence to the prediction of the text paragraph.

[0121] In this preferred embodiment, this application employs a pre-defined integral gradient method and Shapley value analysis method to perform fine-grained detection on AI-generated text, enabling accurate identification of erroneous units in the text. Specifically, the integral gradient method is first used to calculate the gradient of each unit in the text with respect to the classification model's output, thereby deriving the importance score of these units' contribution to the model's prediction. Next, the Shapley value analysis method is used to quantify the contribution of each unit to the model's output prediction result, determining its fair contribution value. Combining the importance score and the fair contribution value, the system can accurately identify erroneous units in the text. This process not only improves the accuracy of text detection but also enhances the transparency and interpretability of model decisions, providing clear guidance for subsequent text optimization. This effectively improves the quality and naturalness of AI-generated text, reduces the workload of manual proofreading, and improves overall work efficiency.

[0122] The second input / output module 40 is used to input the text units generated by each AI into a preset Agent system, so that the Agent system outputs the polishing results of the text units generated by each AI.

[0123] As a preferred embodiment of Embodiment 2, the step of inputting each AI-generated text unit into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit, specifically involves:

[0124] After detecting portions of AI-generated text, the Agent system initiates and performs subsequent processing. The Agent can invoke various tools and models (such as generative models like GPT-4) to modify and refine the text.

[0125] The agent rewrites and polishes the AI-generated portion by producing more natural content that aligns with human language expression habits. Depending on the text's application scenario (such as academic, social media, or business copywriting), the agent adjusts the text's tone, structure, and vocabulary choices to better suit the target style.

[0126] If a section cannot be effectively modified, the Agent will provide alternative text or modification suggestions for human editors to refer to.

[0127] This application acquires AI-generated text to be processed and then inputs it into a pre-trained text classifier model. This model, trained on pre-defined academic writing datasets and social media text datasets, accurately identifies the portions of the AI-generated text that are generated by artificial intelligence software (the first text). Next, a pre-defined integral gradient method and Shapley value analysis method are used to perform fine-grained detection on the first text, accurately identifying each AI-generated text unit. Finally, these AI-generated text units are input into a pre-defined Agent system. The Agent system uses a generative language model to refine these units, outputting a more natural and accurate text result. This process not only improves the naturalness and accuracy of the text but also reduces the workload of manual proofreading, improving overall work efficiency. This application effectively solves the problem of insufficient naturalness and accuracy in existing AI-generated text.

[0128] Example 3:

[0129] This application provides a computer-readable storage medium including a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the AI-generated text post-processing method.

[0130] The AI-generated text post-processing method, when implemented as a software functional unit and used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0131] Example 4

[0132] This application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any of the AI-generated text post-processing methods described in Embodiment 1.

[0133] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A post-processing method for AI-generated text, characterized in that, include: Obtain the AI-generated text to be processed; The AI-generated text is input into a pre-trained text classifier model so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software; The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset. Based on a preset integral gradient method and a preset Shapley value analysis method, the first text is detected to obtain each AI-generated text unit in the first text, specifically: Based on the preset integral gradient method, the gradients of each text unit in the first text to the output of the text classifier model are calculated. Based on the gradients, the importance scores of each text unit in the first text contributing to the output prediction of the text classifier model are calculated. Based on the preset Shapley value analysis method, the contribution of each text unit to the prediction result output by the text classifier model is quantified, and the fair contribution value of each text unit is determined. Based on the importance scores and the fair contribution values, each AI-generated text unit in the first text is identified; Each AI-generated text unit is input into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit.

2. The post-processing method for AI-generated text according to claim 1, characterized in that, The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset, specifically as follows: Obtain the preset academic writing dataset and the preset social media text dataset; The preset academic writing dataset and the preset social media dataset are input into the initial text classifier so that the initial text classifier adjusts the weights and biases according to the preset supervised learning principle. When the loss function of the initial text classifier reaches a preset threshold and no longer changes within a preset time period, training stops, and the text classifier model is obtained.

3. The post-processing method for AI-generated text according to claim 2, characterized in that, The acquisition of the preset academic writing dataset and the preset social media text dataset specifically involves: The preset academic writing dataset includes various academic papers, research reports, and technical documents; The preset social media text dataset includes articles, blogs, and comments published on various social media platforms.

4. The post-processing method for AI-generated text according to claim 1, characterized in that, The step of quantifying the contribution of each text unit to the prediction result output by the text classifier model according to the preset Shapley value analysis method is as follows: The formula for quantifying the contribution of each text unit to the prediction result output by the text classifier model, based on the preset Shapley value analysis method, is as follows: ; In the formula, Given a subset S as input, the text classifier model predicts a first probability that the text belongs to the first text generated by the artificial intelligence software. This represents adding features to subset S. Then, the text classifier model predicts a second probability that the text belongs to the first text generated by the artificial intelligence software; Representation of features Shapley values ​​are used to quantify features. The contribution to the prediction results of the text classifier; Preset weights.

5. The post-processing method for AI-generated text according to claim 1, characterized in that, The step of calculating the importance scores of each text unit in the first text to the output prediction of the text classifier model based on the gradients is as follows: The formula for calculating the importance scores of each text unit in the first text to the output prediction of the text classifier model based on the gradients is as follows: In the formula, This represents the i-th feature value of the input x; Indicates baseline input The i-th eigenvalue; The scale factor represents a range from 0 to 1. Text classifier model For input The partial derivative of the i-th feature, i.e., each gradient.

6. The post-processing method for AI-generated text according to claim 1, characterized in that, The step of inputting each AI-generated text unit into a preset Agent system, so that the Agent system outputs the polishing results of each AI-generated text unit, specifically involves: Each AI-generated text unit is input into a preset Agent system, which then calls various preset tools and preset generative language models to output the polished results of each AI-generated text unit.

7. A post-processing device for AI-generated text, characterized in that, It includes an acquisition module, a first input / output module, a detection module, and a second input / output module; The acquisition module is used to acquire the AI-generated text to be processed; The first input / output module is used to input the AI-generated text into a pre-trained text classifier model, so that the text classifier model outputs the first text in the AI-generated text that belongs to the artificial intelligence software; The text classifier model is trained on an initial text classifier based on a pre-set academic writing dataset and a pre-set social media text dataset. The detection module is used to detect the first text according to a preset integral gradient method and a preset Shapley value analysis method, to obtain each AI-generated text unit in the first text, specifically: Based on the preset integral gradient method, the gradients of each text unit in the first text to the output of the text classifier model are calculated. Based on the gradients, the importance scores of each text unit in the first text contributing to the output prediction of the text classifier model are calculated. Based on the preset Shapley value analysis method, the contribution of each text unit to the prediction result output by the text classifier model is quantified, and the fair contribution value of each text unit is determined. Based on the importance scores and the fair contribution values, each AI-generated text unit in the first text is identified; The second input / output module is used to input the text units generated by each AI into a preset Agent system, so that the Agent system outputs the polishing results of the text units generated by each AI.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the post-processing method for AI-generated text as described in any one of claims 1 to 6.

9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the post-processing method for AI-generated text as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Meteorological contribution evaluation method, system and terminal for ozone pollution

    CN118112686A

  • Intelligent manuscript reviewing system and method based on AI

    CN118485060A