Question generation method and device based on reinforcement learning and storage medium

Through the reinforcement learning framework and bias correction reward model, the problems of low diversity and difficulty in bias correction in the KBQG model are solved, the diversity and quality of question generation are improved, and the correlation between questions and answers is enhanced.

CN118536585AActive Publication Date: 2024-08-23NAT UNIV OF DEFENSE TECH +1

Patent Information

Application Number
CN202410609624.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-08-23
Estimated Expiration
2044-05-16

AI Technical Summary

Technical Problem

Existing knowledge base question generation (KBQG) models suffer from low diversity and difficulty in bias correction, especially when feedback samples are limited, resulting in a lack of diversity and quality in generated questions.

Method used

Adopting a reinforcement learning framework, by training a cold-start question generation model (QG-SFT) and combining it with a bias-corrected reward model, a game theory mechanism is used to coordinate the labeling model, mitigate labeling bias, and mitigate confirmation bias through bias-corrected reinforcement learning methods.

Benefits of technology

It improves the diversity and quality of question generation, mitigates flattery bias, and enhances the relevance and applicability of questions and answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536585A
    Figure CN118536585A
Patent Text Reader

Abstract

The invention belongs to the field of education, and discloses a question generation method and device based on reinforcement learning and a storage medium, and the method comprises the steps: obtaining a question and answer data set which comprises a plurality of data composed of questions, answers and subgraphs; based on a supervised fine tuning training mode, using the subgraph to guide context information of the answer to generate an initial question; according to the answer of the initial question and the subgraph, outputting a to-be-scored question, and marking and scoring the question style of the to-be-scored question; marking the question quality of the question to be scored; calculating a reward score for the marked to-be-scored question; training a problem generation model by using a reinforcement learning model; and the reinforcement learning model performs deviation correction on the graded problem according to the prior knowledge feedback. The problem generation model is trained by using reinforcement learning, the diversity of problem generation is increased, and the problem quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of educational technology, and in particular, relates to a method, device and storage medium for generating questions based on reinforcement learning. Background Art

[0002] As people's demand and dependence on online education continues to grow, improving the quality of online education courses and user experience has become a focus. The application of knowledge graph intelligent question answering system in online education has attracted much attention, which can solve the problems encountered by students in the learning process in a timely and accurate manner.

[0003] Automatic question generation is a natural language question that generates questions based on given data forms (such as images, text, tables, knowledge graphs). This technology has a wide range of applications in the field of question answering (QA) and can automatically generate questions for training and enhancing QA systems. It can also assist dialogue agents in asking questions in human-computer interactions.

[0004] However, traditional rule-based or template-based knowledge graph intelligent question-answering systems have limitations and cannot cope with complex natural language questions, and may even be ambiguous. Recently, deep learning-based question-answering systems have made new progress, but they still face many challenges, such as low answer quality and the existence of flattery bias, that is, because human annotators label data according to predefined priority criteria, through multiple interactions, the machine gradually learns the priority and outputs the content that the annotator values ​​most. This is beneficial in aligning the machine with human preferences, but it may be excessive and sometimes even ignore other criteria, which is called "flattery". For example, if the criterion of "human-like questioning style" is considered to be the highest priority, then in the later feedback stage, the model may pay too much attention to this criterion, causing the model to produce outputs that are more in line with human preferences, while ignoring other factors, such as the relevance of the question to the answer. The preference alignment between machines and humans can be beneficial, but sometimes it may become too obvious to the point of ignoring other criteria, thereby affecting the text quality itself.

[0005] Therefore, knowledge base question generation (KBQG) has attracted increasing interest in recent years. Research on KBQG can be divided into two categories: template-based models and neural network-based models. The former method relies heavily on manually created templates, and the generated questions often show the characteristics of stereotypes, lack of diversity and scalability. Neural models take triples related to answers as input and design Seq2Seq architectures to automatically generate questions. Although these methods can generate fluent questions, they also have an obvious defect that the generated questions usually lack diversity, making these models less applicable in practical scenarios. Knowledge base question generation (KBQG) aims to output natural language questions based on knowledge graphs (KGs) and target answers. However, existing KBQG solutions suffer from the problem of low diversity.

[0006] Figure 1 This further illustrates the problem. The questions presented on the right side of the figure are those asked by humans, which have unique and realistic logic and style. In contrast, although the questions generated by existing models (on the left side of the figure) are meaningful and consistent with the given "standard questions", most of them are unnatural and lack diversity.

[0007] In recent years, under the influence of GPT, people have shown increasing interest in reinforcement learning from prior knowledge feedback. Early studies focused on training agents to achieve predefined goals through feedback. Among them, some studies have utilized expert demonstrations and preference feedback, and adopted imitation learning strategies for initialization to further improve policy performance. However, the efficiency of feedback is still a problem. Some literature combines unsupervised pre-training and experience relabeling techniques to improve feedback efficiency. Some studies learn reward functions through semi-supervised learning and data enhancement. Some studies reduce the number of preference labels and promote exploration by exploiting the uncertainty of rewards. However, these methods only focus on guiding reward learning through the supervised loss between preferences and estimated preferences. When the feedback samples are limited, the estimation bias may be large, resulting in reward learning with large biases, which in turn affects the final results. This leads to confirmation bias, that is, one neural network overfits another neural network. Summary of the invention

[0008] In view of this, in order to solve this problem and make the problem more realistic, inspired by reinforcement learning from prior knowledge feedback (RLHF, the underlying algorithm of ChatGPT), this application proposes a reinforcement learning framework for bias correction of KBQG.

[0009] This application trains a cold start question generation model, namely QG-SFT (Cold Start Question Generation Model with Supervised Fine-Tuning), which is able to generate basic coherent question sentences. Then, based on prior knowledge and inherent question quality, two reward models, namely the question quality reward model, are trained to score the questions generated by QG-SFT; the question style reward model encourages the generation of diverse questions, while the question quality reward model mitigates the flattery bias by emphasizing question quality, such as punctuation, vocabulary, grammar, and whether the question matches the answer. In addition, in order to alleviate the annotation bias in the annotation process, this application uses a game theory mechanism to improve the annotation quality by coordinating two competing annotation models. Finally, QG-SFT is used to initialize BC-RLHF to generate preliminary candidate questions for the reinforcement learning process. In order to alleviate confirmation bias, this application proposes a method to correct confirmation bias to alleviate the impact of scarce feedback annotation data, and combines it with two reward models to produce bias correction rewards. The agent then receives bias-corrected reward feedback and updates its parameters, ultimately resulting in a more realistic and coherent problem.

[0010] It is worth noting that, unlike the original RLHF model, which may become inaccurate when feedback is limited or of low quality, this application designs the reward model and reasoning procedure to avoid potential biases.

[0011] To achieve the above purpose, the question generation method based on reinforcement learning disclosed in the first aspect of the present application includes the following steps:

[0012] Obtain a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs;

[0013] Generate an initial question based on a supervised fine-tuning training method using contextual information of the subgraph to guide the answer;

[0014] Based on the answers and subgraphs of the initial questions, output the questions to be scored, annotate and score the question styles of the questions to be scored; annotate the quality of the questions to be scored; and calculate the reward scores for the annotated questions to be scored;

[0015] Training a question generation model using a reinforcement learning model that performs bias correction on scored questions based on prior knowledge feedback;

[0016] After multiple rounds of training, the trained model is obtained, the actual problems collected are input into the model, and the final problems are output.

[0017] Preferably, question style annotation and question quality annotation are used to automatically reward and score the generated questions, that is, the answer and subgraph information are used as prompts, the previously generated initial questions are encoded into vector representations, and then processed by the pooling layer and the linear transformation layer to generate a one-dimensional style reward score and a one-dimensional quality reward score, respectively.

[0018] Preferably, the labeling of the questioning style of the question to be scored includes at least one of the following methods: large model labeling, manual labeling, and human-computer collaboration.

[0019] Preferably, a game theory mechanism is also used to improve the quality of the question style annotation, including:

[0020] Set up two independent different types of annotation models 1 and 2 for question style annotation, and a quality inspection model for quality inspection; in each cycle, each annotation model annotates multiple groups of questions and then submits a batch of annotation data to the quality inspection model and

[0021] The quality inspection model evaluates the quality of the annotations by scoring each question in the annotation model; for questions with scores below a preset value, or Delete it and return it to the annotation model for re-annotation in the next cycle, with the rejection reason provided by the quality inspection model;

[0022] Will and The scores of annotation models 1 and 2 are averaged to obtain the total scores. That is, in order to motivate the two annotation models to provide higher quality annotation data, the annotation quality of the two annotation models jointly determines the unit price of the annotation data in each cycle. The profits of annotation models 1 and 2 are calculated based on the annotation cost of each sample.

[0023] After continuous independent decision-making games between the two annotation models, the quantity and quality of annotations finally stabilize at a certain value and reach the equilibrium point E.

