Automatic method for network violent speech remodeling
By constructing an evaluation index system for offensive language and a human-computer collaborative prompting framework, the problem of unstable effects in the reshaping of online violent speech was solved, and the accurate quantitative evaluation and multi-dimensional optimization of offensive language were achieved, thereby improving the reshaping effect and semantic preservation ability of the large language model.
Patent Information
- Application Number
- CN202511722021.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies lack a systematic human-computer collaborative prompting framework, resulting in unstable reshaping effects of online violent speech and difficulty in achieving the dual goals of reducing aggression and preserving semantics. Furthermore, existing methods are mostly single-dimensional optimizations, leading to an imbalance between semantic preservation and emotional naturalness in the generated text.
We constructed an assessment index system for offensive language, designed a human-computer collaborative prompting framework, extracted key linguistic clues through XGBoost+SHAP, adopted a four-layer artificial thought chain prompting system, combined with a large language model for controlled decoding, and ensured the reshaping effect through a closed-loop optimization mechanism of quantitative assessment and human-computer feedback.
It significantly improved the non-intrusive language conversion rate of large language models, increased semantic retention by 5.1%, demonstrated strong multi-topic adaptability, achieved semantic retention ≥0.85, reduced toxicity ≥20%, and achieved a user acceptance score of 4.2/5, demonstrating significant robustness across scenarios.
Smart Images

