A stable processing method and system for a content review rule refinement task
Patent Information
- Application Number
- CN202610796598.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]本申请的目的在于解决上述存在的规则细化任务稳定性不足的问题
[0016]本申请具有如下有益效果:通过接收并解析内容审核规则数据源,对规则行进行字段匹配和缺失分类补全,得到包含规则标识、规则分类信息和规则内容的规则集合,使不同格式、分类缺失或字段不统一的规则数据源能够被转换为结构一致的规则记录,降低规则读取失败、分类错位和规则遗漏的风险。
Smart Images

Figure CN122903474A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of content moderation and artificial intelligence-assisted processing technology, and in particular to a stable processing method and system for refining content moderation rules. Background Technology
[0002] With the continuous growth of user-generated content on internet platforms, content moderation rules have been widely applied to the identification and processing of comments, posts, nicknames, image descriptions, video titles, and other content. To ensure that moderators, rule engines, or intelligent moderation systems can execute reviews according to a consistent standard, platforms typically need to further refine their more abstract moderation rules into more detailed rules with clearly defined boundaries, clear conditions, and ease of execution. Existing rules are usually maintained in the form of tables, documents, or rule lists, which may include rule categories, rule numbers, rule text, and example explanations.
[0003] However, in actual business operations, rule data sources are often maintained by different personnel at different times, resulting in inconsistent formats. For example, some rule tables contain blank rows, inconsistent field names, omitted category fields, merged cells, and missing rule content. While human readers can understand these contents based on context, software systems are prone to errors in rule classification, rule omissions, or unstable rule identifiers when automatically reading them. Furthermore, existing methods that utilize text generation models to assist in rule refinement typically only input the rule text into the model and obtain the generated results, lacking continuous management of reference content retrieval, candidate result parsing, user confirmation, and interruption recovery.
[0004] Therefore, the following issues still need to be addressed in the content moderation rule refinement task: how to reliably convert non-standard rule data sources into rule sets; how to obtain reference content for the currently pending rule and generate candidate results for user confirmation during the rule refinement process; how to generate corresponding refined results after the user selects, edits, or skips candidate results; and how to restore the current processing progress based on the session state when the task is interrupted or the user re-enters, avoiding the loss of candidate results, duplicate rule processing, or difficulty in tracing the final result. Based on this, it is necessary to provide a stable processing method and system for the content moderation rule refinement task that can simultaneously handle rule parsing, candidate generation, user confirmation, state restoration, and result output. Summary of the Invention
[0005] The purpose of this application is to address the aforementioned problem of insufficient stability in rule refinement tasks.
[0006] According to one aspect of this application, a stable processing method for refining content moderation rules is provided, comprising: The system receives a content moderation rule data source, reads the rule rows from the content moderation rule data source, performs field matching and missing classification completion on the rule rows, and obtains a rule set; wherein, the rule set includes multiple rule records, and each rule record includes a rule identifier, rule classification information and rule content; A rule refinement session is established based on the rule set, the current rule to be processed is determined according to the arrangement order of the rule records in the rule set, and the rule identifier of the current rule to be processed is used as the current rule identifier; Retrieve reference content based on the current rule to be processed, and generate model input content based on the current rule to be processed and the reference content; The preset text generation model is invoked to process the input content of the model, and the candidate refinement results are obtained. The candidate refinement results are then parsed to obtain a candidate set. Based on the selection, editing, or skipping operations issued by the user on the candidate set, the refined result of the current rule to be processed is obtained; The rule refinement session records the session state, including the current rule identifier, the candidate set, and the processing stage, and resumes the rule refinement task based on the session state when a recovery request is received. After all the rule records in the rule set have obtained corresponding refinement results, rule refinement result data is generated.
[0007] Preferably, the rule rows in the content review rule data source are read, and the rule rows are subjected to field matching and missing category completion to obtain a rule set, including: Identify the file type of the data source for the content moderation rules, and determine the reading method based on the file type; The content review rule data source is read according to the described reading method to obtain multiple rule rows. The header fields in the content review rule data source are matched with the preset field mapping table to determine the category fields and rule content fields; Based on the classification field and the rule content field, extract existing classification information and in-row rule content from each rule row; Filter out rule rows that did not extract inline rule content; The classification context is maintained according to the arrangement order of the multiple rule rows, and the classification context is updated by the valid classification information in the read rule rows; When the existing classification information of the currently read rule row is incomplete, the classification context is used to complete the classification of the rule row to obtain complete classification information; The rule record is generated based on the complete classification information and the inline rule content.
[0008] Preferably, the rule identifier is generated in the following manner: Obtain the data source identifier of the content review rule data source; When the rule row contains an original rule number field and the value of the original rule number field is not empty, the value of the original rule number field is used as the rule identifier, or the value of the original rule number field is combined with the data source identifier to generate the rule identifier; When the original rule number field does not exist in the rule row, or the field value of the original rule number field is empty, the text normalization processing of the rule content in the row is performed to obtain normalized rule content. A rule content summary is generated based on the normalized rule content, and the rule identifier is generated based on the data source identifier, the original row number of the rule row in the content review rule data source, and the rule content summary. Write the rule identifier into the corresponding rule record.
[0009] Preferably, a rule refinement session is established based on the rule set, the current rule to be processed is determined according to the order of the rule records in the rule set, and the rule identifier of the current rule to be processed is used as the current rule identifier, including: Generate a session identifier based on the set of rules; Establish a session state corresponding to the session identifier; The session state records the rule set, the current rule identifier, the reference content, the candidate set, the user confirmation record, and the processing stage. According to the order of the rule records in the rule set, the first rule record that has not been refined is determined as the current rule to be processed; Write the rule identifier of the currently pending rule into the session state as the current rule identifier; The processing stage refers to the processing node where the current rule to be processed is located.
[0010] Preferably, refining the task according to the session state recovery rules includes: The corresponding session state is read based on the session identifier carried in the recovery request; Read the current rule identifier and the processing stage from the session state; When the processing stage indicates that the reference content has not yet been obtained, the current rule to be processed is read according to the current rule identifier, and the reference content is retrieved according to the current rule to be processed. When the processing stage indicates that the candidate refinement result has not yet been obtained, the current rule to be processed is read according to the current rule identifier, and the model input content is generated according to the current rule to be processed and the reference content; When the processing stage indicates that user confirmation is pending, the current pending rule and the candidate set are returned to the user. When the processing stage indicates that the refinement result has been obtained, the next rule record that has not yet obtained a refinement result is determined according to the order of the rule records in the rule set; When there is no next rule record that has not been refined, the rule refinement result data is generated.
[0011] Preferably, retrieving reference content according to the current rule to be processed includes: Based on the rule classification information and rule content of the current rule to be processed, a reference fragment is retrieved from the first reference rule base; When no reference fragment is obtained from the first reference rule base, a reference fragment is retrieved from the second reference rule base according to the rule classification information and the rule content. The reference segments are sorted according to the classification matching results and text similarity between the reference segments and the current rule to be processed. The reference segment is selected based on the sorting result to obtain the reference content; When no reference fragment is available, the empty set is used as the reference content.
[0012] Preferably, generating model input content based on the current rule to be processed and the reference content includes: Generate a rule input fragment based on the rule identifier, rule classification information, and rule content of the current rule to be processed; When the reference content includes a reference fragment, a reference input fragment is generated based on the fragment text and fragment source of the reference fragment; When the reference content is an empty set, a reference input segment is generated to indicate that no reference segment has been obtained; Obtain preset structured output requirements, which include the number of candidate options and the candidate identifier field, title field, and description field that each candidate option needs to include; The model input content is generated based on the rule input segment, the reference input segment, and the preset structured output requirements.
[0013] Preferably, the candidate refinement results are parsed to obtain a candidate set, including: According to the preset structured output requirements, the candidate identifier field, title field, and description field are extracted from the candidate refinement results to obtain the candidate options; When any of the candidate options lacks a title field but includes a description field, the first preset number of characters in the description field of that candidate option are extracted and written into the title field; When any of the candidate options lacks a description field but includes a title field, the value of the title field of that candidate option is written into the description field; When no candidate is extracted from the candidate refinement results, a fallback candidate is generated based on the rule content of the current rule to be processed; The extracted candidate options or the fallback candidate options are written into the candidate option set.
[0014] Preferably, the refined result of the current rule to be processed is obtained based on the selection, editing, or skipping operation issued by the user terminal for the candidate set, including: When the selection operation is received, the refined result is obtained based on the candidate selected by the user and the rule content of the current rule to be processed. When the edit operation is received, the refined result is obtained based on the candidate options edited by the user and the rule content of the current rule to be processed; When the skip operation is received, the rule content of the current rule to be processed is used as the refinement result; The refinement result is associated with the current rule identifier and written into the rule refinement session, and the processing stage is updated to indicate that the refinement result has been obtained.
[0015] This application also provides a stable processing system for content moderation rule refinement tasks, which executes the stable processing method for content moderation rule refinement tasks as described in any of the above claims during runtime, including: The data processing module is used to receive content review rule data sources, parse the content review rule data sources, and output a set of rules. The session management module, connected to the data processing module, is used to establish rule refinement sessions based on the rule set and output the current rules to be processed and the session status. A generation processing module, connected to the session management module, is used to obtain reference content according to the current rules to be processed, and call a preset text generation model to output candidate refinement results; An interactive processing module, connected to the generation processing module and the session management module, is used to receive confirmation information from the user terminal regarding the candidate refinement results, output the refinement results, and return the refinement results to the session management module; The result output module is connected to the session management module and is used to output the rule refinement result data after all the rule records in the rule set have obtained the corresponding refinement results. The session management module is further configured to, upon receiving a recovery request, output the current pending rules after recovery to the generation processing module or the interaction processing module based on the session state.
[0016] This application has the following beneficial effects: by receiving and parsing the content moderation rule data source, performing field matching and missing classification completion on the rule rows, a rule set containing rule identifiers, rule classification information, and rule content is obtained, enabling rule data sources with different formats, missing classifications, or inconsistent fields to be converted into rule records with a consistent structure, reducing the risk of rule reading failure, classification misalignment, and rule omission.
[0017] Meanwhile, a rule refinement session is established based on the rule set. The current rule to be processed is determined according to the order of the rule records. Reference content, model input content and candidate refinement results are retrieved in combination with the current rule to be processed. This allows the rule refinement process to proceed step by step around the specific rule, reducing the problem of disconnect between candidate results and original rules and reference content, and improving the usability of candidate refinement results.
[0018] Furthermore, the candidate refinement results are parsed into a set of candidate options, and the refined results are generated based on the user's selection, editing, or skipping actions. This preserves the user's ability to confirm the rule boundaries and review criteria, while ensuring that the refined results are stably associated with the current rule identifier. By recording the session state in the rule refinement session and resuming the rule refinement task based on the session state, the processing progress can be restored when the page is refreshed, the network is interrupted, or the user re-enters, avoiding the loss of candidate options, duplicate processing of rules, and difficulty in tracing results, thereby improving the stability, continuity, and recoverability of the rule refinement task. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a logic block diagram of a stable processing method for refining content review rules as described in one embodiment of this application. Detailed Implementation
[0021] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings. Preferred embodiments of this application are shown in the drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0023] Please refer to Figure 1 One embodiment of this application provides a stable processing method for content moderation rule refinement tasks, including: S10. Receive the content moderation rule data source, read the rule rows from the content moderation rule data source, perform field matching and missing category completion on the rule rows, and obtain a rule set. The rule set includes multiple rule records, each including a rule identifier, rule category information, and rule content. In this step, it should be noted that the content moderation rule data source can be a rule table uploaded by the user, a file exported from an online table, a rule list file, or a data file converted from a rule document. A rule row refers to a data unit in the content moderation rule data source that represents a moderation rule or a piece of content to be refined for moderation. It can originate from a row in a table or an entry in a rule list. Field matching refers to mapping the original fields in the content moderation rule data source to the system's preset internal fields. For example, mapping fields representing rule categories, rule text, and rule numbers from different files to fields that the system can recognize. Missing category completion refers to supplementing the category of a rule row when incomplete category information is not directly filled in, based on previous rule rows or the currently maintained category context, so that each rule record can independently carry category information and rule content. Through the above processing, the original rule data sources with inconsistent formats, incomplete classification information, or inconsistent field names are transformed into a set of rules with a consistent structure, providing stable input for subsequent processing.
[0024] S20. Establish a rule refinement session based on the rule set, determine the currently pending rule according to the order of rule records in the rule set, and use the rule identifier of the currently pending rule as the current rule identifier. In this step, it should be noted that the rule refinement session serves as the processing context for a single rule refinement task. It can record information such as the rule set, current processing position, candidate rules, user confirmation records, reference content, and processing stage. The currently pending rule is the rule record being processed in this round of rule refinement. The system can determine the currently pending rule from the rule records that have not yet received refinement results, according to the order in the rule set. The current rule identifier is used to establish a correspondence between the rule set, candidate refinement results, user confirmation records, and the final result, avoiding errors in candidate allocation or refinement result writing when multiple rules are processed consecutively. By establishing a rule refinement session, the system no longer processes single rules in isolation with a request-response approach, but rather organizes the processing of multiple rules into a continuously advancing task flow.
[0025] S30. Retrieve reference content based on the current rule to be processed, and generate model input content based on the current rule to be processed and the reference content. In this step, it should be noted that reference content refers to historical rules, similar rules, rule descriptions, review guidelines, or other text content related to the current rule to be processed that can be referenced during model generation. The system can retrieve reference materials similar to the current review scenario based on the rule classification information and rule content of the current rule to be processed. The model input content is not simply sending the rule content directly to the model, but rather organizing the current rule to be processed, the retrieved reference content, and subsequent generation requirements into input data that can be processed by a preset text generation model according to a predetermined format. By adding reference content to the model input content, the risk of candidate refinement results deviating from the existing rule system, inconsistent expression guidelines, or overly generalized boundary descriptions can be reduced.
[0026] S40. The system calls a preset text generation model to process the input content, obtaining candidate refinement results. These results are then parsed to obtain a candidate set. In this step, it's important to note that the preset text generation model is a model capable of generating rules to refine content based on the input text. This model can be a large language model, a text generation model, or a natural language processing model configured for rule-based text generation, and can be deployed on a local server, cloud service, or other computing environment. The candidate refinement results are the initial refinement output of the model for the current rule to be processed, and may include multiple candidate options for the user to select or edit. Because the model output may have inconsistent formats, missing fields, or additional explanatory content, the system needs to parse the candidate refinement results, extracting the portion that represents the refined content of the candidate rules into a candidate set. The candidate set may include one or more candidate options, each representing a rule refinement expression for display and subsequent confirmation by the user. Through this processing, the model output is converted from natural language results into candidate data that the system can display, select, edit, and write back.
[0027] S50. Based on the user's selection, editing, or skipping operations on the candidate set, the refined result of the current rule to be processed is obtained. In this step, it should be noted that the user terminal can display the current rule to be processed and its corresponding candidate set to the user, and receive the user's processing operations on the candidate options. A selection operation means the user selects at least one candidate option from the candidate set as the basis for refining the current rule; an editing operation means the user modifies the candidate content and then confirms it; a skipping operation means the user does not refine the current rule to be processed temporarily, and the system can retain the original rule content as the corresponding result. The refined result is the final output content of the current rule to be processed formed by the system based on the user's operations, and it is saved in association with the current rule identifier. By introducing a user confirmation step, the system can retain human control over the review boundaries, applicable scenarios, and expression, avoiding the direct writing of model-generated content into the rule result without confirmation.
[0028] S60. Record the session state, including the current rule identifier, candidate set, and processing stage, in the rule refinement session. Upon receiving a recovery request, resume the rule refinement task based on the session state. In this step, it should be noted that the session state describes the processing status of the rule refinement task at a certain moment, and may include at least the current rule identifier, candidate set, and processing stage. The processing stage indicates that the rule to be processed is currently at a processing node such as reference content retrieval, candidate result generation, user confirmation, or a refined result has been formed. The system continuously updates the session state during the rule refinement process. When a page refresh, network interruption, user temporary departure, background service restart, or user re-entering the task triggers a recovery request, the system can determine the rule to be restored, the candidate items to be displayed, and the processing node to continue execution based on the recorded session state. Through this mechanism, the system can avoid candidate item loss, current rule misalignment, duplicate generation, or duplicate write-back.
[0029] S70. After all rule records in the rule set have obtained corresponding refinement results, rule refinement result data is generated. In this step, it should be noted that the rule refinement result data is the final organized result of this rule refinement task, which may include rule identifiers, rule classification information, original rule content, and corresponding refinement results. For rule records that have been confirmed through selection or editing operations, the refined content confirmed by the user is written into the rule refinement result data; for rule records that the user skipped, the original rule content can be written or marked as unrefined. By uniformly organizing each rule record with its corresponding refinement result, data results that are easy to export, review, store, or subsequently integrate with rule systems can be formed.
[0030] The technical solution implemented in this embodiment can convert content review rule data sources with inconsistent formats and incomplete classification information into a structurally stable rule set, reducing the risks of rule reading failures, classification misalignments, and rule omissions. Simultaneously, by recording the current rules to be processed, the candidate set, and the processing stage through the rule refinement session, multiple rules can be processed sequentially in a defined order, avoiding mismatches between candidate results and rule records. Furthermore, by retrieving reference content and combining it with the current rules to be processed to generate model input content, the consistency between candidate refinement results and the existing review rule system can be improved. The refinement results generated by allowing users to select, edit, or skip candidate options can balance model generation efficiency with the accuracy of manual confirmation. The rule refinement task can be resumed by restoring the session state, allowing processing progress to resume when the task is interrupted or the user re-enters, reducing issues such as duplicate processing, result loss, and untraceable processes, thereby improving the stability, continuity, and recoverability of the content review rule refinement task.
[0031] In one specific embodiment, rule rows from the content moderation rule data source are read, and field matching and missing category completion are performed on the rule rows to obtain a rule set, including: The system identifies the file type of the content moderation rule data source and determines the reading method accordingly. It's important to note that the content moderation rule data source can be a spreadsheet file, a comma-separated value file, an online spreadsheet export file, or a rule list file. Different data sources have different data organization methods. For example, spreadsheet files typically store rule content in worksheet and cell format, while comma-separated value files typically store rule content in text lines and delimiters. Therefore, the system identifies the file type before reading and determines the corresponding reading method to avoid using mismatched parsing methods that could lead to garbled rule content, misread columns, or lost row data. The file type can be determined based on the file extension, file header information, or file type information uploaded by the user.
[0032] The system reads the content moderation rule data source according to the specified reading method, resulting in multiple rule rows. It's important to note that a rule row is a data unit within the content moderation rule data source that carries the rule content. For tabular files, a rule row corresponds to a single row in the table; for rule list files, a rule row corresponds to a single rule entry. The system reads the content moderation rule data source using the aforementioned reading method, converting the content relevant to rule refinement into multiple rule rows. During the reading process, rows that are completely blank, table footer descriptions, or statistical descriptions—data that does not carry rule content—can be skipped to reduce invalid data entering subsequent processing.
[0033] The header fields in the content moderation rule data source are matched with a preset field mapping table to determine the category fields and rule content fields. It's important to note that header names may differ when the same type of rule file is maintained by different business personnel or on different platforms. For example, fields representing categories might be recorded as "Primary Category," "Secondary Category," "Rule Category," "Tag," or "Rule Type," while fields representing rule content might be recorded as "Rule Content," "Rule Text," "Rule Details," or "Description." The preset field mapping table stores the correspondence between original fields and internal system fields. After matching the header fields with the preset field mapping table, the system can determine which fields represent category information and which represent rule content, thus unifying rule data from different sources and with different naming conventions under a single processing standard.
[0034] Based on the category field and rule content field, the system extracts existing category information and in-line rule content from each rule row. It's important to note that existing category information refers to the category content already recorded in the current rule row itself, while in-line rule content refers to the text of the review rule to be refined directly recorded in the current rule row. For a rule row, if its category field already contains a category name, that category name is considered existing category information; if its rule content field contains a specific review rule, that specific review rule is considered in-line rule content. By extracting existing category information and in-line rule content separately, the system can distinguish between "rule attribution information" and "rule text information," facilitating the subsequent completion of missing categories and ensuring that the final rule record simultaneously possesses both category attribution and rule content.
[0035] Filter rule rows for which no inline rule content has been extracted. It's important to note that rule rows for which no inline rule content has been extracted are generally unsuitable for inclusion as independent rule records in subsequent refinement processes. These rule rows may only represent category titles, notes, separators, or placeholders, and do not contain the specific rule text required for the model to generate candidate refinement results. Filtering these rule rows avoids subsequent reference retrieval, model generation, and user confirmation for data without rule text, reducing unnecessary tasks and mitigating the risk of category titles being incorrectly identified as rule text. For rule rows that only contain category information but not inline rule content, the category information can be used to update the category context of subsequent rule rows without needing to generate independent rule records.
[0036] The classification context is maintained according to the order of the rule rows, and is updated from the valid classification information in the rule rows that have been read. It's important to note in this step that the classification context is used to store the most recently acquired valid classification information during the reading process. In actual rule tables, to reduce duplicate entry, a common practice is to fill in the classification information only in the first rule row when multiple consecutive rules belong to the same category, leaving the classification fields of subsequent rule rows blank, or using merged cells to represent the classification inheritance relationship. While a human reader can understand from the context that subsequent rules still belong to the same category, if the software system reads directly from the current row's fields, it may easily identify subsequent rules as unclassified rules. By maintaining the classification context according to the order of the rule rows, the system can update the classification context when new valid classification information is read, providing inheritable classification criteria for subsequent rule rows with missing classifications.
[0037] When the existing category information of the currently read rule row is incomplete, the category context is used to complete the category information of the rule row. It should be noted that incomplete category information can include situations such as an empty category field, only partial hierarchical categories being filled in, or the current row not displaying category content due to merged cells. When the system determines that the currently read rule row has any of these situations, it uses the category context to complete the rule row, forming complete category information that can independently represent the rule's affiliation. Complete category information does not need to be limited to a fixed hierarchy; it can include first-level categories, second-level categories, or other categories that can characterize the rule's affiliation. Through this completion process, even if the original rule data source uses blank inheritance, merged cells, or omission of duplicate categories, the system can still generate a clear category affiliation for each valid rule.
[0038] Rule records are generated based on complete classification information and inline rule content. It's important to note in this step that rule records are structured data directly processed by subsequent rule refinement tasks. The system combines the completed classification information with the inline rule content and assigns a rule identifier to it, thus forming a rule record. The rule identifier is used to locate the same rule during subsequent reference content retrieval, candidate generation, user confirmation, session resumption, and result output; the complete classification information is used to determine the review scenario to which the rule belongs; and the rule content serves as the base text for generating subsequent candidate refinement results. By generating rule records, the system transforms unstructured or weakly structured content from the original rule data source into a unified, locateable, and processable set of rules.
[0039] The technical solution implemented in this embodiment can reliably read valid rule content and convert it into rule records with consistent structure even when the rule data source format is inconsistent, field names are inconsistent, classification fields are omitted, or some rule rows lack classification information. Field matching reduces parsing differences caused by different file templates; filtering rule rows without rule content reduces invalid data entering the refinement process; and classification context completion avoids rule classification loss due to blank inheritance or merged cells. Therefore, it improves the stability and accuracy of rule set generation, reduces rule omissions, classification misalignments, and incorrect attribution of subsequent candidate refinement results, providing a reliable data foundation for subsequent reference content retrieval, model generation, user confirmation, and task recovery.
[0040] In one specific embodiment, the rule identifier is generated as follows: Obtain the data source identifier for the content moderation rule data source. In this step, it's important to note that the data source identifier is used to distinguish content moderation rule data sources from different origins, batches, or files. The data source identifier can be generated based on the file name, file upload time, file storage path, file summary value, task number, or a unique number assigned by the system. By obtaining the data source identifier first, the subsequently generated rule identifiers can not only distinguish different rule rows within the same data source but also differentiate between rule numbers or content that may exist in different data sources. This ensures that when users upload rule files multiple times, different business lines use rules with the same number, or the same rule file is re-imported, the system can still accurately identify the data source to which the rule record belongs, reducing rule location conflicts.
[0041] When an original rule number field exists in a rule row and its value is not empty, the value of the original rule number field is used as the rule identifier, or the value of the original rule number field is combined with the data source identifier to generate a rule identifier. In this step, it's important to note that the original rule number field refers to a number field pre-maintained by business personnel or the rule management system in the content review rule data source, such as rule number, rule ID, clause number, or detailed rule number. When this field exists and its value is not empty, it means that the original rule data source has already provided a number that can be used for locating the rule row. In this case, the field value can be directly used as the rule identifier, or it can be combined with the data source identifier to form the rule identifier. Directly using the original rule number ensures consistency with the original business rule system; combining the original rule number with the data source identifier avoids identifier conflicts when the same original rule number appears in different data sources. By prioritizing the use of the original rule number, existing management information in the rule data source can be fully utilized, reducing the risk of changes in correspondence caused by the system regenerating identifiers.
[0042] When the original rule number field is absent in a rule row, or its value is empty, the text normalization process is performed on the rule content within the row to obtain normalized rule content. A rule content summary is then generated based on this normalized rule content, and a rule identifier is generated based on the data source identifier, the original row number of the rule row in the content review rule data source, and the rule content summary. It should be noted that some rule data sources may not have an original rule number field, or although a number field is set, some rule rows may not have the number filled in. For these rule rows, the system needs to generate a rule identifier based on the rule row's own information. Text normalization refers to the uniform processing of the rule content within a row, ensuring a more stable text foundation even when there are differences in spaces, line breaks, punctuation, or formatting. Text normalization may include removing redundant whitespace characters, standardizing full-width and half-width punctuation, removing invisible characters, merging consecutive line breaks, standardizing capitalization, or standardizing symbol formats. The rule content summary can be calculated based on the normalized rule content, for example, using hash calculations, digest algorithms, or by extracting characteristic text from the normalized rule content. The original line number indicates the position of the rule line within the content review rule data source. Combining the data source identifier, the original line number, and the rule content summary to generate a rule identifier takes into account the data source attribution, rule location, and rule content characteristics, enabling the system to generate relatively stable and distinguishable identifiers for rule records even in the absence of the original line number.
[0043] Write the rule identifier to the corresponding rule record. It's important to note that after the rule identifier is generated, it needs to be written to the rule record corresponding to that rule row, serving as the basis for locating that rule record in subsequent processes. Subsequently, when retrieving reference content, generating candidate refinement results, receiving user confirmation operations, recording session states, resuming rule refinement tasks, and generating rule refinement result data, the operation object can be identified through the rule identifier. By writing the rule identifier to the rule record, a stable association is established between the rule record and the candidates, user confirmation records, refinement results, and session states, avoiding problems such as incorrect candidate results, mismatched user confirmation records, or incorrect exported results when multiple rules are processed consecutively.
[0044] The technical solution implemented in this embodiment can generate a locatable and associative rule identifier for each rule record, even when the content review rule data source may or may not have an original rule number. By prioritizing the use of the original rule number, consistency with the original rule management system can be maintained; by combining the data source identifier, original line number, and rule content summary to generate a rule identifier when the original rule number is missing, the risk of duplicate or missing rule identifiers can be reduced. Therefore, it can be ensured that subsequent rule refinement sessions, candidate sets, user confirmation records, and final refinement results can all be accurately associated with the corresponding rule records, improving the continuity, recoverability, and traceability of the rule refinement task.
[0045] In one specific embodiment, a rule refinement session is established based on a rule set, the current rule to be processed is determined according to the order of rule records in the rule set, and the rule identifier of the current rule to be processed is used as the current rule identifier, including: Generate a session identifier based on the rule set. In this step, it's important to note that the session identifier is used to distinguish different rule refinement tasks. Since users may import different content moderation rule data sources at different times and may process multiple rule files simultaneously, a unique session identifier needs to be generated for each rule refinement task. The session identifier can be generated based on the data source identifier corresponding to the rule set, the task creation time, the user identifier, or a system-randomized number. Using the session identifier, the same rule refinement task can be located during subsequent processing, avoiding confusion between rule records, candidate sets, user confirmation records, or refinement results across different tasks.
[0046] Establish session state corresponding to the session identifier. In this step, it's important to note that session state is used to store intermediate data and processing progress during the rule refinement task's execution. Session state can be stored in a database, cache, file system, or task state table, or it can be maintained by the server-side session object. The session state corresponds to the session identifier, enabling the system to read, update, or restore processing information for the same task based on the session identifier. By establishing session state, the rule refinement task no longer depends on a single page request or a single model call result, but can continuously progress in a stateful manner.
[0047] The session state records the rule set, current rule identifier, reference content, candidate set, user confirmation record, and processing stage. In this step, it's important to note that the rule set stores all rule records to be processed in this task; the current rule identifier locates the rule record currently being processed; the reference content stores rule fragments or explanatory text related to the currently pending rule; the candidate set stores the candidate refined content generated and parsed by the model; the user confirmation record stores the user's selection, editing, or skipping results for candidate options; and the processing stage indicates the current processing node of the task. By writing the above data into the session state, the system can continuously monitor the current rules, generated results, user confirmation status, and task progress during processing, thus providing a basis for subsequent recovery, continued processing, and result output.
[0048] The first rule record that has not yet been refined is identified as the current rule to be processed, based on the order of the rule records in the rule set. It's important to note that the rule records in the rule set typically retain their original order from the content moderation rule data source. Determining the current rule to be processed according to this order ensures that the system's processing order aligns with the user's reading order of the original rule file, facilitating user understanding and confirmation. The first rule record that has not yet been refined refers to the rule record for which no corresponding refinement result has been generated when searching from the beginning to the end of the list. This method of determining the current rule to be processed avoids the system arbitrarily selecting rule records, ensuring that the rule refinement task proceeds step-by-step in a stable and predictable order.
[0049] The rule identifier of the currently pending rule is written into the session state as the current rule identifier. It's important to note that the current rule identifier is the location information of the currently pending rule within the session state. After determining the current pending rule, the system writes its rule identifier into the session state. Subsequent actions such as retrieving reference content, generating candidate refinement results, receiving user confirmation, and writing refinement results can all use the current rule identifier to identify the corresponding rule record. Establishing associations through the current rule identifier prevents candidate sets, reference content, or user confirmation records from being incorrectly associated with other rule records, which is particularly suitable for scenarios where a rule set contains a large number of rules that need to be processed one by one.
[0050] The processing stage indicates the current processing node of the rule to be processed. In this step, it's important to note that the processing stage describes the progress status of the rule in the rule refinement process. Processing stages can include states such as reference content to be retrieved, reference content obtained, candidate results to be generated, candidate options to be confirmed, and refinement results obtained. Different processing stages correspond to different subsequent actions. For example, when the processing stage indicates candidate options are pending confirmation, the system needs to return the current rule to be processed and the set of candidate options to the user; when the processing stage indicates refinement results have been obtained, the system can continue searching for the next unprocessed rule record. By recording the processing stages, the system can determine from which processing node to resume execution after a task interruption.
[0051] The technical solution implemented in this embodiment enables unified management of rule refinement tasks through session identifiers and session states, establishing a stable association between the rule set, the currently pending rule, reference content, candidate set, user confirmation record, and processing stage. By determining the currently pending rule according to the order of the rule set, multiple rules can be processed sequentially in their original order, reducing the risk of missed, duplicate, or disordered processing. By writing the rule identifier of the currently pending rule as the current rule identifier into the session state, the reference content, candidate set, user confirmation record, and refinement result can all accurately correspond to the same rule record. Therefore, when the page is refreshed, the network is interrupted, the user re-enters the task, or the background service resumes, the system can continue the rule refinement process based on the session state, improving the continuity, stability, and recoverability of task processing.
[0052] In one specific embodiment, the task is refined according to the session state recovery rules, including: The system reads the corresponding session state based on the session identifier carried in the recovery request. It's important to note that recovery requests can be triggered by the user re-entering the task page, refreshing the page, reconnecting to the server, restarting the background service, or the user actively clicking "continue processing." The session identifier points to a specific rule refinement task. The system reads the corresponding session state based on this identifier to obtain information such as the saved rule set, current rule identifier, reference content, candidate set, user confirmation record, and processing stage for that task. Using the session identifier for location helps avoid task state confusion when a user processes multiple rule files simultaneously or when multiple tasks are executed in parallel.
[0053] The current rule identifier and processing stage are read from the session state. In this step, it's important to note that the current rule identifier determines which rule record should continue processing upon recovery, while the processing stage determines from which processing node to resume execution after recovery. Using them together avoids the problem of knowing only the current rule without knowing the processing progress, or knowing only the processing progress without being able to identify the rule object. For example, if the current rule identifier points to a rule record, and the processing stage indicates waiting for user confirmation, the system should restore the candidate confirmation interface for that rule; if the processing stage indicates that the reference content has not yet been obtained, the system should continue searching for the reference content for that rule.
[0054] When the processing stage indicates that reference content has not yet been obtained, the system reads the current rule to be processed based on the current rule identifier and retrieves reference content based on that rule. It's important to note that "reference content not yet obtained" means the current rule to be processed has been determined, but the acquisition of reference materials related to that rule has not yet been completed. At this point, the system reads the corresponding current rule to be processed from the rule set based on the current rule identifier and retrieves reference content based on the rule's classification information and content. By entering the reference content acquisition process during recovery at this stage, the system avoids the model lacking reference materials due to interruption and ensures that subsequent candidate refinement results are still generated based on the current rule and its related background.
[0055] When the processing stage indicates that candidate refinement results have not yet been obtained, the system reads the current rule to be processed based on the current rule identifier, and generates model input content based on the current rule to be processed and the reference content. It's important to note in this step that "candidate refinement results have not yet been obtained" means the system already has the current rule to be processed, and the session state can record existing reference content or continue to obtain reference content, but a set of candidate options for user confirmation has not yet been formed. At this time, the system reads the current rule to be processed based on the current rule identifier and organizes the current rule to be processed and the reference content into model input content, ensuring complete input for subsequent text generation processing and preventing the candidate result generation process from being unable to continue due to page interruption or backend abnormalities.
[0056] When the processing phase indicates that user confirmation is pending, the system returns the current pending rule and candidate set to the user. It's important to note that "waiting for user confirmation" means the system has obtained the candidate set but has not yet received any selection, editing, or skipping action from the user. At this point, the system does not need to re-retrieve reference content or regenerate refined candidate results; instead, it directly returns the current pending rule and the already generated candidate set to the user based on the session state, allowing the user to continue confirming at the original processing location. This process prevents candidate items from being lost due to page refreshes or user departure, and also avoids the same rule being repeatedly invoked to generate multiple inconsistent candidate results.
[0057] When the processing stage indicates that a refined result has been formed, the next rule record that has not yet formed a refined result is determined according to the order of rule records in the rule set. It's important to note in this step that "formed a refined result" means that the currently pending rule has been confirmed by the user (e.g., skipped, or edited) and a corresponding refined result has been formed. At this point, the recovery process does not need to process this rule again but continues to the next rule. The system searches for rule records that have not yet formed a refined result after the current rule according to the order of rule records in the rule set and treats them as subsequent pending objects. By searching for the next incomplete rule in the order of arrangement, it ensures that the recovered task continues in the original order, reducing the problems of missed rule processing, duplicate processing, or disordered processing order.
[0058] When no further rule record has been refined, rule refinement result data is generated. It's important to note in this step that "no further rule record has been refined" means that all rule records in the rule set have already generated corresponding refinement results, or have been skipped and generated results according to user actions. In this case, the system generates rule refinement result data based on the rule set and the refinement results of each rule record. The rule refinement result data may include rule identifiers, rule classification information, original rule content, and refinement results, and is used for subsequent export, storage, review, or integration into the rule management system.
[0059] The technical solution implemented in this embodiment can quickly read the corresponding session state based on the session identifier after the rule refinement task is interrupted, and determine the recovery entry point by combining the current rule identifier and processing stage. For tasks that have not yet obtained reference content, reference content retrieval can continue; for tasks that have not yet obtained candidate refinement results, model input content can continue to be generated and connected to subsequent model processing; for tasks waiting for user confirmation, the current rule and candidate set can be directly returned to avoid duplicate generation; for tasks that have formed refinement results, progress can continue to the next unprocessed rule. Therefore, it can reduce the problems of lost processing progress, lost candidate options, duplicate processing, and result misalignment caused by page refresh, network anomalies, service interruptions, or user re-entry, and improve the continuity, recoverability, and completeness of the final result of the rule refinement task.
[0060] In one specific embodiment, retrieving reference content based on the current rule to be processed includes: Based on the rule classification information and rule content of the current rule to be processed, reference fragments are retrieved from the first reference rule base. In this step, it should be noted that the first reference rule base can be a preferred rule source, such as an online rule base, a historical review rule base, a business knowledge base, or an external search service. The rule classification information of the current rule to be processed is used to limit the search scope, enabling the system to prioritize finding reference materials belonging to the same or similar review categories as the current rule; the rule content of the current rule to be processed provides specific semantic content, enabling the system to find reference fragments that are similar in expression to the current rule, have similar review objects, or are related to the handling boundaries. Reference fragments refer to text content that can serve as the basis for generating candidate refinement results; these can include historical rule texts, similar rule descriptions, review guidelines, typical scenario descriptions, or existing refinement entries. By first searching in the first reference rule base, reference sources with higher credibility or more timely updates can be prioritized.
[0061] When no reference fragment is obtained from the first reference rule base, the reference fragment is retrieved from the second reference rule base based on the rule classification information and rule content. It should be noted that failure to obtain a reference fragment from the first reference rule base can include situations such as no matching results in the first reference rule base, access failure, response timeout, empty returned content, or returned content that cannot be parsed by the system. The second reference rule base can be a local rule base, a cached rule base, an offline index, or a backup rule base. When no usable reference fragment is found in the first reference rule base, the system continues to retrieve it from the second reference rule base using the rule classification information and rule content of the same currently pending rule, thereby avoiding the rule refinement process from relying entirely on a single reference source. By setting a second reference rule base, supplementary reference sources can be provided when the primary search path is unavailable or misses, improving the stability of reference content retrieval.
[0062] The reference segments are ranked based on their classification matching results and text similarity with the current rule to be processed. In this step, it's important to note that the classification matching result indicates the closeness between the rule category of the reference segment and the rule category information of the current rule to be processed; text similarity indicates the semantic or textual similarity between the text content of the reference segment and the rule content of the current rule to be processed. The system can calculate the classification matching result and text similarity separately and determine the ranking criteria for the reference segments based on both. For example, reference segments with completely identical categories and similar text content can be ranked higher; reference segments with inconsistent categories or weak text content relevance can be ranked lower. By combining classification matching and text similarity for ranking, irrelevant reference segments entering the model input content based solely on keyword matching can be reduced, improving the relevance between the reference content and the current rule to be processed.
[0063] Reference fragments are selected based on the ranking results to obtain reference content. In this step, it should be noted that the reference content can consist of one or more reference fragments ranked high in the ranking. The system can select reference fragments according to a preset number, preset length, or relevance threshold, and organize the selected fragments into the reference portion of the subsequent model input. When selecting reference fragments, the text content, source information, or classification information of the reference fragments can be retained so that they can be combined with the reference content when generating candidate refinement results. By selecting reference fragments based on the ranking results, the reference materials entering the model input can be more focused and relevant, reducing the interference of irrelevant content in the generation of candidate refinement results.
[0064] When no reference fragment is obtained, the empty set is used as the reference content. It's important to note in this step that "no reference fragment obtained" means that after searching the first and second reference rule bases, the system still cannot obtain reference text suitable for the current rule to be processed. Using the empty set as the reference content does not indicate a process interruption, but rather that there is currently no available reference material for the rule to be processed. When generating model input content subsequently, candidate refinement results can be generated based on the current rule to be processed itself and the preset structured output requirements. By using the empty set as the reference content, the system can explicitly record the "no reference fragment obtained" state, preventing the task from failing due to missing reference content.
[0065] The technical solution implemented in this embodiment can prioritize obtaining reference fragments from the first reference rule library when the current rule to be processed needs to be refined in conjunction with existing rule materials. If no results are found in the first reference rule library, the system switches to the second reference rule library to continue searching, thereby reducing the risk of process interruption due to the failure of a single search source. By combining classification matching results and text similarity to rank the reference fragments, the relevance between the reference content and the current rule to be processed can be improved, reducing the interference of irrelevant reference materials on the candidate refinement results. Even if no reference fragment is obtained, the system continues subsequent processing with an empty set as the reference content, ensuring that the rule refinement task maintains process continuity and recordable status even when reference materials are missing.
[0066] In one specific embodiment, the model input content is generated based on the current rule to be processed and the reference content, including: Generate rule input fragments based on the rule identifier, rule classification information, and rule content of the current rule to be processed. In this step, it's important to note that the rule input fragments clarify the rule object to be processed for the pre-defined text generation model. The rule identifier uniquely identifies the current rule within the rule set, ensuring that subsequent generated results, candidate sets, and user confirmation records correspond to this rule. The rule classification information describes the review category or rule scenario to which the current rule belongs, enabling the model to understand the rule boundaries within the corresponding category. The rule content is the original review rule text that needs further refinement. By organizing the above information into rule input fragments, the model avoids generating results solely from isolated rule text, thereby reducing the likelihood of candidate refinement results deviating from the rule classification or misinterpreting the rule's applicable scenario.
[0067] When the reference content includes a reference fragment, a reference input fragment is generated based on the fragment text and its source. In this step, it's important to note that the reference fragment is relevant text obtained from the reference rule base during the preceding retrieval process. The fragment text can be historical rules, similar rules, review instructions, typical scenario descriptions, or existing refined content. The fragment source indicates that the fragment comes from a first reference rule base, a second reference rule base, or other available reference sources. The system generates reference input fragments based on the fragment text and its source, enabling the preset text generation model to incorporate existing rule materials when generating candidate refined results, while retaining the source information of the reference materials for easy review and tracing of the basis for candidate results later.
[0068] When the reference content is an empty set, a reference input fragment is generated to indicate that no reference fragment has been obtained. It's important to note in this step that an empty reference content set means the system failed to obtain a usable reference fragment from the reference rule base. At this point, the model generation process is not directly terminated; instead, a reference input fragment is generated to indicate that no reference fragment has been obtained. This reference input fragment can be used to prompt the preset text generation model that there is currently no external reference content, and that the generation of candidate refinement results should primarily rely on the rule classification information and rule content of the current rule to be processed. Through this process, the system can clearly distinguish between the states of "no reference content retrieved" and "empty reference content," avoiding incomplete model input structure or task interruption due to missing reference content.
[0069] The process involves obtaining preset structured output requirements, including the number of candidate options and the required candidate identifier, title, and description fields for each option. It's important to note that these preset structured output requirements constrain the output format of the preset text generation model, ensuring that the generated refined candidate results can be parsed and displayed by the system. The number of candidate options limits the number of candidate results generated, preventing insufficient output that leaves users with limited choices, while also avoiding excessive output that increases confirmation costs. The candidate identifier field distinguishes different candidate options, the title field summarizes the core meaning of the candidate option, and the description field describes the specific rule refinement content corresponding to the candidate option. By setting these fields, the model output can more closely approximate the data structure that the system can process, reducing the risk of subsequent parsing failures or missing fields.
[0070] The system generates model input content based on rule input fragments, reference input fragments, and preset structured output requirements. In this step, it's important to note that the model input content is the complete input data sent to the preset text generation model, including basic information about the rule to be processed, available reference materials, and the model's output format requirements. The rule input fragment defines the processing object, the reference input fragment provides the basis for generation, and the preset structured output requirements define the output structure. The system combines these three elements to generate the model input content, allowing the preset text generation model to clearly define "which rule to generate," "which materials to use," and "what format to output." This improves the correspondence between the candidate refinement results and the current rule to be processed, the consistency with the reference content, and the adaptability to subsequent parsing processes.
[0071] The technical solution implemented in this embodiment can unify the current rules to be processed, reference content, and output format requirements into the model input content before generating candidate refinement results, enabling the preset text generation model to obtain complete and clear input information. By using rule input fragments, it can be ensured that the generated results accurately correspond to the current rules; by using reference input fragments, the generated content can be made as close as possible to existing rule materials and review guidelines; by using preset structured output requirements, the regularity and parsability of the model output can be improved. Even without obtaining reference fragments, the system can continue to execute model processing with a complete input structure, thereby improving the stability of the candidate refinement result generation process and the reliability of subsequent candidate parsing.
[0072] In one specific embodiment, the candidate refinement results are parsed to obtain a candidate set, including: According to the preset structured output requirements, the candidate identifier field, title field, and description field are extracted from the candidate refinement results to obtain the candidate options. It's important to note in this step that the candidate refinement results are the text output by the preset text generation model based on the model's input content, which may contain one or more candidate rule refinements. The preset structured output requirements define the types of fields that should be included in the candidate refinement results, enabling the system to extract candidate options according to uniform rules. The candidate identifier field distinguishes different candidate options, the title field summarizes the main content of the candidate option, and the description field provides specific refinement explanations for the corresponding candidate option. The system parses the candidate refinement results according to the preset structured output requirements, converting the model's output text into data objects that can be displayed on the front end, selected by the user, and subsequently written back.
[0073] When any candidate lacks a title field but includes a description field, the first preset number of characters from the description field of that candidate are extracted and written into the title field. It's important to note in this step that "missing a title field" means the system has extracted the candidate and its description from the candidate refinement results, but hasn't extracted a title field that can summarize the candidate. Since the description field usually contains the main refinement content of the candidate, the first preset number of characters can be extracted from the description field as the title field. The first preset number of characters can be determined based on the user's display area, the length of the candidate list, or the system's default configuration; for example, the first 10 to 30 characters. Through this processing, even if the model does not strictly output a title field, the system can still generate title information for the candidate for list display and user selection.
[0074] When any candidate lacks a description field that includes a title field, the value of the title field for that candidate is written into the description field. It's important to note that "missing a description field" means the system has extracted a title field that represents the core meaning of the candidate, but hasn't extracted a description field to further explain the candidate's content. In this case, writing the title field value into the description field ensures that the candidate at least has text content that the user can view and confirm. This process doesn't change the source of the candidate; rather, it completes the missing field situation, allowing the candidate to enter the unified display and confirmation process, preventing the entire candidate from being discarded due to a single missing field.
[0075] When no candidates are extracted from the candidate refinement results, a fallback candidate is generated based on the rule content of the current rule to be processed. It should be noted that not extracting any candidates from the candidate refinement results can include situations such as an empty model output, a mismatch between the model output and the preset structured output requirements, unparseable output content, or output content containing only descriptive text without candidate structure. The fallback candidate is an alternative display object generated by the system when no valid candidate can be obtained. It can be formed based on the rule content of the current rule to be processed, to indicate to the user that the current rule can still be viewed, edited, or reprocessed. By generating a fallback candidate, the system can avoid having no content to display on the front end when the candidate refinement results fail to be parsed, and it also retains the user's entry point to continue processing the current rule to be processed.
[0076] The extracted candidate options or fallback candidate options are written to the candidate option set. It's important to note that the candidate option set is used to centrally store the displayable candidate content corresponding to the currently pending rule. For candidate refinement results that can be parsed normally, the system writes the extracted candidate options to the candidate option set; for cases where no candidate options are parsed, the system writes the fallback candidate options to the candidate option set. The candidate option set can be associated with the current rule identifier and stored in the rule refinement session for display, selection, or editing by the user, and for being returned to the user when the task is resumed. By uniformly writing to the candidate option set, normal candidate options and fallback candidate options can be processed using a consistent data processing method in subsequent processes.
[0077] The technical solution implemented in this embodiment can perform structured parsing and field completion on candidate refinement results even when the output format of the preset text generation model is not completely stable. This allows the model output to be converted into a set of candidate options that the system can display, confirm, and write back. By completing the title or description fields when they are missing, the problem of candidate options becoming unusable due to missing local fields can be reduced. By generating a fallback candidate option when no candidate option can be extracted, the rule refinement process can be prevented from being interrupted due to a single abnormal model output. Therefore, the parsability of candidate refinement results and the continuity of the rule refinement task can be improved, and a stable data foundation can be provided for user confirmation and session recovery.
[0078] In one specific embodiment, based on the selection, editing, or skipping operations issued by the user terminal for the candidate set, the refined result of the current rule to be processed is obtained, including: When a selection operation is received, the system generates a refined result based on the candidate options selected by the user and the content of the current rule to be processed. It's important to note that the selection operation refers to the user choosing one or more candidate options from the candidate option set, which are then used as the basis for refining the current rule to be processed. The candidate options selected by the user can include a title field and a description field. The title field summarizes the core content of the candidate option, while the description field represents the specific refined expression of the rule. After receiving the selection operation, the system associates the selected candidate options with the content of the current rule to be processed, forming the corresponding refined result. This refined result can retain the original rule content and add or replace it with the refined description confirmed by the user, so that the final output can both trace back to the original rule and reflect the refined content confirmed by the user.
[0079] When an edit operation is received, a refined result is obtained based on the user's edited candidate options and the rule content of the currently pending rule. It's important to note that the edit operation refers to the user modifying the candidate option content based on the candidate option set and submitting it for confirmation. Because candidate options generated by the preset text generation model may not be sufficiently aligned with business requirements, have unclear applicability boundaries, or have a granularity that does not meet review requirements, the user is allowed to edit the candidate options. Upon receiving the edit operation, the system uses the user-edited candidate option as the confirmation content and combines it with the rule content of the currently pending rule to obtain the refined result. Through this process, the refined result does not entirely depend on the model output but reflects the user's final confirmation of the rule boundaries, applicable scenarios, and textual expression.
[0080] When a skip operation is received, the content of the currently pending rule is used as the refinement result. It's important to note that a skip operation means the user temporarily does not adopt any candidate options from the candidate set, nor does it further refine the currently pending rule. Upon receiving a skip operation, the system can directly use the content of the currently pending rule as the refinement result. This process ensures that the currently pending rule still has a corresponding result record, preventing the rule from being missing from the rule refinement result data due to user skipping. For skipped rules, their absence of substantial refinement can be identified later based on the rule identifier, facilitating subsequent review or reprocessing.
[0081] The refinement result is associated with the current rule identifier and written into the rule refinement session, and the processing stage is updated to indicate that the refinement result has been obtained. In this step, it's important to note that the current rule identifier is used to locate the rule currently awaiting processing. After the refinement result is associated with the current rule identifier and written into the rule refinement session, the system can clearly identify which rule record the refinement result corresponds to. The processing stage indicates the processing progress of the rule currently awaiting processing. After the refinement result is written, updating the processing stage to indicate that the refinement result has been obtained allows the system to recognize that the rule has been confirmed when continuing processing or resuming the task. This process prevents the same rule from being repeatedly confirmed, repeatedly written, or incorrectly judged as unprocessed when the task is resumed.
[0082] The technical solution implemented in this embodiment can generate corresponding refined results based on different user operations, enabling the rule refinement process to combine model generation efficiency with manual verification capabilities. For selection operations, the system can quickly adopt candidate options approved by the user; for editing operations, the system can receive the user's revised expression, improving the consistency between the refined results and business review standards; for skip operations, the system still retains the result record for the currently pending rule, avoiding missing items in the final result. Furthermore, by associating the refined results with the current rule identifier and writing it into the rule refinement session, and updating the processing stage, it can ensure a stable correspondence between the refined results and the rule records, reducing problems such as result mismatch, duplicate processing, and task recovery anomalies.
[0083] In this embodiment, it should be noted that the stable processing system can be deployed on a server, cloud platform, local computing device, or a computing system consisting of a front-end user terminal and a back-end server. The data processing module, session management module, generation processing module, interaction processing module, and result output module can be independent software functional units, or they can be implemented by the same processor executing different program logics. The "connection" between the modules can be understood as a data call relationship, interface call relationship, message passing relationship, or database read / write relationship, and is not limited to a physical line connection.
[0084] The data processing module receives content moderation rule data sources, parses them, and outputs a set of rules. These data sources can be rule tables, rule list files, exported online tables, or data files converted from rule documents. During parsing, the data processing module identifies rule rows, category fields, and rule content fields, and organizes the inconsistent raw data into a rule set. This rule set is the foundation for subsequent system processing and can include multiple rule records. Each record must represent at least one rule identifier, category, and rule text for the rule to be refined. By setting up the data processing module, subsequent modules can avoid directly dealing with complex raw files and instead process a more uniformly structured rule set.
[0085] The session management module connects to the data processing module and is used to establish rule refinement sessions based on the rule set, outputting the currently pending rules and session status. The rule refinement session represents the processing context of a rule refinement task, and the session status stores intermediate data and progress information during the task's execution. The session status can include information such as the rule set, current rule identifier, reference content, candidate refinement results, candidate set, user confirmation record, refinement result, and processing stage. The currently pending rule is the rule record being processed from the rule set, which can be determined one by one according to the order in the rule set. Through the session management module, the system can continuously monitor which rule is currently being processed, whether candidate results have been generated, whether user confirmation is pending, and whether a refinement result has been formed.
[0086] The generation processing module connects to the session management module and is used to obtain reference content based on the current rule to be processed, and to call the preset text generation model to output candidate refinement results. The reference content can come from historical rule bases, similar rule bases, rule description bases, local cache bases, or external retrieval services. The generation processing module can obtain relevant reference content based on the classification information and rule content of the current rule to be processed, and organize the current rule to be processed, the reference content, and the output format requirements into the model input content. The preset text generation model refers to a text processing model that can generate rule refinement content based on the input text. The candidate refinement result is the preliminary refined content output by the model, which can include one or more candidate expressions that can be selected or edited by the user. By setting up the generation processing module, the acquisition of reference content and the generation of candidate content can be centrally processed, reducing the disconnect between the current rule and the reference content and candidate results.
[0087] The interaction processing module connects to the generation processing module and the session management module. It receives confirmation information from the user regarding the refined candidate results, outputs the refined results, and returns them to the session management module. The user can be a web page, a client application, a backend management interface, or other human-computer interaction interface. Confirmation information can include the user's selection of candidate content, editing information, skipping information, or other information used to confirm the current rule's processing result. After receiving the confirmation information, the interaction processing module associates the user-confirmed content with the currently pending rule to form the corresponding refined result, and returns this refined result to the session management module for storage. By setting up the interaction processing module, the user's final confirmation ability regarding the review criteria, rule boundaries, and refined expressions can be preserved, preventing the model-generated results from being directly written into the final result without confirmation.
[0088] The results output module connects to the session management module and outputs the refined rule results data after all rule records in the rule set have received their corresponding refined results. This refined rule results data can include rule identifiers, rule classification information, original rule content, and refined results. It can also include user confirmation records, processing time, skip flags, or reference source information, depending on actual needs. The results output module can output the refined rule results data as a table file, structured data, database records, or a data interface for use by other rule systems. By setting up the results output module, the refined results generated line by line in the rule refinement task can be uniformly organized, facilitating subsequent export, review, storage, or integration into content review systems.
[0089] The session management module, upon receiving a recovery request, outputs the restored current pending rules to the generation processing module or interaction processing module based on the session state. Recovery requests can be triggered by page refresh, user re-entering the task, service restart, network connection restoration, or user-initiated click to continue processing. If the session state indicates that the current pending rule has not yet obtained candidate refinement results, the session management module can output the restored current pending rule to the generation processing module, allowing the generation processing module to continue obtaining reference content or generating candidate refinement results. If the session state indicates that the current pending rule has obtained candidate refinement results but has not yet been confirmed, the session management module can output the restored current pending rule and related candidate content to the interaction processing module, restoring the user to the confirmation interface. Through this recovery mechanism, the system can continue processing based on the saved session state after a task interruption, instead of restarting the entire rule refinement task.
[0090] The technical solution implemented in this embodiment can organize inconsistent content review rule data sources into a rule set through the data processing module, providing stable input for subsequent modules; the session management module can uniformly maintain the current rules to be processed and the session status, enabling multiple rules to be processed continuously in a predetermined order; the generation processing module can generate candidate refinement results by combining reference content and a preset text generation model, improving the generation efficiency and consistency of rule refinement content; the interaction processing module can receive user confirmation information, allowing the final refinement results to retain the manual confirmation and correction process; and the result output module can uniformly output the rule refinement result data, ensuring the final result is complete and usable. Furthermore, by having the session management module output the restored current rules to be processed to the generation processing module or interaction processing module upon a recovery request, the loss of candidate results, duplicate rule processing, and processing progress disorder caused by page refresh, network interruption, or user re-entry into the task can be reduced, thereby improving the stability, continuity, and recoverability of the content review rule refinement task.
[0091] In one specific embodiment, a user uploads a content moderation rule table via a client. This table contains multiple moderation rules to be refined. Some rule rows include a rule number, rule category, and rule content; others do not have complete category information because they reuse the category from the previous row. Upon receiving this content moderation rule data source, the system's data processing module first reads the rule rows from the rule table and identifies the category and rule content fields based on the table header fields. For rule rows where rule content can be read, the data processing module extracts the existing category information and the rule content within the row. For rule rows where incomplete category information is missing, the data processing module completes the information based on the valid category information already read from the preceding rule rows, thus obtaining complete category information that independently represents the rule's affiliation. Subsequently, the data processing module generates a rule identifier for each rule row and combines the rule identifier, rule category information, and rule content into multiple rule records, forming a rule set.
[0092] After the rule set is generated, the data processing module sends it to the session management module. The session management module establishes a rule refinement session based on this rule set and generates a session identifier to identify this rule refinement task. The session management module stores information such as the rule set, current rule identifier, reference content, candidate set, user confirmation record, refinement result, and processing stage in the session state. The system selects the first rule record that has not yet received a refinement result as the current rule to be processed, according to the order of the rule records in the rule set, and writes the rule identifier of this current rule to the session state as the current rule identifier. In this way, the reference content, candidate refinement results, user confirmation record, and refinement result in the subsequent system can all be matched with this rule record through the current rule identifier.
[0093] After determining the current rule to be processed, the session management module sends it to the generation processing module. The generation processing module searches for relevant reference fragments in the first reference rule library based on the rule classification information and rule content of the current rule. If no usable reference fragment is found in the first reference rule library, the generation processing module continues searching in the second reference rule library. After obtaining a reference fragment, the generation processing module sorts it according to the classification matching result and text similarity between the reference fragment and the current rule, and selects the highest-ranked reference fragment as the reference content. If no reference fragment is found in either the first or second reference rule library, the generation processing module uses an empty set as the reference content and continues the subsequent process without interrupting the task.
[0094] Subsequently, the generation processing module generates model input content based on the current rule to be processed and the reference content. Specifically, the generation processing module organizes the rule identifier, rule classification information, and rule content of the current rule to be processed into a rule input fragment; it organizes the fragment text and fragment source from the reference content into a reference input fragment; and, in conjunction with preset structured output requirements, generates model input content. The preset structured output requirements can limit the number of candidate options, and each candidate option must include a candidate identifier field, a title field, and a description field. The generation processing module calls a preset text generation model to process the model input content and obtain the candidate refinement results.
[0095] After the candidate refinement results are generated, the system parses them, extracting the candidate identifier, title, and description fields to obtain the candidates, which are then written into the candidate set. If a candidate in the refinement results lacks a title field but has a description field, the system can complete the title field based on the description field; conversely, if a description field is missing but a title field exists, the system can complete the description field based on the title field. If no candidates can be extracted from the candidate refinement results, the system generates a fallback candidate based on the rule content of the current rule to be processed and writes the fallback candidate into the candidate set. After the candidate set is formed, the session management module writes the current rule identifier, the candidate set, and the processing stage into the session state and updates the processing stage to "awaiting user confirmation."
[0096] After receiving the candidate set, the interaction processing module sends the current rule to be processed and the candidate set to the user terminal for display. The user can select, edit, or skip the candidates on the user terminal. When the user selects one or more candidates, the interaction processing module obtains a refined result based on the selected candidates and the rule content of the current rule to be processed. When the user edits a candidate, the interaction processing module obtains a refined result based on the edited candidate and the rule content of the current rule to be processed. When the user selects to skip, the interaction processing module uses the rule content of the current rule to be processed as the refined result. After the refined result is formed, the interaction processing module returns the refined result to the session management module. The session management module associates the refined result with the current rule identifier and saves it, and updates the processing stage to indicate that the refined result has been obtained.
[0097] After the current rule to be processed is completed, the session management module continues to search for the next rule record that has not yet received a refined result, according to the order of the rule records in the rule set. This rule record is then designated as the new rule to be processed, and the processes of reference content retrieval, model input content generation, candidate refined result generation, candidate parsing, user confirmation, and refined result writing are repeated. If a page refresh, network interruption, or user re-entering the task occurs during task execution, the user can send a recovery request carrying a session identifier. The session management module reads the corresponding session state based on the session identifier and determines the recovery method based on the current rule identifier and processing stage in the session state. If the processing stage indicates that the reference content has not yet been obtained, the session management module sends the current pending rule to the generation processing module to continue obtaining the reference content; if the processing stage indicates that the candidate refinement result has not yet been obtained, the session management module instructs the generation processing module to continue generating the model input content and call the preset text generation model; if the processing stage indicates that user confirmation is pending, the session management module sends the current pending rule and the saved candidate set to the interaction processing module, so that the user terminal returns to the original confirmation interface; if the processing stage indicates that the refinement result has been obtained, the session management module continues to search for the next rule record that has not yet obtained the refinement result.
[0098] Once all rule records in the rule set have received their corresponding refined results, the session management module notifies the result output module to generate the rule refinement result data. The result output module, based on the rule set and the refined results for each rule record, compiles a data file or structured data containing rule identifiers, rule classification information, original rule content, and refined results. For rule records that have been confirmed or edited by the user, the refined content after user confirmation is written into the rule refinement result data; for rule records skipped by the user, the original rule content or the corresponding skipped record is retained in the rule refinement result data. Thus, the system completes the entire processing flow from receiving rule data sources, generating rule sets, establishing sessions, obtaining reference content, generating candidate content, user confirmation, status restoration, to result output, enabling the content review rule refinement task to execute in a stable order and resume processing after interruption.
[0099] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A stable processing method for refining content review rules, characterized in that, include: The system receives a content moderation rule data source, reads the rule rows from the content moderation rule data source, performs field matching and missing classification completion on the rule rows, and obtains a rule set; wherein, the rule set includes multiple rule records, and each rule record includes a rule identifier, rule classification information and rule content; A rule refinement session is established based on the rule set, the current rule to be processed is determined according to the arrangement order of the rule records in the rule set, and the rule identifier of the current rule to be processed is used as the current rule identifier; Retrieve reference content based on the current rule to be processed, and generate model input content based on the current rule to be processed and the reference content; The preset text generation model is invoked to process the input content of the model, and the candidate refinement results are obtained. The candidate refinement results are then parsed to obtain a candidate set. Based on the selection, editing, or skipping operations issued by the user on the candidate set, the refined result of the current rule to be processed is obtained; The rule refinement session records the session state, including the current rule identifier, the candidate set, and the processing stage, and resumes the rule refinement task based on the session state when a recovery request is received. After all the rule records in the rule set have obtained corresponding refinement results, rule refinement result data is generated.
2. The stable processing method for refining content review rules according to claim 1, characterized in that, Read the rule rows from the content review rule data source, perform field matching and missing category completion on the rule rows to obtain a rule set, including: Identify the file type of the data source for the content moderation rules, and determine the reading method based on the file type; The content review rule data source is read according to the described reading method to obtain multiple rule rows. The header fields in the content review rule data source are matched with the preset field mapping table to determine the category fields and rule content fields; Based on the classification field and the rule content field, extract existing classification information and in-row rule content from each rule row; Filter out rule rows that did not extract inline rule content; The classification context is maintained according to the arrangement order of the multiple rule rows, and the classification context is updated by the valid classification information in the read rule rows; When the existing classification information of the currently read rule row is incomplete, the classification context is used to complete the classification of the rule row to obtain complete classification information; The rule record is generated based on the complete classification information and the inline rule content.
3. The stable processing method for refining content review rules according to claim 2, characterized in that, The rule identifier is generated in the following way: Obtain the data source identifier of the content review rule data source; When the rule row contains an original rule number field and the value of the original rule number field is not empty, the value of the original rule number field is used as the rule identifier, or the value of the original rule number field is combined with the data source identifier to generate the rule identifier; When the original rule number field does not exist in the rule row, or the field value of the original rule number field is empty, the text normalization processing of the rule content in the row is performed to obtain normalized rule content. A rule content summary is generated based on the normalized rule content, and the rule identifier is generated based on the data source identifier, the original row number of the rule row in the content review rule data source, and the rule content summary. Write the rule identifier into the corresponding rule record.
4. The stable processing method for refining content review rules according to claim 1, characterized in that, A rule refinement session is established based on the rule set. The current rule to be processed is determined according to the order of the rule records in the rule set, and the rule identifier of the current rule to be processed is used as the current rule identifier, including: Generate a session identifier based on the set of rules; Establish a session state corresponding to the session identifier; The session state records the rule set, the current rule identifier, the reference content, the candidate set, the user confirmation record, and the processing stage. According to the order of the rule records in the rule set, the first rule record that has not been refined is determined as the current rule to be processed; Write the rule identifier of the currently pending rule into the session state as the current rule identifier; The processing stage refers to the processing node where the current rule to be processed is located.
5. The stable processing method for refining content review rules according to claim 4, characterized in that, The task is refined based on the session state recovery rules, including: The corresponding session state is read based on the session identifier carried in the recovery request; Read the current rule identifier and the processing stage from the session state; When the processing stage indicates that the reference content has not yet been obtained, the current rule to be processed is read according to the current rule identifier, and the reference content is retrieved according to the current rule to be processed. When the processing stage indicates that the candidate refinement result has not yet been obtained, the current rule to be processed is read according to the current rule identifier, and the model input content is generated according to the current rule to be processed and the reference content; When the processing stage indicates that user confirmation is pending, the current pending rule and the candidate set are returned to the user. When the processing stage indicates that the refinement result has been obtained, the next rule record that has not yet obtained a refinement result is determined according to the order of the rule records in the rule set; When there is no next rule record that has not been refined, the rule refinement result data is generated.
6. The stable processing method for refining content review rules according to claim 1, characterized in that, Retrieve reference content based on the current pending rules, including: Based on the rule classification information and rule content of the current rule to be processed, a reference fragment is retrieved from the first reference rule base; When no reference fragment is obtained from the first reference rule base, a reference fragment is retrieved from the second reference rule base according to the rule classification information and the rule content. The reference segments are sorted according to the classification matching results and text similarity between the reference segments and the current rule to be processed. The reference segment is selected based on the sorting result to obtain the reference content; When no reference fragment is available, the empty set is used as the reference content.
7. The stable processing method for refining content review rules according to claim 6, characterized in that, The model input content is generated based on the current rule to be processed and the reference content, including: Generate a rule input fragment based on the rule identifier, rule classification information, and rule content of the current rule to be processed; When the reference content includes a reference fragment, a reference input fragment is generated based on the fragment text and fragment source of the reference fragment; When the reference content is an empty set, a reference input segment is generated to indicate that no reference segment has been obtained; Obtain preset structured output requirements, which include the number of candidate options and the candidate identifier field, title field, and description field that each candidate option needs to include; The model input content is generated based on the rule input segment, the reference input segment, and the preset structured output requirements.
8. The stable processing method for refining content review rules according to claim 7, characterized in that, The candidate refinement results are analyzed to obtain a candidate set, including: According to the preset structured output requirements, the candidate identifier field, title field, and description field are extracted from the candidate refinement results to obtain the candidate options; When any of the candidate options lacks a title field but includes a description field, the first preset number of characters in the description field of that candidate option are extracted and written into the title field; When any of the candidate options lacks a description field but includes a title field, the value of the title field of that candidate option is written into the description field; When no candidate is extracted from the candidate refinement results, a fallback candidate is generated based on the rule content of the current rule to be processed; The extracted candidate options or the fallback candidate options are written into the candidate option set.
9. The stable processing method for refining content review rules according to claim 8, characterized in that, Based on the selection, editing, or skipping operations issued by the user on the candidate set, the refined result of the current rule to be processed is obtained, including: When the selection operation is received, the refined result is obtained based on the candidate selected by the user and the rule content of the current rule to be processed. When the edit operation is received, the refined result is obtained based on the candidate options edited by the user and the rule content of the current rule to be processed; When the skip operation is received, the rule content of the current rule to be processed is used as the refinement result; The refinement result is associated with the current rule identifier and written into the rule refinement session, and the processing stage is updated to indicate that the refinement result has been obtained.
10. A stable processing system for content moderation rule refinement tasks, which executes the stable processing method for content moderation rule refinement tasks as described in any one of claims 1-9 during runtime, characterized in that... include: The data processing module is used to receive content review rule data sources, parse the content review rule data sources, and output a set of rules. The session management module, connected to the data processing module, is used to establish rule refinement sessions based on the rule set and output the current rules to be processed and the session status. A generation processing module, connected to the session management module, is used to obtain reference content according to the current rules to be processed, and call a preset text generation model to output candidate refinement results; An interactive processing module, connected to the generation processing module and the session management module, is used to receive confirmation information from the user terminal regarding the candidate refinement results, output the refinement results, and return the refinement results to the session management module; The result output module is connected to the session management module and is used to output the rule refinement result data after all the rule records in the rule set have obtained the corresponding refinement results. The session management module is further configured to, upon receiving a recovery request, output the current pending rules after recovery to the generation processing module or the interaction processing module based on the session state.