[0024] Preferably, the question quality annotation is used to improve the quality of the question itself, and the question quality annotation includes at least one of the following sub-modules in question quality assessment:

[0025] The text accuracy submodule and the symbol accuracy submodule are used to evaluate the quality of characters;

[0026] Lexical diversity submodule and lexical precision submodule, used to evaluate the quality of vocabulary;

[0027] The syntactic complexity submodule and the syntactic correctness submodule are used to evaluate the quality of syntax;

[0028] The question clarity submodule and the question completeness submodule are used to evaluate the quality of the content;

[0029] An evaluation submodule for whether there is logical consistency and smoothness between questions and answers, which is used to evaluate the quality of the interaction;

[0030] The question-answer matching submodule and the practical value submodule are used to evaluate the overall effectiveness;

[0031] For each submodule, a binary label is performed, which is 1 if the answer to the question is yes, otherwise it is 0; then, the labeling results of all submodules are summed up to obtain the total question quality score; these questions are sorted in descending order according to the total question quality score to generate a priority sequence.

[0032] Preferably, the environment and agent in the reinforcement learning model are combined with a bias-corrected reward function to obtain feedback for training the model; the environment includes questions, answers, and subgraphs; the agent generates a model for the cold start problem;

[0033] Based on the data provided by the environment, the agent is initialized. Then, the agent observes the standard questions, answers, and subgraphs in the environment and generates initial questions, i.e., actions, and stores them in the replay buffer. In order to calculate the reward and optimize the agent, the question is sampled from the replay buffer and passed to the reward predictor, which calculates the reward score and the bias correction score.

[0034] Preferably, the bias-corrected reward function is used together with the entropy regularization of the action distribution corresponding to the strategy π in the state s as a loss function to avoid overfitting, and the bias-corrected reward function includes at least one of the following:

[0035] The Word Mover's Distance model is used at the word level to calculate the semantic distance between two texts, which is used to evaluate the semantic similarity between the text generated by the strategy and the target text;

[0036] At the sentence level, the ROUGE-L model is used to calculate the similarity between the automatically generated text and the reference text, which is used to evaluate the similarity between the sentences generated by the strategy and the target sentences;

[0037] Calculate the difference using a character-based similarity measurement method at the character level, wherein the character-based similarity measurement method includes at least one of a Levenshtein distance and a character-based language model;

[0038] Use semantic similarity measures between paragraphs to calculate differences at the paragraph level, such as similarity measures based on paragraph vector representations;

[0039] At the overall effectiveness level, based on the differences in texts generated by the strategies at different levels, the overall effect of the strategy generation is comprehensively evaluated.

[0040] Preferably, the reinforcement learning model is based on data provided by the environment, i.e., annotated question-answering datasets and knowledge bases. The agent generates questions and stores these questions in an experience pool. The agent generates a model for cold start questions. In order to calculate rewards and optimize the agent, questions are sampled from the experience pool and forwarded to a reward predictor to generate bias correction rewards. The bias correction rewards include question style rewards, question quality rewards, and bias corrections. Based on the reward results, the agent is optimized using a proximal policy optimization algorithm.

[0041] Preferably, the deviation correction comprises:

[0042] Using the question style reward and the question quality reward, a score is generated according to prior knowledge, logic, and question quality;

[0043] Calculate bias correction scores to mitigate the baseline problem Q b Sample question Q s and the target question Q t The confirmation bias from the perspectives of word-level similarity and sentence-level similarity is: b is the model output obtained by selecting the best action using the current policy. It is used as a reference standard during the training process and is used to evaluate the sample problem Q s The quality of the sample problem Q s is the model output obtained by randomly sampling from the current policy.

[0044] Preferably, the goal of the word-level reward in the question style reward model is to positively reward the sample question Q s , if Q s Compared with the baseline question Q b Closer to the target question Q t ;

[0045] The sentence-level reward uses ROUGE-L to measure similarity. The reward target of ROUGE-L is to positively reward the sample question Q s , if Q s With the target question Q t Compared to the baseline problem Q b More similar;

[0046] Bias-corrected reward r total It is the question style reward, question quality reward, word-level reward, sentence-level reward, and the baseline question Q is measured according to the BLEU-4 metric. b And sample question Q s With the target question Qt The sum of rewards.

[0047] Preferably, based on the reward r total The agent is iteratively trained. During the training process, the entropy regularization term is used to make the policy distribution more uniform; for the discrete probability distribution on the action space |A|.

[0048] The second aspect of the present application discloses a question generation device based on reinforcement learning, comprising:

[0049] An acquisition module is used to acquire a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers and subgraphs;

[0050] An initial question generation module, based on a supervised fine-tuning training method, generates an initial question using context information of the subgraph to guide the answer;

[0051] The question reward module outputs the questions to be scored based on the answers and subgraphs of the initial questions, annotates and scores the question styles of the questions to be scored, annotates the quality of the questions to be scored, and calculates the reward scores for the annotated questions to be scored.

[0052] A reinforcement training module, which trains the question generation model using a reinforcement learning model, wherein the reinforcement learning model performs bias correction on the scored questions based on prior knowledge feedback;

[0053] The output module obtains the trained question generation model after multiple rounds of training, inputs the actual question into the question generation model, and outputs the final question.

[0054] A third aspect of the present application discloses an electronic device, which includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the method.

[0055] A fourth aspect of the present application discloses a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the method.

[0056] A fifth aspect of the present application discloses a computer program product, which includes a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the steps of the method.

[0057] The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:

[0058] This application trains a preference-based question reward model by marking an initial question set and a preset reward loss function, so that the trained model can generate basically fluent questions, and score the generated questions to improve the scoring accuracy, and then trains the reinforcement learning module according to a preset reinforcement loss function, uses the trained reinforcement learning module to build a question generation environment, and generates multiple candidate questions in the question generation environment using the initial question generation model and the standard questions, answers and subgraphs in the environment, and trains the reinforcement learning module by a preset reinforcement loss function, so that the trained reinforcement learning module makes the strategy more evenly distributed when constructing the question generation environment, thereby improving the accuracy of candidate question generation, and uses the initial question generation model to observe the "standard questions", answers and subgraphs in the environment, and generates candidate questions, which are generated in combination with specific actual scenarios, and have higher applicability, and then scores multiple candidate questions according to the trained preference-based question reward model, and uses deviation correction to correct the scoring results. The trained preference-based question reward model uses the reward function, and when the feedback is not accurate enough, it may not work properly and the effect is poor. This application uses a question quality reward model to reduce bias by emphasizing question quality, such as punctuation, vocabulary, grammar, and whether the question matches the answer. In addition, in order to alleviate the annotation bias in the style question annotation process, this application uses a game theory mechanism to improve the annotation quality of style questions by coordinating two competing annotation models. In order to mitigate potential confirmation bias, this application proposes a bias-corrected reinforcement learning method to learn from feedback to correct confirmation bias. The scoring results are corrected through bias correction to ensure quality, and the initial question generation model is trained using the bias-corrected reward and the proximal strategy optimization algorithm iterative optimization strategy to obtain a trained question model; diverse questions are generated based on the trained question generation model, thereby increasing the diversity and quality of question generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 Problems in the field of knowledge base question generation;

[0060] Figure 2 A flowchart of a method provided by an embodiment of the present application;

[0061] Figure 3 A diagram of a deviation correction framework based on reinforcement learning provided by an embodiment of the present application;

[0062] Figure 4 A structural diagram of a knowledge graph question generation device provided by an embodiment of the present application;

[0063] Figure 5 A structural diagram of a knowledge graph question generating device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0064] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0065] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0066] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0067] The technical solutions provided in the embodiments of the present application involve technologies such as machine learning and natural language processing of artificial intelligence, which are specifically introduced and explained through the following embodiments.

[0068] Before introducing the embodiments of the present application, some terms involved in the present application are first explained.

[0069] 1. Knowledge Graph: It is a series of various graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mine, analyze, construct, draw and display knowledge and their interrelationships.

[0070] The knowledge graph may include multiple nodes and edges connecting the nodes. The nodes in the knowledge graph include different types of nodes such as entity nodes and value nodes. Each entity node represents an entity, and each value node represents a value.

[0071] 2. Knowledge Base Question Generation (KBQG): A knowledge base (KB), often referred to as a knowledge graph (KG), is composed of<s,r,o> This is a set of triples, where s, r, and o represent subject, relation, and object, respectively. A subgraph is a subset of a knowledge graph, containing one or more triples, which can be represented as G = (V, E), where Represents the entity set (s or o) in the knowledge graph, Represents all the relationships connecting these entities. and ε represent the set of all entities and relations in the knowledge graph respectively. The knowledge base question generation task mainly involves inputting a subgraph G = (V, E) and the answer Then generate more human and realistic natural language questions Q G The training data for this task consists of a set of triplets: <knowledge graph subgraph G, answer V t , the target question Q t >.

[0072] Current knowledge base question generation models are mainly divided into template-based and neural network-based methods. Typically, triplets in a knowledge graph subgraph are organized into sequences and passed as input to a Seq2Seq neural network (L2A).

