Training data generation method and content auditing method
By constructing an information graph and iteratively generating question-answer pairs, the problem of simple question-answer pairs in traditional methods is solved, the review quality of the content review agent is improved, and a more efficient content review effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional question-and-answer pairs are too simple and differ significantly from real-world content moderation scenarios, resulting in content moderation agents trained to meet the required quality standards.
By constructing an information graph, based on the web page mention entities associated with each of the multiple web page nodes, iteratively executing the sampling evidence path from the information graph, using a question generation model and an inference response model to generate question-answer pairs, and updating the model parameters, a high-quality training dataset is constructed to train the content moderation agent.
It improves the quality of content review by the intelligent content review agent. By generating factual basis and dynamic game mechanism, it ensures the quality of question-answer pairs and improves the accuracy and robustness of review judgment.
Smart Images

Figure CN122021901A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a training data generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product, as well as a content moderation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of computer technology, intelligent content moderation agents have emerged. These agents utilize artificial intelligence to automatically detect and judge content such as text, images, and videos. They can assess the quality of the input content to be reviewed and obtain the review results. These intelligent content moderation agents can be trained.
[0003] In traditional technologies, when training a content moderation agent, the first step is to collect all the content from a website, and then automatically generate multiple question-and-answer pairs based on the content. These generated question-and-answer pairs are then used to train the content moderation agent.
[0004] However, traditional methods generate too many simple question-and-answer pairs, which are far removed from the real-world scenarios of content moderation. This makes it difficult for the content moderation agents trained to meet the required quality standards. Summary of the Invention
[0005] Based on this, it is necessary to provide a training data generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can support improving the content review quality of content review agents, as well as a content review method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the content review quality of content review agents.
[0006] Firstly, this application provides a method for generating training data, including:
[0007] An information graph is constructed based on the webpage mention entities associated with each of the multiple webpage nodes; the webpage nodes in the information graph are associated with the same webpage mention entities as their adjacent webpage nodes.
[0008] Iterative execution: Multiple evidence paths are sampled from the information graph; for each evidence path, question-answer pairs are generated corresponding to the evidence path using a question generation model and a reasoning-response model, respectively; training question-answer pairs are selected from the question-answer pairs corresponding to each of the multiple evidence paths; the model parameters of the question generation model and the model parameters of the reasoning-response model are updated according to the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pair includes a question generated by the question generation model based on the path nodes in the evidence path, and a question answer inferred by the reasoning-response model based on the path nodes in the evidence path and the question;
[0009] A training dataset is constructed based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
[0010] Secondly, this application also provides a training data generation apparatus, comprising:
[0011] The graph construction module is used to construct an information graph based on the web page mention entities associated with each of the multiple web page nodes; the web page nodes in the information graph are associated with the same web page mention entities as their adjacent web page nodes;
[0012] An iterative execution module is used to iteratively execute: sampling multiple evidence paths from the information graph; for each evidence path, generating question-answer pairs corresponding to the evidence path using a question generation model and a reasoning-response model respectively; selecting training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths; updating the model parameters of the question generation model and the model parameters of the reasoning-response model based on the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pair includes a question generated by the question generation model based on path nodes in the evidence path, and a question answer inferred by the reasoning-response model based on path nodes in the evidence path and the question;
[0013] The dataset construction module is used to construct a training dataset based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
[0014] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described training data generation method.
[0015] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described training data generation method.
[0016] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described training data generation method.
[0017] The aforementioned training data generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product construct an information graph based on webpage mention entities associated with multiple webpage nodes. This enables cross-webpage information association, transforming webpage corpora into structured representations capable of supporting inference tasks. Through iterative execution, multiple evidence paths are sampled from the information graph. For each evidence path, a question-and-answer pair corresponding to the evidence path is generated using both a question generation model and an inference-response model. Training question-and-answer pairs are selected from the question-and-answer pairs corresponding to each of the multiple evidence paths. By updating the model parameters of the question generation model and the inference-response model based on the question-and-answer pairs corresponding to each of the multiple evidence paths, the training data can be generated from the information graph. Based on the sampled evidence paths, the open-ended question generation task is reconstructed into a conditional generation task based on structured evidence, ensuring the factual basis of the generated question-answer pairs. By introducing a dynamic game mechanism, the model parameters of the question generation model and the inference response model are continuously updated using the question-answer pairs corresponding to multiple evidence paths. High-quality question-answer pairs are generated using the question generation model and the inference response model. Training question-answer pairs are selected from the generated question-answer pairs to obtain high-quality training data. Thus, a high-quality training dataset can be constructed based on the training question-answer pairs selected during the iterative execution process. The content moderation agent can be trained using the training dataset, which can improve the content moderation quality of the content moderation agent.
[0018] Sixthly, this application provides a content moderation method, including:
[0019] Obtain the content to be reviewed and input it into a trained content review agent; the content review agent is trained based on a training dataset; the training dataset is constructed using the above-described training data generation method.
[0020] The content review agent performs semantic understanding on the content to be reviewed, generates a review conclusion, queries an information graph based on the review conclusion to obtain graph evidence data, and reviews and judges the review conclusion based on the graph evidence data to obtain the content review result.
[0021] Seventhly, this application also provides a content moderation device, comprising:
[0022] The acquisition module is used to acquire the content to be reviewed and input the content to be reviewed into a trained content review agent; the content review agent is trained based on a training dataset; the training dataset is constructed using the above-described training data generation method.
[0023] The review module is used to perform semantic understanding on the content to be reviewed through the content review intelligent agent, generate a review conclusion, query an information graph based on the review conclusion to obtain graph evidence data, and review and determine the review conclusion based on the graph evidence data to obtain the content review result.
[0024] Eighthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned content review method.
[0025] Ninthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described content review method.
[0026] In a tenth aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described content review method.
[0027] The aforementioned content moderation method, apparatus, computer equipment, computer-readable storage medium, and computer program product train a content moderation agent using a high-quality training dataset constructed through a training data generation method. This trained agent is then used to judge the content to be reviewed. The high-quality training dataset enhances the content moderation quality of the agent. During the review process, semantic understanding of the content generates a review conclusion. Based on this conclusion, an information graph is queried, allowing the acquisition of graph evidence data as objective evidence for the review. This graph-based review method improves the overall content moderation quality of the intelligent content moderator. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a diagram illustrating the application environment of a training data generation method in one embodiment.
[0030] Figure 2This is a flowchart illustrating a training data generation method in one embodiment;
[0031] Figure 3 This is a schematic diagram of associated edges in one embodiment;
[0032] Figure 4 This is a schematic diagram of an information graph in one embodiment;
[0033] Figure 5 This is a schematic diagram illustrating the determination of a reward signal in one embodiment;
[0034] Figure 6 This is a flowchart illustrating the training data generation method in another embodiment;
[0035] Figure 7 This is a flowchart illustrating the training data generation method in yet another embodiment;
[0036] Figure 8 This is a diagram illustrating the application environment of a content moderation method in one embodiment.
[0037] Figure 9 This is a flowchart illustrating a content moderation method in one embodiment;
[0038] Figure 10 This is a schematic diagram of the content review process in one embodiment;
[0039] Figure 11 This is a structural block diagram of a training data generation device in one embodiment;
[0040] Figure 12 This is a structural block diagram of a content moderation device in one embodiment;
[0041] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0043] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0044] In order to clearly describe the technical solution of this application and facilitate understanding of the technical solution of this application, the key concepts involved in this application will be explained below.
[0045] 1. Web page nodes.
[0046] A webpage node is a structured basic unit representing a webpage in an information graph. It serves as a bridge connecting unstructured information on the internet with the structured semantic network of the information graph. Through the abstraction of webpage metadata and key semantics, and by connecting it with other nodes, the original webpage content is transformed into a knowledge object that can be globally identified, associated, and reasoned about. In the embodiments of this application, webpage nodes are primarily used to represent webpages, thereby achieving the abstraction and modeling of webpages.
[0047] 2. The webpage mentions the entity.
[0048] A webpage mention entity refers to an entity mentioned in the content of a webpage. An entity is an independently existing object or thing that can be identified and distinguished through its attributes or characteristics. For example, an entity can specifically refer to a directly perceptible physical object, such as a person or a product. Alternatively, an entity can specifically refer to an abstract organization defined by social consensus, such as a company. In the embodiments of this application, the webpage mention entity associated with a webpage node refers to the entity mentioned in the webpage represented by the webpage node.
[0049] 3. Information Graph.
[0050] An information graph is a visual knowledge network that organizes and associates information in a structured and semantic way. Using a graph as its data model, it integrates fragmented information into an interconnected, machine-understandable whole, aiming to reveal the patterns, relationships, and deeper meanings behind the information. In the embodiments of this application, information graphs are mainly used to integrate different web pages into an interconnected, machine-understandable whole, achieving cross-web page information association and transforming web page corpora into structured representations capable of supporting reasoning tasks.
[0051] 4. Evidence path.
[0052] An evidence path refers to an ordered sequence of interconnected nodes and edges in an information graph. It represents a specific, traversable path from the starting node to the target node. Simply put, an evidence path is the "way" from one "node" to another in an information graph, recording which nodes are traversed along the way and the relationships between them. In the embodiments of this application, the evidence path is equivalent to providing logically complete and traceable evidence within the information graph to support the generation of questions and answers, ensuring the "factual consistency" of the generated content.
[0053] 5. Problem generation model.
[0054] A question generation model is a model capable of deeply understanding given information content, identifying key and implicit doubts, and generating relevant natural language questions. Its core capability lies not only in constructing basic questions but also in strategically generating challenging, misleading, or in-depth reasoning questions to enhance the robustness and depth of understanding of the reasoning response model. In the embodiments of this application, the question generation model is primarily used to deeply understand the path nodes in a given evidence path, generating relevant questions that provide diverse "test questions" for the reasoning response model, thereby testing and driving the enhancement of the reasoning response model's reasoning and response capabilities.
[0055] 6. Reasoning-response model.
[0056] A reasoning-response model refers to a model capable of deeply understanding natural language questions and generating accurate and reliable answers by retrieving, integrating, and logically reasoning from internal and external knowledge. Its core capability lies in transforming questions into precise, structured knowledge query and reasoning tasks, demonstrating advanced cognitive abilities such as multi-step reasoning, evidence fusion, and counterfactual inference in the process. In the embodiments of this application, the reasoning-response model is mainly used to deeply understand a given question, combining path nodes in the evidence path for logical association, multi-step reasoning, and information integration, ultimately generating accurate, reliable, and interpretable answers.
[0057] 7. Practice answering questions correctly.
[0058] Training question-answer pairs refer to the selected question-answer pairs used to train the content moderation agent, including a "question" and a "question answer." For example, training question-answer pairs can specifically include selected positive sample question-answer pairs used to train the content moderation agent. These positive sample question-answer pairs consist of a question and a question answer deemed correct; their core function is to serve as examples of "standard answers" to guide the model in learning the correct input-output mapping relationship. As another example, training question-answer pairs can specifically include selected negative sample question-answer pairs used to train the content moderation agent. These negative sample question-answer pairs consist of a question and a question answer deemed incorrect; their core function is to serve as negative examples, helping the model clarify the decision boundaries of answers through comparative learning, thereby improving its discriminative power, robustness, and generalization ability.
[0059] 8. Problems generate reward signals.
[0060] The problem generation reward signal is a quantitative evaluation scalar that measures the quality of problems generated by a problem generation model in a given context. It defines the quality standard of a "good problem" and, as a core feedback mechanism in the reinforcement learning training paradigm, directly drives the update of the model parameters of the problem generation model, guiding it to evolve towards generating higher-quality problems. In the embodiments of this application, the given context refers to the evidence path.
[0061] 9. Reasoning response reward signal.
[0062] The reasoning response reward signal is a quantitative evaluation scalar that measures the quality of the question answers generated by the reasoning response model under a given context and question. It defines the quality standard of "good question answers" and serves as the core feedback mechanism in the reinforcement learning training paradigm. It directly drives the updating of the model parameters of the reasoning response model and guides the reasoning response model to evolve towards generating better question answers.
[0063] The training data generation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the data storage system stores the data that server 102 needs to process. The data storage system can be set up independently, integrated into server 102, or placed in the cloud or on other network servers. Server 102 constructs an information graph 104 based on the webpage mention entities associated with multiple webpage nodes. Webpage nodes in the information graph 104 are associated with the same webpage mention entities as their adjacent webpage nodes. Iteratively, the following steps are performed: multiple evidence paths are sampled from the information graph; for each evidence path, a question-and-answer pair is generated using a question generation model and a reasoning-response model; training question-and-answer pairs 106 are selected from the question-and-answer pairs corresponding to each of the multiple evidence paths; and the model parameters of the question generation model and the reasoning-response model are updated based on these pairs. The question-and-answer pairs include questions generated by the question generation model based on path nodes in the evidence path, and question answers inferred by the reasoning-response model based on path nodes and questions in the evidence path. A training dataset 108 is constructed based on the training question-and-answer pairs selected during the iterative execution process. The training dataset 108 is used to train the content moderation agent. Among them, server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0064] In one exemplary embodiment, such as Figure 2As shown, a training data generation method is provided. This embodiment illustrates the method applied to a server, but it is understood that the method can also be applied to a terminal, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes steps 202 to 206. Wherein:
[0065] Step 202: Construct an information graph based on the webpage mention entities associated with each of the multiple webpage nodes; the webpage nodes in the information graph are associated with the same webpage mention entities as their adjacent webpage nodes.
[0066] In this context, a webpage node refers to a structured basic unit representing a webpage in an information graph. It serves as a bridge connecting unstructured information on the internet with the structured semantic network of the information graph. Through the abstraction of webpage metadata and key semantics, and by establishing connections with other nodes, the original webpage content is transformed into a knowledge object that can be globally identified, associated, and reasoned about. In the embodiments of this application, webpage nodes are primarily used to represent webpages, thereby achieving the abstraction and modeling of webpages.
[0067] Abstracting webpage metadata refers to explicitly recording metadata such as the webpage's publisher, publication date, and source website, establishing the webpage's background and authority as an information source. Abstracting key semantics refers to extracting the webpage's core theme, mentioned entities, and summary to form a structured description.
[0068] Understandably, for each webpage obtained, a webpage node representing the webpage can be generated. For example, if webpages A, B, and C are obtained, a webpage node A can be generated for webpage A, a webpage node B can be generated for webpage B, and a webpage node C can be generated for webpage C. Based on the webpage metadata and key semantics of webpages A, B, and C, the relationship between webpage nodes A, B, and C can be established.
[0069] In this context, "webpage mention entity" refers to an entity mentioned within the content of a webpage. An entity is an independently existing object or thing that can be identified and distinguished through its attributes or characteristics. For example, an entity can specifically refer to a directly perceptible physical object, such as a person or a product. Alternatively, an entity can refer to an abstract organization defined by social consensus, such as a company. In the embodiments of this application, the webpage mention entity associated with a webpage node refers to the entity mentioned within the webpage represented by that webpage node.
[0070] For example, if the content of webpage A is "News of the XX mobile phone launch event", where "XX mobile phone" is an entity, then the webpage mentions associated with the webpage node of webpage A can include "XX mobile phone". As another example, if the content of webpage B is "XX mobile phone performance review", where "XX mobile phone" is an entity, then the webpage mentions associated with the webpage node of webpage B can include "XX mobile phone".
[0071] Information graphs, in this context, refer to a visual knowledge network that organizes and associates information in a structured and semantic way. Using a graph as its data model, it integrates fragmented information into an interconnected, machine-understandable whole, aiming to reveal the patterns, relationships, and deeper meanings behind the information. In the embodiments of this application, information graphs are primarily used to integrate different web pages into an interconnected, machine-understandable whole, achieving cross-web page information association and transforming web page corpora into a structured representation capable of supporting reasoning tasks.
[0072] Understandably, the core components of an information graph are nodes and connecting edges. Nodes represent basic entities or concepts in the information world. For example, a node can specifically include a webpage node representing a webpage and an entity node representing an entity. Connecting edges represent relationships between nodes that have specific semantic or statistical significance. For example... Figure 3 As shown, the associated edge can specifically refer to the associated edge between webpage node 302 and webpage node 304, indicating that the two webpage nodes are associated with the same webpage-mentioned entity. The associated edge can also refer to the associated edge between webpage node 306 and entity node 308, indicating that the webpage node represents an entity mentioned by the entity node, meaning the entity represented by the entity node is the webpage-mentioned entity of that webpage. The associated edge can also refer to the associated edge between entity node 310 and entity node 312, indicating that there is a relationship between the entities represented by the two entity nodes. This relationship can specifically be a specific, meaningful semantic relationship, logical connection, etc.
[0073] For example, the server can determine the neighboring web nodes of each web node based on the web page reference entities of each web page node. Based on determining the neighboring web nodes of each web page node, the server determines the weight of the associated edges between the web page node and its neighboring web page nodes for each web page node, and then constructs an information graph based on each web page node, its neighboring web page nodes, and the weights of the associated edges between each web page node and its neighboring web page nodes.
[0074] In practical applications, the server first crawls web pages from multiple websites, obtaining multiple web pages. These web pages are then cleaned to produce multiple web page corpora. Entity recognition is then performed on each of these corpora, and unified entity links are established to determine the web page mention entities for each corpus. Finally, a web page node is defined for each web page, and the web page mention entities associated with this node are the entities identified from the cleaned web page corpora. Based on the web page mention entities associated with each web page node, the server can determine the adjacent web page nodes by comparing the web page mention entities associated with different web page nodes.
[0075] In practical applications, the server can connect and integrate discrete web page nodes to construct an information graph based on the weights of each web page node, each web page node's neighboring web page nodes, and the associated edges between each web page node and its neighboring web page nodes.
[0076] In practical applications, when the infographic only includes web page nodes, the server can directly construct the infographic based on the weights of each web page node, its neighboring web page nodes, and the edges connecting each web page node to its neighboring nodes. When the infographic also includes entity nodes, the server needs to determine the neighboring nodes of each entity node and the weights of the edges connecting each entity node to its neighboring nodes. Then, based on the weights of each entity node, its neighboring nodes, and the edges connecting each entity node to its neighboring nodes, the server connects and integrates the entity nodes with other nodes to construct the infographic.
[0077] It's understandable that the adjacent nodes of an entity node could be either entity nodes or webpage nodes. For example, if the adjacent node of an entity node is also an entity node, it means that the entities represented by both entity nodes appear simultaneously in at least one webpage. The weight of the association edge between the two entity nodes can be obtained by calculating the co-occurrence frequency, explicit relationship, and semantic similarity of the entities represented by each entity node. As another example, if the adjacent node of an entity node is a webpage node, it means that the entity represented by the entity node is a mentioned entity in the webpage associated with the webpage node. The weight of the association edge between the entity node and the webpage node can be obtained by calculating the word frequency and position of the entity represented by the entity node in the webpage represented by the webpage node, the topic centrality of the webpage represented by the webpage node, and the incoming anchor text.
[0078] In a specific application, taking an information graph consisting of 4 web page nodes and 4 entity nodes as an example, the information graph can be specifically designed as follows: Figure 4As shown, the neighboring nodes of webpage node 401 include webpage nodes 402, 403, and entity node 405; the neighboring nodes of webpage node 402 include webpage node 401 and entity node 407; the neighboring nodes of webpage node 403 include webpage node 401 and entity node 408; and the neighboring nodes of webpage node 404 include entity nodes 406, 407, and 408. The neighboring nodes of entity node 405 include webpage nodes 401 and 406; the neighboring nodes of entity node 406 include entity node 405 and webpage node 404; the neighboring nodes of entity node 407 include webpage nodes 402 and 404; and the neighboring nodes of entity node 408 include webpage nodes 403 and 404.
[0079] Step 204, iterative execution: Sample multiple evidence paths from the information graph; for each evidence path, generate question-answer pairs corresponding to the evidence path using the question generation model and the reasoning-response model respectively; select training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths; update the model parameters of the question generation model and the model parameters of the reasoning-response model according to the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pairs include questions generated by the question generation model based on the path nodes in the evidence path, and question answers generated by the reasoning-response model based on the path nodes and questions in the evidence path.
[0080] In this context, an evidence path refers to an ordered sequence of interconnected nodes and edges in an information graph. It represents a specific, traversable path from the starting node to the target node. Simply put, an evidence path is the "path" from one "node" to another in the information graph, recording which nodes are traversed along the way and their relationships. In the embodiments of this application, the evidence path is equivalent to providing logically complete and traceable evidence within the information graph to support the generation of questions and answers, ensuring the "factual consistency" of the generated content.
[0081] For example, using information graphs such as Figure 4 For example, if the starting node is "web node 401" and the target node is "web node 404", the sampled evidence path can be either "web node 401 - web node 402 - entity node 407 - web node 404" or "web node 401 - web node 403 - entity node 408 - web node 404". If the starting node is "web node 402" and the target node is "web node 404", the sampled evidence path can be either "web node 402 - entity node 407 - web node 404".
[0082] The question generation model refers to a model capable of deeply understanding given information content, identifying key and implicit doubts, and generating relevant natural language questions. Its core capability lies not only in constructing basic questions but also in strategically generating challenging, misleading, or in-depth reasoning questions to enhance the robustness and depth of understanding of the reasoning response model. In the embodiments of this application, the question generation model is primarily used to deeply understand the path nodes in a given evidence path, generating relevant questions that provide diverse "test questions" for the reasoning response model, thereby testing and driving the enhancement of the reasoning response model's reasoning and response capabilities.
[0083] The reasoning-response model refers to a model capable of deeply understanding natural language questions and generating accurate and reliable answers by retrieving, integrating, and logically reasoning from internal and external knowledge. Its core capability lies in transforming questions into precise and structured knowledge query and reasoning tasks, demonstrating advanced cognitive abilities such as multi-step reasoning, evidence fusion, and counterfactual inference in the process. In the embodiments of this application, the reasoning-response model is mainly used to deeply understand a given question, combining path nodes in the evidence path for logical association, multi-step reasoning, and information integration, ultimately generating accurate, reliable, and interpretable answers.
[0084] Training question-answer pairs refer to the selected question-answer pairs used to train the content moderation agent, including a "question" and a "question answer." For example, training question-answer pairs can specifically include selected positive sample question-answer pairs used to train the content moderation agent. These positive sample question-answer pairs consist of a question and a question answer deemed correct; their core function is to serve as examples of "standard answers" to guide the model in learning the correct input-output mapping relationship. As another example, training question-answer pairs can specifically include selected negative sample question-answer pairs used to train the content moderation agent. These negative sample question-answer pairs consist of a question and a question answer deemed incorrect; their core function is to serve as negative examples, helping the model clarify the decision boundaries of answers through comparative learning, thereby improving its discriminative power, robustness, and generalization ability.
[0085] The model parameters of the question generation model refer to the inherent weights and biases that the model learns and determines through data during training. They encode the rules and patterns of "how to ask good questions based on information." Similarly, the model parameters of the inference and response model refer to the inherent weights and biases that the model learns and determines through data during training. They encode the knowledge and reasoning ability of "how to find the correct answer based on the question."
[0086] In this context, path nodes in the evidence path refer to each node that is traversed sequentially within the evidence path; they are integral parts of the evidence path. For example, consider an information graph... Figure 4 For example, if the starting node is "webpage node 401" and the target node is "webpage node 404", then the sampled evidence path can be "webpage node 401 - webpage node 402 - entity node 407 - webpage node 404". The path nodes of the evidence path can include webpage node 401, webpage node 402, entity node 407, and webpage node 404, where the first path node is "webpage node 401" and the last path node is "webpage node 404". It can be understood that for each node in the infographic, that node can belong to multiple different evidence paths, and it is only accessed sequentially in a specific evidence path.
[0087] For example, after generating the information graph, the server performs adversarial training data generation, i.e., iterative execution, sampling multiple evidence paths from the information graph. For each evidence path, a question-answer pair corresponding to the evidence path is generated through a question generation model and a reasoning-response model, respectively. Training question-answer pairs are selected from the question-answer pairs corresponding to the multiple evidence paths, and the model parameters of the question generation model and the reasoning-response model are updated according to the question-answer pairs corresponding to the multiple evidence paths. The question-answer pair includes questions generated by the question generation model based on path nodes in the evidence path, and question answers generated by the reasoning-response model based on path nodes and questions in the evidence path.
[0088] In practical applications, when sampling multiple evidence paths from an information graph, the number of sampled evidence paths can be configured according to the actual application scenario, and the first path node of each evidence path can be randomly selected. With the first path node selected, based on a predefined number of path nodes, starting from the first path node, the adjacent nodes of the latest path node in the information graph are randomly selected sequentially as new path nodes, until the number of path nodes reaches the predefined number or the latest path node has no adjacent nodes, thus obtaining the evidence path.
[0089] For example, using information graphs such as Figure 4For example, if the first path node is "web page node 401" and the predefined number of path nodes is 4, the server will start from web page node 401 and randomly select the adjacent nodes of the latest path node in the information graph as new path nodes to obtain the evidence path. Specifically, the second path node can be any one of web page node 402, web page node 403, and entity node 405 adjacent to web page node 401. Once the second path node is selected, the server can continue to select the next path node from its adjacent nodes until the number of path nodes is reached or the latest path node has no adjacent nodes, thus obtaining the evidence path.
[0090] In practical applications, once the evidence path is obtained, it can be first input into the question generation model, which then generates questions based on the path nodes in the evidence path. The evidence path and the questions generated by the question generation model are then input into the reasoning and response model, which then infers and generates the answers to the questions based on the path nodes in the evidence path and the questions.
[0091] In a specific application, a question generation model can obtain information for question generation based on path nodes in the evidence path, and then use this information to generate questions. For example, taking webpage nodes as path nodes, the obtained information can specifically include the original webpage content represented by the webpage node. Furthermore, to train the reasoning generation ability of the reasoning-response model, the question generation model often generates trap-filled questions. For example, the question generation model may generate questions based on information interference mechanisms, that is, deliberately adding some distractors similar to the correct answer but irrelevant to the question. Another example is that the question generation model may generate questions with hidden premises, meaning that the answer to the question requires understanding a certain implicit condition before it can be derived. Yet another example is that the question generation model may generate questions requiring comparison, meaning that the question requires comparing information from different sources, rather than simply restating it.
[0092] In a specific application, the question generation model can create semantically similar distractors. For example, knowing the correct answer is A, the model might search the information graph for incorrect but highly similar options like B, C, and D to generate questions that mislead the reasoning response model. The model can also create "outdated information" traps, intentionally using old information to set distractors by leveraging the time attribute of the information graph. For instance, if the correct answer is "The current head of Company A is B," the model might design a question that includes the strongly related but outdated information "C" and "The founder of Company A," misleading the response model into answering "The head of Company A is C." Furthermore, the model can create a maze of "invalid logical chains," constructing a seemingly logical but ultimately flawed path that runs parallel to the correct one, thus increasing deception. For example, to answer a question, the correct logical chain might be A -> B -> C. The question generation model will deliberately find another seemingly related path A -> D -> E from the information graph, and then write information about D and E into the question. If the reasoning response model cannot distinguish which path is the key to solving the problem, it will be led astray and waste reasoning ability on an invalid information chain.
[0093] In a specific application, the reasoning-response model can obtain information for reasoning and responding based on path nodes in the evidence path. This information can then be used to reason about the answer to the question and generate the answer. For example, taking webpage nodes as path nodes, the obtained information can specifically include the original webpage content represented by the webpage node.
[0094] In practical applications, when updating the model parameters of the question generation model and the inference response model, for each evidence path, the server first evaluates the accuracy of the answers based on the questions and answers in the question-answer pair corresponding to the evidence path to determine whether the question answer can accurately answer the question and obtain the accuracy evaluation result. Then, based on the accuracy evaluation result, the server determines the question generation reward signal and the inference response reward signal corresponding to the evidence path. The question generation reward signal is used to update the model parameters of the question generation model, and the inference response reward signal is used to update the model parameters of the inference response model.
[0095] It is understood that in the various embodiments of this application, updating the model parameters of the question generation model and the inference response model based on the question-answer pairs corresponding to each of the multiple evidence paths actually introduces a min-maximum game framework composed of the question generation model and the inference response model. The question generation model attempts to generate questions that can cause the inference response model to make mistakes, while the inference response model strives to answer correctly to maximize its reward. The entire process can be modeled using two interrelated reinforcement learning objectives. The strategy of the inference response model (minimizing error) aims to maximize its expected reward; therefore, the model parameters of the inference response model can be updated using the inference response reward signal. The strategy of the question generation model (maximizing the error of the inference response model) aims to maximize its own reward, which is negatively correlated with the reward of the inference response model; therefore, the model parameters of the question generation model can be updated using the question generation reward signal.
[0096] Step 206: Construct a training dataset based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
[0097] Among them, the content moderation intelligent agent refers to a model that uses artificial intelligence technology to automatically detect and judge content such as text, images, and videos. It can judge the content quality of the input content to be reviewed and obtain the content review result.
[0098] For example, the server can generate reward signals and reasoning response reward signals based on the questions corresponding to each evidence path to perform iterative stopping evaluation and obtain iterative stopping evaluation results. If the iterative stopping evaluation results are passed, the iterative execution is stopped. The server will construct a training dataset based on the training question-answer pairs selected during the iterative execution process. This training dataset can be used to train the content review agent.
[0099] In practical applications, during iterative stopping evaluation, the server can calculate the first expected reward for the problem generation model based on the problem generation reward signal corresponding to each evidence path and the number of sampled evidence paths. Based on the reasoning response reward signal corresponding to each evidence path and the number of sampled evidence paths, the server can calculate the second expected reward for the reasoning response model. The first expected reward can then be used as the core indicator for updating the model parameters of the problem generation model, and the second expected reward can be used as the core indicator for updating the model parameters of the reasoning response model, thus achieving accurate iterative stopping evaluation.
[0100] The aforementioned training data generation method constructs an information graph based on the webpage mentions associated with multiple webpage nodes, enabling cross-webpage information association. It transforms webpage corpora into a structured representation capable of supporting inference tasks. Through iterative execution, multiple evidence paths are sampled from the information graph. For each evidence path, a question-and-answer pair is generated using both a question generation model and an inference-response model. Training question-and-answer pairs are selected from these pairs. By updating the model parameters of both the question generation model and the inference-response model based on the question-and-answer pairs corresponding to each evidence path, the method can leverage the evidence paths sampled from the information graph to... The open-ended question generation task is restructured into a conditional generation task based on structured evidence, ensuring the factual basis of the generated question-answer pairs. By introducing a dynamic game mechanism, the model parameters of the question generation model and the inference response model are continuously updated using the question-answer pairs corresponding to multiple evidence paths. High-quality question-answer pairs are generated using the question generation model and the inference response model. Training question-answer pairs are selected from the generated question-answer pairs to obtain high-quality training data. Thus, a high-quality training dataset can be constructed based on the training question-answer pairs selected during the iterative execution process. The content moderation agent can be trained using the training dataset, which can improve the content moderation quality of the content moderation agent.
[0101] In an exemplary embodiment, the model parameters of the question generation model and the model parameters of the inference response model are updated based on the question-answer pairs corresponding to each of the multiple evidence paths, including:
[0102] For each evidence path, the accuracy of the answers is evaluated based on the questions and answers in the question-answer pairs corresponding to the evidence path, and the accuracy evaluation results are obtained.
[0103] Based on the accuracy assessment results, the reward signals for generating questions and the reward signals for reasoning responses corresponding to the evidence path are determined.
[0104] Based on the question, a reward signal is generated, and the first policy gradient corresponding to the evidence path is determined. Based on the reasoning response reward signal, the second policy gradient corresponding to the evidence path is determined.
[0105] Based on the first policy gradient corresponding to each evidence path, update the model parameters of the question generation model, and based on the second policy gradient corresponding to each evidence path, update the model parameters of the inference response model.
[0106] The question generation reward signal refers to a quantitative evaluation scalar that measures the quality of questions generated by the question generation model in a given context. It defines the quality standard for a "good question" and, as the core feedback mechanism in the reinforcement learning training paradigm, directly drives the update of the model parameters of the question generation model, guiding it to evolve towards generating higher-quality questions. For example, the question generation reward signal for a good question can be a positive signal, and the specific quantitative scalar can be configured according to the actual application scenario; for example, a positive signal can be 1. The question generation reward signal for a bad question can be a negative signal, and the specific quantitative scalar can be configured according to the actual application scenario; for example, a negative signal can be 0 or -1. In the embodiments of this application, the given context refers to the evidence path.
[0107] The inference response reward signal is a quantitative evaluation scalar that measures the quality of the question answers generated by the inference response model under a given context and question. It defines the quality standard of a "good question answer" and, as the core feedback mechanism in the reinforcement learning training paradigm, directly drives the update of the inference response model's parameters, guiding the model to evolve towards generating higher-quality question answers. For example, the inference response reward signal for a correct answer can be a positive signal, and the specific quantization scalar can be configured according to the actual application scenario; for instance, a positive signal can be 1. Conversely, the inference response reward signal for an incorrect answer can be a negative signal, and the specific quantization scalar can be configured according to the actual application scenario; for instance, a negative signal can be 0 or -1.
[0108] It's understandable that the question generation reward signal and the inference response reward signal are negatively correlated. That is, when the question generation reward signal is positive, the inference response reward signal is usually negative, and vice versa. This is because a good question generated by the question generation model can specifically refer to a question that can mislead the inference response model, i.e., a question that the inference response model will answer incorrectly. Conversely, a bad question generated by the question generation model can specifically refer to a question that the inference response model can answer correctly, i.e., a question that the inference response model will answer correctly.
[0109] The first policy gradient refers to the gradient vector of how the model parameters of the problem generation model should be adjusted to maximize the expected reward of the generated problem. It is the core bridge connecting the problem generation reward signal and the update of the model parameters of the problem generation model. Its direction points to the steepest local growth of the expected reward function value in the parameter space, and its magnitude indicates the urgency of the adjustment. Specifically, it can be the gradient of the expected reward objective function of the problem generation model with respect to the model parameters.
[0110] The second policy gradient refers to the gradient vector of how the model parameters of the quantification response model should be adjusted to maximize the expected reward for generating the answer to the question. It is the core bridge connecting the inference response reward signal and the update of the model parameters of the inference response model. Its direction points to the steepest local growth of the expected reward function value in the parameter space, and its magnitude indicates the urgency of the adjustment. Specifically, it can be the gradient of the expected reward objective function of the inference response model with respect to the model parameters.
[0111] For example, such as Figure 5 As shown, for each evidence path, the server evaluates the accuracy of the answer based on the question and answer in the question-answer pair corresponding to the evidence path, determining whether the answer accurately answers the question, and obtaining an accuracy evaluation result 502. Based on the accuracy evaluation result 502, the server can determine the question generation reward signal and the reasoning response reward signal corresponding to the evidence path. Specifically, if the accuracy evaluation result 502 indicates a correct answer, the question generation reward signal corresponding to the evidence path can be a negative signal 504, and the reasoning response reward signal corresponding to the evidence path can be a positive signal 506. If the accuracy evaluation result indicates an incorrect answer, the question generation reward signal corresponding to the evidence path can be a positive signal 508, and the reasoning response reward signal corresponding to the evidence path can be a negative signal 510.
[0112] For example, based on the question generation reward signal and the reasoning response reward signal, the server will calculate the first policy gradient corresponding to the evidence path based on the question generation reward signal, and calculate the second policy gradient corresponding to the evidence path based on the reasoning response reward signal. Then, based on the first policy gradient corresponding to each evidence path, the server will update the model parameters of the question generation model, and based on the second policy gradient corresponding to each evidence path, the server will update the model parameters of the reasoning response model.
[0113] In practical applications, answer accuracy assessment can be achieved using a pre-trained large language model. By inputting the question and answer from the question-answer pair corresponding to the evidence path into the large language model, the model can output the accuracy assessment result. This accuracy assessment result can be a response accuracy score. If the response accuracy score is greater than a threshold, the accuracy assessment result is considered to indicate a correct answer. If the response accuracy score is less than or equal to the threshold, the accuracy assessment result is considered to indicate an incorrect answer.
[0114] In practical applications, when updating model parameters, the server can calculate the average of the first policy gradients corresponding to each evidence path as the target first policy gradient, and then apply the optimizer to update the model parameters of the problem generation model. Similarly, the server can calculate the average of the second policy gradients corresponding to each evidence path as the target second policy gradient, and then apply the optimizer to update the model parameters of the inference response model.
[0115] In this embodiment, by evaluating the accuracy of the questions and answers in the question-answer pairs corresponding to the evidence path, an accuracy evaluation result can be obtained. Then, the accuracy evaluation result can be used to determine the question generation reward signal and the reasoning response reward signal corresponding to the evidence path, thereby achieving a quantitative evaluation of the quality of question generation and reasoning response. The question generation reward signal can be used to determine the first policy gradient corresponding to the evidence path, and the reasoning response reward signal can be used to determine the second policy gradient corresponding to the evidence path. Furthermore, the first policy gradient is used to update the model parameters of the question generation model, and the second policy gradient is used to update the model parameters of the reasoning response model.
[0116] In an exemplary embodiment, a reward signal is generated based on the question, a first policy gradient corresponding to the evidence path is determined, and a second policy gradient corresponding to the evidence path is determined based on the reasoning response reward signal, including:
[0117] Based on the question-generated reward signal and the first generation probability of the question in the question-answer pair corresponding to the evidence path, the first policy gradient corresponding to the evidence path is determined.
[0118] The second policy gradient corresponding to the evidence path is determined based on the reasoning response reward signal and the second generation probability of the question answer in the question-answer pair corresponding to the evidence path.
[0119] The first generation probability refers to the conditional probability that the question generation model generates a question given a context. For example, the first generation probability can specifically refer to the conditional probability that the question generation model generates a question by predicting word by word given a context, which is the product of the probabilities of the word predicted by the question generation model at each step in the word-by-word prediction process.
[0120] Understandably, the question generation model generates questions by predicting words one by one, which can be understood as an automatic completion process. The question generation model receives the evidence path as a given context and needs to be told that the generated question must be related to this evidence path. For example, the specific method of generating questions by word-by-word prediction can be as follows: Predicting the first word: Based on the input evidence path P, the question generation model predicts the most likely first word to be the question Q. Predicting the second word: The question generation model takes "evidence path P + first word" as new input and predicts the most likely second word again. Iterating: This process is repeated continuously, each step predicting the next word based on **(original path + all generated words)**, until a symbol indicating the end is generated.
[0121] The second generation probability refers to the conditional probability that the inference-response model generates a question answer given the context and the question. For example, the second generation probability can specifically refer to the conditional probability that the inference-response model generates a question answer by predicting word by word given the context and the question; that is, the product of the probabilities of the word predicted by the inference-response model at each step in the word-by-word prediction process.
[0122] For example, the server calculates the first generation probability of the question in the question-answer pair corresponding to the evidence path, and calculates the first policy gradient corresponding to the evidence path based on the question generation reward signal, the first generation probability, and a predefined first policy gradient calculation formula. The predefined first policy gradient calculation formula can be configured according to the actual application scenario. For example, the first policy gradient calculation formula can specifically be the product of the gradient of the log probability and the question generation reward signal. Here, the log probability refers to the logarithm of the first generation probability. For example, the first policy gradient calculation formula can specifically be:
[0123] ;
[0124] in, This refers to the first generation probability, Q refers to the question, and P refers to the evidence path. This refers to the problem generation model. It is a strategy of the problem generation model. This refers to the generation of reward signals for problems. This refers to the log-probability ratio of the model parameters. The gradient.
[0125] For example, the server calculates the second generation probability of the question answer in the question-answer pair corresponding to the evidence path, and calculates the second policy gradient corresponding to the evidence path based on the inference response reward signal, the second generation probability, and a predefined second policy gradient calculation formula. The predefined second policy gradient calculation formula can be configured according to the actual application scenario. For example, the second policy gradient calculation formula can specifically be the product of the gradient of the log probability and the inference response reward signal. Here, the log probability refers to the logarithm of the second generation probability. For example, the second policy gradient calculation formula can specifically be:
[0126] ;
[0127] in, This refers to the second generation probability, where 'a' represents the question answer, 'a' represents the question, and A represents the reasoning-response model. It is a strategy of the inference response model. It is a reasoning response reward signal. This refers to the log-probability ratio of the model parameters. The gradient.
[0128] In this embodiment, based on determining the first generation probability of the question and the second generation probability of the question answer, the first policy gradient can be accurately calculated using the question generation reward signal and the first generation probability, and the second policy gradient can be accurately calculated using the inference response reward signal and the second generation probability.
[0129] In one exemplary embodiment, the training data generation method further includes:
[0130] Based on the question generated for each evidence path and the number of sampled evidence paths, calculate the first expected reward for the question generation model;
[0131] Calculate the second expected reward for the reasoning response model based on the reasoning response reward signal corresponding to each evidence path and the number of sampled evidence paths;
[0132] The iteration stops based on the first and second expected rewards. If the iteration stops and the evaluation result is passed, the iteration is terminated.
[0133] The number of sampled evidence paths refers to the total number of evidence paths sampled from the information graph during one iteration. The first expected reward is the average reward the question generation model receives when generating questions according to the current strategy. It quantifies the overall generation quality of the question generation model under the current reward standard; a higher first expected reward indicates higher generation quality. The second expected reward is the average reward the inference-response model receives when generating answers according to the current strategy. It quantifies the overall generation quality of the inference-response model under the current reward standard; a higher second expected reward indicates higher generation quality.
[0134] For example, after each iteration, the server needs to determine whether the iteration should be terminated. At this time, the server will calculate the first expected reward for the problem generation model based on the problem generation reward signal and the number of sampled evidence paths corresponding to each evidence path, and calculate the second expected reward for the reasoning response model based on the reasoning response reward signal and the number of sampled evidence paths corresponding to each evidence path. The iteration stop evaluation is performed based on the first and second expected rewards to obtain the iteration stop evaluation result. If the iteration stop evaluation result is passed, the iteration is terminated.
[0135] In practical applications, the first expected reward can be the ratio of the accumulated reward signal for each evidence path's corresponding question generation to the number of sampled evidence paths. Based on this, the quality of question generation for each evidence path can be quantified. The second expected reward can be the ratio of the accumulated reward signal for each evidence path's corresponding reasoning response to the number of sampled evidence paths. Based on this, the quality of question answer generation for each evidence path can be quantified.
[0136] In practical applications, the strategy of problem generation models The objective function aims to maximize its first expected reward; therefore, it can be: , among them This represents the average of all possible evidence paths, with evidence path P sampled from the information graph. Essentially, the goal is for the problem generation model to perform well across all types of evidence paths. This represents the average of all possible outputs of the problem generation strategy, where the strategy is... It is the object to be optimized, and its essence is to measure the overall performance of the problem generation model under a given evidence path P. This refers to the fact that the reward signal for the answer evaluation depends on the parameters of a fixed reasoning-response model. .
[0137] Understandably, based on this objective function and its sampling estimation method, when the answer evaluation reward signal includes both positive and negative signals, the objective function value can be calculated by sampling and estimating the expected reward. Therefore, the server can use the accumulated value of the problem generation reward signal to calculate the first expected reward, which can be the ratio of the accumulated value of the problem generation reward signal to the number of sampled evidence paths, i.e., the average problem generation reward.
[0138] In practical applications, the strategy of inference response models The objective function aims to maximize its second expected reward; therefore, it can be: , among them This indicates that the average is taken under dual randomness, and the evidence path P is sampled from the information graph. Question Q comes from a fixed question generation model. Essentially, it is an average of all possible combinations of evidence paths and questions. This refers to parameter dependence The answer evaluation reward function aims to find the most suitable parameters. Maximize the second expected reward.
[0139] Understandably, based on this objective function and its sampling estimation method, when the output of the answer evaluation reward function includes both positive and negative signals, the objective function value can be calculated by sampling and estimating the expected reward. Therefore, the server can use the accumulated value of the inference response reward signal to calculate the second expected reward, which can be the ratio of the accumulated value of the inference response reward signal to the number of sampled evidence paths, i.e., the average inference response reward.
[0140] In practical applications, when performing iteration stop evaluation, the server can use the first expected reward to quantitatively evaluate the generation quality of the problem generation model and the second expected reward to quantitatively evaluate the generation quality of the reasoning response model. When both the first and second expected rewards meet their respective iteration stop conditions, the iteration stop evaluation result can be determined as passed, and the iteration execution can be terminated.
[0141] In a specific application, the iteration stopping conditions corresponding to the first and second expected rewards can be configured according to the actual application scenario. For example, the iteration stopping condition corresponding to the first expected reward could be the convergence of the first expected reward or the first expected reward reaching a first reward threshold, which can be configured according to the actual application scenario. Similarly, the iteration stopping condition corresponding to the second expected reward could be the convergence of the second expected reward or the second expected reward reaching a second reward threshold, which can be configured according to the actual application scenario.
[0142] In this embodiment, the first expected reward can be estimated by generating a reward signal from the problem, and the second expected reward can be estimated by using the reasoning response reward signal. Then, the first and second expected rewards can be used to achieve accurate iterative stopping evaluation and obtain the iterative stopping evaluation result. Thus, if the iterative stopping evaluation result is passed, the iterative execution can be terminated and the iterative execution process can be completed.
[0143] In one exemplary embodiment, the training data generation method further includes:
[0144] The logical paths corresponding to multiple target questions are sampled from the information graph. For each logical path, the target question corresponding to the logical path is predicted based on the logical path through the initial generation model, so as to determine the conditional probability of question generation.
[0145] Determine the sampling probability of the logical path, and calculate the question generation quality score corresponding to the logical path based on the sampling probability and the question generation conditional probability.
[0146] Based on the quality score generated for each logical path, the quality score of the initial generation model is determined.
[0147] The problem generation model is obtained when the quality score of the initial generation model satisfies the stopping condition of generation training.
[0148] In this context, a logical path refers to an ordered sequence of logically feasible, structured skeletons that constitute the target problem within the information graph. This logical path can be understood as structured evidence for generating the target problem, guiding the initial generation model to predict the corresponding target problem based on the logical path. This reconstructs the problem generation task into a conditional generation task based on structured evidence. In other words, the logical path essentially provides logically complete and traceable evidence within the information graph to support the prediction of the target problem.
[0149] The initial generation model refers to a model capable of understanding given information content, identifying key and implicit points of doubt, and generating relevant natural language questions. In various embodiments of this application, the initial generation model refers to a generation model whose model parameters are not optimized. By optimizing the model parameters of the initial generation model, a question generation model can be obtained.
[0150] The conditional probability of question generation refers to the conditional probability that the initial generation model predicts the target question corresponding to the logical path based on the logical path. For example, the conditional probability of question generation can specifically refer to the conditional probability that the initial generation model generates the target question by predicting word by word when given a logical path, that is, the product of the probabilities of the initial generation model predicting words in the target question at each step during word-by-word prediction.
[0151] Here, sampling probability refers to the probability that a logical path is sampled from the information graph. Question generation quality score is a score used to measure the conditional generation quality of the initial generation model. It can be understood that the goal of the initial generation model is to maximize the conditional probability of generating the target question given the logical path. Therefore, the training objective of the question generation model can be to maximize the conditional log-likelihood, and the question generation quality score can specifically be the conditional log-likelihood value.
[0152] For example, based on the obtained information graph, the server can use the information graph to obtain a question generation model. Specifically, the server first identifies multiple target questions, then samples the logical paths corresponding to each target question from the information graph. For each logical path, the initial generation model predicts the target question corresponding to the logical path to determine the conditional probability of question generation for that logical path, and further determines the sampling probability of the logical path. Based on the sampling probability and the conditional probability of question generation, the server calculates the question generation quality score corresponding to the logical path. This question generation quality score characterizes the ability of the initial generation model to predict the target questions based on the logical paths. Based on the question generation quality scores corresponding to the logical paths, the server can determine the question generation quality score of the initial generation model, which characterizes the ability of the initial generation model to generate high-quality questions based on a given path. Given the question generation quality score of the initial generation model, the server determines whether the question generation quality score of the initial generation model meets the training stopping condition. If the question generation quality score of the initial generation model meets the training stopping condition, the question generation model is obtained.
[0153] In practical applications, the quality score of question generation corresponding to a logical path can be the product of the sampling probability of the logical path and the conditional probability of question generation. The sampling probability can be obtained by calculating the path score of the logical path. The quality score of question generation in the initial generation model can be the average or cumulative value of the quality scores of question generation for each logical path; this embodiment does not impose specific limitations on this.
[0154] In practical applications, taking the training objective of the question generation model as maximizing the conditional log-likelihood as an example, the question generation quality score can be calculated using the following formula: L(φ) = E_{P \sim p(P)}[log P(Q | P; φ)], where P = (d_1, e_1, d_2, ..., d_k) is a logical path sampled from the information graph G, d_n is a logical path node, e_n is a path edge connecting the logical path nodes, p(P) is the sampling distribution of the logical path, Q is the target question corresponding to the logical path P, and P(Q | P; φ) is the conditional probability that the initial generation model predicts the target question given the logical path P and the model parameters φ of the initial generation model.
[0155] In specific applications, training stopping conditions can be generated, which can be either the initial generation of the model's problem quality score convergence or the initial generation of the model's problem quality score reaching a quality score threshold. This quality score threshold can be configured according to the actual application scenario.
[0156] In this embodiment, by sampling the logical paths corresponding to multiple target questions from the information graph, the problem generation capability of the initial generation model can be trained by predicting the target questions corresponding to the logical paths. During the training process, the problem generation quality score corresponding to each logical path is used to obtain the problem generation quality score of the initial generation model, thereby evaluating the problem generation capability of the initial generation model. This anchors the problem generation process to the verification path, ensuring the factual basis of the training instances, guaranteeing the quality of the supervision signal, and resulting in a problem generation model that can generate high-quality questions.
[0157] In one exemplary embodiment, determining the sampling probability of a logical path includes:
[0158] The path score of a logical path is obtained by summing the weights of the path edges connecting the logical path nodes in the logical path.
[0159] The sampling probability of a logical path is calculated based on the path score of the logical path and a predefined temperature parameter.
[0160] In this context, the path edges connecting logical path nodes refer to the association edges in the information graph that connect logical path nodes. Each association edge has a weight, which represents the strength of the association between the two nodes connected by the edge. For example, taking webpage nodes as an example, the weight of the association edge can specifically refer to a probability estimate that represents the strength of the association between the webpages represented by the two webpage nodes in a specific spatiotemporal context.
[0161] The predefined temperature parameter is a hyperparameter that controls the level of randomness in path sampling, defining the initial difficulty distribution of the generated problem. A higher predefined temperature parameter leads to more random sampling, tending to explore low-weight paths to increase difficulty. A lower predefined temperature parameter concentrates sampling on high-weight paths to reduce difficulty. By adjusting the predefined temperature parameter, the initial difficulty of the generated problem can be planned.
[0162] For example, when determining the sampling probability of a logical path, the server accumulates the weights of the path edges connecting the logical path nodes to obtain the path score of the logical path, and then calculates the sampling probability of the logical path based on the path score of the logical path and the predefined temperature parameter.
[0163] In practical applications, the sampling probability of a logical path can be proportional to the exponent of its path score. This can be defined by a Softmax distribution with a predefined temperature parameter, i.e., p(P) ∝ exp( (1 / τ) * Σ_{e_i ∈P} w(e_i) ), where τ is the predefined temperature parameter, e_i refers to the path edge connecting logical path nodes in logical path P, w(e_i) refers to the weight of the path edge connecting logical path nodes, and Σ_{e_i ∈ P} w(e_i) refers to the path score of the logical path.
[0164] In this embodiment, the weights of path edges can be used as prior knowledge to guide the path sampling process, thereby controlling the initial difficulty of the problem generation task at a macro level. High-weighted paths correspond to tasks with high cohesion and easy reasoning, while low-weighted paths correspond to difficult tasks requiring greater logical scope. It is understandable that the learning efficiency of the reasoning-response model is highly dependent on the difficulty distribution of the training data. An ideal training course should progress from easy to difficult. By quantifying the difficulty of the problem generation task, the learning efficiency of the reasoning-response model can be effectively improved.
[0165] In an exemplary embodiment, selecting training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths includes:
[0166] From the question-and-answer pairs corresponding to each of the multiple evidence paths, identify the first question-and-answer pair that answers correctly and the second question-and-answer pair that answers incorrectly.
[0167] From the first question-and-answer pair, select positive sample question-and-answer pairs, and from the second question-and-answer pair, select negative sample question-and-answer pairs;
[0168] Training question-answer pairs are obtained based on positive and negative sample question-answer pairs.
[0169] For example, when selecting training question-answer pairs, the server determines the accuracy evaluation results of the question-answer pairs corresponding to multiple evidence paths. Using the multiple accuracy evaluation results, it determines the first question-answer pair with correct answers and the second question-answer pair with incorrect answers from the question-answer pairs corresponding to the multiple evidence paths. Then, based on the accuracy evaluation results of the first question-answer pair, it selects positive sample question-answer pairs from the first question-answer pairs. Based on the accuracy evaluation results of the second question-answer pairs, it selects negative sample question-answer pairs from the second question-answer pairs. The training question-answer pairs are obtained based on the positive sample question-answer pairs and the negative sample question-answer pairs.
[0170] Understandably, when selecting positive question-answer pairs, the first question-answer pair with high accuracy should be chosen, while when selecting negative question-answer pairs, the second question-answer pair with low accuracy should be chosen. Taking the accuracy assessment result as the answer accuracy score as an example, the server will obtain the answer accuracy score of each first question-answer pair and select the first question-answer pair with the highest accuracy score as the positive question-answer pair. Simultaneously, the server will obtain the answer accuracy score of each second question-answer pair and select the second question-answer pair with the lowest accuracy score as the negative question-answer pair.
[0171] The number of selected first question-and-answer pairs can be configured according to the actual application scenario. Specifically, the selection quantity or selection ratio can be predefined to select according to the selected quantity or selection ratio. Similarly, the number of selected second question-and-answer pairs can be configured according to the actual application scenario. Again, the selection quantity or selection ratio can be predefined to select according to the selected quantity or selection ratio.
[0172] In this embodiment, by determining the first question-and-answer pair that answers correctly and the second question-and-answer pair that answers incorrectly, it is possible to divide the question-and-answer pairs corresponding to each of the multiple evidence paths. Then, positive sample question-and-answer pairs can be selected from the first question-and-answer pairs, and negative sample question-and-answer pairs can be selected from the second question-and-answer pairs. The positive sample question-and-answer pairs and the negative sample question-and-answer pairs are used to construct training question-and-answer pairs.
[0173] Understandably, this approach allows for the selection of high-quality and challenging question-and-answer pairs as training samples during iterative execution, thereby improving the quality of the training pairs. Furthermore, by simultaneously collecting both positive and negative samples, more balanced and discriminative training pairs can be constructed, enabling the content moderation agent to more clearly define decision boundaries during comparative learning, thus enhancing its generalization ability and robustness.
[0174] In one exemplary embodiment, an information graph is constructed based on the webpage mention entities associated with each of multiple webpage nodes, including:
[0175] Based on the webpage mention entities associated with each of the multiple webpage nodes, determine the adjacent webpage nodes of each webpage node;
[0176] For each webpage node, based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, webpage relevance analysis is performed to determine the weight of the association edges between the webpage node and its neighboring webpage nodes.
[0177] An information graph is constructed based on the weights of each webpage node, each webpage node's neighboring webpage nodes, and the associated edges between each webpage node and its neighboring webpage nodes.
[0178] The weight of an edge represents the strength of the association between the two nodes connected by the edge. For example, taking web page nodes as the two nodes connected by the edge, the weight of the edge can specifically refer to the probability estimate that can represent the strength of the association between the web pages represented by the two web page nodes in a specific spatiotemporal context.
[0179] For example, the server determines the adjacent web nodes of each web node based on the web mention entities associated with each of the multiple web nodes. For each web node, the server performs web relevance analysis based on the same web mention entities associated with the web node and its adjacent web nodes to determine the weight of the association edges between the web node and its adjacent web nodes. Then, based on each web node, each web node's adjacent web nodes, and the weight of the association edges between each web node and its adjacent web nodes, an information graph is constructed.
[0180] In practical applications, when performing webpage relevance analysis, the server performs entity sparse analysis based on the same webpage mention entities associated with webpage nodes and adjacent webpage nodes to determine the entity sparseness of the same webpage mention entities. Then, based on the entity sparseness of the same webpage mention entities, the weight of the association edge between the webpage node and adjacent webpage nodes is determined.
[0181] In a specific application, the server can calculate the cumulative entity rarity of entities mentioned on the same webpage. This cumulative entity rarity is then used as the weight of the association edge between a webpage node and its neighboring webpage nodes. Alternatively, it can combine this with other webpage relevance analysis factors to determine the weight of the association edge between a webpage node and its neighboring webpage nodes. For example, other webpage relevance analysis factors could be time-related factors, such as publication time relevance.
[0182] In specific applications, when the information graph also includes entity nodes, the server needs to determine the neighboring nodes of each entity node and the weight of the associated edges between each entity node and its neighboring nodes. Then, based on the weight of each entity node, its neighboring nodes, and the associated edges between each entity node and its neighboring nodes, the entity nodes are connected and integrated with other nodes to construct the information graph.
[0183] It's understandable that the adjacent nodes of an entity node could be either other entity nodes or webpage nodes. For example, if the adjacent nodes of an entity node are also entity nodes, it means that the entities represented by each of the two entity nodes appear simultaneously in at least one webpage. The weight of the association edge between two entity nodes can be obtained by calculating the co-occurrence frequency, explicit relationship, and semantic similarity of the entities represented by each entity node.
[0184] Co-occurrence frequency refers to the frequency at which two entities appear together in a large number of articles or sentences, indicating a higher underlying weight between them. In various embodiments of this application, co-occurrence frequency can specifically refer to the frequency at which two entities appear together in multiple crawled web pages, indicating a higher underlying weight between them.
[0185] Explicit relationships primarily stem from direct declarations in structured data. For instance, if structured data explicitly states "Founder of Company X: Y," then the weight of the associated edge connecting the entity node representing entity X and the entity node representing entity Y is very high because it is a confirmed fact.
[0186] Semantic similarity refers to the "distance" between two entities in the semantic space calculated by a natural language processing model. For example, "CEO" and "Chairman" are semantically close, which increases the weight of the association edge between "Company A" and "B" (Chairman of Company A).
[0187] For example, when the adjacent nodes of an entity node are web page nodes, it means that the entity represented by the entity node is a web page mentioned by the web page node. The weight of the association edge between the entity node and the web page node can be obtained by calculating the word frequency and position of the entity represented by the entity node in the web page represented by the web page node, the topic centrality of the web page represented by the web page node, and the incoming anchor text.
[0188] In this context, term frequency refers to the frequency with which an entity appears on a webpage. Essentially, the more times an entity appears, the higher its weight. Location refers to the position of an entity within the webpage. Generally, an entity appearing in the core semantic information of a webpage carries significantly more weight than one appearing in the main text. Core semantic information can specifically include the webpage title, H1 / H2 tags, URLs (Uniform Resource Locator), or bold text, etc.
[0189] Theme centrality refers to the relevance of an entity to the core theme of a webpage. In other words, an entity that is part of the core theme of a webpage has a higher weight than an entity that is not. Specifically, the server can use algorithms to determine whether an entity is a "protagonist" of the webpage. For example, the server can input the webpage content and entities into a large language model, allowing the model to determine whether the entity is a core theme of the webpage.
[0190] In this context, inbound anchor text refers to the relevance between an entity and the link text that links to the webpage. It's understood that the weight of an entity included in the link text is significantly greater than that of an entity not included in the link text. For example, if many other websites link to this webpage using link text (anchor text) that contains an entity, the weight of the association between the webpage and the entity will be greatly increased.
[0191] In this embodiment, based on the webpage mention entities associated with each of the multiple webpage nodes, the adjacent webpage nodes of each webpage node can be determined. Then, for each webpage node, webpage relevance analysis can be performed based on the same webpage mention entities associated with the webpage node and its adjacent webpage nodes, thereby determining the weight of the relevance edges between the webpage node and its adjacent webpage nodes. Thus, an information graph can be constructed using the weights of each webpage node, each webpage node's adjacent webpage nodes, and the relevance edges between each webpage node and its adjacent webpage nodes.
[0192] In an exemplary embodiment, for each webpage node, based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, a webpage relevance analysis is performed to determine the weight of the association edges between the webpage node and its neighboring webpage nodes, including:
[0193] For each webpage node, entity sparse analysis is performed based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes to determine the entity sparseness of the same webpage mention entities;
[0194] Based on the publication time of each webpage node and its adjacent webpage nodes, a publication time correlation analysis is performed to determine the publication time correlation.
[0195] The weights of the associated edges between web page nodes and adjacent web page nodes are determined based on the entity rarity and publication time relevance of the same web page mentioned entities.
[0196] For example, for each webpage node, the server performs entity rarity analysis based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes to determine the entity rarity of the same webpage mention entities. It also performs publication time correlation analysis based on the publication time of the webpages associated with the webpage node and its neighboring webpage nodes to determine the publication time correlation. Finally, based on the entity rarity of the same webpage mention entities and the publication time correlation, the server determines the weight of the association edge between the webpage node and its neighboring webpage nodes.
[0197] It is understandable that if two web pages both mention a very rare entity, their correlation is much higher than if they both mention a common entity. Since web page nodes represent web pages, if two web page nodes are associated with a very rare entity, their correlation is much higher than if they are associated with a common entity. Therefore, in this embodiment, inverse document frequency can be used to measure entity rarity. That is, based on the same web page mentioning an entity, the number of associated web page nodes is counted. The fewer the number of web page nodes associated with the same web page mentioning an entity, the higher the correlation between the web page node and its adjacent web page nodes, that is, the higher the entity rarity.
[0198] Understandably, when content review tasks are time-sensitive, web pages with similar publication times are more related. Therefore, we can analyze the correlation between web page nodes and adjacent web page nodes from the perspective of web page publication time to determine the correlation based on the publication time difference.
[0199] In practical applications, the server calculates the cumulative value of the entity rarity of the same web page mentions the entity, and combines the cumulative value of entity rarity with the publication time correlation to calculate the weight of the associated edges between web page nodes and adjacent web page nodes. For example, the weight of the associated edge between a webpage node and its adjacent webpage nodes can be the product of the cumulative entity rarity and the publication time relevance. The formula for calculating the weight of the associated edge is: w(d_i, d_j) = Σ_{e ∈ E(d_i) ∩ E(d_j)} [ IDF(e) ] * T(d_i, d_j), where e ∈ E(d_i) ∩ E(d_j) represents the same webpage mention entity associated with webpage node d_i and its adjacent webpage node d_j, IDF(e) represents the entity rarity of a single identical webpage mention entity, Σ_{e ∈ E(d_i) ∩ E(d_j)} [ IDF(e) ] represents the cumulative entity rarity, and T(d_i, d_j) represents the publication time relevance. The specific calculation method can be configured according to the actual application scenario.
[0200] Understandably, this formula calculates the sum of the Inverse Document Frequency (IDF) values of all identical webpage mentions e between webpage node d_i and its neighboring webpage node d_j, and penalizes them with a time decay factor. In this way, rare and temporally close identical webpage mentions contribute the most to the weight of the association edge between the two webpage nodes, enabling accurate calculation of the weight of the association edge between a webpage node and its neighboring webpage nodes.
[0201] In an exemplary embodiment, for each webpage node, entity rarity analysis is performed based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes to determine the entity rarity of the same webpage mention entities, including:
[0202] For each webpage node, based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, the number of webpage nodes associated with the same webpage mention entities is determined, and the total number of webpage nodes is determined.
[0203] The entity rarity of the same entity mentioned on a webpage is determined based on the number of webpage nodes and the total number of webpage nodes.
[0204] For example, for each webpage node, the server will perform a statistical analysis of associated webpage nodes based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, determine the number of webpage nodes associated with the same webpage mention entities, determine the total number of webpage nodes, and then determine the entity rarity of the same webpage mention entities based on the number of webpage nodes and the total number of webpage nodes.
[0205] In practical applications, the ratio of the number of associated webpage nodes to the total number of webpage nodes can be used as the rarity of the same webpage mentioning the entity. Alternatively, inverse document frequency (IDF) can be used to measure entity rarity. Taking IDF as an example, the formula for calculating entity rarity is: IDF(e) = log ( N / (df(e) + 1) ), where N represents the total number of webpage nodes, i.e., the total number of webpages, and df(e) is the number of webpage nodes, i.e., the number of webpages mentioning the entity. The smaller df(e) is, the larger the IDF(e) value, indicating that the same webpage mentioning the entity e is rarer and more important.
[0206] In this embodiment, by performing statistics on associated webpage nodes, the number of webpage nodes associated with the same webpage mentioned entity can be determined. Then, based on the total number of webpage nodes, the entity rarity can be accurately measured by using the number of webpage nodes and the total number of webpage nodes, thus obtaining the entity rarity of the same webpage mentioned entity.
[0207] In one exemplary embodiment, a publication time correlation analysis is performed based on the publication time of each webpage node and its adjacent webpage nodes to determine the publication time correlation, including:
[0208] The publication time difference is determined based on the publication time of the web page node and the web pages associated with each adjacent web page node;
[0209] The correlation between release times is determined based on the difference in release times.
[0210] For example, the server can determine the publication time difference based on the publication time of each webpage node and its associated webpages, and then use this publication time difference to measure the correlation between publication times. In specific applications, the server can directly use the publication time difference to measure the correlation between publication times, or it can combine the publication time difference with an exponential decay function to measure the correlation between publication times; that is, the larger the publication time difference, the greater the weight decay.
[0211] In a specific application, the publication time correlation can be calculated using the following formula: T(d_i, d_j) = exp(-λ * |t_i - t_j|), where t_i and t_j are the publication times of the webpages associated with webpage node d_i and its adjacent webpage node d_j, respectively, and |t_i - t_j| is the difference in publication times (e.g., calculated in days). λ is a decay coefficient that controls the rate of decay and can be configured according to the actual application scenario. When the time difference is 0, T=1; the larger the time difference, the closer T is to 0.
[0212] In this embodiment, by calculating the publication time difference between the publication time of each webpage node and the publication time of the webpages associated with each adjacent webpage node, the publication time difference can be used to measure the correlation of publication time.
[0213] In one exemplary embodiment, such as Figure 6 As shown, a training data generation method is provided. This embodiment illustrates the method applied to a server, but it is understood that the method can also be applied to a terminal, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes steps 602 to 652. Wherein:
[0214] Step 602: Based on the webpage mention entities associated with each of the multiple webpage nodes, determine the adjacent webpage nodes of each webpage node.
[0215] Step 604: For each webpage node, based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, perform related webpage node statistics, determine the number of webpage nodes associated with the same webpage mention entities, and determine the total number of webpage nodes.
[0216] Step 606: Determine the entity rarity of the same entity mentioned on a webpage based on the number of webpage nodes and the total number of webpage nodes.
[0217] Step 608: Determine the publication time difference based on the publication time of the web page node and the web pages associated with each adjacent web page node.
[0218] Step 610: Determine the correlation between release times based on the release time difference.
[0219] Step 612: Based on the entity rarity and publication time relevance of the same webpage mentioned entities, determine the weight of the association edges between webpage nodes and adjacent webpage nodes.
[0220] Step 614: Construct an information graph based on the weights of each webpage node, each webpage node's neighboring webpage nodes, and the associated edges between each webpage node and its neighboring webpage nodes.
[0221] Iterative execution:
[0222] Step 616: Sample the logical paths corresponding to multiple target questions from the information graph. For each logical path, predict the target question corresponding to the logical path based on the logical path through the initial generation model, so as to determine the conditional probability of question generation.
[0223] Step 618: For each logical path, accumulate the weights of the path edges connecting the logical path nodes to obtain the path score of the logical path.
[0224] Step 620: Calculate the sampling probability of the logical path based on the path score of the logical path and the predefined temperature parameter.
[0225] Step 622: Calculate the problem generation quality score corresponding to the logical path based on the sampling probability and the problem generation conditional probability.
[0226] Step 624: Based on the quality score of the problem generation corresponding to each logical path, determine the problem generation quality score of the initial generation model.
[0227] Step 626: If the quality score of the problem generation model in the initial generation model meets the stopping condition for generation training, the problem generation model is obtained.
[0228] Step 628: Sample multiple evidence paths from the information graph. For each evidence path, generate question-answer pairs corresponding to the evidence path using a question generation model and a reasoning-response model. The question-answer pairs include questions generated by the question generation model based on path nodes in the evidence path, and question answers generated by the reasoning-response model based on path nodes and questions in the evidence path.
[0229] Step 630: For each evidence path, evaluate the accuracy of the answers based on the questions and answers in the question-answer pair corresponding to the evidence path, and obtain the accuracy evaluation result.
[0230] Step 632: Based on the accuracy assessment results of each evidence path, determine the first question-and-answer pair with the correct answer and the second question-and-answer pair with the incorrect answer from the question-and-answer pairs corresponding to each of the multiple evidence paths.
[0231] Step 634: Select positive sample question-answer pairs from the first question-answer pair and negative sample question-answer pairs from the second question-answer pair.
[0232] Step 636: Based on the positive sample question-answer pairs and the negative sample question-answer pairs, obtain the training question-answer pairs.
[0233] Step 638: For each evidence path, based on the accuracy assessment results of the evidence path, determine the question generation reward signal and reasoning response reward signal corresponding to the evidence path.
[0234] Step 640: Based on the question-generated reward signal and the first generation probability of the question in the question-answer pair corresponding to the evidence path, determine the first policy gradient corresponding to the evidence path.
[0235] Step 642: Based on the reasoning response reward signal and the second generation probability of the question answer in the question-answer pair corresponding to the evidence path, determine the second policy gradient corresponding to the evidence path.
[0236] Step 644: Update the model parameters of the question generation model based on the first policy gradient corresponding to each evidence path, and update the model parameters of the inference response model based on the second policy gradient corresponding to each evidence path.
[0237] Step 646: Calculate the first expected reward for the problem generation model based on the problem-generating reward signal corresponding to each evidence path and the number of sampled evidence paths.
[0238] Step 648: Calculate the second expected reward for the reasoning response model based on the reasoning response reward signal corresponding to each evidence path and the number of sampled evidence paths.
[0239] Step 650: Perform an iterative stopping evaluation based on the first expected reward and the second expected reward to obtain the iterative stopping evaluation result. If the iterative stopping evaluation result is passed, terminate the iteration execution.
[0240] Step 652: Construct a training dataset based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
[0241] In an exemplary embodiment, the training data generation method of this application is used to generate a content review agent for determining whether the content to be reviewed is outdated, as an example, to illustrate the training data generation method of this application.
[0242] The inventors point out that in related technologies, training content moderation agents to determine whether content to be reviewed is outdated mainly involves two methods: online training and offline training. The first method, online training (reinforcement learning), involves directly placing the content moderation agent into a real network environment, allowing it to explore on its own, rewarding correct actions and punishing incorrect ones. This method is theoretically sound, but practically problematic because each training session requires thousands of interactions with the internet, making it slow, expensive, and the uncontrollable network environment leads to unstable training results. The second method, offline training, avoids interacting with the real network by pre-organizing offline training data, allowing the content moderation agent to learn locally. Its general approach involves first completely scraping the content of a website, then automatically generating numerous question-and-answer questions based on that content, ensuring both questions and answers originate from that single website. This method solves the speed and cost issues, but introduces a new problem: the constructed data is too simplistic. Specifically, the questions and answers generated by this technology can generally be found on the same webpage or within the same website. The content moderation agent only learns the ability to "find information within a fixed scope," which is far removed from the real-world scenario of content moderation. In the real world, determining whether something is outdated often involves searching for a needle in a haystack across the entire internet, connecting information from different isolated sites to make a judgment. This usually requires combining information from several completely unrelated websites, and the information may even contradict itself. Furthermore, the content moderation models trained by this technology are too rigid because the training data is too simple—questions are questions, answers are answers, there are no traps. This results in a content moderation model that is like an "honest person," only able to process straightforward information. However, there is a lot of well-disguised outdated content online, such as very recent dates or old content. Content moderation models perform poorly on such data. Therefore, the training data generated by this technology cannot teach content moderation agents to handle the complex tasks in real-world scenarios, such as cross-website interactions, scattered information, and even deceptive content.
[0243] Based on this, this application proposes a training data generation method that constructs training data locally to directly simulate the most challenging real-world auditing scenarios. Specifically, the training data generation method of this application includes the following two key points:
[0244] The first is cross-webpage correlation. For example, to determine whether a recommendation article about "a certain restaurant" is outdated, the content moderation AI would have to check the official website, the latest user reviews, and even news reports to see if it has closed down—the answer is scattered across multiple places. Our method is to pre-link this information from official websites, reviews, and news pages, constructing a cross-webpage information graph, and then generating a content moderation task. In this way, during training, the content moderation AI is forced to learn to find key points from a pile of scattered information and piece together a conclusion: "Is this restaurant still worth recommending?"
[0245] Understandably, the training data generation method in this application, by employing "cross-webpage association" technology, connects related information from different websites (isolated sites) before generating questions, thus building a "bridge." Therefore, our agent can learn to integrate and compare information from multiple sources.
[0246] Second, adversarial question generation. If content moderation agents simply generate question-and-answer pairs based on available information, they easily learn to copy answers instead of engaging in genuine thought. For example, they might find answers through keyword matching, which is ineffective in real-world business scenarios. Therefore, we introduced an adversarial generation mechanism: a question-generating module (the question generation model) and an answering module (the reasoning and response model, which is the agent we train). The goal of the question-generating module is to challenge the agent in various ways. Based on the cross-webpage information graph we built earlier, it specifically generates trap-filled questions. For example, the module might generate questions based on information interference mechanisms, intentionally adding distractors similar to but unrelated to the correct answer. Another example is questions with hidden premises, requiring an understanding of an implicit condition before the answer can be derived. Yet another example is questions requiring comparison, demanding a comparison of information from different sources rather than simple restatement.
[0247] It should be noted that the question-answering module in this embodiment, as the agent that needs to be trained, is not the same as the content moderation agent. They can be considered as two versions of the same agent at different stages. That is, the agent that needs to be trained is a practice partner in the training data generation process, adversarially competing with the "question generation model" to jointly create high-quality, challenging training data. The content moderation agent, on the other hand, is the final product; it is the final model obtained after specialized training using the training dataset generated in the "practice partner" stage.
[0248] Understandably, the training data generation method of this application, by adopting an adversarial generation mechanism, will continuously create various traps and disguised data to specifically attack the weak links of the intelligent agent, forcing the model to grow into an auditing expert capable of recognizing various disguise traps.
[0249] In summary, this application proposes a training data generation method based on cross-webpage association and adversarial question generation. The core idea is to first construct an interconnected information graph from discrete webpage information, and then, based on this information graph, generate high-quality, high-difficulty training data through a game-like mechanism of "question generation" and "question answering." A flowchart illustrating the training data generation method of this application can be seen as follows: Figure 7 As shown, the overall process is as follows: [Original Web Page Data] -> Step 1: Cross-Web Page Infographic Construction -> [Cross-Web Page Infographic] -> Step 2: Adversarial Training Data Generation -> [High-Quality Training Dataset] -> [Content Moderation Agent]. The following section combines... Figure 7 The flowchart below illustrates the training data generation method of this application.
[0250] Step 1: Constructing a cross-webpage information graph:
[0251] The problem encountered in step one is that simple "connections" are meaningless. Specifically, constructing an information graph by only associating web pages that mention the same word (i.e., entity) reveals that the resulting information graph is unusable. This is because relevant knowledge graph construction methods, such as those based on RDF (Resource Description Framework) triples, are primarily used to model relatively static information. Such knowledge graphs cannot effectively capture the strength of contextual relationships and temporal dynamics between information, which are precisely the key decision-making factors for content timeliness review. Directly applying such methods results in a "semantically flattened" graph structure that cannot distinguish between core evidence and outdated background information. Furthermore, simply associating documents based on common entities introduces a large number of pseudo-associations. Distinguishing between genuine semantic and logical connections and accidental surface co-occurrences is crucial for constructing a high-quality information graph.
[0252] For example: 1. Webpage A is a news article published today about the "XX mobile phone launch event". 2. Webpage B is a "XX mobile phone performance review" published yesterday. 3. Webpage C is a "stock analysis of the company that launched the XX mobile phone" from five years ago. All three webpages mention "the company that launched the XX mobile phone" and "XX mobile phone". Technically, they would be simply linked together. However, for our content moderation task, the correlation between webpages A and B is extremely strong, crucial for judging timeliness, while the correlation between webpages A and C is very weak. If the content moderation AI confuses them, it will make an incorrect judgment. Based on this flat information graph, it is impossible to generate in-depth questions that test judgment.
[0253] Therefore, the core of step one lies in how to transform the various unstructured, time-sensitive web page corpora into a structured representation that can support reasoning tasks. Based on this, the training data generation method in this application introduces the following two points in the cross-web page information graph construction stage:
[0254] 1. A context-aware, dynamically weighted graph model is proposed:
[0255] This application proposes a paradigm for edge weight calculation that integrates semantic importance measurement from information retrieval with decay models from time series analysis. By introducing entity IDF as a proxy variable for semantic importance and combining it with an exponential decay function to quantify the temporal proximity between web pages, the edge weights of our constructed information graph are no longer simple binary Boolean values, but rather probabilistic estimates that characterize the strength of association between web pages in a specific spatiotemporal context. This transforms the information graph into a knowledge space rich in semantic and temporal information.
[0256] In practical applications, the basic construction of this method requires crawling web pages, cleaning the content (1.1), identifying entities (people, products, companies, etc.), and linking them uniformly, defining web page nodes and entity nodes. Among them, web page nodes represent web pages, and entity nodes represent entities (1.2).
[0257] In practical applications, the core innovation of this method lies in the calculation of weighted association edges (1.3). That is, when two webpage nodes d_i and d_j need to be associated because they both mention a certain entity e (i.e., the same webpage mentions the same entity), we do not simply connect them, but calculate a weight w(d_i, d_j). This weight is determined by two core factors:
[0258] First, the "rarity" of common entities:
[0259] The principle is that if two web pages both mention a rare entity (such as "EUV lithography machine"), their relevance is much higher than if they both mention a common entity (such as "mobile phone"). We use inverse document frequency (IDF) to measure this rarity.
[0260] The specific calculation formula can be: IDF(e) = log ( N / (df(e) + 1) );
[0261] Where N is the total number of web pages in the corpus, which is also the total number of web page nodes, and df(e) is the number of web pages that mention entity e, which is also the number of web page nodes associated with entity e. The smaller df(e) is, the larger the IDF(e) value is, indicating that entity e is rarer and more important.
[0262] Second, the "proximity" of time:
[0263] Principle: For time-sensitive content review tasks, web pages published around the same time are more relevant. We use an exponential decay function to model this; the greater the time difference, the more severe the weight decay.
[0264] The specific calculation formula can be: T(d_i, d_j) = exp(-λ * |t_i - t_j|);
[0265] Where t_i and t_j are the publication times of the two web pages, and |t_i - t_j| is the difference in publication times (e.g., calculated in days). λ is a decay coefficient that controls the rate of decay and can be configured according to the actual application scenario. When the time difference is 0, T=1; the larger the time difference, the closer T is to 0.
[0266] The final weighting formula is derived by comprehensively considering all common entities between the two webpage nodes (i.e., all identical webpage mentions):
[0267] w(d_i, d_j) = Σ_{e ∈ E(d_i) ∩ E(d_j)} [ IDF(e) ] * T(d_i, d_j);
[0268] This formula calculates the sum of the IDF values of all common entities e between webpage nodes d_i and d_j, and penalizes them with a time decay factor. In this way, common entities that are both rare and temporally close will contribute the most to the association weight between the two webpages.
[0269] Step 2: Generation of adversarial training data:
[0270] The training data generation method in this application introduces a game mechanism in step two, involving two roles: a question generation model and an agent to be trained (i.e., a reasoning and response model). The goal is to use infographics to generate challenging and misleading questions to test the agent, while the agent's goal is to answer the questions correctly. Through this mutual "battle," we can collect a large amount of high-quality and challenging training data.
[0271] Understandably, after constructing the information graph, the core challenge shifts to how to generate training instances based on this structured knowledge that can effectively improve the agent's complex reasoning capabilities. This process faces two major technical bottlenecks:
[0272] First, there's the issue of "factual consistency" and "verifiability" of the generated content: If an unconstrained generative model (such as a general large language model) directly asks questions about the information graph content, it's highly likely to produce illusions or rootless questions. These questions may be semantically valid, but within the given information graph (corpus), there isn't a logically complete and traceable path of evidence to support their answers. Such training samples that cannot be fact-verified are ineffective or even harmful for training an agent that requires rigorous reasoning, because they cannot provide correct supervisory signals.
[0273] Secondly, there is the issue of "difficulty labeling" in training courses: the learning efficiency of an agent is highly dependent on the difficulty distribution of training samples. An ideal training course should progress from easy to difficult. However, randomly generated tasks are either too simple to promote the improvement of the agent's capabilities (e.g., they can be solved by simple keyword matching), or too difficult, far exceeding the capabilities of the agent's current policy, causing the sparse reward model to have difficulty converging during training. How to quantitatively label the difficulty of generated tasks is crucial for training.
[0274] Based on this, the core innovation of this step in the training data generation stage is to construct an adversarial generation framework, which solves the above problems through two key mechanisms.
[0275] First, this step proposes a path-conditional generation method to ensure the traceability and factual basis of the logical chain.
[0276] Specifically, to fundamentally solve the "rootless problem," an evidence path-first generation strategy is proposed. Its core is to reconstruct the open-ended question generation task into a conditional generation task based on structured evidence.
[0277] Principle Explanation: We first sample a logically feasible path P = (d_1, e_1, d_2, ..., d_k) in the information graph G. This path constitutes the structured skeleton of the preset answer. Subsequently, the goal of the question generation model (QG) is to maximize the conditional probability of generating a high-quality question Q under the condition of this path P.
[0278] Specifically, the training objective of the problem generation model (with parameter φ) can be to maximize the conditional log-likelihood: L(φ) = E_{P \sim p(P)}[log P(Q | P; φ)].
[0279] Where: P = (d_1, ..., d_k) is a path sampled from the information graph G, and p(P) is the sampling distribution of the path. Q is the target question corresponding to path P, and P(Q | P; φ) is the conditional probability calculated by the question generation model, which can be obtained through word-by-word prediction.
[0280] This paradigm ensures the factual grounding of each training instance (Q, P) by anchoring the generation process to a verifiable evidence path P. This not only guarantees the quality of the supervision signal but also allows the agent's training objective to focus from the vague "answering questions" to the more specific "reproducing and understanding the evidence chain," significantly improving the effectiveness of training.
[0281] Secondly, this step proposes adversarial learning guided by information graphs to achieve adaptive and precise control of difficulty.
[0282] To address the challenges of calibrating training difficulty and adapting it dynamically, this step designs a hybrid learning mechanism that combines static graph heuristics with dynamic adversarial game theory.
[0283] Among them, static heuristic refers to course-based path sampling based on graph weights (2.1).
[0284] Explanation of the principle: We use the edge weights (i.e., the weights of associated edges) w(e) of the information graph in step one as prior knowledge to guide the sampling process of the evidence path, thereby controlling the initial difficulty of the generation task at a macro level. High-weighted paths correspond to tasks with high cohesion and easy reasoning, while low-weighted paths correspond to difficult tasks that require a greater logical span.
[0285] The corresponding formula is: the sampling probability p(P) of path P is proportional to the exponent of its path score, which can be defined by a Softmax distribution with a temperature parameter τ: p(P) ∝ exp( (1 / τ) * Σ_{e_i ∈ P} w(e_i) ). Where: w(e_i) is the weight of the i-th edge in path P, and τ is the temperature parameter. When τ is high, sampling tends to be more random, tending to explore low-weight paths (increasing difficulty). When τ is low, sampling is more concentrated on high-weight paths (reducing difficulty). By adjusting τ, we can achieve a preliminary plan for the difficulty of the course.
[0286] Among them, dynamic game refers to the fine-tuning of adversarial difficulty based on policy gradient.
[0287] Principle Explanation: Building upon static difficulty grading, we introduce a mini-maximum game framework consisting of a problem generation model (parameter φ) and an agent (parameter θ) to achieve online, adaptive fine-tuning of difficulty. The problem generation model attempts to generate problems that can cause the agent to make mistakes, while the agent strives to solve them correctly to maximize its reward. For example... Figure 7 As shown, the question generation model can generate adversarial questions (2.2). The agent to be trained will perform reasoning and output the answer A' (i.e., the question answer) and path P' (2.3). When the agent answers correctly, the agent's reward is positive, and the question generation model's reward is negative. When the agent answers incorrectly, the agent's reward is negative, and the question generation model's reward is positive. In this process, high-quality samples can be collected from correctly answered question-answer pairs, and high-value incorrect question samples can be collected from incorrectly answered question-answer pairs, and the parameters of both models can be updated (2.4). Furthermore, after the loop iteration ends, a high-quality training dataset can be obtained, which can then be used to train the final content moderation agent offline, and the final result is the content moderation agent.
[0288] Specifically, the entire process can be modeled using two interrelated reinforcement learning objectives, with the corresponding formula being:
[0289] The agent's objective (minimizing error) is as follows: the agent's policy π_θ aims to maximize its expected reward R_A (e.g., +1 for a correct answer and -1 for an incorrect answer).
[0290] Its objective function J(θ) is: , among them This indicates that the average is taken under dual randomness, and the evidence path P is sampled from the information graph. Question Q comes from a fixed question generation model. Essentially, it is an average of all possible combinations of evidence paths and questions. This refers to parameter dependence The answer evaluation reward function aims to find the most suitable parameters. Maximize the second expected reward.
[0291] Its policy gradient ∇_θ J(θ) is: ;
[0292] in, This refers to the second generation probability, where 'a' represents the question answer, 'a' represents the question, and A represents the reasoning-response model. It is a strategy of the inference response model. It is a reasoning response reward signal. This refers to the log-probability ratio of the model parameters. The gradient.
[0293] The objective of the problem generation model (QG) (maximizing agent error) is as follows: The policy π_φ of the problem generation model aims to maximize its own reward R_{QG}, which is negatively correlated with the agent's reward, for example, R_{QG} = -R_A. Its objective function J(φ) is: , among them This represents the average of all possible evidence paths, with evidence path P sampled from the information graph. Essentially, the goal is for the problem generation model to perform well across all types of evidence paths. This represents the average of all possible outputs of the problem generation strategy, where the strategy is... It is the object to be optimized, and its essence is to measure the overall performance of the problem generation model under a given evidence path P. This refers to the fact that the reward signal for the answer evaluation depends on the parameters of a fixed reasoning-response model. .
[0294] Its policy gradient ∇_φ J(φ) is: ;
[0295] in, This refers to the first generation probability, Q refers to the question, and P refers to the evidence path. This refers to the problem generation model. It is a strategy of the problem generation model. This refers to the generation of reward signals for problems. This refers to the log-probability ratio of the model parameters. The gradient.
[0296] Value Analysis: This adversarial framework forms an automated course generator. The problem-generating model is forced to continuously explore the weaknesses of the agent's current policy π_θ and generate challenging samples that are precisely on the boundary of its capabilities. This not only achieves fine-grained training difficulty, but the generated "incorrect" data itself also becomes a high-value training signal, guiding the agent to perform more efficient model iterations.
[0297] Understandably, compared to related technologies, the benefits of our method are very direct and obvious, mainly in three aspects:
[0298] First, the data is more authentic and more challenging. The training data we constructed contains a "logical chain" that requires cross-website searches to find the answers, and we deliberately added many "pitfalls," making it more authentic than the clean data from before.
[0299] Secondly, the intelligent agent is smarter and more resistant to deception. The intelligent agent trained on such realistic and difficult data has learned to integrate information and identify traps, has stronger judgment, and is not easily deceived by illusions.
[0300] Third, it saves money and time. We no longer need to make the AI agent actually go online to practice slowly; we can quickly and in batches generate high-quality "training" data locally, greatly improving R&D efficiency.
[0301] The content moderation method provided in this application embodiment can be applied to, for example, Figure 8 In the application environment shown, terminal 802 communicates with server 804 via a network. A data storage system stores the data that server 804 needs to process. The data storage system can be set up independently, integrated into server 804, or placed in the cloud or on other network servers. Server 804 obtains the content to be reviewed uploaded by terminal 802, inputs the content to be reviewed into a trained content review agent, which is trained based on a training dataset constructed using the aforementioned training data generation method. The content review agent performs semantic understanding on the content to be reviewed, generates a review conclusion, queries an information graph based on the review conclusion to obtain graph evidence data, and performs a review judgment based on the graph evidence data to obtain the content review result.
[0302] Among them, terminal 802 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 804 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0303] In one exemplary embodiment, such as Figure 9 As shown, a content moderation method is provided. This embodiment illustrates the method by applying it to a server. It is understood that this method can also be applied to a terminal, or to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes steps 902 to 904. Wherein:
[0304] Step 902: Obtain the content to be reviewed and input it into the trained content review agent; the content review agent is trained based on the training dataset; the training dataset is constructed using the training data generation method described above.
[0305] Step 904: The content review agent performs semantic understanding on the content to be reviewed, generates a review conclusion, queries the information graph based on the review conclusion to obtain graph evidence data, and makes a review judgment on the review conclusion based on the graph evidence data to obtain the content review result.
[0306] For example, during content moderation, the server can obtain the content to be reviewed and input it into a pre-trained content moderation agent. This agent is trained on a training dataset constructed using the aforementioned training data generation method. Upon receiving the content to be reviewed, the agent performs semantic understanding, generates a review conclusion, and queries an information graph based on the review result to obtain graph evidence data. It then analyzes this graph evidence data to determine the review conclusion and obtain the content review result.
[0307] In practical applications, the content moderation agent will find the relationship record connecting at least two object entities involved in the result to be reviewed in the information graph, analyze the metadata of the relationship record, and draw a graph evidence conclusion. Then, the review will be judged by comparing whether the graph evidence conclusion is consistent with the result to be reviewed. If the graph evidence conclusion is consistent with the result to be reviewed, the content review result is approved. If the graph evidence conclusion is inconsistent with the result to be reviewed, the content review result is rejected.
[0308] For example, if the review results involve two object entities, object entity A and object entity B, the content review agent will find the relationship record connecting object entity A and object entity B in the information graph. Specifically, this relationship record can be a path between the entity node representing object entity A and the entity node representing object entity B in the information graph. Furthermore, if multiple paths exist, the content review agent can select the relationship record from the multiple paths by comparing their respective metadata.
[0309] In a specific application, metadata includes the newness, source authority, and credibility of relationship records. Newness can be measured by the time the relationship record was created; the later the record was created, the newer it is. For example, if a relationship record was created last week, it is relatively new. Source authority can be measured by the source from which the relationship record originated. For example, if a relationship record is found to have originated from an official press conference, it can be considered to have strong source authority. Credibility can be measured by the weights of the related edges involved in the relationship record. Higher weight edges indicate a higher weight for the relationship record, and thus, higher credibility. Understandably, for content moderation models, relationship records with strong source authority, high credibility, and newness are more trustworthy.
[0310] In a specific application, taking the conclusion to be reviewed as a relational conclusion as an example, if the relationship between the objects described in the conclusion to be reviewed is consistent with the relationship between the objects described in the graph evidence conclusion, then the content review result is "review passed." If the relationship between the objects described in the conclusion to be reviewed is inconsistent with the relationship between the objects described in the graph evidence conclusion, then the content review result is "review failed."
[0311] For example, if the relationship between the objects described in the review conclusion is that object A performs better than object B, then if the graph evidence conclusion is that object A performs better than object B, the content review result will be "approved." If the graph evidence conclusion is that object B performs better than object A, the content review result will be "failed."
[0312] The aforementioned content moderation method trains a content moderation agent using a high-quality training dataset generated by a training data generation method. This trained agent is then used to judge the content to be reviewed. The high-quality training dataset improves the quality of content moderation. During the review process, semantic understanding of the content generates a review conclusion. Based on this conclusion, an information graph is queried, providing graph evidence data as objective evidence for the review. This graph-based approach enhances the quality of content moderation by using graph evidence data to judge the review conclusion.
[0313] In one exemplary embodiment, the content review method of this application is described by comparing related technologies with the content review method of this application.
[0314] Let's assume the content moderation task is to review an article published yesterday titled "2024 AI Chip Ranking." The problem is that while the article appears recent, its core data is from last year. It still touts the then-most powerful chip, A, but its main competitor, chip B, just had its launch last week and has already surpassed it in performance.
[0315] The workflow of the content review method for related technologies is as follows: First, it checks the surface: it looks at the article's publication date, which is yesterday. Its first reaction is, "Hmm, very new, timeliness should be fine." This gives it a strong initial impression. Second, it verifies known information: it extracts the core argument from the article, "Chip A has the strongest performance," and then searches online. It finds countless articles online praising the power of chip A. This further convinces it that the article's viewpoint is correct. Third, it processes new information: it also searches for "chip B," which might lead to news about last week's press conference. But at this point, it becomes conflicted because this contradicts the information it obtained in the previous step. In its eyes, this is an isolated news item; compared to hundreds or thousands of older news articles praising chip A online, it doesn't know which to believe, nor can it determine the weight of this new information. Final conclusion: Because the reasons of "very new publication date" and "the mainstream viewpoint can be verified" are too strong, it tends to ignore the inexplicable contradictory information. Therefore, it concludes with "Review passed."
[0316] The workflow of the content review method in this application is as follows: First, establish a relational model (i.e., derive the conclusion to be reviewed): After reading the article, the first thing it does is not to search for individual keywords, but to build a model: "The core of this article is comparing the performance of chip A and chip B, and it concludes that chip A > chip B." Second, perform cross-validation using an information graph: It uses this relational model to query its own knowledge base (the information graph we built). It finds that the two nodes, chip A and chip B, were closely linked last week by a high-weight event (the launch of chip B), and this connection points to a clear new relation (i.e., the conclusion of the graph evidence): chip B > chip A. Third, detect logical conflicts and reason: At this point, the article's conclusion that chip A > chip B and the latest information in its knowledge base that chip B > chip A form a sharp conflict. Because it has seen a large number of similar cases during training, it immediately activates the warning mechanism. Its reasoning is: "An isolated viewpoint of an article contradicts a latest fact pointed to by multiple authoritative sources (launch, official website, multiple media outlets), so this article must be problematic." Final conclusion: It not only determined that the review was "failed," but also provided a clear chain of evidence: "The data in the article is outdated. According to data from the launch event of chip B on [last week's date] and its official website, its latest performance has surpassed that of chip A."
[0317] The comparison reveals that the content review method used in this application is based on relationships and evidence, such as... Figure 10 As shown, the entire reasoning process resembles an intelligent fact-checking process, divided into three steps. First, the viewpoint is transformed into query 1002: the article's conclusion ("A chip > B chip") is converted into a structured query instruction, namely, "find the relationship between A chip and B chip regarding 'performance comparison'." Second, evidence is searched and analyzed in the infographic 1004: it finds the relationship record connecting A chip and B chip in the infographic. The key is not finding the record itself, but analyzing its "metadata," such as its age, source authority, and credibility. Finally, a comparison and conclusion are drawn 1006: the article's "old viewpoint" ("A chip > B chip") is compared with the "newer, more authoritative opposing viewpoint" (B chip > A chip) found in the infographic, thereby identifying conflicts and determining that the article's conclusion may be outdated, resulting in a content review result of "[Review Failed]." Compared with related technologies, this infographic-based review method can improve the content review quality of the intelligent content review agent.
[0318] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0319] Based on the same inventive concept, embodiments of this application also provide a training data generation apparatus for implementing the training data generation method described above, and a content moderation apparatus for implementing the content moderation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations of one or more training data generation apparatuses and content moderation apparatus embodiments provided below can be found in the limitations of the training data generation method and content moderation method described above, and will not be repeated here.
[0320] In one exemplary embodiment, such as Figure 11As shown, a training data generation device is provided, including: a graph construction module 1102, an iterative execution module 1104, and a dataset construction module 1106, wherein:
[0321] The graph construction module 1102 is used to construct an information graph based on the web page mention entities associated with each of the multiple web page nodes; the web page nodes in the information graph are associated with the same web page mention entities as their adjacent web page nodes;
[0322] The iterative execution module 1104 is used for iterative execution as follows: sampling multiple evidence paths from the information graph; for each evidence path, generating question-answer pairs corresponding to the evidence path through a question generation model and a reasoning-response model respectively; selecting training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths; updating the model parameters of the question generation model and the model parameters of the reasoning-response model according to the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pair includes questions generated by the question generation model based on path nodes in the evidence path, and question answers inferred by the reasoning-response model based on path nodes and questions in the evidence path;
[0323] The dataset construction module 1106 is used to construct a training dataset based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content moderation agent.
[0324] The aforementioned training data generation device constructs an information graph based on the webpage mentions associated with multiple webpage nodes, enabling cross-webpage information association. It transforms webpage corpora into a structured representation capable of supporting inference tasks. Through iterative execution, it samples multiple evidence paths from the information graph. For each evidence path, it generates question-answer pairs corresponding to the evidence path using both a question generation model and an inference-response model. Training question-answer pairs are selected from these multiple evidence path pairs. By updating the model parameters of the question generation model and the inference-response model based on the question-answer pairs corresponding to each evidence path, it can use the evidence paths sampled from the information graph as a basis to... The open-ended question generation task is restructured into a conditional generation task based on structured evidence, ensuring the factual basis of the generated question-answer pairs. By introducing a dynamic game mechanism, the model parameters of the question generation model and the inference response model are continuously updated using the question-answer pairs corresponding to multiple evidence paths. High-quality question-answer pairs are generated using the question generation model and the inference response model. Training question-answer pairs are selected from the generated question-answer pairs to obtain high-quality training data. Thus, a high-quality training dataset can be constructed based on the training question-answer pairs selected during the iterative execution process. The content moderation agent can be trained using the training dataset, which can improve the content moderation quality of the content moderation agent.
[0325] In an exemplary embodiment, the iterative execution module is further configured to, for each evidence path, evaluate the accuracy of the answer based on the question and the answer in the question-answer pair corresponding to the evidence path, obtain an accuracy evaluation result, determine the question generation reward signal and the inference response reward signal corresponding to the evidence path based on the accuracy evaluation result, determine the first policy gradient corresponding to the evidence path based on the question generation reward signal, determine the second policy gradient corresponding to the evidence path based on the inference response reward signal, update the model parameters of the question generation model based on the first policy gradient corresponding to each evidence path, and update the model parameters of the inference response model based on the second policy gradient corresponding to each evidence path.
[0326] In an exemplary embodiment, the iterative execution module is further configured to determine a first policy gradient corresponding to the evidence path based on the first generation probability of the question in the question-answer pair corresponding to the question generation reward signal and the evidence path, and to determine a second policy gradient corresponding to the evidence path based on the second generation probability of the question answer in the question-answer pair corresponding to the inference response reward signal and the evidence path.
[0327] In an exemplary embodiment, the iterative execution module is further configured to calculate a first expected reward for the question generation model based on the question generation reward signal corresponding to each evidence path and the number of sampled evidence paths, calculate a second expected reward for the reasoning response model based on the reasoning response reward signal corresponding to each evidence path and the number of sampled evidence paths, perform an iterative stop evaluation based on the first and second expected rewards, obtain an iterative stop evaluation result, and terminate the iterative execution if the iterative stop evaluation result is passed.
[0328] In an exemplary embodiment, the iterative execution module is further configured to sample logical paths corresponding to multiple target questions from the information graph, and for each logical path, predict the target question corresponding to the logical path based on the logical path through an initial generation model to determine the conditional probability of question generation, determine the sampling probability of the logical path, calculate the question generation quality score corresponding to the logical path based on the sampling probability and the conditional probability of question generation, determine the question generation quality score of the initial generation model based on the question generation quality score corresponding to each logical path, and obtain the question generation model when the question generation quality score of the initial generation model satisfies the generation training stopping condition.
[0329] In an exemplary embodiment, the iterative execution module is further configured to accumulate the weights of the path edges connecting the logical path nodes in the logical path to obtain the path score of the logical path, and calculate the sampling probability of the logical path based on the path score of the logical path and the predefined temperature parameter.
[0330] In an exemplary embodiment, the iterative execution module is further configured to determine a first question-and-answer pair with correct answers and a second question-and-answer pair with incorrect answers from the question-and-answer pairs corresponding to each of the multiple evidence paths, select positive sample question-and-answer pairs from the first question-and-answer pairs, and select negative sample question-and-answer pairs from the second question-and-answer pairs, and obtain training question-and-answer pairs based on the positive sample question-and-answer pairs and the negative sample question-and-answer pairs.
[0331] In an exemplary embodiment, the graph construction module is further configured to determine the neighboring web nodes of each web node based on the web mention entities associated with each of the multiple web nodes, perform web relevance analysis for each web node based on the same web mention entities associated with the web node and its neighboring web nodes, determine the weight of the association edges between the web node and its neighboring web nodes, and construct an information graph based on each web node, each web node's neighboring web nodes, and the weight of the association edges between each web node and its neighboring web nodes.
[0332] In an exemplary embodiment, the graph construction module is further configured to perform entity rarity analysis for each webpage node based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, determine the entity rarity of the same webpage mention entities, perform publication time correlation analysis based on the publication time of the webpages associated with the webpage node and its neighboring webpage nodes, determine the publication time correlation, and determine the weight of the association edges between the webpage node and its neighboring webpage nodes based on the entity rarity of the same webpage mention entities and the publication time correlation.
[0333] In an exemplary embodiment, the graph construction module is further configured to, for each webpage node, perform associated webpage node statistics based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, determine the number of webpage nodes associated with the same webpage mention entities, determine the total number of webpage nodes, and determine the entity rarity of the same webpage mention entities based on the number of webpage nodes and the total number of webpage nodes.
[0334] In an exemplary embodiment, the graph construction module is further configured to determine the publication time difference based on the publication time of the web page node and the web page associated with each adjacent web page node, and to determine the publication time correlation based on the publication time difference.
[0335] In one exemplary embodiment, such as Figure 12 As shown, a content moderation device is provided, including: an acquisition module 1202 and a moderation module 1204, wherein:
[0336] The acquisition module 1202 is used to acquire the content to be reviewed and input the content to be reviewed into the trained content review agent; the content review agent is trained based on the training dataset; the training dataset is constructed using the above-mentioned training data generation method.
[0337] The review module 1204 is used to perform semantic understanding of the content to be reviewed through a content review intelligent agent, generate a review conclusion, query the information graph based on the review conclusion to obtain graph evidence data, and make a review judgment based on the graph evidence data to obtain the content review result.
[0338] The aforementioned content moderation device trains a content moderation agent using a high-quality training dataset constructed through a training data generation method. This trained agent is then used to judge and approve content to be reviewed. The high-quality training dataset enhances the content moderation quality of the agent. During the review process, semantic understanding of the content generates a review conclusion. Based on this conclusion, an information graph is queried, allowing the acquisition of graph evidence data as objective evidence for the review. This graph-based approach improves the overall content moderation quality of the intelligent content moderation agent.
[0339] The modules in the aforementioned training data generation device and content review device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0340] In one exemplary embodiment, a computer device is provided, which can be a server or a terminal. Taking the computer device as a server as an example, its internal structure diagram can be as follows: Figure 13 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as information graphs. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a training data generation method and a content moderation method.
[0341] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0342] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0343] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0344] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0345] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0346] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0347] 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 application.
[0348] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating training data, characterized in that, The method includes: An information graph is constructed based on the webpage mention entities associated with each of the multiple webpage nodes; the webpage nodes in the information graph are associated with the same webpage mention entities as their adjacent webpage nodes. Iterative execution: Multiple evidence paths are sampled from the information graph; for each evidence path, question-answer pairs are generated corresponding to the evidence path using a question generation model and a reasoning-response model, respectively; training question-answer pairs are selected from the question-answer pairs corresponding to each of the multiple evidence paths; the model parameters of the question generation model and the model parameters of the reasoning-response model are updated according to the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pair includes a question generated by the question generation model based on the path nodes in the evidence path, and a question answer inferred by the reasoning-response model based on the path nodes in the evidence path and the question; A training dataset is constructed based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
2. The method according to claim 1, characterized in that, The step of updating the model parameters of the question generation model and the model parameters of the reasoning response model based on the question-answer pairs corresponding to each of the multiple evidence paths includes: For each evidence path, the accuracy of the answer is evaluated based on the questions and answers in the question-answer pair corresponding to the evidence path, and the accuracy evaluation result is obtained; Based on the accuracy assessment results, the question generation reward signal and the reasoning response reward signal corresponding to the evidence path are determined; A reward signal is generated based on the question, a first policy gradient corresponding to the evidence path is determined, and a second policy gradient corresponding to the evidence path is determined based on the reasoning response reward signal. The model parameters of the question generation model are updated based on the first policy gradient corresponding to each of the evidence paths, and the model parameters of the reasoning response model are updated based on the second policy gradient corresponding to each of the evidence paths.
3. The method according to claim 2, characterized in that, The process of generating a reward signal based on the question, determining the first policy gradient corresponding to the evidence path, and determining the second policy gradient corresponding to the evidence path based on the inference response reward signal includes: Based on the question-generated reward signal and the first generation probability of the question in the question-answer pair corresponding to the evidence path, the first policy gradient corresponding to the evidence path is determined. Based on the reasoning response reward signal and the second generation probability of the question answer in the question-answer pair corresponding to the evidence path, the second policy gradient corresponding to the evidence path is determined.
4. The method according to claim 2, characterized in that, The method further includes: Based on the question generated for each evidence path and the number of sampled evidence paths, calculate the first expected reward for the question generation model. Based on the reasoning response reward signal corresponding to each of the evidence paths and the number of sampled evidence paths, calculate the second expected reward for the reasoning response model; Based on the first expected reward and the second expected reward, an iterative stop evaluation is performed to obtain an iterative stop evaluation result. If the iterative stop evaluation result is passed, the iteration execution is terminated.
5. The method according to claim 1, characterized in that, The method further includes: Multiple logical paths corresponding to target questions are sampled from the information graph. For each logical path, an initial generation model is used to predict the target question corresponding to the logical path to determine the conditional probability of question generation. Determine the sampling probability of the logical path, and calculate the question generation quality score corresponding to the logical path based on the sampling probability and the question generation conditional probability. Based on the quality score of the problem generation corresponding to each logical path, the quality score of the problem generation of the initial generation model is determined. If the quality score of the problem generation model in the initial generation model satisfies the stopping condition for generation training, then the problem generation model is obtained.
6. The method according to claim 5, characterized in that, Determining the sampling probability of the logical path includes: For each logical path, the weights of the path edges connecting the logical path nodes are accumulated to obtain the path score of the logical path. The sampling probability of the logical path is calculated based on the path score of the logical path and the predefined temperature parameter.
7. The method according to any one of claims 1 to 6, characterized in that, The step of selecting training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths includes: From the question-and-answer pairs corresponding to each of the multiple evidence paths, determine the first question-and-answer pair that answers correctly and the second question-and-answer pair that answers incorrectly; From the first question-and-answer pair, select positive sample question-and-answer pairs, and from the second question-and-answer pair, select negative sample question-and-answer pairs; Training question-answer pairs are obtained based on the positive sample question-answer pairs and the negative sample question-answer pairs.
8. The method according to any one of claims 1 to 6, characterized in that, The construction of an information graph based on the webpage mention entities associated with each of the multiple webpage nodes includes: Based on the webpage mention entities associated with each of the multiple webpage nodes, determine the adjacent webpage nodes of each webpage node; For each webpage node, based on the same webpage mention entities associated with the webpage node and the adjacent webpage nodes, a webpage relevance analysis is performed to determine the weight of the relevance edge between the webpage node and the adjacent webpage nodes. An information graph is constructed based on the weights of each webpage node, each webpage node's neighboring webpage nodes, and the associated edges between each webpage node and its neighboring webpage nodes.
9. The method according to claim 8, characterized in that, For each webpage node, based on the shared webpage mention entities associated with the webpage node and its neighboring webpage nodes, a webpage relevance analysis is performed to determine the weight of the association edges between the webpage node and its neighboring webpage nodes, including: For each webpage node, entity rarity analysis is performed based on the same webpage mention entities associated with the webpage node and the adjacent webpage nodes to determine the entity rarity of the same webpage mention entities; Based on the publication time of the web page node and the web page nodes associated with each other, a publication time correlation analysis is performed to determine the publication time correlation. The weights of the associated edges between the same webpage node and its adjacent webpage nodes are determined based on the entity rarity of the same webpage mentions and the relevance of the publication time.
10. The method according to claim 9, characterized in that, For each webpage node, the entity rarity analysis is performed based on the shared webpage mentions associated with the webpage node and its neighboring webpage nodes to determine the entity rarity of the shared webpage mentions, including: For each webpage node, based on the same webpage mention entities associated with the webpage node and its neighboring webpage nodes, the number of webpage nodes associated with the same webpage mention entities is determined, and the total number of webpage nodes is determined. The entity rarity of the same webpage mentioned entity is determined based on the number of webpage nodes and the total number of webpage nodes.
11. The method according to claim 9, characterized in that, The step of performing a publication time correlation analysis based on the publication time of the webpage node and its adjacent webpage nodes, and determining the publication time correlation, includes: The publication time difference is determined based on the publication time of the web page node and the web page nodes associated with each of the adjacent web page nodes; The correlation between release times is determined based on the difference in release times.
12. A content moderation method, characterized in that, The method includes: Obtain the content to be reviewed, and input the content to be reviewed into a trained content review agent; the content review agent is trained based on a training dataset; the training dataset is constructed by the method described in any one of claims 1 to 11. The content review agent performs semantic understanding on the content to be reviewed, generates a review conclusion, queries an information graph based on the review conclusion to obtain graph evidence data, and reviews and judges the review conclusion based on the graph evidence data to obtain the content review result.
13. A training data generation device, characterized in that, The device includes: The graph construction module is used to construct an information graph based on the web page mention entities associated with each of the multiple web page nodes; the web page nodes in the information graph are associated with the same web page mention entities as their adjacent web page nodes; An iterative execution module is used to iteratively execute: sampling multiple evidence paths from the information graph; for each evidence path, generating question-answer pairs corresponding to the evidence path using a question generation model and a reasoning-response model respectively; selecting training question-answer pairs from the question-answer pairs corresponding to each of the multiple evidence paths; updating the model parameters of the question generation model and the model parameters of the reasoning-response model based on the question-answer pairs corresponding to each of the multiple evidence paths; wherein, the question-answer pair includes a question generated by the question generation model based on path nodes in the evidence path, and a question answer inferred by the reasoning-response model based on path nodes in the evidence path and the question; The dataset construction module is used to construct a training dataset based on the training question-answer pairs selected during the iterative execution process; the training dataset is used to train the content review agent.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.