Method for constructing content auditing rule base and computer equipment
By constructing a multi-level structured rule base and utilizing a large language model to understand and cluster rule text, the problem of low efficiency and accuracy in the review of user-generated content on social media and short video platforms has been solved, achieving faster review speed and higher accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, social media and short video platforms suffer from low matching efficiency and inaccurate review results due to the large number of rule texts in the review of user-generated content. In particular, when there are a large number of rule texts, it is difficult to meet the requirements of real-time review, and there is also interference from irrelevant rule texts.
By acquiring rule text, extracting entities and clustering them, a multi-level structured rule base is constructed. A large language model is used to understand the logical relationships between rule texts, merge synonymous conditions, and construct first and second clusters, thereby reducing computation and improving matching accuracy.
It speeds up content review, reduces the impact of irrelevant rule texts, improves the accuracy and efficiency of review results, and prevents rule omissions.
Smart Images

Figure CN121833668A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification belong to the technical field of artificial intelligence, and particularly relate to a method for constructing a content review rule library and a computer device. BACKGROUND
[0002] With the development of the Internet, in social media and short video platforms, users generally publish multi-modal content, such as at least one of text, pictures, and videos. The content published by the user is also referred to as user-generated content (UGC). Social media and short video platforms generally need to review UGC based on rule documents recording rule texts,
[0003] In related technologies, UGC is generally matched with rule texts in rule documents. In the case of conditional matching of UGC and any rule text, the content published by the user can be processed according to the processing mode specified by the rule text. However, this method has the following problems: first, in the case of a large number of rule texts, UGC needs to be matched with the conditions of each rule text, resulting in low rule matching efficiency in the content review process and difficulty in meeting real-time review requirements; second, due to the large number of rule texts, there are many irrelevant domain interference rule texts corresponding to UGC, which may result in the final recalled rule text not matching the UGC, and thus inaccurate review results. SUMMARY
[0004] The purpose of the present specification is to provide a method for constructing a content review rule library and a computer device.
[0005] The first aspect of the present specification provides a method for constructing a content review rule library, comprising:
[0006] obtaining a plurality of rule texts; each rule text includes a condition and an action, and the rule text is used to indicate that the content is processed by the action if the content meets the condition;
[0007] extracting an entity corresponding to each rule text from the condition of the rule text;
[0008] clustering the entities corresponding to each rule text to obtain a plurality of first clustering clusters; the first clustering cluster includes a feature vector of the entity included in at least one rule text;
[0009] determining a plurality of second clustering clusters based on the plurality of first clustering clusters; any second clustering cluster includes at least one first clustering cluster, and the cluster center distance of any two first clustering clusters included in the second clustering cluster is less than a preset distance threshold;
[0010] Based on the correspondence relationship between the second clustering cluster, the first clustering cluster and the rule text, a multi-level rule library is constructed.
[0011] A computing device according to a second aspect of the present specification includes a memory and a processor, the memory stores executable code, and the processor executes the executable code to implement the method of constructing the content review rule library described above.
[0012] In the method of the present specification, the first clustering cluster is obtained by clustering the entities, and the second clustering cluster is obtained by clustering the first clustering cluster, and a multi-level structured rule library is constructed, which can be used for content. In content review, the rule text used for review can be determined according to the matching degree of the second clustering cluster or the first clustering cluster with the content published by the user, which reduces the calculation amount and speeds up the review speed compared with matching all rule texts with the content published by the user. Moreover, in the above method, by matching with the second clustering cluster, the rule texts included in the field with high matching degree with the content published by the user can be screened out, reducing the influence of irrelevant rule texts on review matching; and compared with rule text retrieval according to the first clustering cluster only, the second clustering cluster can better reflect the field corresponding to the content published by the user, preventing rule omission caused by retrieval according to the first clustering cluster only. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments described in the present specification, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0014] Figure 1 It is a flowchart of the method of constructing the content review rule library in an embodiment; Figure 2 It is a schematic diagram of the correspondence relationship between the first clustering cluster and the second clustering cluster in an embodiment; Figure 3 It is a schematic diagram of the method of constructing the content review rule library in an embodiment; Figure 4 It is a flowchart of the incremental update method of the rule library in an embodiment. DETAILED DESCRIPTION
[0015] In order for those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described in the specification below in conjunction with the drawings in the embodiments of the specification. Obviously, the described embodiments are only a part of the embodiments of the specification, not all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the protection scope of the specification.
[0016] In the specification, a large language model (LLM) can also be referred to as a large model. A large language model is a natural language processing model based on deep learning technology, with a parameter order of magnitude of tens of billions to hundreds of billions or even higher, and with strong language understanding and generation capabilities. A large language model can use a Transformer architecture or its variants (such as GPT, BERT, etc.), which uses an attention mechanism to realize global modeling of sequence data and can efficiently handle long-distance dependencies, thus performing well in natural language tasks. A large language model is pre-trained on a large corpus of text to learn statistical features and semantic relationships of language, making it have good generalization ability. The core capabilities of a large language model include but are not limited to: understanding contextual semantics, generating coherent and grammatically correct text, performing logical reasoning, and handling multi-task scenarios. Its usage methods usually include direct inference and fine-tuning. In the direct inference mode, users guide the large language model to generate specific output by designing prompts. The prompt can be a text form of task description or instruction to stimulate the semantic understanding and generation ability of the large language model. In the fine-tuning mode, the large language model is further trained on a small dataset in a specific domain to optimize its performance on specific tasks. The strong generalization ability and flexibility of a large language model make it an important tool in the field of artificial intelligence technology, providing efficient and accurate solutions for automated text generation and understanding.
[0017] In some embodiments, large language models can also understand and generate data from other modalities (such as visual and audio data). In this case, large language models can also be called multimodal large language models (MLLMs). MLLMs provide a richer and more natural interactive experience by integrating multiple types of input and output, such as text, images, and sound. The core advantage of MLLMs lies in their ability to process and understand information from different modalities and fuse this information to complete complex tasks. For example, MLLMs can analyze an image and generate descriptive text, or generate a corresponding image based on a text description. This cross-modal understanding and generation capability makes MLLMs widely applicable across multiple fields.
[0018] It should be noted that the key technologies of large language models can be found in the detailed description in the paper "A Survey of Large Language Models" (paper number: arXiv:2303.18223v16, published on March 11, 2025, public link: https: / / doi.org / 10.48550 / arXiv.2303.18223), and will not be repeated here.
[0019] This manual provides a method for building a content moderation rule base, which can be used to build a rule base for content moderation. This manual also provides a content moderation method for reviewing user-posted content based on the built rule base. The two methods will be explained separately below.
[0020] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for constructing a content moderation rule base, as shown in this specification, including the following steps:
[0021] Step 101: Obtain multiple rule texts.
[0022] Each rule text includes a condition and an action. The condition rule text indicates how to process the user-posted content under the given condition, provided that the user-posted content meets the condition. In other words, the condition indicates the conditions that the user-posted content meets, and the action indicates how to process the user-posted content under the given condition.
[0023] The rule text is a manually written document outlining the review rules. Conditions describe the criteria that user-posted content meets, while actions describe how to process the content. Optionally, the action can be one of several pre-defined tags, allowing the review system to pre-define specific processing methods for each tag. This makes it easy for the system to process user-posted content based on tags. If user-posted content meets the conditions in the rule text, it must be processed according to the actions outlined in the rule text, such as deleting the content.
[0024] Here are some examples of rule texts. One rule text could state: "Involves sharing good products," with the corresponding action being "Approve," meaning the user's content will not be processed. Another example is: "Involves promoting prohibited items," with the corresponding action being "Delete," meaning the user's content will be deleted. Yet another example is: "Contains images of Buddha, Jesus, and God," with the corresponding action being: "Mark the user's content as religiously related." This facilitates consistent handling of content posted by users with these tags when new rule texts are introduced.
[0025] The rule documents used in existing technologies may be unstructured text information, with conditions and actions written in the same text or in distant locations, which makes it difficult to find the rule text. This specification uses structured rule text that includes conditions and actions, which can reduce the difficulty of matching rule text, and the review system can also clearly determine how to process the rule text based on the actions associated with the conditions.
[0026] Furthermore, some actions not only include how to process the content posted by users, but also how to process the users who posted that content. For example, if the rule text specifies the condition of creating a group to attract traffic, the actions could include deleting the content posted by the user and suspending the user's account for three days.
[0027] In some embodiments, rule texts that meet specific conditions can be obtained directly, and then step 101 can read multiple rule texts from the corresponding storage space.
[0028] In other embodiments, the given rule text is an initial rule document in human-written text format. In other words, the initial rule document is the first human-written rule document obtained by the system. Furthermore, the multiple initial rule documents obtained may have inconsistent formats; for example, the initial rule documents may include formats such as docx, pdf, tables, and web pages. Based on the initial rule documents, rule documents with a format hierarchy conforming to the specifications can be obtained.
[0029] To facilitate the recognition of rule text in the initial rule document, it can be preprocessed. Preprocessing may include using OCR or other text recognition methods to read the content of the initial rule document line by line. Furthermore, to ensure consistent formatting of the extracted content, character cleaning can be performed. Character cleaning may include eliminating tabs, consecutive spaces, and non-standard Unicode characters, as well as unifying full-width and half-width characters.
[0030] Furthermore, the structure of initial rule documents is often inconsistent; the review items in different initial rule documents may be represented using a mixture of numerical designations, indentation, and symbols. Therefore, the hierarchical structure of the preprocessed initial rule document can be parsed and represented in a second preset format to obtain the rule document. This allows for multiple rule documents with a clear and consistent hierarchical structure, facilitating subsequent analysis. In this specification, a rule document refers to a document whose format and hierarchy conform to the specifications, while an initial rule document refers to a document whose format and hierarchy do not conform to the specifications.
[0031] In an optional implementation, when multiple rule documents with a unified format and hierarchy exist, the rule documents can be processed directly in the subsequent text. The processing method for rule documents will be explained below. Although the rule documents have a unified format and hierarchy, the following problems may still exist: First, there is a lack of clear relationships between rule examples; for example, two adjacent rules may have a subordinate relationship, but this is not explicitly marked. Second, the names for the same entity are inconsistent in the rule documents; for example, aliases, official names, and colloquialisms are used interchangeably; moreover, the same word may have different meanings in different scenarios. Third, multiple mutually dependent or mutually exclusive action rules may be implicitly contained in adjacent paragraphs; these deep logics are often difficult to automatically parse into executable audit logic using code.
[0032] Based on this, this specification illustrates a method for obtaining rule text from a rule document.
[0033] First, based on the context in the rule document, a large language model can be used to extract the conditions, actions, and cases recorded in the rule document and their corresponding relationships.
[0034] Specifically, rule documents and prompts can be input into a large language model, which then atomically decomposes the rule document to obtain each specific condition, action, and case, as well as their corresponding relationships. Because large language models have strong text understanding capabilities, they can comprehend the subordinate relationships between multiple rules and identify implicit interdependent or mutually exclusive logical rules in adjacent paragraphs. Therefore, through large language models, logically clear conditions, actions, and cases can be extracted, and the relationships between these data can be identified.
[0035] The input prompts can specifically include: text extraction requirements and the specific form of the extracted text. The text extraction requirements can indicate the logical relationships between adjacent texts that the large model needs to recognize, as well as any implicit logic involved.
[0036] Furthermore, it can prompt the large model to split a sentence containing multiple rules into smaller sentences. It can also prompt the large model to break down cases, clearly indicating the relationship between the cases and the rules formed by the conditional actions, thus preventing the large model from treating cases as rules.
[0037] Furthermore, in some cases, multiple conditions correspond to only one action. In such cases, the large model can be prompted to extract the action from a longer context if the action of the condition cannot be identified in a short context, thus ensuring the integrity of the rule text.
[0038] Furthermore, for rule text, conditions and actions are necessary, while cases are not, and rule documents may contain rule text without corresponding cases. Therefore, it can also be suggested to larger models that conditions and actions are mandatory, while cases are optional.
[0039] Secondly, based on the conditions, actions, and cases extracted from the rule document and their corresponding relationships, synonymous conditions are merged through a large language model, each condition is summarized to determine its corresponding sub-features, and the rule text is output in a first preset format; the rule text also records the sub-features and cases corresponding to the conditions.
[0040] Specifically, the extracted text and corresponding prompt words can be input into a large language model to merge synonymous conditions and summarize the conditions to obtain rule text that conforms to the first preset format.
[0041] This approach, employing a two-step large model, yields rule text that better meets the requirements compared to a single-step large model. Furthermore, since the rule document is manually written, multiple rules with similar meanings may exist in different locations within the document; therefore, redundancy can be reduced by merging synonymous conditions. Additionally, while merging synonymous conditions, sub-features can be extracted to facilitate subsequent matching.
[0042] As mentioned earlier, since there are many synonyms in the document, the terminology can be standardized by replacing multiple action synonyms (especially synonyms within actions) with standardized terms. This will facilitate matching based on rule-based text in subsequent processes.
[0043] The prompts can include text extraction requirements and the specific form of the extracted text. Text extraction requirements can include: merging similar conditions and summarizing sub-features for each condition. Furthermore, in some cases, the rule text extracted by the large model may have missing actions. Therefore, the text extraction requirements can also prompt the large model to label the corresponding condition as "Action Undefined" when actions are missing, so that subsequent manual filtering based on the labels can quickly identify conditions with missing actions and facilitate condition supplementation. In addition, some special symbols can be removed from the rule text; these special symbols may have been introduced into the specific text form specified in the previous large model processing step.
[0044] By leveraging the semantic parsing capabilities of the large model in the above steps, the transformation from unstructured documents to executable rules is achieved, resolving the issues of format heterogeneity and logical nesting.
[0045] Step 103: Extract the entity corresponding to each rule text from the conditions of the rule text.
[0046] Specifically, to facilitate clustering later, it is necessary to extract entities from the rule text. An entity refers to an instance of an object or concept that can be identified and categorized into a specific semantic type and is uniquely identifiable. Examples include names of people, places, organizations, times, events, products, and numerical representations.
[0047] In one alternative implementation, entity extraction can be based on a large language model.
[0048] In another alternative implementation, entities can be extracted according to the following method. Step 103 specifically includes:
[0049] First, for each rule text, multiple candidate words are obtained from the conditions of the rule text based on the word segmentation method.
[0050] Specifically, the conditions of the rule text can be segmented first to obtain multiple candidate words. In an optional implementation, a multi-granularity n-gram segmentation method can be used.
[0051] Since too many entities may introduce unnecessary information to the subsequent clustering, it is necessary to split multiple candidate words to obtain the entities most relevant to the conditions of the rule text.
[0052] Secondly, based on the context of multiple candidate words in the document corresponding to the rule text, the order of multiple candidate words is determined; the order indicates the degree of correlation between the candidate words and the rule text; the document corresponding to the rule text is the source document of the rule text.
[0053] The document corresponding to the rule text can refer to the initial rule document or the rule document mentioned earlier. The ranking can be determined based on various information, such as the word frequency of candidate words or document frequency.
[0054] In an optional implementation, this step may specifically include: for each candidate word among multiple candidate words, determining the word frequency of the candidate word in the context of the document corresponding to the rule text, and the pointwise mutual information (PMI) between the candidate word and the context of the document corresponding to the rule text; determining the score of the candidate word based on the weighted sum of the PMI and the word frequency; and determining the ranking of the multiple candidate words based on their scores.
[0055] Specifically, the degree of association between candidate words and rule text can be determined based on the word frequency and PMI of the candidate word. PMI indicates the probability of two words appearing simultaneously. PMI can be used to evaluate the degree of association between candidate words and the context of the rule text.
[0056] Optionally, the PMI value can be normalized before calculating the weighted sum of word frequency and PMI.
[0057] After obtaining the ranking of multiple candidate words, the top K candidate words with the highest scores can be selected to form a refined candidate word list, and the refined candidate word list can be further processed.
[0058] Finally, the multiple candidate words and their order, the rule text, and the context of the rule text in the corresponding document are input into the large language model to determine the entity from the multiple candidate words.
[0059] Specifically, the deep semantic understanding capabilities of a large model can be leveraged to determine the probability of retaining a candidate word—that is, the probability of identifying the word as the corresponding entity in the rule text—thereby determining the entity from multiple candidate words. Optionally, the number of entities output by the large model can be limited to facilitate subsequent clustering.
[0060] Step 105: Cluster the entities corresponding to each rule text to obtain multiple first clusters.
[0061] The first cluster includes feature vectors of at least one entity included in the regular text.
[0062] Specifically, clustering can be performed based on the conditions of each rule text, grouping rule texts with similar conditions into a cluster. Here, we use a feature vector-based clustering method. Compared to condition-based clustering, this method ensures that multiple conditions in a cluster are for reviewing the same domain. This makes the established rule base structure clearer and easier to conduct content review.
[0063] Before performing step 105, a pre-trained embedding model can be used to obtain the embedding vectors corresponding to the entities in order to capture the deep semantic features of the entity.
[0064] The goal of clustering is to maximize the label similarity within a cluster and minimize the similarity between the cluster centers of different clusters.
[0065] Step 105 can be implemented using any of a variety of clustering algorithms. In one alternative implementation, a density-aware hierarchical clustering method can be used. In another alternative implementation, a density-based spatial clustering algorithm (DBSCAN) can also be used.
[0066] Furthermore, after step 105, based on the conditions and entities of the rule texts included in each first cluster, the first descriptor corresponding to each first cluster can be determined using a large language model. The first descriptor can be used for the secondary clustering in step 107, thus improving the efficiency of the secondary clustering. Additionally, the first descriptor can be stored in the rule base in subsequent steps, thereby improving the interpretability of the recalled rule texts during the review of user-published content.
[0067] The first descriptor is a descriptor describing the subcategory of the rule text contained in the first cluster, and the second descriptor is a descriptor describing the major category of the rule text contained in the second cluster.
[0068] Step 107: Based on multiple first clusters, determine multiple second clusters.
[0069] Wherein, any second cluster includes at least one first cluster, and the distance between the centers of any two first clusters included in the second cluster is less than a preset distance threshold.
[0070] In an optional implementation, step 107 can be achieved by clustering, which can cluster the cluster center vectors of multiple first clusters to obtain multiple second clusters.
[0071] In another alternative implementation, a graph neural network can be constructed. First, a semantic association graph can be constructed, where nodes are the cluster center vectors of each first cluster. Edges in the graph are determined based on the similarity of the cluster center vectors corresponding to two nodes and the degree of overlap of the conditions included in the first clusters corresponding to the two nodes. Edges can be determined based on a weighted sum of the similarity of the cluster center vectors and the degree of overlap of the conditions. The degree of overlap of the conditions is used to evaluate the degree of overlap of the conditions of the rule texts included in the two first clusters.
[0072] Then, the cluster center vectors of each first cluster are updated using a graph neural network to obtain the updated first clusters. Specifically, the cluster center vectors of each first cluster can be updated based on the nodes directly or indirectly connected to each node using a pre-trained graph neural network. Optionally, the graph neural network may include a graph convolutional feature extractor and an attention pooling layer.
[0073] Finally, clustering is performed based on the updated cluster center vectors of each first cluster to determine multiple second clusters.
[0074] This allows graph neural networks to update each first cluster, making the representation vectors of the first clusters better reflect the relationships between different first clusters, and uncovering the semantic relationships between the first clusters, thus facilitating the generation of second clusters.
[0075] Furthermore, when clustering the updated first clusters, different clustering conditions can be applied to first clusters of different sizes. Specifically, for clustering first clusters containing only one rule text, a smaller preset distance threshold can be used; that is, two first clusters will only be clustered into a second cluster if they are close to each other or have high similarity. For clustering first clusters containing multiple rule texts, a larger preset distance threshold can be used. This differentiated approach preserves the accuracy of individual rules while promoting the reasonable merging of multiple rules.
[0076] In another optional implementation, after obtaining the first descriptor corresponding to each first cluster in step 105, step 107 can be implemented using a large language model. Specifically, based on the descriptor corresponding to each first cluster, a plurality of second clusters and the second descriptor corresponding to each second cluster can be determined using a large language model.
[0077] By inputting the descriptive words and prompt words of each first cluster into a large language model, the semantic relationships between multiple first clusters can be mined through the large language model, while reducing the computational cost.
[0078] The correspondence between the multiple second clusters and the first clusters obtained from clustering can be referred to Figure 2 As shown.
[0079] This specification provides a method for secondary clustering. This results in a more clearly defined hierarchy in the rule base and facilitates subsequent review processes. First, during retrieval, only a similarity comparison with the fewer second clusters is needed, reducing the computational load. Second, in some cases, when reviewing user-posted content, keywords extracted from the content may have the highest similarity to a particular first cluster, but the first cluster's rule text does not contain a matching rule, while the second cluster to which the first cluster belongs does. Therefore, by performing similarity retrieval with the second cluster, the accuracy of rule text retrieval can be improved.
[0080] Step 109: Based on the correspondence between the second cluster, the first cluster, and the rule text, construct a multi-level rule base.
[0081] The rule base is used to review the content posted by users.
[0082] After obtaining the correspondence between the first cluster, the second cluster, and the rule text, it can be stored as a structured rule base to facilitate subsequent review of user-published content.
[0083] In one optional implementation, if a first descriptor and a second descriptor are available, the rule base also stores the first descriptor corresponding to each first cluster and the second descriptor corresponding to each second cluster. This facilitates providing users with interpretable review results after subsequent review.
[0084] In addition, the entities corresponding to the rule text can also be stored in the rule base for subsequent review.
[0085] In an optional implementation, synonyms can be expanded for entities, and these synonyms can also be stored in the rule base to improve the recall accuracy during subsequent review and retrieval. Specifically, for each entity, synonyms can be determined from the domain scope of the entity in the first knowledge graph, based on the similarity between the entity and each word in the first knowledge graph, or from the k-hop subgraph corresponding to the entity; the entities included in each rule text and their synonyms are stored in the rule base to facilitate the review of user-published content.
[0086] Here, the k-hop subgraph refers to the subgraph whose distance to the entity is within k nodes. From the k-hop subgraph corresponding to the entity, multiple candidate synonyms can be identified. To make the synonyms more accurate, in an optional implementation, the candidate synonyms and entities can be input into a large language model, which can then filter out synonymous expressions in a specific domain based on prompts, thereby improving the accuracy of synonyms.
[0087] In an alternative implementation, the flowchart of the above process can be as follows: Figure 3 As shown. Figure 3 The dashed boxes represent data, and the solid boxes represent processing steps. Specifically, for the initial rule document, it can first undergo character cleaning and hierarchical parsing to obtain the rule document. Then, a two-stage LLM rule text extraction is performed on the rule document to obtain the rule text. Next, entity extraction is performed on the rule text to obtain entities, and synonym expansion is performed on the entities to obtain synonyms. Simultaneously, two-stage clustering is performed on the entities to obtain the first cluster and the second cluster. Finally, the first cluster, the second cluster, entities, synonyms, rule text, and sub-features are stored in the rule base.
[0088] The rule base can include the following fields:
[0089] 1. Category: A descriptive term used to indicate the second cluster.
[0090] 2. `sub_category` is used to indicate the descriptor of the first cluster. Additionally, it can store the cluster center vector of the first cluster.
[0091] 3. condition, used to indicate the conditions for each rule text.
[0092] 4. Action: Used to indicate the action for each rule text.
[0093] 5. cases, used to indicate the cases for each rule text.
[0094] Among them, 3, 4, and 5 are included in the rule text mentioned above.
[0095] 6. sub_feature, used to indicate the sub-features of each rule text, is used to provide a high-level summary of the core intent in the conditions.
[0096] 7. entity_labels, used to indicate the entity corresponding to each rule text.
[0097] 8. Synonyms, used to indicate the synonyms of the entities corresponding to each rule text.
[0098] In addition, the relationship between various fields can be indicated through the database structure.
[0099] In some cases, after the rule base is built, maintainers may discover, based on the content text, that rules still need to be added. Correspondingly, this manual also provides a method for incremental updates to the rule base. For example... Figure 4 As shown, it includes the following steps:
[0100] Step 401: Obtain the supplementary rule text.
[0101] The supplementary rule text has the same format as the regular rule text. The specific method for obtaining it can be found in step 101 above. Specifically, you can first obtain the supplementary rule document / initial supplementary rule document, and then extract the rule text from the document based on the method in step 101.
[0102] Step 403: Determine whether the supplementary rule text matches any existing rule text in the rule base. If the supplementary rule text matches any existing rule text, update the existing rule text; otherwise, create a new rule text.
[0103] Specifically, it can be determined whether the supplementary rule text is similar in meaning to a certain rule text. If the two are similar in meaning, the original rule text can be updated based on the supplementary rule text.
[0104] In one alternative implementation, the similarity between the conditions of the supplementary rule text and the conditions of each rule text can be calculated to determine the rule text that matches the supplementary rule text.
[0105] In another alternative implementation, to improve matching efficiency, a similar method to that described above can be used for matching. That is, entities are extracted from the supplementary rule text, and the entities corresponding to the supplementary rule text are matched with the entities of the existing rule texts.
[0106] Specifically, it can be determined that the entities included in the conditions of the supplementary rule text are matched with the existing rule text if any entity in any existing rule text in the rule base includes the entity corresponding to the supplementary rule text; or, if the similarity between the conditions of any existing rule text in the rule base and the conditions of the supplementary rule text is greater than a similarity threshold, it can be determined that the supplementary rule text matches the existing rule text.
[0107] The entity extraction method for the supplementary rule text is described in step 103 and will not be repeated here. Two entity extraction methods have been shown above. In the first method, if the entities of two rule texts are identical, or if the entities of an existing rule text include all the entities of the supplementary rule text, then the two are considered a match. The second method matches based on entity similarity. If multiple rule texts matching the supplementary rule text are identified using the above methods, all of these rule texts can be used as the rule text to be updated.
[0108] In one optional implementation of the specific rule text update method, a large language model can be used. Specifically, based on the existing rule text (i.e., the existing rule text that matches the supplementary rule text as determined above) and the supplementary rule text, the large language model determines the update type of the existing rule text; the update type can be any one of refining conditions, adding cases, expanding synonyms, or removing redundant rules. Based on the update type, the existing rule text, and the supplementary rule text, the large language model updates the existing rule text according to the update type.
[0109] The above process is achieved through a two-step call to the large model. During the first call, the large model determines the specific update type. When multiple rule texts need to be updated, all of them can be input into the large language model, which then determines which rule text to update.
[0110] The second call to the large language model involves updating the existing rule text to determine its type. This two-step process of calling the large model improves matching accuracy.
[0111] In one alternative implementation, the large language model can be fine-tuned based on a small number of samples to improve its ability to identify update types and update.
[0112] The aforementioned refined condition updates primarily involve rewriting or supplementing the conditions and sub-features. Adding new cases improves the matching accuracy of subsequent content review. Expanding synonyms expands the synonyms for entities. Removing redundant rules determines whether there are overlapping entities for the given conditions and generates deletion suggestions for those entities.
[0113] Step 405: Based on the similarity between the updated or newly created rule text and each first cluster, determine the first cluster to which the updated or newly created rule text belongs, and update the first cluster.
[0114] The similarity between the entities in the updated or newly created rule text and the cluster center vectors of each first cluster can be determined. Optionally, if the update type is supplementary cases or expanded synonyms, step 405 above can be omitted.
[0115] Step 407: Determine multiple second clusters based on the updated multiple first clusters, and construct a new multi-level rule base based on the correspondence between the updated second clusters, the first clusters and the rule text.
[0116] The implementation method of step 407 can be found in step 107, and will not be repeated here.
[0117] By following the steps above, the rule base can be updated.
[0118] Subsequently, the rule base can be used to review the content published by users.
[0119] The method described above resolves the conflict between rule granularity and matching coverage. By matching with the second cluster, the accuracy of the target rule text retrieved at the final content review stage can be improved while simultaneously increasing review efficiency and reducing manual review costs.
[0120] The above method also extracts text from rule documents / initial rule documents in various formats. Furthermore, a two-stage LLM refinement framework is used to extract rule text conforming to the specified format from the text of the rule documents. Simultaneously, the keyness of entity words is calculated using a fusion of term frequency and PMI, and the entity words are expanded using synonyms through a knowledge graph. These methods improve the accuracy and processing efficiency of rule extraction.
[0121] This specification also provides an apparatus for building a content moderation rule base, comprising:
[0122] An acquisition unit is used to acquire multiple rule texts; each rule text includes a condition and an action, the rule text being used to instruct the content to be processed by the action when the content meets the condition;
[0123] The extraction unit is used to extract the entity corresponding to each rule text from the conditions of the rule text;
[0124] The first clustering unit is used to cluster entities corresponding to each rule text to obtain multiple first clusters; the first cluster includes feature vectors of entities included in at least one rule text.
[0125] The second clustering unit is used to determine multiple second clusters based on multiple first clusters; any second cluster includes at least one first cluster, and the distance between the cluster centers of any two first clusters included in the second cluster is less than a preset distance threshold.
[0126] The building unit is used to construct a multi-level rule base based on the correspondence between the second cluster, the first cluster, and the rule text.
[0127] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described above.
[0128] This specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described above.
[0129] This specification provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0130] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0131] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0132] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this specification does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments may be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0133] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.
[0134] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0135] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0140] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0141] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0143] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0144] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of these embodiments. Various modifications and variations can be made to these embodiments by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.
Claims
1. A method for constructing a content moderation rule base, comprising: Obtain multiple rule texts; each rule text includes a condition and an action, the rule text being used to instruct the content to be processed by the action if the content meets the condition; Extract the entity corresponding to each rule from the conditions of the rule text; Clustering is performed on the entities corresponding to each rule text to obtain multiple first clusters; each first cluster includes the feature vector of at least one entity included in the rule text. Based on multiple first clusters, multiple second clusters are determined; Any second cluster includes at least one first cluster, and the distance between the cluster centers of any two first clusters included in the second cluster is less than a preset distance threshold; Based on the correspondence between the second cluster, the first cluster, and the rule text, a multi-level rule base is constructed.
2. The method according to claim 1, wherein extracting the entity corresponding to each rule text from the conditions of the rule text comprises: For each rule text, multiple candidate words are obtained from the conditions of that rule text based on word segmentation methods; The ranking of multiple candidate words is determined based on their context in the documents corresponding to the rule text; The sorting indicates the degree of correlation between candidate words and rule text; the document corresponding to the rule text is the source document of that rule text; Multiple candidate words and their order, rule text, and the context of the rule text in the corresponding document are input into a large language model to determine the entity from the multiple candidate words.
3. The method according to claim 2, wherein determining the order of the multiple candidate words based on their context in the document corresponding to the rule text includes: For each candidate word among multiple candidate words, determine the word frequency of the candidate word in the context of the document corresponding to the rule text, as well as the point mutual information (PMI) between the candidate word and the context of the document corresponding to the rule text, and determine the score of the candidate word based on the weighted sum of the PMI and the word frequency. The ranking of multiple candidate words is determined based on their scores.
4. The method according to claim 1, wherein determining a plurality of second clusters based on a plurality of first clusters comprises: A graph neural network is constructed, and the cluster center vectors of each first cluster are updated through the graph neural clustering network to obtain the updated first clusters. In the graph, the nodes are the cluster center vectors of each first cluster, and the edges in the graph are determined based on the similarity of the cluster center vectors corresponding to two nodes and the degree of overlap of the conditions included in the first clusters corresponding to two nodes. Clustering is performed based on the updated cluster center vectors of each first cluster to determine multiple second clusters.
5. The method according to claim 1, wherein determining a plurality of second clusters based on a plurality of first clusters comprises: Based on the conditions and entities of the rule texts included in each first cluster, the first descriptive word corresponding to each first cluster is determined by the large language model. Based on the descriptive words corresponding to each first cluster, multiple second clusters and the second descriptive words corresponding to each second cluster are determined through a large language model; The rule base also stores the first descriptor corresponding to each first cluster and the second descriptor corresponding to each second cluster.
6. The method according to claim 1, wherein obtaining multiple rule texts includes: Based on the context in the rule document, the conditions, actions, and cases recorded in the rule document and their corresponding relationships are extracted using a large language model. Based on the conditions, actions, and cases extracted from the rule document and their corresponding relationships, a large language model is used to merge synonymous conditions, summarize each condition to determine its corresponding sub-features, and output the rule text in a first preset format; the rule text also records the sub-features and cases corresponding to the conditions.
7. The method according to claim 1, further comprising: Retrieve supplementary rule text; Determine whether the supplementary rule text matches any existing rule text in the rule base. If the supplementary rule text matches any existing rule text, update the existing rule text; otherwise, create a new rule text. Based on the similarity between the updated or newly created rule text and each first cluster, determine the first cluster to which the updated or newly created rule text belongs, and update the first cluster. Multiple second clusters are determined based on the updated first clusters, and a new multi-level rule base is constructed based on the correspondence between the updated second clusters, the first clusters, and the rule text.
8. The method according to claim 7, wherein determining whether the supplementary rule text matches any existing rule text includes: If the entity included in the conditions of the supplementary rule text is determined, and the entity of any existing rule text in the rule base includes the entity corresponding to the supplementary rule text, then the supplementary rule text is determined to match the existing rule text. Alternatively, if the similarity between the conditions of any existing rule text in the rule base and the conditions of the supplementary rule text is greater than a similarity threshold, the supplementary rule text is determined to match the existing rule text.
9. The method according to claim 7, wherein updating the existing rule text includes: Based on the existing rule text and the supplementary rule text, the update type for the existing rule text is determined through a large language model. The update type is any one of the following: refining conditions, adding cases, expanding synonyms, and removing redundant rules; Based on the update type, the existing rule text, and the supplementary rule text, the existing rule text is updated according to the update type using a large language model.
10. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-9.