[0073] 3. Reinforcement learning: When training with reinforcement learning, the environment needs to give feedback and the corresponding specific feedback value. Reinforcement learning includes environment, agent, action, state and reward. It is not a classification task, but mainly guides the training object on how to make decisions at each step and what actions to take to achieve a specific goal or maximize benefits.

[0074] 4. The proximal policy optimization algorithm is a model-free reinforcement learning algorithm based on policy gradient. Its main idea comes from the TRPO algorithm. It uses the Clip function to replace the KL divergence and directly constrains the strategy through the ratio rt(θ). In a state, the agent selects action A and then obtains the reward R. The strategy is optimized through the policy gradient to maximize the overall reward.

[0075] Please refer to Figure 2 , which shows a schematic diagram of the implementation process of the solution provided by an embodiment of the present application. The figure includes four steps:

[0076] Step S1: Obtain a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs.

[0077] Step S2: Generate initial questions using the context information of the subgraph-guided answer based on a supervised fine-tuning training method. In one embodiment, supervised fine-tuning is used to train a cold start question generation model, which can generate basically fluent natural language questions, which can be used as initial questions.

[0078] Supervised fine-tuning cold start question generation is generated by the SOTA model in the current field of knowledge graph question generation. The SOTA model (State-of-the-Art model) can be a G2S model, a G2S-AE model, an IGND model or a G2S-AE-RL model, which uses subgraph guidance to utilize the contextual information of the answer to generate more accurate and fluent natural language questions. Exemplarily, the training data is provided to the G2S-AE-RL model for fine-tuning, and it generates preliminary questions for subsequent training processes. The G2S-AE-RL model is one of the latest KBQG models, which uses a new BiGraph2Seq model to generate questions and answers from KB subgraphs. The application is not limited to the choice of baseline models, and there are many selectable models, including but not limited to the following models: L2A, RNN, Transformer, zero-shot, mhqg, T5, IGND, G2S, G2S-AE, G2S-AE-RL.

[0079] In one embodiment, step 2 generates an initial question based on the supervised fine-tuning training method using the context information of the subgraph to guide the answer, including:

[0080] The question generation model G2S-AE-RL proposed in 2023 is adopted, which uses a new BiGraph2Seq model to generate questions and answers from KB subgraphs. Specifically, this application provides training data in the format of 1 above to fine-tune G2S-AE-RL, which will generate preliminary questions.

[0081] In one embodiment, step 2 generates an initial question based on the supervised fine-tuning training method using the context information of the subgraph to guide the answer, including:

[0082] The question generation model, L2A, which is an early KG subgraph, is used as the input of an LSTM-based Seq2Seq model, which is an attention-based Seq2Seq model that can generate natural language questions in an open domain dialogue system using context information. Specifically, the application provides training data in the format of 1 above to fine-tune L2A, which will generate preliminary questions.

[0083] In one embodiment, step 2 for the supervised fine-tuning training method uses the context information of the subgraph-guided answer to generate an initial question, including:

[0084] Adopt the question generation model Zero-shot, which is a knowledge base question generation model based on zero-shot RNN based on OVV predicates and entity types. Specifically, the present application provides the training data in the above 1 format to fine-tune Zero-shot, which will generate preliminary questions.

[0085] In one embodiment, step 2 for the supervised fine-tuning training method uses the context information of the subgraph-guided answer to generate an initial question, including:

[0086] Adopt the question generation model MHQG, which is an end-to-end knowledge base complex multi-hop question generation model based on neural networks. Specifically, the present application provides the training data in the above 1 format to fine-tune MHQG, which will generate preliminary questions.

[0087] Step S3: According to the answer and subgraph of the initial question, output the question to be scored, annotate and score the questioning style of the question to be scored; and annotate the question quality of the question to be scored; calculate the reward score for the annotated question to be scored. The style questioning annotation assigns a sequence priority label to the initial question according to prior knowledge. In one embodiment, step S3 includes the following 3 sub-steps:

[0088] S31 Question generation: Input each <KG subgraph, answer> pair, and use the QG-SFT model trained in step 2 to generate a set of K questions. Multiple sets of data (each set of K questions) will be generated simultaneously. Then, all these questions to be annotated will be annotated by the annotation model, so as to generate the sequence priority of K questions for training the reward model. The following shows an example of the input format of the answer and subgraph.

[0089] {"answers":["Computer Vision","Face Recognition"],"answer_ids":["10001082","10001100"],"outSeq":"By the way, what knowledge have you used that uses probabilistic models?","qId":18,"inGraph":{"g_node_names":{"10001082":"Computer Vision","10001100":"Face Recognition","10001092":"Probabilistic Model"},"g_edge_types":{"Computer / Field / Topic Learning Dependency":"Computer / Field / Topic / Learning Dependency"},"g_adj":"10001082":{"10001092":"Computer / Field / Topic / Learning Dependency},"10001100":{"10001092":"Computer / Field / Topic / Learning Dependency"}}}}

[0090] S32: Sequence Priority Labeling: Using Question-Style Reward Model and the question quality reward model The generated questions are labeled from good to bad based on the semantics, grammar, relevance and questioning style of the questions in the prior knowledge.

[0091] Relative ranking is used to rank the generated questions as it reduces the difficulty of annotation.

[0092] It is worth noting that in this application, two different annotation models are used in the style question reward model, and a game theory mechanism is used to coordinate the two annotation models to stabilize the annotation quality.

[0093] S33: Train the corresponding question style reward model according to the annotation sorting priority and the question quality reward model where θ is a parameter. After training, we hope that these two models can automatically score the generated questions. Specifically, using the answer and subgraph information x as prompts, the ERNIE model is used to encode the previously generated question y into a vector representation, which is then processed by the pooling layer and the linear transformation layer to generate a one-dimensional reward value r human and r quality .

[0094] In one embodiment, step 3 includes the following steps:

[0095] For each <KG subgraph, answer> pair, this module uses the QG-SFT model trained in step 1 to generate a set of K scored questions. We will generate multiple sets of data (K questions per set) simultaneously. Then, all these questions to be labeled are labeled by human annotators, thus generating a sequence priority for K questions for training the reward model.

[0096] Use relative ranking to rank the generated questions because it captures human preferences and also reduces the difficulty of labeling.

[0097] Question style annotation: It is expected that the questions generated by the machine follow the principles of human-like style, harmlessness, and authenticity. To achieve this, 9 volunteers are selected and trained. They are evenly divided into two annotation groups (3 student volunteers in each group) and a quality inspection group (3 teacher volunteers in each group). The members of the annotation team independently assign a priority sequence to each set of k questions according to three principles (prioritizing human-like style > harmless > authenticity). In case of inconsistencies in the annotation, the team will conduct a collective discussion and vote. After the annotation process of each team is completed, the quality inspection group conducts a comprehensive inspection. They score the quality of the questions annotated by the team and give feedback. Questions that do not meet the standard (less than ε) will be sent back by the quality inspection group for re-annotation.

[0098] Question quality annotation: Merely pursuing a human-like style often leads to a flattering bias. Therefore, as a supplement, this application designs a multi-granularity question quality annotation module to highlight the quality of the questions themselves. This application divides the question quality assessment into 6 layers and 11 sub-modules:

[0099] · Character layer, including text accuracy (whether the text is accurate) and symbol accuracy (whether the symbols are accurate); · Lexical layer, including lexical diversity (whether there is a rich vocabulary quantity) and lexical precision (whether the word choice is accurate);

[0100] · Syntactic layer, including syntactic complexity (whether the sentence length and structure are complex) and syntactic correctness (whether grammar and grammar rules are followed);

[0101] · Content layer, including question clarity (whether the question has a clear topic and clear logic) and question integrity (whether the question is complete enough);

[0102] · Overall effectiveness layer, including question-answer matching (whether the answer truly answers the question) and practical value (whether useful information or solutions are provided).

[0103] For each submodule, binary annotation is performed, where if the answer to the question in the bracket is yes, it is 1, otherwise it is 0. Then, the annotation results of all submodules are summarized to obtain the total score of the question in terms of question quality. These questions are sorted in descending order according to the score to generate a priority sequence. Based on the above information, the quality inspection team will evaluate the annotation quality of the annotation model.

[0104] Step S4: Use a bias-corrected reinforcement learning framework from prior knowledge feedback to further train the question generation model guided by a bias-corrected reward function.

[0105] The feedback framework uses the environment and agent in reinforcement learning, combined with a bias-corrected reward function, to obtain feedback for training the model.

[0106] refer to Figure 3 In one embodiment, based on the data provided by the environment, the agent (initialized as QG-SFT from step 2) generates problems and stores them in the replay buffer. In order to calculate the reward and optimize the agent, the problem is sampled from the replay buffer and passed to the reward predictor, which performs two functions, namely reward value calculation and bias correction score calculation.

[0107] The environment mainly consists of question-answering data, including questions, answers, and subgraph information. This application first initializes the agent using QG-SFT in step S2. Then, the agent observes the "standard questions", answers, and subgraphs in the environment and generates questions, i.e., actions.

[0108] Since the existing algorithm only learns the reward function through preference, it may not work properly when the feedback is not accurate enough, and the effect is poor. In order to mitigate the potential confirmation bias, this application further proposes a bias-corrected RLHF framework. Based on the reward model trained in step S3, the reward value r is calculated according to the prior knowledge. human and r quality . r human and r quality The higher the value, the more diverse the questions.

[0109] Bias correction score In order to avoid overfitting of the training model, this application proposes a method to calculate the bias correction score to alleviate the problem Q b Sample question Q s and the target question Q t Confirmation bias from the perspective of word-level similarity and sentence-level similarity.

[0110] In one embodiment, the present application uses question quality annotation to highlight the quality of the question itself. Question quality assessment is divided into 6 layers and 11 sub-modules:

[0111] 1) Character layer, including text accuracy (whether the text is accurate) and symbol accuracy (whether the symbols are accurate);

[0112] 2) Lexical level, including lexical diversity (whether there are rich vocabulary types and quantities) and lexical precision (whether the vocabulary selection is accurate);

[0113] 3) Syntactic level, including syntactic complexity (whether the sentence length and structure are complex) and syntactic correctness (whether grammar and syntax rules are followed);