Figure CN121561202A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Natural Language Processing (NLP) and Artificial Intelligence Content Governance Technology, specifically relating to an automatic method and system for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control. Background Technology
[0002] With the widespread use of online communication, offensive language (including hate speech, cyberbullying, and toxic language) has proliferated in online comments, not only harming users' mental health but also exacerbating group conflicts and damaging the online ecosystem. Current governance methods primarily employ a "detection-deletion" paradigm, merely identifying and blocking offensive text, failing to preserve users' communication intentions and hindering the guidance of constructive expression.
[0003] Despite the powerful text generation capabilities of Large Language Models (LLMs), three core shortcomings remain in offensive language reshaping tasks: ① semantic bias leading to information distortion; ② lack of empathy hindering interpersonal understanding; and ③ residual bias affecting generation fairness. These problems stem from the insufficient perception of social context and limited fine-grained control of LLMs, making it difficult to meet the needs of accurate reshaping by simply relying on the model's spontaneous thought chain generation.
[0004] Existing text rewriting methods mostly focus on single-objective optimization (such as minimizing toxicity), neglecting semantic preservation and interpretability, resulting in output distortion or uncontrollable policies. There is a lack of feasible engineering solutions that unify fine-grained control of "functionality-clues" with "online constraint decoding - offline policy learning - closed-loop adaptation".
[0005] Human-computer collaborative methods offer a solution to the aforementioned problems by integrating human communication expertise with the language processing capabilities of models. However, the current lack of a systematic human-computer collaborative prompting framework prevents the transformation of abstract communication strategies into executable model instructions, leading to unstable reshaping effects and difficulty in simultaneously achieving the dual goals of reducing aggression and preserving semantics. Therefore, it is necessary to construct a scientific human-computer collaborative prompting system to accurately enhance the ability of large language models to reshape aggressive language.
[0006] Based on the above analysis, the problems and shortcomings of the existing technology are as follows:
[0007] (1) Currently, there is a lack of a systematic human-computer collaborative prompting framework, which makes it impossible to transform abstract communication strategies into executable model instructions, resulting in unstable reshaping effects and difficulty in achieving the dual goals of reducing aggression and preserving semantics.
[0008] (2) Existing methods are mostly single-dimensional in terms of optimization objectives (such as minimizing toxicity) and lack an optimization framework for multi-dimensional balance, resulting in an imbalance between semantic preservation and emotional naturalness in the generated text. Summary of the Invention
[0009] To address the shortcomings of existing technologies in terms of semantic preservation, emotional empathy, and policy control, this invention proposes an automatic method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable cue control.
[0010] This invention is implemented as follows: an automated method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control, the method comprising:
[0011] (1) Construct an evaluation index system for aggressive language: Based on the Chinese aggressive language dataset, 26 core linguistic cues were extracted using an interpretable machine learning model (such as XGBoost+SHAP), covering four dimensions: sentiment modulation, position modulation, attribution reconstruction, and frame breaking, to quantify the degree of language aggression;
[0012] (2) Design of human-computer collaborative prompting framework: Based on the communication adaptation theory and the principle of nonviolent communication, a four-layer artificial thought chain (ManualCoT) prompting system of "request - task - output format - strategy instruction" is constructed to make the model follow multi-dimensional communication goals when reshaping;
[0013] (3) Execution of offensive language reshaping: The offensive language to be processed is input into the large language model. The multi-layer prompting structure generated in step (2) guides the large language model to perform controlled decoding and outputs non-offensive language with semantic preservation ≥0.85 and toxicity reduction ≥20%.
[0014] (4) Remodeling effect verification and optimization: A closed-loop optimization mechanism combining quantitative evaluation and human-computer feedback is adopted. The remodeling effect is judged by toxicity index, semantic retention degree and user perception score, and the prompt parameter weight is automatically adjusted based on the evaluation results.
[0015] Furthermore, the extraction process of key linguistic clues in step (1) includes:
[0016] (1a) The XGBoost classifier is used to model the aggressive language in the COLD dataset, and the contribution of each linguistic feature to the aggressiveness determination is quantified by the SHAP method;
[0017] (1b) The optimal feature subset was selected by forward stepwise selection method with 5-fold cross-validation, and 26 core linguistic cues were identified, including emotion cues such as angry words, negative emotion words, and positive emotion words; position cues such as tentative expressions and limiting words; attribution cues such as the proportion of personal pronouns; and frame-breaking cues such as leisure words and filler words.
[0018] (1c) Establish a database of the relationship between clues and aggression, and clarify the positive or negative impact weight of each clue on language aggression.
[0019] Furthermore, the specific construction of the artificial thought chain prompting framework in step (2) includes:
[0020] (2a) Basic structure design: The requirements, objectives and output format of the reshaping task are defined using the RTF structure;
[0021] (2b) Strategy embedding: Transform the four core communication functions into specific language operation instructions, including emotion regulation instructions to increase positive emotional vocabulary and reduce anger expression, position modulation instructions to use tentative language and optimize sentence structure, attribution reconstruction instructions to change personal pronouns and express objective needs, and framework breakthrough instructions to insert humorous elements and reasonably change topics.
[0022] (2c) Example Supplement: Configure corresponding application examples for each communication strategy to form a structured prompt template.
[0023] Furthermore, the reshaping effect verification in step (4) adopts a triple evaluation mechanism:
[0024] (4a) Toxicity Quantitative Assessment: Calculate the toxicity score of the language before and after remodeling using Google Perspective API, requiring a reduction of more than 20% in the toxicity score after remodeling;
[0025] (4b) Semantic integrity assessment: The cosine similarity algorithm is used to calculate the semantic similarity between the reconstructed text and the original text to ensure that the similarity is not less than 0.85;
[0026] (4c) User experience evaluation: Collect user ratings on the effectiveness of reshaping text in reducing aggression and willingness to adopt it through questionnaires. The effective sample size should be no less than 600.
[0027] Another objective of this invention is to provide an automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control, the system comprising:
[0028] Data preprocessing module: This module receives input offensive language text, performs preprocessing operations such as word segmentation and stop word removal, and extracts linguistic features of the text based on an evaluation index system.
[0029] The prompt generation and optimization module stores and calls up the artificial thought chain prompt templates, and dynamically adjusts the strategy weights in the prompt instructions based on the features extracted by the preprocessing module.
[0030] Language reshaping execution module: integrates callable large language model interfaces (such as GPT-4, ERNIE Bot, Tongyi Qianwen, etc.), supports multi-model switching and security review mechanisms, and realizes automatic reshaping under multiple languages and themes;
[0031] The effect evaluation and adaptive optimization module realizes quantitative evaluation in three dimensions: toxicity, semantics, and experience, and drives the prompt optimization unit with reinforcement learning algorithm to achieve adaptive weight update and policy evolution.
[0032] Results storage and tracking module: Saves the original text, reshapes the text, evaluates the results, and optimizes the prompt strategy parameters.
[0033] Furthermore, the prompt generation and optimization module also includes a strategy optimization unit. This unit adjusts the combination ratio of linguistic cues for the four core communication strategies through reinforcement learning algorithms based on the feedback data from the effect evaluation and adaptive optimization module, thereby achieving adaptive optimization of the prompt framework.
[0034] Furthermore, the language reshaping execution module supports the processing of multi-topic offensive language, including sensitive topics such as race, gender, and region, and dynamically adjusts the cue weight allocation in the prompt strategy for different topics.
[0035] Furthermore, the effect evaluation and adaptive optimization module also integrates a harmful fragment marking function, which generates targeted optimization suggestions by identifying the invasive fragments remaining in the reshaped text.
[0036] Another object of the present invention is to provide a computer device, the computer device including a memory and a processor, the memory storing a computer program, the computer program being executed by the processor causing the processor to perform the steps of the automatic method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control.
[0037] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the automatic method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control.
[0038] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows:
[0039] This invention achieves precise quantitative assessment of offensive language by extracting key linguistic clues and constructing an evaluation system, providing a scientific basis for the formulation of reshaping strategies;
[0040] The designed artificial thought chain prompting framework transforms abstract communication theory into executable model instructions, significantly improving the effectiveness of large language models in reshaping aggressive language, and increasing the non-aggressive language conversion rate of GPT-3.5 and GPT-4 by 20.15% and 25.02%, respectively.
[0041] A triple evaluation mechanism was adopted to ensure that the redesigned text retains its core semantics while reducing invasiveness, improving semantic retention by 5.1% and solving the semantic bias problem of existing technologies;
[0042] The system supports flexible applications across multiple themes and models, and can be widely adapted to the needs of invasive language governance in different scenarios, providing technical support for building a healthy online ecosystem.
[0043] The system supports the reshaping of language across multiple themes (race, gender, region, ideology, etc.) and adaptive adjustment of themes, ensuring automatic balance of clue weights in different contexts.
[0044] This invention achieves semantic preservation of ≥0.85 and toxicity reduction of ≥20% through human-computer collaborative prompting and multi-objective constraint decoding mechanism, significantly improving the accuracy and controllability of non-intrusive language generation.
[0045] Experimental results show that the present invention achieves an average toxicity reduction rate of 22.4% and semantic preservation of 0.86 on multi-topic corpora, with a user acceptance score of 4.2 / 5, proving that the method has significant cross-scenario robustness. Attached Figure Description
[0046] Figure 1 This is a flowchart of an automatic method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control, provided in an embodiment of the present invention.
[0047] Figure 2 This is a diagram of an automatic system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control, provided in an embodiment of the present invention.
[0048] Figure 3 This is an overall flowchart provided in the embodiments of the present invention;
[0049] Figure 4 This is a graph showing the performance variation of the key linguistic clue screening model provided in this embodiment of the invention;
[0050] Figure 5 This is a SHAP value analysis chart of the four core communication functions provided in the embodiments of the present invention;
[0051] Figure 6 This is a comparison chart of toxicity scores before and after text reshaping on different themes, provided in an embodiment of the present invention;
[0052] Figure 7 This is a comparison chart of user evaluation results provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0054] like Figure 1 , Figure 3 As shown, this embodiment of the invention provides an automated method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control. The method includes:
[0055] S101, Constructing an indicator system for assessing offensive language:
[0056] Training samples were constructed based on an ethically reviewed Chinese online comment dataset, which included multi-dimensional features with infringement annotations, semantic hierarchy, and sentiment labels to quantify the model's discriminative ability.
[0057] S102, Design a human-computer collaborative prompting framework:
[0058] Through a dual-chain prompting structure that integrates human expert strategy and model self-generated thought chain (AutoCoT), the autonomous generation of the model and human strategy control are dynamically balanced.
[0059] S103, Implementation of Aggressive Language Remodeling:
[0060] By using a custom prompting strategy to simultaneously input the text to be processed and the cue features into the model, and implementing token-level control and sentence-level soft decoding during the generation stage, the stability and repeatability of the reshaping results can be guaranteed.
[0061] S104, Reshaping Effect Verification and Optimization:
[0062] A combination of predictive modeling and manual evaluation was used to verify the reshaping effect from three dimensions: toxicity score, semantic retention, and user acceptance. Based on the verification results, the weights of linguistic cues and the combination of strategies in the prompt framework were iteratively optimized.
[0063] This invention provides an automated method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control, which further includes:
[0064] A multi-objective pre-training and constrained decoding fusion method: using four major functions (Emotion Regulation, Stance Modulation, Attribution Reshaping, and Framing) and 26 linguistic cues as control panels, it jointly minimizes toxicity loss. semantic loss With style control loss In the inference phase, hard / soft constraints are implemented using differentiable proxies and vocabulary biases;
[0065] SHAP-based policy prototype and threshold learning: "Policy prototype clusters" are formed by clustering SHAP contribution profiles. The "clue-threshold-result" rule is learned through an interpretable agent and fed back into the training weights, decoding biases and cue templates to form a closed loop.
[0066] The input sentence is (x), and the output is (y).
[0067] A semantic encoder is denoted as... Used to map sentences to vector representations .
[0068] The semantic preservation between sentence pairs is calculated using cosine similarity:
[0069]
[0070] External or distillation toxicity scorer .
[0071] Clue Extractor Output .
[0072] Four major function mappings .
[0073] The extraction process of key linguistic clues in step (1) includes:
[0074] (1a) The XGBoost classifier is used to model the aggressive language in the COLD dataset, and the contribution of each linguistic feature to the aggressiveness determination is quantified by the SHAP method;
[0075] (1b) The optimal feature subset was selected by forward stepwise selection method with 5-fold cross-validation, and 26 core linguistic cues were identified, including emotion cues such as angry words, negative emotion words, and positive emotion words; position cues such as tentative expressions and limiting words; attribution cues such as the proportion of personal pronouns; and frame-breaking cues such as leisure words and filler words.
[0076] (1c) Establish a database of the relationship between clues and aggression, and clarify the positive or negative impact weight of each clue on language aggression.
[0077] The specific construction of the artificial thought chain prompting framework in step (2) includes:
[0078] (2a) Basic structure design: The requirements, objectives and output format of the reshaping task are defined using the RTF structure;
[0079] (2b) Strategy embedding: Transform the four core communication functions into specific language operation instructions, including emotion regulation instructions to increase positive emotional vocabulary and reduce anger expression, position modulation instructions to use tentative language and optimize sentence structure, attribution reconstruction instructions to change personal pronouns and express objective needs, and framework breakthrough instructions to insert humorous elements and reasonably change topics.
[0080] (2c) Example Supplement: Configure corresponding application examples for each communication strategy to form a structured prompt template.
[0081] The reshaping effect verification in step (4) adopts a triple evaluation mechanism:
[0082] (4a) Toxicity Quantitative Assessment: Calculate the toxicity score of the language before and after remodeling using Google Perspective API, requiring a reduction of more than 20% in the toxicity score after remodeling;
[0083] (4b) Semantic integrity assessment: The cosine similarity algorithm is used to calculate the semantic similarity between the reconstructed text and the original text to ensure that the similarity is not less than 0.85;
[0084] (4c) User experience evaluation: Collect user ratings on the effectiveness of reshaping text in reducing aggression and willingness to adopt it through questionnaires. The effective sample size should be no less than 600.
[0085] like Figure 2 As shown, this embodiment of the invention provides an automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control. The system includes:
[0086] Data preprocessing module: This module receives input offensive language text, performs preprocessing operations such as word segmentation and stop word removal, and extracts linguistic features of the text based on an evaluation index system.
[0087] The prompt generation and optimization module stores and calls up the artificial thought chain prompt templates, and dynamically adjusts the strategy weights in the prompt instructions based on the features extracted by the preprocessing module.
[0088] Language reshaping execution module: integrates callable large language model interfaces (such as GPT-4, ERNIE Bot, Tongyi Qianwen, etc.), supports multi-model switching and security review mechanisms, and realizes automatic reshaping under multiple languages and themes;
[0089] The effect evaluation and adaptive optimization module realizes quantitative evaluation in three dimensions: toxicity, semantics, and experience, and drives the prompt optimization unit with reinforcement learning algorithm to achieve adaptive weight update and policy evolution.
[0090] Results storage and tracking module: Saves the original text, reshapes the text, evaluates the results, and optimizes the prompt strategy parameters.
[0091] The prompt generation and optimization module also includes a strategy optimization unit. This unit adjusts the combination ratio of linguistic cues for the four core communication strategies through reinforcement learning algorithms based on the feedback data from the effect evaluation and adaptive optimization modules, thereby achieving adaptive optimization of the prompt framework.
[0092] The language reshaping execution module supports the processing of multi-topic offensive language, including sensitive topics such as race, gender, and region, and dynamically adjusts the clue weight allocation in the prompt strategy for different topics.
[0093] The effect evaluation and adaptive optimization module also integrates a harmful fragment marking function, which generates targeted optimization suggestions by identifying and reshaping the text of offensive fragments.
[0094] Figure 4 The model's F1 and ROC-AUC values change as the number of key clues increases. The performance is optimal when the number of clues is 26 (F1=0.7892, ROC-AUC=0.8662).
[0095] Figure 5 The SHAP value demonstrates the degree of impact of each clue on the invasiveness assessment.
[0096] Figure 6 A comparison of toxicity scores for different thematic texts under AutoCoT and ManualCoT prompts showed that the ManualCoT prompts of this invention are more effective.
[0097] Figure 7 The results show the improvement trend of user experience scores after the integration of ManualCoT and AutoCoT. The difference in scores is significant after t-test (p<0.05), indicating that the dual-chain collaborative structure can effectively improve the naturalness of language.
[0098] Example 1: Specific Implementation Steps of the Method
[0099] Construction of an indicator system for assessing offensive language:
[0100] Data preparation: The COLD dataset was used, which contains 37,480 annotated comments covering topics such as race, gender, and region. It was divided into training and test sets at a ratio of 85.8% and 14.2%, respectively.
[0101] Feature extraction: The LIWC dictionary and pattern matching methods were used to extract features of the text in dimensions such as sentiment, stance, and attribution, resulting in more than 100 initial linguistic features.
[0102] Feature selection: Based on XGBoost, an L1 regularization term is introduced to suppress redundant features, and the forward stepwise method is combined to ensure that the feature subset is optimal.
[0103] Assessment criteria were established: threshold ranges were set for each clue to form a quantitative scoring system for aggressive language (maximum score of 10 points, ≥5 points is considered aggressive language).
[0104] Human-computer collaborative prompting framework design:
[0105] Basic template construction: adopting the RTF structure, with the explicit requirement to "transform offensive comments into civilized expressions, retain core viewpoints, and avoid offensive vocabulary", the task is defined as "achieving emotional de-escalation, softening of stance, attribution shift, or framing breakthrough", and the format requirement is "concise and natural Chinese sentences, with a length deviation of ≤20% from the original text".
[0106] Strategy embedding:
[0107] Emotional regulation strategies: Instructions: "Increase positive emotional vocabulary (such as 'understanding', 'suggestion'), reduce angry vocabulary (such as 'garbage', 'disgusting'), and use empathetic expressions." Example: "Original sentence: 'Your point of view is absolutely stupid!' → Restructured sentence: 'I understand you have a different opinion, but there may be some room for discussion on this point of view.'"
[0108] Strategy for modulating position: Instructions: “Use tentative language (such as ‘maybe’ or ‘perhaps’), avoid absolute statements, and add explanatory statements.” Example: “Original sentence: ‘You people don’t understand at all!’ → Restructured sentence: ‘Perhaps everyone has a different perspective on this issue, and I would like to share my views.’”
[0109] Attribution restructuring strategy: The instruction is to "transform the 'you' sentence structure into the 'I' sentence structure to express objective feelings rather than accusations". Example: "Original sentence: 'You are deliberately targeting me!' → Restructured sentence: 'I feel that I have been targeted and hope to be treated fairly'";
[0110] Framework Breakthrough Strategy: Instruction: "Appropriately add humor or change the topic to ease the atmosphere of conflict." Example: "Original sentence: 'Communicating with you is a waste of time!' → Restructured sentence: 'It seems we have some differences right now. Why don't we talk about it from a different angle and maybe we can find a consensus.'"
[0111] Invasive language reshaping implementation:
[0112] Input processing: Receives offensive text input from users, such as "People from a certain region are all selfish, none of them are good";
[0113] Cue generation: The cue framework strengthens the weight of sentiment regulation and attribution reconstruction strategies based on text features (regional themes, group aggression, strong negative emotions);
[0114] Model invocation: Input the prompt and the original text into the GPT-4 model to generate the reconstructed text: "People from different regions have their own personality traits. We cannot generalize. I think such a general evaluation is not objective."
[0115] Remodeling effect verification and optimization:
[0116] Toxicity assessment: Calculated using Google Perspective API, the original text had a toxicity score of 0.82, while the rewritten text had a score of 0.21, a reduction of 74.4%, meeting the requirement of a reduction of ≥20%.
[0117] Semantic assessment: The cosine similarity was calculated to be 0.89, which is higher than the threshold of 0.85, indicating good semantic preservation;
[0118] User evaluation: 620 valid questionnaires were collected. The effect of reducing aggression was rated 4.3 (out of 5), and the willingness to adopt it was rated 4.1 (out of 5).
[0119] Strategy optimization: Based on the evaluation results, suggestions for using vocabulary related to "regional cultural diversity" have been added to texts on regional themes, and the prompt framework has been optimized.
[0120] Example 2: System Deployment and Application
[0121] The system can be deployed in cloud or local containerized environments, is compatible with mainstream inference frameworks (such as TensorRT and ONNXRuntime), and supports horizontal scaling and parallel inference. Application scenarios include:
[0122] Social media comment governance: Real-time processing of user-posted comments, reshaping offensive content before display, and preserving reasonable opinions;
[0123] Online education dialogue filtering: processes dialogues between teachers and students, and among students themselves, to avoid language conflicts and create a civilized communication environment;
[0124] Customer service dialogue optimization: Transform aggressive user complaints into constructive feedback to improve customer service processing efficiency.
[0125] The system can achieve a real-time processing rate of 120 texts per second on average under single GPU conditions, with a processing latency of less than 1.8 seconds, meeting the online review requirements of mainstream social platforms. The response time of the language reshaping execution module is ≤2 seconds, and the time for the effect evaluation and adaptive optimization module to generate evaluation reports is ≤5 seconds, meeting the requirements of real-time applications.
[0126] Example 1: A Multi-Objective Pre-training and Inference Integration Method
[0127] 1.1 Data Preparation and Prior Construction
[0128] S101 Data Compliance and Layered Segmentation. Samples with a length in the range (5, 256) are filtered and layered according to topic and infringement intensity to obtain ( ); Upper bound of KL divergence to ensure differences in distribution across layers:
[0129]
[0130] S102 Evaluate signal construction. Calculate the toxicity score for each sentence(s). ); for pairing ( )Calculate semantic retention ( ).
[0131] S103 Clue Direction and Threshold. Information gain and monotonicity tests are performed on 26 clues to obtain their importance ( ) and desired direction ( ), and set the target interval ( ).
[0132] 1.2 Loss Function and Scalar Quantization
[0133] (1) Toxicity targets
[0134]
[0135] (2) Semantic Preservation Objectives
[0136]
[0137] (3) Style control objectives
[0138] make( Define a piecewise linear penalty function:
[0139]
[0140] but
[0141]
[0142] (4) Multi-objective scalarization
[0143]
[0144] Alternatively, weighted Chebyshev's algorithm can be used:
[0145] ,
[0146] in( ) represents the quantity after distribution normalization.
[0147] (5) Constraint Perspective
[0148]
[0149] 1.3 Expert Knowledge Learning and Optimization
[0150] The training iterations are divided into three stages, and the time (t) is adaptively adjusted. ):
[0151]
[0152] in( The optimizer uses AdamW with cosine annealing for the learning rate; it is developed to select checkpoints based on Pareto fronts.
[0153] 1.4 Constraint Decoding and Adaptive Control
[0154] (1) Decoding score lets the candidate prefix be ( ),but:
[0155] ,
[0156] in( ) and( Isomorphism, ( ) represents the online adjustable coefficient.
[0157] (2) Lexical bias applies a negative bias to the word classes that promote infringement. Apply a positive bias to the buffered filament. ), and set a "minimum coverage" constraint ( ).
[0158] (3) Adaptive law if ( The rise amplitude exceeds the threshold in adjacent steps. ),but( )(( If the predicted semantic similarity decreases, then the semantically related cost coefficient is increased.
[0159] (4) Gating and backoff output ( ) Must meet
[0160]
[0161] Otherwise, trigger a prompt or edit-style post-processing to ensure minimal distortion of entities and key information.
[0162] 1.5 Indicators and Acceptance
[0163] The system uses "infringement conversion rate", "semantic retention rate", "lead compliance rate" and "topic robustness" as multi-dimensional KPIs, and adopts the Pareto optimality criterion to select the deployment model.
[0164] Example 2: SHAP-based policy prototype and threshold learning
[0165] 1.1 Predictor and SHAP Calculation
[0166] Training a text infringement predictor ( (e.g., XGBoost or RoBERTa-GRU), calculate the SHAP matrix for the evaluation set samples:
[0167] ,
[0168] And standardize ( ).
[0169] 1.2 Feature Forward Filtering
[0170] With global (| |) Importance ranking is performed by forward insertion, when the validation set performance gain ( That is, stop, and you get the simplified set ( ).
[0171] 1.3 SHAP Profile Clustering
[0172] Profile vector for each sample ( Similarity measures (cosine or correlation coefficient) are performed, and hierarchical clustering or spectral clustering is used to obtain (K) clusters:
[0173]
[0174] 1.4 Cluster-level strategy profile
[0175] clusters ( Calculate the mean profile ( ) and the salience of clues, forming "( The direction labels are used to summarize the strategy prototypes (such as "Anger(++), QMark(+), Posemo(-)").
[0176] 1.5 Threshold Rule Learning
[0177] Using cluster labels or "successful conversion" labels as targets, an interpretable agent (depth-restricted decision tree / rule learning) is trained to obtain a rule set:
[0178] ,
[0179] Its semantics are: if and only if ( When ), the non-infringement probability (or high retention probability) is at least ( ).
[0180] 1.6 Recharge and Coordination
[0181] Will( Translated as: Training option weight ( ) and threshold ( Fine-tuning of the decoding phase bias () ) and cost ( The update includes improvements to the "Recommended Buffer Clue Combinations" in the prompt template.
[0182] 1.7 Drift Monitoring and Relearning
[0183] Distribution drift is monitored using the Population Stability Index (PSI) or KS distance:
[0184]
[0185] This invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the automatic method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control.
[0186] This invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the automatic method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control.
[0187] Evidence related to the technical effects obtained by the embodiments of the present invention.
[0188] (1) A unified framework for model-decoding-interpretation. "Function-cue control" is embedded as an isomorphic penalty function of training loss and decoding cost. ), in conjunction with adaptive coefficients ( This achieves end-to-end consistency from learning to generation, unlike schemes that only apply heuristic constraints at the prompting or post-processing layers.
[0189] (2) Chebyshev and gating are implemented in parallel. In addition to a single weighted sum, a weighted Chebyshev algorithm is introduced to suppress target skew (avoiding the sacrifice of a target due to weight adjustments alone), supplemented by a verifiable hard gating threshold. )).
[0190] (3) Closed-loop adaptation of policy profile-threshold rules. A stable "policy prototype" is formed using SHAP profile clustering, and then thresholded white-box rules are applied. Feedback is fed back to training weights, decoding biases, and cue templates, forming an interpretable, controllable, and deployable closed loop; this differs from approaches that merely provide an importance ranking without being able to translate it into executable control variables.
[0191] (4) Fine-grained vocabulary bias and minimum coverage. During the decoding phase, fine-grained vocabulary bias and minimum coverage are applied to the vocabulary lists of the two types of cues: "enhanced infringement" and "buffering". ) and( It also provides a minimum coverage constraint, thereby balancing toxicity reduction with the preservation of semantic information units.
[0192] (5) Project feasibility. Introducing a lightweight proxy ( With editable post-processing, online secondary correction and SLA guarantees are achieved; combined with PSI / KS drift monitoring and small-step reflow updates, long-term evolution is supported.
[0193] Technical effect: Under the same data and evaluator, the present invention does not reduce the semantic preservation threshold ( Under the premise of ), make ( The rate of compliance with the guidelines decreased significantly, and a high compliance rate was maintained across multiple themes, thus mitigating the side effects of excessively pruning buffered guidelines.
[0194] It should be noted that embodiments of the present invention can be implemented using hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The apparatus of the present invention can be implemented using a general-purpose computer or a dedicated acceleration chip, and provides an API call interface through a microservice architecture to achieve module-level decoupling and scalability.
[0195] The above description is merely a specific embodiment of the present invention. All technical equivalents and improvements within the scope of the spirit and essence of the present invention should be included within the scope of protection. Any modifications, equivalents, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. An automated method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control, characterized in that, The method includes: Step (1) Construct an assessment index system for offensive language: Based on a Chinese offensive language dataset, an interpretable machine learning model was used to extract 26 core linguistic cues, covering four dimensions: sentiment modulation, stance modulation, attribution reconstruction, and frame breaking, to quantify the degree of language aggression. Step (2) Design the human-computer collaborative prompting framework: Based on the theory of communication adaptation and the theory of nonviolent communication, an artificial thought chain prompt structure is constructed, which includes requests, tasks, format definitions, and communication strategy guidance. It consists of a template definition unit, a strategy weight unit, and a semantic preservation monitoring unit. The communication strategies include emotional resonance and relationship maintenance, reducing uncertainty to promote understanding, first-person expression of needs, and strategic humor and topic switching. Step (3) Implementation of Aggressive Language Remodeling: The offensive language to be processed is input into the large language model, and the model is guided to perform the reshaping operation through the prompting framework constructed in step (2) to generate non-intrusive language that retains the core semantics; Step (4) Verification and optimization of the reshaping effect: A feedback mechanism combining automated prediction and subjective human evaluation is adopted to comprehensively optimize prompt parameters and strategy weights through toxicity indicators, semantic retention, and user perception scores.
2. The automatic method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control as described in claim 1, characterized in that, The extraction process of key linguistic clues in step (1) includes: (1a) The XGBoost classifier is used to model the aggressive language in the COLD dataset. The SHAP method is used to calculate the marginal contribution of each language feature in the toxicity prediction and form a feature importance vector for the clue screening and optimization module to call. (1b) The optimal feature subset was selected by forward stepwise selection method with 5-fold cross-validation, and 26 core linguistic cues were identified, including emotion cues such as angry words, negative emotion words, and positive emotion words; position cues such as tentative expressions and limiting words; attribution cues such as the proportion of personal pronouns; and frame-breaking cues such as leisure words and filler words. (1c) Establish a database of the relationship between clues and aggression, and clarify the positive or negative impact weight of each clue on language aggression.
3. The automatic method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control as described in claim 1, characterized in that, The specific construction of the artificial thought chain prompting framework in step (2) includes: (2a) Basic structure design: The requirements, objectives and output format of the reshaping task are defined using the RTF structure; (2b) Strategy embedding: Transform the four core communication functions into specific language operation instructions, including emotion regulation instructions to increase positive emotional vocabulary and reduce anger expression, position modulation instructions to use tentative language and optimize sentence structure, attribution reconstruction instructions to change personal pronouns and express objective needs, and framework breakthrough instructions to insert humorous elements and reasonably change topics. (2c) Example Supplement: Configure corresponding application examples for each communication strategy to form a structured prompt template.
4. The automatic method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control as described in claim 1, characterized in that, The reshaping effect verification in step (4) adopts a triple evaluation mechanism: (4a) Toxicity Quantitative Assessment: The language toxicity score before and after remodeling is calculated using a standardized toxicity detection model. The toxicity reduction after remodeling is required to be ≥20%, and the assessment consistency is maintained among different models. (4b) Semantic integrity assessment: The cosine similarity algorithm is used to calculate the semantic similarity between the reconstructed text and the original text to ensure that the similarity is not less than 0.85; (4c) User experience evaluation: Collect user ratings on the effectiveness of reshaping text in reducing aggression and willingness to adopt it through questionnaires. The effective sample size should be no less than 600.
5. An automatic system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clues, implementing the automatic method for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clues as described in any one of claims 1-4, characterized in that, The automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clues includes: Data preprocessing module: This module receives input offensive language text, performs preprocessing operations such as word segmentation and stop word removal, and extracts linguistic features of the text based on an evaluation index system. The prompt generation and optimization module stores and calls up the artificial thought chain prompt templates, and dynamically adjusts the strategy weights in the prompt instructions based on the features extracted by the preprocessing module. Language reshaping execution module: integrates a callable large language model interface, supports multi-model switching and security review mechanism, and realizes automatic reshaping under multiple languages and themes; The effect evaluation and adaptive optimization module realizes quantitative evaluation in three dimensions: toxicity, semantics, and experience, and drives the prompt optimization unit with reinforcement learning algorithm to achieve adaptive weight update and policy evolution. Results storage and tracking module: Saves the original text, reshapes the text, evaluates the results, and optimizes the prompt strategy parameters.
6. The automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control as described in claim 5, characterized in that, The prompt generation and optimization module also includes a strategy optimization unit. This unit adjusts the combination ratio of linguistic cues for the four core communication strategies through reinforcement learning algorithms based on the feedback data from the effect evaluation and adaptive optimization modules, thereby achieving adaptive optimization of the prompt framework.
7. The automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clues as described in claim 5, characterized in that, The language reshaping execution module supports the processing of multi-topic offensive language, including sensitive topics such as race, gender, and region, and dynamically adjusts the clue weight allocation in the prompt strategy for different topics.
8. The automated system for reshaping cyberbullying speech based on human-machine collaborative prompts and explainable clue control as described in claim 5, characterized in that, The effect evaluation and adaptive optimization module also integrates a harmful fragment marking function, which generates targeted optimization suggestions by identifying and reshaping the text of offensive fragments.
9. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the automated method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control as described in any one of claims 1-4.
10. A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the automated method for reshaping cyberbullying speech based on human-computer collaborative prompts and explainable clue control as described in any one of claims 1-4.