[0114] 4) The content layer, which consists of the clarity of the question (whether the question has a clear theme and clear logic) and the completeness of the question (whether the question is complete enough);

[0115] 5) The interaction layer, which consists of interaction consistency (whether there is logical consistency and smoothness between questions and answers);

[0116] 6) The overall effectiveness layer, which consists of question-answer matching (whether the answer actually answers the question) and practical value (whether it provides useful information or solutions).

[0117] For each submodule, the annotation model is asked to perform a binary annotation, which is 1 if the answer to the question in the bracket is yes, otherwise it is 0. Then, the annotation results of all submodules are summed up to get the total score of the question in terms of question quality. These questions are sorted in descending order according to the score to generate a priority sequence. Based on the above information, the quality inspection model evaluates the annotation quality of the annotation model.

[0118] In one embodiment, calculating the reward score for the marked question to be scored includes:

[0119] The annotation ranking priorities of human-like question annotations and multi-granular question quality annotations are adopted to train the corresponding reward models Rθhuman quality and Rθquality, where θ is a parameter. After training, it is hoped that these two models can automatically score the generated questions. Specifically, using the answer and subgraph information x as hints, adopt

[0120] ELECTRA / ALBERT / RoBERTa / ELMo / Bert / Cluade3 / Cluade2 / Cluade / GPT4 / GPT3.5 / GPT3 / GPT2 / GPT / ERNIE / ERNIE2 / ERNIE3 / UniLM / BART encodes the previously generated question y into a vector representation, which is then processed by a pooling layer and a linear transformation layer to produce a one-dimensional reward value and quality, respectively.

[0121] Then, based on the reward, the loss function is designed:

[0122]

[0123]

[0124] Where (K, 2) represents a comparison with two questions. D is a labeled set of annotated sequence data sets. For each set of sequence data, i.e., K questions, a reward model is used to generate a reward value for each question, and yb represents the question ranked before y. σ is a function that converts the difference between 0-1 into a σ-type function. The goal of this application is to maximize the score difference between good and bad questions, which is achieved by taking a negative loss.

[0125] These two reward models are trained separately to score questions.

[0126] In some embodiments, the method for calculating the reward score in step S3 includes but is not limited to the following method:

[0127] (1) Manual evaluation: The questions to be scored are given to experts or human annotators for evaluation, and they are given corresponding reward scores based on their experience and judgment. This method can more accurately evaluate the quality and relevance of the questions.

[0128] (2) Crowdsourcing evaluation: Post the problem to be rated on the crowdsourcing platform and let multiple participants evaluate it. The reward score can be calculated by majority voting, weighted average, etc. This method can obtain the opinions of multiple participants and avoid the subjective bias of a single evaluator.

[0129] (3) BLEU (Bilingual Evaluation Understudy): The BLEU indicator was first used in the field of machine translation. It is an indicator used to evaluate the difference between sentences generated by the model and actual sentences. Its core idea is to compare the degree of overlap between the n-grams in the candidate translation and the reference translation. The higher the degree of overlap, the higher the quality of the translation. Unigram is used to measure the accuracy of word translation, and high-order n-gram is used to measure the fluency of sentence translation. In practice, N is usually taken as 1 to 4, and then a weighted average is performed.

[0130] (4) ROUGE (Recall-Oriented Understudy for Gisting Evaluation): ROUGE is a common evaluation metric in the fields of machine translation, automatic summarization, question-answer generation, etc. Both ROUGE and BLEU can be used to measure the degree of match between the generated results and the standard results. The difference is that ROUGE is based on recall, while BLEU focuses more on accuracy.

[0131] (5) METEOR (Metric for Evaluation of Translation with Explicit Ordering): Banerjee and Lavie invented the METEOR metric in 2005, which is based on the single-precision weighted harmonic mean and word recall rate, in order to address some inherent defects in the BLEU standard. METEOR expands the concept of "co-occurrence" in BLEU and proposes three modules for counting the number of co-occurrences: the "exact" module, the "porter stem" module, and the "WN synonymy" module. At the same time, METEOR includes word order in the evaluation scope and establishes a penalty mechanism based on word order changes. When the word order of the translation to be tested is different from that of the reference translation, an appropriate penalty is imposed. Finally, the precision, recall and F value are calculated based on the number of co-occurrences, and the METEOR value of the translation to be tested is finally obtained by considering the penalty.

[0132] (6) CIDEr (Consensus-based Image Description Evaluation): CIDEr is a combination of BLEU and vector space model. It treats each sentence as a document and calculates the cosine angle of the TF-IDF vector (except that the term is n-gram instead of word) to obtain the similarity between the candidate sentence and the reference sentence.

[0133] (7) SARI: SARI focuses on evaluating the lexical, structural, and semantic changes between generated sentences and reference sentences, taking into account three sub-indicators: Additions (measuring the difference between the newly added words or phrases in the generated translation and the reference translation), Deletions (measuring the presence of words or phrases missing in the reference translation in the generated translation), and Keepings (measuring the proportion of words or phrases in the generated translation that are the same as the reference translation).

[0134] (8) LEPOR: LEPOR scores sentences by combining various factors such as length penalty, precision, n-gram position difference penalty, and recall. The n-gram position difference penalty in LEPOR is designed to compare the word order between the reference sentence and the output sentence, and the penalty value is normalized. The calculation of the n-gram position difference penalty involves aligning and calculating the n-gram position difference of the aligned words between the output sentence and the reference sentence.

[0135] (9) BERTScore: This was proposed by Cornell University at ICLR 2020 (paper: BERTSCORE: EVALUATING TEXT GENERATION WITH BERT). It is mainly based on the BERT pre-training model, uses contextual embedding to describe sentences, and calculates the cosine similarity between two sentences.

[0136] (10) GEMBA: This is a method proposed by Kocmi and Federmann to use an LLM evaluator to assign quality scores (0 to 100) to evaluate generated translations, with or without a reference. GEMBA demonstrates the effectiveness of using GPT-3.5 or larger LLMs for translation quality assessment.

[0137] In one embodiment, step S1 acquires a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs, including:

[0138] The question-answering dataset is WebQuestions. The WebQuestions dataset (proposed in 2013) was constructed by researchers at Stanford University through the Google Suggest API. The dataset itself contains 5810 (question, answer) pairs, of which simple questions account for 84%, and complex multi-hop and reasoning questions are relatively few. According to the original data division method of the proposer, WebQuestions is divided into two sets: training set and test set, of which the training set contains 3778 data and the test set contains 2032 data.

[0139] {"answers":["Portugal national football team"],"answer_ids":[" / m / 02rqxc"],"outSeq":"which of the sports teams for whom cristianoronaldo playedwas founded most recently?","qId":20990,"inGraph":{"g_node_names":{" / m / 02sf29t":"none"," / m / 02rqxc":"Portugal national football team"," / m / 02xt6q":"Cristiano Ronaldo","1914":"1914"},"g_edge_types":{" / sports / sports_team_roster / team": " / sports / sports_team_roster / team"," / sports / pro_athlete / teams":" / sports / pro_athlete / teams"," / sports / sports_team / founded": " / sports / sports_team / founded"}, "g_adj":{" / m / 02sf29t":{" / m / 02rqxc":" / sports / sports_team_roster / team"}," / m / 02xt6q":{" / m / 02sf29t":" / sports / pro_athlete / teams"}," / m / 02rqxc":{"1914":" / sports / sports_team / founded"}}}}

[0140] {"answers":["Burj Khalifa"],"answer_ids":[" / m / 03cn0v"],"outSeq":"which attractions in dubai are greater than 26 stories tall / ?","qId":20991,"inGraph":{"g_node_names":{" / m / 03cn0v":"Burj Khalifa","163":"163"," / m / 01f08r":"Dubai"}, "g_edge_types": {" / architecture / building / floors":" / architecture / building / floors", " / travel / travel_destination / tourist_attractions":" / travel / travel_destination / tourist_attractions"},"g_adj":{" / m / 03cn0v":{"163":" / architecture / building / floors"}," / m / 01f08r":{" / m / 03cn0v":" / travel / travel_destination / tourist_attractions"}}}}

[0141] {"answers":["Hawaii-Aleutian Time Zone"],"answer_ids":[" / m / 02lctm"],"outSeq":"find the state that has a nene as the official symbol,what time zoneis this state in?","qId":20992,"inGraph":{"g_node_names":{" / m / 03gh4":"Hawaii"," / m / 02lctm":"Hawaii-Aleutian Time Zone"," / m / 071qmv":"UTC\u221210:00"," / m / 04st848":"none"," / m / 0139l8":"Nene"},"g_edge_types":{" / location / location / time_zones":" / location / location / time_zones"," / location / location_symbol_relationship / symbol":

[0142] " / location / location_symbol_relationship / symbol",

[0143] " / government / governmental_jurisdiction / official_symbols":

[0144] " / government / governmental_jurisdiction / official_symbols"},"g_adj":{" / m / 03gh4":{" / m / 02lctm": " / location / location / time_zones", " / m / 071qmv":" / location / location / time_zones", " / m / 04st848":" / government / governmental_jurisdiction / official_symbols"}, " / m / 04st848":{" / m / 0139l8":" / location / location_symbol_relationship / symbol"}}}}。

[0145] In one embodiment, step S1 acquires a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs, including:

[0146] The question-and-answer dataset is the EduQA online education question-and-answer dataset. An example of the data format is as follows: Question: Comrades from the fourth province in Northeast China, do you know what types of cognitive science disciplines are there?

[0147] Answer: ["Cognitive Science Learning and Developmental Psychology", "Cognitive Science Perception and Behavior", "Cognitive Science Artificial Intelligence", "Cognitive Science Memory", "Cognitive Science Language", "Cognitive Science Attention"];

[0148] Subgraphs: ["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science learning and developmental psychology"],["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science perception and behavior"],["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science artificial intelligence"],["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science memory"],["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science language"],["Discipline scope of cognitive science","Computer / field / topic / facets / hierarchy","Cognitive science attention"].

[0149] In one embodiment, step S1 acquires a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs, including:

[0150] The question-and-answer dataset is the China Law Research Cup question-and-answer dataset, which provides dataset support for legal education-related work. Specifically, users who provide legal advice ask questions and several answers, as a real question-and-answer dataset, the contestant's task is to output the corresponding correct, complete, and concise reference answers. The training set, validation set, and test set used in the technical evaluation of this task are all from the Internet, containing approximately 24,000 questions. Each question contains 2 to 4 lawyer answers and the corresponding standard summary answer. Question: Which option is a form of state compensation? Answer: Monetary awards Sub-graph text: Monetary awards is a form of state compensation

[0151] Question: Who is the principal offender according to Criminal Law? Answer: Bob, the leader of a robbery group, who ordered his subordinates to commit robbery on multiple occasions, but was never personally involved.

[0152] Subplot text: The principal ofender is the person in a group of offenderswholeads, and carries out the main part of a criminal act.

[0153] In one embodiment, step S1 acquires a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs, including:

[0154] The question-answering dataset is a Baidu Zhidao knowledge question-answering dataset: The Baidu Zhidao dataset contains 1,470,142 pre-filtered, high-quality questions and answers, each question belongs to a category. There are 492 categories in total, of which 434 categories have a frequency of 10 or more times. Here we modify the format designed to be questions, answers, and subgraphs.

[0155] {"qid": <qid>,"category": <category>,"title": <title> ,"desc":< / title> <desc>,"answer": }

[0156] {"Question":"Who is mostly responsible for this traffic accident? A car and a motorcycle had an accident in an area with no traffic lights","Sub-picture":"<car, accident, motorcycle>, <car, speed, 10 kilometers per hour>, <motorcycle, position, left side of the car>, <car, position, driving on the right>","Answer":"When passing an intersection without traffic lights, you should slow down and let the car on the right go first. According to what you said, the motorcycle seemed to be on the left side of the car, so strictly speaking, the motorcycle may be fully responsible. Of course, it also depends on whether the car has all the necessary certificates and whether the driver was drinking. The specific details will be determined by the traffic police after investigation."}

[0157] In one embodiment, step S1 acquires a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs, including:

[0158] The question-and-answer dataset is a community question-and-answer webtext2019zh knowledge dataset: The community question-and-answer webtext2019zh knowledge dataset contains 4.1 million pre-filtered, high-quality questions and replies. Each question belongs to a topic, and there are a total of 28,000 various topics, covering everything. From the 14 million original questions and answers, we screened out answers that received at least 3 likes, which means that the content of the reply is good or interesting, thus obtaining a high-quality dataset. In addition to a topic, a description of the question, and one or more replies for each question, each reply also carries a sub-graph label with the number of likes, reply ID, and respondent.

[0159] In one embodiment, the present application uses a game theory mechanism to improve the quality of style question annotation. Two independent annotation models 1 and 2 of different types and a quality inspection model are set up for quality inspection. Assume that there are T cycles. In each cycle, given the same time, the annotation model annotates multiple groups of questions (non-overlapping), and then submits a batch of annotation data to the quality inspection model. and Next, the quality verification model evaluates the quality of the annotations separately by scoring a set of questions s∈[0,1] for each annotation. Questions with s<σ will be or and sent back to the annotation model for re-annotation in the next cycle with the rejection reasons provided by the quality inspection model. and The scores of are averaged to produce an overall score for each annotation model, i.e., In order to motivate the two annotation models to provide higher quality annotation data, the unit price of annotation data per cycle is set to It is determined by the annotation quality of the two annotation models. Assume that the annotation cost of each sample is c∈(0,1). Then the profit of annotation model 1 is The profit of the labeled model 2 is Where || represents the number of samples. The two annotation models know the annotation quality of each annotation model after each cycle and quantity

[0160] Exemplarily, the annotation model may be Siamese-uniNLU or paddleNLP, and the quality detection model may be GPT-4.

[0161] In some embodiments, quality standards are set for question quality, including large model annotation, manual annotation, and human-machine collaborative annotation. Large model annotation includes but is not limited to: Cluade3 / Cluade2 / Cluade / GPT4 / GPT3.5 / GPT3 / GPT2 / GPT / ERNIE / ERNIE2 / ERNI E3 and other large models.

[0162] The manual labeling method is crowdsourcing, inviting student volunteers, teacher volunteers, and hiring field experts to do the labeling.

[0163] Human-machine collaboration first uses machine annotation, using the following models: Cluade3 / Cluade2 / Cluade / GPT4 / GPT3.5 / GPT3 / GPT2 / GPT / ERNIE / ERNIE2 / ERNIE3, and then uses manual proofreading such as crowdsourcing, inviting volunteers, and hiring field experts.

[0164] Based on the fact that annotation quality is often negatively correlated with quantity, we assume Where r is the coefficient of the impact of the labeled data on the quality (preferably, r1=r2=r is set). After continuous independent decision-making and game between the two parties, the quantity and quality of the annotations will eventually stabilize at a certain value and reach a balance point E, where each data The cost and amount of labeled data

[0165] In one embodiment, in step S33, according to the reward, the loss function of the question style reward model and the question quality reward model is defined as follows:

[0166]

[0167] Among them, (K, 2) represents the comparison of two questions, D is a set of labeled sequence data sets, and for each set of sequence data, i.e., K questions, a reward model is used to generate the reward value of each question, r θ (x,y) represents the scalar output of the generated question y calculated by the reward model, corresponding to the model parameter θ, x is the answer and subgraph information of the corresponding question y, y b represents all generated questions sorted before y. σ is the sigmoid function that converts real numbers to the range of 0-1. The difference in scores between good questions and bad questions is maximized by taking the negative value of the loss.

[0168] For example, suppose there is currently sequence annotation information of D>A>C>B, and the scoring model needs to be trained. The scores of the four sentences output by the question generation model must satisfy r(D)>r(A)>r(C)>r(B), and the value of the loss function (Loss) is equal to the sum of the reward of the "good question" minus the reward of the "bad question". Here, we hope that the reward model can maximize the difference between the score of the "good question" and the score of the "bad question", because this means that the "good question" has a higher score and the "bad question" has a lower score, and the model has a stronger predictive ability, and gradient descent is a minimization operation. Therefore, the loss function is negative, and the minimization operation is converted into a maximization operation to achieve the effect.

[0169] A question style reward model and a question quality reward model are trained separately to score questions.

[0170] In one embodiment, to avoid overfitting of the reward model, a bias correction score is calculated to mitigate the bias from the baseline problem Q b Sample question Q s and the target question Q t The confirmation bias from the perspective of word-level similarity and sentence-level similarity. b is the model output obtained by selecting the best action using the current policy. It is used as a reference standard during the training process and is used to evaluate the sample problem Q s Sample Question Q s is the model output obtained by randomly sampling from the current policy.

[0171] The word-level reward is measured as:

[0172]

[0173] WMD refers to the word mover's distance. The goal is to positively reward Q s , if it is better than the current best policy Q b Closer to the target question Q t As for the sentence-level reward, this application uses two metrics, namely ROUGE-L and BLEU-4, to measure the similarity.

[0174] Taking the ROUGE-L metric as an example, the reward is:

[0175]

[0176] The goal is to positively reward Q s , if it is consistent with the target problem Q t Compared with the current best strategy Q b More similar. The reward of BLEU-4 is denoted as Note that for all reward scores, this application limits them to a value range [―γ,γ]. If the score is outside this range, the hyperparameter (―)γ will be used instead. Finally, the bias-corrected reward r total (Bias-corrected score) is defined as:

[0177]

[0178] The bias-corrected rewards can guide the reinforcement model to accurately generate diverse questions, correct bias errors, and further enhance the effectiveness of the model.

[0179] In particular, although deterministic policy learning makes it less likely to choose very bad actions, it may also cause the agent to become complacent. To address this issue, this application designs an entropy regularization term It refers to the entropy regularization of the action distribution corresponding to the policy π in state s The goal is to encourage a more even distribution of strategies.

[0180] Given a discrete probability distribution over the action space |A|, the entropy regularization term is defined as:

[0181]

[0182] Among them, λ represents the hyperparameter that determines the weight of the regularization term. Incorporate it into the objective function of reinforcement learning for model optimization.

[0183] After multiple rounds of training, high-quality questions with diversity are generated.

[0184] In one embodiment, reference Figure 3 ,In step S3, the predicted reward value is used for agent training, and the proximal policy optimization algorithm based on quadratic exponential decay rollback is used to iteratively optimize the strategy and QG-SFT model.

[0185] In one embodiment, considering that there are still many limitations due to problems such as the weak stability of reinforcement learning, the current rollback mechanism can effectively alleviate the problem of gradient disappearance. However, this rollback mechanism also brings a series of new problems. For example, the maximum point of the proxy function in the existing PPO-RB algorithm is not differentiable, causing the policy gradient to oscillate when approaching the maximum point. The present application uses a proximal policy optimization algorithm based on a quadratic exponential decay rollback mechanism. Through a rollback function with quadratic exponential decay, the zero point and the maximum point of the rollback function coincide, thereby solving the problem that the maximum point of the proxy function is not differentiable, so that reinforcement learning can better adapt to a diverse learning environment and improve learning efficiency.

[0186] In order to push the policy gradient update to the maximum point of the proxy function, this application introduces a quadratic exponential decay rollback function as follows:

[0187]

[0188] Among them, the hyperparameter α = ε ―2 , r t is the ratio. Based on the above quadratic decay rollback function, the proxy function of the proximal policy optimization algorithm is:

[0189]

[0190] There exist real numbers δ1,δ2∈(1+ε,+∞). When r∈(1+ε,δ1), the policy gradient of the proximal policy optimization algorithm based on quadratic exponential decay rollback approaches zero more stably than the existing PPO-RB algorithm, which means that the policy is close to the maximum point of the replacement function; when r∈(δ1,δ2), the policy is far away from the maximum point, and the proximal policy optimization algorithm will drive the policy gradient to take large steps to approach 0; when r>δ2, the proximal policy optimization algorithm will guide the policy gradient to take small steps to avoid the new policy exceeding the trust region.

[0191] In one embodiment, a reinforcement learning model is used for training in step S4, and the reinforcement learning model performs bias correction on the scored questions according to prior knowledge feedback, and the bias-corrected reward function regularizes the entropy of the action distribution corresponding to the strategy under the state, wherein the reinforcement learning model includes but is not limited to policy gradient, A2C / A3C, PPO algorithm, TRPO algorithm, PPO-Clip algorithm, PPO-QED algorithm, PPO-S algorithm, DDPG algorithm, TD3 algorithm, SAC algorithm, DQN algorithm, C51 algorithm, QR-DQN algorithm, HER algorithm and Q-Learning algorithm.

[0192] Among them, the policy gradient directly optimizes the policy parameters to maximize the long-term cumulative reward. The gradient ascent method is usually used to update the policy parameters. A2C / A3C is an algorithm based on policy gradient, which combines the estimation of the value function and guides the policy update through the advantage function. A3C is a parallelized version of A2C. The PPO algorithm limits the step size of the policy update to ensure that each update is not too large, thereby improving the stability and convergence of the algorithm. The TRPO algorithm is similar to PPO, but uses a stricter policy update amplitude limit to ensure that each update is within a credible region. The PPO-Clip algorithm is a variant of PPO that limits the amplitude of the policy update by comparing the policy ratio. The PPO-QED algorithm is an improved version of PPO that introduces a new estimation method to update the policy. The PPO-S algorithm is another improved version of PPO, which is aimed at policy optimization in continuous action space. The DDPG algorithm is a policy optimization algorithm for continuous action space, combining the actor-critic architecture and deep learning methods. The TD3 algorithm is an improved version of DDPG that improves stability by using two Q networks and delaying the update of the target network. The SAC algorithm is another policy optimization algorithm for continuous action space, which introduces entropy regularization to promote exploration. The DQN algorithm is a Q-learning method based on deep learning, which is used to solve reinforcement learning problems in discrete action spaces. The C51 algorithm is a variant of DQN, which uses distribution estimation to represent the action value function. The QR-DQN algorithm is another improved DQN algorithm that uses quantile regression to estimate the action value function. The HER algorithm is a technique used to solve sparse reward problems, which learns failure trajectories by replaying and replaying memories. The Q-Learning algorithm is a classic reinforcement learning algorithm that learns the optimal strategy by iteratively updating the action value function.

[0193] In one embodiment, the model-based reinforcement learning algorithm in step S4 includes but is not limited to the WorldModel algorithm, the I2A algorithm, the MBMF algorithm, the MBVF algorithm, and the AlphaZero algorithm. Among them, the World Model algorithm divides the environment into three parts: the perception model, the dynamic model, and the control model. The original environmental information is converted into a processable state representation through the perception model, and then the state transition is predicted by the dynamic model, and finally the strategy is generated through the control model. The I2A algorithm embeds the environmental model into the decision network of the intelligent agent, so that the intelligent agent can simulate the results of multi-step operations in imagination and make decisions based on these simulation results. The MBMF algorithm quickly learns the environmental model on each task through the meta-learning framework, and optimizes the strategy through the environmental model, thereby achieving rapid adaptation to new tasks. Based on the environmental model, the MBVF algorithm expands the estimation of the action value function and uses the future trajectory simulated by the model to expand the estimation range of the value function, thereby improving the accuracy of the decision. AlphaZero algorithm: uses the Monte Carlo tree search algorithm and deep neural network to learn strategies and value functions, continuously improves strategies through self-game, and finally achieves game performance beyond human level.

[0194] In one embodiment, the bias-corrected reward function in step S4 regularizes the entropy of the action distribution corresponding to the strategy under the state, and the bias-corrected reward function includes but is not limited to the following:

[0195] The reward function at the word level calculates the difference through the WMD (Word Mover's Distance) model. WMD is a method for calculating the semantic distance between two texts, which can be used to evaluate the semantic similarity between the text generated by the strategy and the target text.

[0196] The reward function at the sentence level calculates the difference through the ROUGE-L model. ROUGE-L is a metric commonly used to evaluate the similarity between automatically generated text and reference text, and is particularly suitable for evaluating the similarity between sentences generated by the strategy and target sentences.

[0197] The character-level reward function uses a character-based similarity measurement method, such as the edit distance (Levenshtein distance) or a character-based language model to calculate the difference.

[0198] The reward function at the paragraph level uses a semantic similarity measure between paragraphs to calculate the difference, such as a similarity measure based on the paragraph vector representation.

[0199] The reward function at the overall effectiveness level comprehensively considers the differences in the text generated by the strategy at different levels and comprehensively evaluates the overall effect of the strategy generation.

[0200] In one embodiment, the entropy regularization in step S4 includes but is not limited to the following methods:

[0201] Entropy Regularization: The simplest entropy regularization method is to add an entropy term to the objective function of policy optimization. This entropy term is defined as the entropy of the action distribution corresponding to the policy in a certain state, that is, the negative entropy of the action distribution. By maximizing the entropy of the policy, the policy can be made more random and more exploratory.

[0202] KL-Divergence Regularization: KL divergence regularization is another common entropy regularization method, which is achieved by controlling the KL divergence between the distributions before and after the policy update. Specifically, a KL divergence term is added to the optimization objective function, and the KL divergence between the action distributions before and after the policy update is used as a regularization term, so that the policy update does not cause too large a change in the action distribution, thereby maintaining a certain degree of exploratory nature.

[0203] Temperature Scaling: Temperature scaling is a method of achieving entropy regularization by adjusting the temperature parameter of the action probabilities in the policy. By increasing the temperature parameter, the variance of the action probabilities can be increased, thereby increasing the exploratory nature of the policy. The higher the temperature parameter, the more exploratory the policy.

[0204] Action Dropout: Action Dropout is a highly random entropy regularization method that randomly drops certain actions with a certain probability each time the strategy selects an action, thereby increasing the diversity and exploration of the strategy. Action Dropout can be viewed as a random sampling of the action space.

[0205] The methods for calculating the reward score in the embodiments can be used for bias correction. In addition, the bias correction can also adopt a variety of fold-one reinforcement models (such as policy gradient, A2C / A3C, PPO algorithm, TRPC algorithm, PPO-Clip, algorithm, etc.), and use the prior knowledge of feedback (such as feedback reward score question information, answer information or subgraph information during training, or execution action, etc.) to perform bias correction on the scored questions. The bias correction function also includes one or more of the word level, sentence level, character level, paragraph level and overall effectiveness level. The bias correction function can also be BLEU, ROUGE, METEOR, CIDEr, BERTscores, etc.

[0206] In one embodiment, outputting the final question after multiple rounds of training includes:

[0207] Split a piece of data into multiple pieces of data, each of which includes the User and Assistant parts.

[0208] After splicing a piece of data, it is input into the model and the loss of each part is calculated in parallel. Only the loss of the Assistant part is involved in the weight update.

[0209] In one embodiment, outputting the final question after multiple rounds of training includes:

[0210] A learning rate decay strategy is introduced to gradually reduce the learning rate so that it can converge more stably in the later stages of training.

[0211] In each round of training, the negative sampling strategy is dynamically adjusted according to the performance of the model, and negative samples are selected more specifically to enhance the model's ability to learn and remember key information.

[0212] Data enhancement techniques, such as random perturbation and partial occlusion, are introduced to increase data diversity and improve the generalization ability of the model.

[0213] Implement an early stopping strategy to terminate training in time when the model performance on the validation set no longer improves to avoid overfitting.

[0214] Through grid search, Bayesian optimization and other methods, the model's hyperparameters are tuned to find the optimal parameter combination and further improve model performance.

[0215] In one embodiment, outputting the final question after multiple rounds of training includes:

[0216] For unbalanced data sets, methods such as oversampling or undersampling are used to balance the distribution of samples of each category to improve the learning effect of the model on minority class samples.

[0217] The model update process is combined with real-time data flow to continuously perform online learning and incremental learning to adapt to changes in data distribution and the accumulation of new knowledge.

[0218] By integrating multiple models of different types or structures, such as voting and stacking, the generalization ability and performance of the model can be further improved.

[0219] This application trains a preference-based question reward model by marking an initial question set and a preset reward loss function, so that the trained model generates basically fluent questions, and scores the generated questions to improve the scoring accuracy, and then trains the reinforcement learning module according to a preset reinforcement loss function, uses the trained reinforcement learning module to build a question generation environment, and generates multiple candidate questions in the question generation environment using the initial question generation model and the standard questions, answers and subgraphs in the environment, and trains the reinforcement learning module by a preset reinforcement loss function, so that the trained reinforcement learning module makes the strategy more evenly distributed when constructing the question generation environment, thereby improving the accuracy of candidate question generation, and uses the initial question generation model to observe the "standard questions", answers and subgraphs in the environment, and generates candidate questions, which are generated in combination with specific actual scenarios and have higher applicability, and then scores multiple candidate questions according to the trained preference-based question reward model, and uses deviation correction to correct the scoring results. The trained question reward model learns the reward function, and when the feedback is not accurate enough, it may not work properly and the effect is poor. This application uses a question quality reward model to reduce bias by emphasizing question quality, such as punctuation, vocabulary, grammar, and whether the question matches the answer. In addition, in order to alleviate the annotation bias in the annotation process, this application uses a game theory mechanism to improve the annotation quality by coordinating two competing question style annotation models. In order to mitigate potential confirmation bias, this application proposes a bias-corrected reinforcement learning method to learn from feedback to correct confirmation bias. The scoring results are corrected through bias correction to ensure quality, and the initial question generation model is trained using the bias-corrected reward and the proximal strategy optimization algorithm iterative optimization strategy to obtain a trained question model; diverse questions are generated based on the trained question generation model to increase the diversity and quality of question generation.

[0220] refer to Figure 4 In one embodiment, the present invention further discloses a knowledge graph question generating device diagram, including:

[0221] An acquisition module 11 is used to acquire a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers and subgraphs;

[0222] An initial question generation module 12 generates an initial question based on a supervised fine-tuning training method using the context information of the subgraph to guide the answer;

[0223] The supervised fine-tuning cold start question generation is generated by the SOTA model in the current knowledge graph question generation field. The SOTA model (State-of-the-Art model) can be a G2S model, a G2S-AE model, an IGND model or a G2S-AE-RL model, which uses subgraph guidance to utilize the contextual information of the answer to generate accurate and fluent natural language questions. Exemplarily, the training data is provided to the G2S-AE-RL model for fine-tuning, which will generate preliminary questions for subsequent training processes. It is worth noting that the application is not limited to the selection of baseline models, and there are many selectable models, including but not limited to the following models: L2A, RNN, Transformer, zero-shot, mhqg, T5, IGND, G2S, G2S-AE, G2S-AE-RL. Exemplarily, for the G2S-AE-RL model, it uses a new BiGraph2Seq model to generate questions and answers from the KB subgraph. Specifically, the application provides training data to fine-tune G2S-AE-RL, which will generate preliminary questions. For the L2A model, it is an early KG subgraph, as the input of an LSTM-based Seq2Seq model, which is an attention-based Seq2Seq model that can generate natural language questions in an open-domain dialogue system using contextual information. Specifically, the present application provides training data to fine-tune L2A, which will generate preliminary questions. For the G2S-AE-RL model, it is a knowledge base question generation model that uses a two-level RL (reinforcement learning) training strategy, in which the objective function combines cross-entropy loss and RL loss. Specifically, the present application provides training data to fine-tune G2S-AE-RL, which will generate preliminary questions.

[0224] The question reward module 13 outputs the questions to be scored according to the answers and subgraphs of the initial questions, labels the questions to be scored with priorities, and then uses question style labeling and question quality labeling to calculate reward scores for the questions to be scored by sorting the label priorities.

[0225] The question reward module includes the following 3 sub-modules:

[0226] Question generation submodule: Generate 4 questions by feeding the input answers and subgraphs into the QG-SFT model trained in the first step. An example of the input format of answers and subgraphs is shown below.

[0227] {"answers":["Computer Vision","Face Recognition"],"answer_ids":["10001082","10001100"],"outSeq":"By the way, what knowledge have you used that uses probabilistic models?","qId":18,"inGraph":{"g_node_names":{"10001082":"Computer Vision","10001100":"Face Recognition","10001092":"Probabilistic Model"},"g_edge_types":{"Computer / Field / Topic Learning Dependency":"Computer / Field / Topic / Learning Dependency"},"g_adj":"10001082":{"10001092":"Computer / Field / Topic / Learning Dependency},"10001100":{"10001092":"Computer / Field / Topic / Learning Dependency"}}}}

[0228] Sequence Priority Labeling Submodule: Using Question Style Reward Model and the question quality reward model The generated questions are labeled from good to bad based on the semantics, grammar, relevance and questioning style of the questions in the prior knowledge.

[0229] Relative ranking is used to rank the generated questions as it reduces the difficulty of annotation.

[0230] It is worth noting that in this application, two different annotation models are used in the style question reward model, and a game theory mechanism is used to coordinate the two annotation models to stabilize the annotation quality.

[0231] The reward training submodule uses the annotation sorting priority of human-like question style annotation and question quality annotation to train the corresponding reward model respectively. People quality and quality, where θ is a parameter. After training, it is hoped that these two models can automatically score the generated questions. Specifically, using the answer and subgraph information x as prompts, the ERNIE model is used to encode the previously generated question y into a vector representation, which is then processed by the pooling layer and the linear transformation layer to generate a one-dimensional reward value r human and r quality .

[0232] The reinforcement training module 14 is trained using a reinforcement learning model. The reinforcement learning model performs bias correction on the scored questions based on prior knowledge feedback. The bias-corrected reward function regularizes the entropy of the action distribution corresponding to the strategy π in the state s. After multiple rounds of training, the final question is output.

[0233] Figure 5 FIG. 2 shows a structural block diagram of a knowledge graph question generating device according to an embodiment of the present invention. Figure 5 As shown, the device includes: a memory 910 and a processor 920, wherein the memory 910 stores a computer program that can be run on the processor 920. When the processor 920 executes the computer program, the question-answer pair generation method in the above embodiment is implemented. The number of the memory 910 and the processor 920 can be one or more.

[0234] The device also includes:

[0235] The communication interface 110 is used to communicate with external devices and perform data exchange transmission.

[0236] The memory 120 may include a high-speed RAM memory, and may also include a nonvolatile memory (nonvolatile memory), such as at least one disk memory.

[0237] If the memory 120, the processor 130 and the communication interface 110 are implemented independently, the memory 120, the processor 130 and the communication interface 110 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Component (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0238] As used herein, the word "preferred" is intended to be used as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X employs A or B" means any one of the naturally inclusive permutations. That is, if X employs A; X employs B; or X employs both A and B, then "X employs A or B" is satisfied in any of the foregoing examples.

[0239] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (e.g., elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (e.g., it is functionally equivalent), even if the structure is not equivalent to the disclosed structure that performs the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desirable and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".

[0240] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.

[0241] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.< / desc> < / category> < / qid>

Claims

1. A question generation method based on reinforcement learning, characterized in that: The following steps are involved: Obtain a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers, and subgraphs; Generate an initial question based on a supervised fine-tuning training method using contextual information of the subgraph to guide the answer; Based on the answers and subgraphs of the initial questions, output the questions to be scored, annotate and score the question styles of the questions to be scored; annotate the quality of the questions to be scored; and calculate the reward scores for the annotated questions to be scored; Training a question generation model using a reinforcement learning model that performs bias correction on scored questions based on prior knowledge feedback; After multiple rounds of training, a trained question generation model is obtained. The actual problem is input into the question generation model to output the final problem.

2. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The generated questions are automatically rewarded and scored by using question style annotation and question quality annotation. That is, the generated initial questions are encoded into vector representations using the answer and subgraph information as hints, which are then processed by the pooling layer and the linear transformation layer to generate a one-dimensional style reward score and a one-dimensional quality reward score, respectively.

3. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The labeling of the question style of the to-be-rated question includes at least one of the following methods: large model labeling, manual labeling, and human-computer collaboration.

4. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: Game theory mechanisms are also used to improve the quality of the question style annotations, including: Set up two independent different types of annotation models 1 and 2 for question style annotation, and a quality inspection model for quality inspection; in each cycle, each annotation model annotates multiple groups of questions and then submits a batch of annotation data to the quality inspection model and The quality inspection model evaluates the quality of the annotations by scoring each question in the annotation model; for questions with scores below a preset value, or Delete it and return it to the annotation model for re-annotation in the next cycle, with the rejection reason provided by the quality inspection model; Will and The total score of annotation model 1 and annotation model 2 is obtained by averaging the scores. That is, in order to motivate the two annotation models to provide higher quality annotation data, the unit price of the annotation data in each cycle is jointly determined by the annotation quality of the two annotation models. The profit of annotation models 1 and 2 is calculated based on the annotation cost of each sample. After continuous independent decision-making games between the two annotation models, the quantity and quality of annotations finally stabilize at a certain value and reach the equilibrium point E.

5. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The question quality annotation is used to improve the quality of the question itself. The question quality annotation includes at least one of the following sub-modules in question quality assessment: The text accuracy submodule and the symbol accuracy submodule are used to evaluate the quality of characters; Lexical diversity submodule and lexical precision submodule, used to evaluate the quality of vocabulary; The syntactic complexity submodule and the syntactic correctness submodule are used to evaluate the quality of syntax; The question clarity submodule and the question completeness submodule are used to evaluate the quality of the content; An evaluation submodule for whether there is logical consistency and smoothness between questions and answers, which is used to evaluate the quality of the interaction; The question-answer matching submodule and the practical value submodule are used to evaluate the overall effectiveness; For each submodule, a binary label is performed, which is 1 if the answer to the question is yes, otherwise it is 0; then, the labeling results of all submodules are summed up to obtain the total question quality score; these questions are sorted in descending order according to the total question quality score to generate a priority sequence.

6. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The prior knowledge includes at least a known environment, a question generated by the agent, one of the actions taken, and the environment and agent in the reinforcement learning model, combined with a bias-corrected reward function, to obtain feedback for the training model; the environment includes questions, answers, and subgraphs; the agent generates a model for a cold start problem; Based on the data provided by the environment, the agent is initialized. Then, the agent observes the standard questions, answers, and subgraphs in the environment and generates initial questions, i.e., actions, and stores them in the replay buffer. In order to calculate the reward and optimize the agent, the question is sampled from the replay buffer and passed to the reward predictor, which calculates the reward score and the bias correction score.

7. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The bias-corrected reward function is used together with the entropy regularization of the action distribution corresponding to the policy π in the state s as a loss function to avoid overfitting. The bias-corrected reward function includes at least one of the following: The Word Mover's Distance model is used at the word level to calculate the semantic distance between two texts, which is used to evaluate the semantic similarity between the text generated by the strategy and the target text; At the sentence level, the ROUGE-L model is used to calculate the similarity between the automatically generated text and the reference text, which is used to evaluate the similarity between the sentences generated by the strategy and the target sentences; Calculate the difference using a character-based similarity measurement method at the character level, wherein the character-based similarity measurement method includes at least one of a Levenshtein distance and a character-based language model; Use semantic similarity measures between paragraphs to calculate differences at the paragraph level, such as similarity measures based on paragraph vector representations; At the overall effectiveness level, based on the differences in texts generated by the strategies at different levels, the overall effect of the strategy generation is comprehensively evaluated.

8. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The reinforcement learning model is based on the data provided by the environment, namely the labeled question-answering dataset and knowledge base. The agent generates questions and stores these questions in an experience pool. The agent generates a model for cold start questions. In order to calculate rewards and optimize the agent, questions are sampled from the experience pool and forwarded to the reward predictor to generate bias correction rewards. The bias correction rewards include question style rewards, question quality rewards and bias corrections. According to the reward results, the proximal policy optimization algorithm is used to optimize the agent.

9. The method for generating questions based on reinforcement learning according to claim 1, characterized in that: The deviation correction includes: Using the question style reward and the question quality reward, a score is generated according to prior knowledge, logic, and question quality; Calculate bias correction scores to mitigate the baseline problem Q b Sample question Q s and the target question Q t The confirmation bias from the perspectives of word-level similarity and sentence-level similarity is: b is the model output obtained by selecting the best action using the current policy. It is used as a reference standard during the training process and is used to evaluate the sample problem Q s The quality of the sample problem Q s is the model output obtained by randomly sampling from the current policy.

10. The method for generating questions based on reinforcement learning according to claim 8, characterized in that: The goal of the word-level reward in the question-style reward model is to positively reward the sample question Q s , if Q s Compared with the baseline question Q b Closer to the target question Q t ; The sentence-level reward uses ROUGE-L to measure similarity. The reward target of ROUGE-L is to positively reward the sample question Q s , if Q s With the target question Q t Compared to the baseline problem Q b More similar; Bias-corrected reward r total It is the question style reward, question quality reward, word-level reward, sentence-level reward, and the baseline question Q is measured according to the BLEU-4 metric. b And sample question Q s With the target question Q t The sum of rewards.

11. The method for generating questions based on reinforcement learning according to claim 8, characterized in that: Based on the reward r total The agent is iteratively trained. During the training process, the entropy regularization term is used to make the policy distribution more uniform; for the discrete probability distribution on the action space |A|.

12. A question generation device based on reinforcement learning, characterized in that: include: An acquisition module is used to acquire a question-answering dataset, wherein the question-answering dataset includes a plurality of data consisting of questions, answers and subgraphs; An initial question generation module, based on a supervised fine-tuning training method, generates an initial question using context information of the subgraph to guide the answer; The question reward module outputs the questions to be scored based on the answers and subgraphs of the initial questions, annotates and scores the question styles of the questions to be scored, annotates the question quality of the questions to be scored, and calculates the reward scores for the annotated questions to be scored. A reinforcement training module, which trains the question generation model using a reinforcement learning model, wherein the reinforcement learning model performs bias correction on the scored questions based on prior knowledge feedback; The output module obtains the trained question generation model after multiple rounds of training, inputs the actual question into the question generation model, and outputs the final question.

13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The method comprises a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the method according to any one of claims 1 to 11.

15. A computer program product, characterized in that It includes a computer program, which is stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Text processing method and device, computer equipment and storage medium

    CN112329435A

  • Selection question generation method and system oriented to text reading understanding and storage medium

    CN116860947A

  • Question template generation model training method and device based on reinforcement learning

    CN117454865A

Cited By

  • Operation and maintenance report auxiliary generation method and device, equipment, medium and program product

    CN118886865A

  • Urban management illegal behavior recognition system and method based on large model

    CN119091504A

  • Industrial network security service providing method adaptive to multiple types of business scenes

    CN119420510A

  • Block chain and deep learning-based enterprise propaganda virtual digital human system

    CN119514587A

  • Fine-tuning model Chinese small sample generation method based on temperature control

    CN119849489A