Live question and answer interaction model sample processing method and device, and electronic equipment

By generating question-and-answer interactive texts with various question-asking methods in the live broadcast field and rewriting them using a common language model, the problem of scarce training data is solved and the generalization ability and stability of the model are improved.

CN117235224BActive Publication Date: 2025-10-21GUANGZHOU HUYA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311206931.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-10-21
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

In the live broadcast field, existing large-scale pre-trained language models lack training data, resulting in overfitting, which affects the training effect and stability of the model.

Method used

By acquiring live commentary knowledge information, generating at least two different question-asking methods to express question-answer interaction texts, and using multiple public language models for rewriting and training, the quantity and diversity of training data can be expanded.

Benefits of technology

It increases the diversity of question-and-answer interactive texts, expands the amount of training data, improves the generalization ability of the model, solves the problem of data scarcity in vertical fields, and improves the stability of the model and training effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235224B_ABST
    Figure CN117235224B_ABST
Patent Text Reader

Abstract

The application provides a live question and answer interaction model sample processing method and device and electronic equipment, and relates to the technical field of artificial intelligence. The method comprises the following steps: acquiring live commentary knowledge information; based on the live commentary knowledge information, generating question and answer interaction texts in at least two different questioning manners to express the live commentary knowledge, wherein the question and answer interaction texts comprise question texts and answer texts; and training a live question and answer interaction model according to the question and answer interaction texts. In the above design, the question and answer interaction texts in at least two different questioning manners are generated through the live commentary knowledge information, the diversity of the question and answer interaction texts can be increased, the number of training data can be expanded, and thus the generalization capability of the trained model can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a method, device, and electronic device for processing samples of a live question-and-answer interactive model. Background Art

[0002] With the development of artificial intelligence technology, large-scale pre-trained language models, such as the Generative Pre-training Transformer (GPT), have been able to achieve accurate text generation in multiple vertical fields. For example, in the live broadcast field, the GPT model can be used for barrage generation, real-time translation, and audience interaction and response.

[0003] These models require a large amount of training data during training. However, available training data is scarce and difficult to obtain, especially in vertical fields. Collecting training data on a large scale is very difficult. The scarcity of training data can easily lead to overfitting of the model, thereby affecting the training effect and stability of the language model. Summary of the Invention

[0004] In order to at least overcome the above-mentioned deficiencies in the prior art, the purpose of this application is to provide a live question-and-answer interactive model sample processing method, device and electronic device.

[0005] In a first aspect, an embodiment of the present application provides a method for processing a live Q&A interactive model sample, the method comprising:

[0006] Obtain live commentary knowledge and information;

[0007] Based on the live broadcast commentary knowledge information, generating a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning modes, the question-and-answer interactive text including a question text and an answer text;

[0008] A live Q&A interaction model is trained based on the Q&A interaction text.

[0009] In a possible implementation, the step of generating, based on the live commentary knowledge information, a question-and-answer interactive text expressing the live commentary knowledge in at least two different questioning formats includes:

[0010] Obtaining first prompt information templates corresponding to at least two different questioning methods, the first prompt information templates including a sample question and answer field, a sample knowledge field, and a knowledge field to be processed; the sample knowledge field including sample knowledge content, and the sample question and answer field including question and answer content text that is consistent with the questioning method and related to the sample knowledge content;

[0011] For each questioning method, insert the live commentary knowledge information into the first prompt information template corresponding to the first prompt information template to obtain a first prompt information text;

[0012] The first prompt information text is input into a trained first common language model to obtain at least one question-and-answer interaction text generated by the first common language model with reference to the sample question-and-answer field and the sample knowledge field and related to the knowledge field to be processed.

[0013] In one possible implementation, the questioning methods include true / false questioning, multiple-choice questioning, essay-and-answer questioning, and reasoning questioning. The step of generating, based on the live commentary knowledge information, a question-and-answer interactive text expressing the live commentary knowledge in at least two different questioning methods includes:

[0014] Detecting whether the word count of the live commentary knowledge information is greater than a threshold;

[0015] If the word count of the live commentary knowledge information is not greater than the threshold, selecting the judgment question format to generate the question-answer interactive text;

[0016] If the word count of the live commentary knowledge information is greater than the threshold, the question-and-answer interactive text is generated by selecting the multiple-choice question format, the essay-and-answer question format, and the reasoning question format.

[0017] In a possible implementation, after generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning formats, the method further includes:

[0018] Obtain a second prompt information template, the second prompt information template including the knowledge to be processed field, a first rewriting task indication field, and a first rewriting sample field; the first rewriting task indication field is used to instruct the second common language model to rewrite part of the knowledge information in the question text in the knowledge to be processed field to generate a new first enhanced question-answer interaction text; the first rewriting sample field includes at least one rewriting sample;

[0019] Inserting the question-and-answer interactive text into the to-be-processed knowledge field of the second prompt information template to obtain a second prompt information text;

[0020] Inputting the second prompt information text into a second common language model, obtaining a first enhanced question-answer interaction text by rewriting the question-answer interaction text in the to-be-processed knowledge field based on the task indicated by the first rewriting task prompt field and taking the first rewriting sample field as a reference, the second common language model obtains;

[0021] The step of training the live Q&A interaction model based on the Q&A interaction text includes:

[0022] A live question-and-answer interaction model is trained based on the question-and-answer interaction text and the first enhanced question-and-answer interaction text.

[0023] In one possible implementation, the questioning methods include true / false questioning methods, multiple-choice questioning methods, essay questioning methods, and reasoning questioning methods; after the step of generating, based on the live commentary knowledge information, a question-and-answer interactive text expressing the live commentary knowledge in at least two different questioning methods, the method further includes:

[0024] Obtaining a third prompt information template, the third prompt information template including the knowledge to be processed field, a second rewriting task indication field, and a second rewriting sample field; the second rewriting task indication field is used to instruct the third common language model to swap the positions of part of the knowledge information in the question text with part of the knowledge information in the answer text in the knowledge to be processed field to generate a new second enhanced question-answer interaction text; the second rewriting sample field includes at least one rewriting sample;

[0025] For the question-and-answer interactive text generated by the question-and-answer question format and the reasoning question question format, inserting the question-and-answer interactive text into the to-be-processed knowledge field of the third prompt information template to obtain a third prompt information text;

[0026] Inputting the third prompt information text into a third common language model, obtaining a second enhanced question-answer interaction text by rewriting the question-answer interaction text in the to-be-processed knowledge field based on the task indicated by the second rewriting task prompt field and taking the second rewriting sample field as a reference, the third common language model;

[0027] The step of training the live Q&A interaction model based on the Q&A interaction text includes:

[0028] For the question-and-answer interactive text generated using the question-and-answer question-asking method and the reasoning question-asking method, a live question-and-answer interactive model is trained based on the question-and-answer interactive text and the second enhanced question-and-answer interactive text.

[0029] In a possible implementation, after the step of generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning formats, the method further includes:

[0030] Determine whether the question text corresponds to the questioning method, and if not, regenerate the question text;

[0031] Determine whether the answer text corresponds to the question text, and if not, regenerate the answer text;

[0032] Determine whether the question text and the answer text correspond to the live commentary knowledge information; if not, regenerate the question text and the answer text.

[0033] In a possible implementation, the questioning method includes a judgment question method, a multiple-choice question method, an essay question method, and a reasoning question method; the method further includes:

[0034] For the question-and-answer interactive text generated in the multiple-choice question format, the frequency of occurrence of each option in the answer text is adjusted to be equal.

[0035] In a second aspect, an embodiment of the present application further provides a live question-and-answer interactive model sample processing device, comprising: a receiving module for acquiring live commentary knowledge information;

[0036] A generation module, configured to generate, based on the live commentary knowledge information, a question-and-answer interactive text expressing the live commentary knowledge in at least two different questioning modes, wherein the question-and-answer interactive text includes a question text and an answer text;

[0037] A training module is used to train a live question-and-answer interaction model based on the question-and-answer interaction text.

[0038] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0039] a memory for storing one or more programs;

[0040] The processor implements the live question-and-answer interactive model sample processing method provided in the first aspect above when the one or more programs are executed by the processor.

[0041] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the live question-and-answer interactive model sample processing method provided in the first aspect above is implemented.

[0042] Based on any one of the above aspects, the live question-and-answer interactive model sample processing method, device and electronic device provided in the embodiments of the present application can generate question-and-answer interactive texts with at least two different question-asking methods through live commentary knowledge information, which can increase the diversity of question-and-answer interactive texts and expand the amount of training data, thereby enhancing the generalization ability of the trained model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 This is a flow chart of a sample processing method for a live Q&A interactive model provided in this embodiment;

[0045] Figure 2 This is one of the sub-step schematic diagrams of step S200 provided in this embodiment;

[0046] Figure 3 This is a second schematic diagram of sub-steps of step S200 provided in this embodiment;

[0047] Figure 4 This is the second flow chart of the live Q&A interactive model sample processing method provided in this embodiment;

[0048] Figure 5 Flowchart 3 of the live Q&A interactive model sample processing method provided in this embodiment;

[0049] Figure 6 Flowchart 4 of the live Q&A interactive model sample processing method provided in this embodiment;

[0050] Figure 7 A schematic diagram of an application scenario of the live Q&A interactive model sample processing method provided in this embodiment;

[0051] Figure 8 A schematic structural block diagram of an electronic device provided in this embodiment;

[0052] Figure 9 Schematic diagram of the functional modules of the live question-and-answer interactive model sample processing device provided in this embodiment.

[0053] Icons: 100 - server; 200 - terminal; 700 - electronic device; 710 - processor; 720 - computer-readable storage medium; 730 - live question-and-answer interactive model sample processing device; 731 - receiving module; 732 - generating module; 733 - training module. DETAILED DESCRIPTION

[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0055] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.

[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0057] In the description of this application, it should be noted that the terms "upper" and "lower" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or the orientations or positional relationships in which the product of this application is typically placed when in use. These terms are intended solely to facilitate the description of this application and simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first" and "second" and the like are used solely for distinction and should not be construed as indicating or implying relative importance.

[0058] It should be noted that, in the absence of conflict, different features in the embodiments of the present application can be combined with each other.

[0059] This embodiment provides a solution that can solve the above-mentioned problem. The specific implementation methods of this application are described in detail below with reference to the accompanying drawings.

[0060] Please refer to Figure 1 , Figure 1 A flow chart of a live Q&A interactive model sample processing method provided in this embodiment, the method may include the following steps.

[0061] Step S100: Acquire live commentary knowledge information.

[0062] In this embodiment, the live commentary knowledge information is obtained based on live commentary knowledge input by the user. The user may input the live commentary knowledge by text input (e.g., editing text) or voice input. By obtaining the live commentary knowledge information, the live commentary knowledge information can be rewritten to obtain more diverse data.

[0063] It should be noted that the information obtained is not limited to the live commentary knowledge information, but may also include information in other vertical fields.

[0064] Step S200: Based on the live broadcast commentary knowledge information, generate a question-and-answer interactive text that expresses the live broadcast commentary knowledge in at least two different questioning methods, wherein the question-and-answer interactive text includes a question text and an answer text.

[0065] Specifically, in this embodiment, a large number of interactive question-answering texts of different question types can be generated based on the live commentary knowledge information obtained in step S100. The question texts in the interactive question-answering texts can include different questioning methods, such as true / false questioning methods, multiple-choice questioning methods, essay-answering questioning methods, and reasoning questioning methods, and the generated question texts can also include true / false question texts, multiple-choice question texts, essay-answering question texts, and reasoning question texts. The question texts correspond to the answer texts one-to-one, and the answer texts are the correct answers to the question texts.

[0066] Exemplarily, the question-and-answer interaction text may be in json format.

[0067] Step S300: training a live Q&A interaction model based on the Q&A interaction text.

[0068] In this embodiment, in order to avoid overfitting of the model, it is not possible to generate only the question-answering interactive text with a single question and answer method. It is necessary to generate the question-answering interactive text corresponding to at least two question-asking methods based on known information, so that the question-answering interactive text can cover as many actual usage scenarios as possible, allowing the model to handle more diverse problems.

[0069] Based on the above design, the live question-and-answer interactive model sample processing method provided in the embodiment of the present application can generate a question-and-answer interactive text that expresses the live commentary knowledge in at least two different questioning methods through the live commentary knowledge information, which not only expands the number of samples, but also increases the diversity of samples. It can solve the problems of scarcity of vertical field data and insufficient generalization ability of deep learning models, improve the generalization ability of the model, and thus realize the generation of the question-and-answer interactive text from a small amount of single vertical field information.

[0070] In a possible implementation, the live commentary knowledge information can be input into a trained public language model, such as a GPT (Generative Pre-training Transformer) model, to generate the question-answering interactive text. Figure 2 , step S200 may further include the following sub-steps.

[0071] Step S201, obtain a first prompt information template corresponding to at least two different questioning methods, the first prompt information template includes a sample question and answer field, a sample knowledge field and a knowledge field to be processed; the sample knowledge field includes sample knowledge content, and the sample question and answer field includes a question and answer content text that is consistent with the questioning method and related to the sample knowledge content.

[0072] Specifically, the first prompt information template is used to prompt the first common language model that the task to be performed is to generate question-answer interactive text.

[0073] The sample question and answer field is used to indicate the question type that needs to be generated for the question and answer interactive text. For example, the sample question and answer field may include the following content:

[0074] "Input: When Hero 1 is laning against an opponent, if the opponent is Hero 2, how should Hero 1 respond to win?

[0075] Output: Hero 1 should XXX"

[0076] The sample knowledge field is used to describe the basic knowledge (game character information, certain game-related strategies, etc.) required to generate the sample question and answer field. For example, the sample knowledge field may include the following content.

[0077] “The following information about the hero XXX in the XXX game is known:

[0078] Hero Category: XXX

[0079] Hero rating: XXX

[0080] Hero Skill: XXX

[0081] Gameplay guide: XXX"

[0082] The to-be-processed knowledge field is used to generate at least one question-and-answer interactive text.

[0083] The first prompt information template may further include an output format indication field, which is used to indicate the format in which the first common language model outputs the question-answer interaction text. For example, the output format indication field may include the following:

[0084] "Response format:

[0085] 1. Use json to reply content, [{"instruction": "input": "output":}]

[0086] "Instruction" is the prompt information, "input" is the question of type XXX, and the source of the question must be extracted based on known information, and "output" is the answer to the question of type XXX, which must be answered based on known information and cannot be fabricated."

[0087] Step S202: For each of the first prompt information templates corresponding to the questioning method, the live commentary knowledge information is inserted into the first prompt information template to obtain a first prompt information text.

[0088] In this embodiment, inputting the live commentary knowledge information into the first prompt information template can make the generated question-and-answer interactive text more consistent with the live commentary knowledge information, thereby improving the quality of the question-and-answer interactive text.

[0089] The live commentary knowledge information may include the following:

[0090] “Task: Rewrite known information into a question-and-answer format using anthropomorphic and colloquial language.

[0091] Background: You are a sentence rewriting master and a veteran player of the XXX game. Your job is to rewrite sentences.

[0092] Step S203: input the first prompt information text into a trained first common language model to obtain at least one question-answer interaction text generated by the first common language model with reference to the sample question-answer field and the sample knowledge field and related to the knowledge field to be processed.

[0093] In this embodiment, in order to avoid overfitting of the first common language model, it is not possible to generate only the question-answer interaction text with a single question and answer method. It is necessary to generate the question-answer interaction text corresponding to at least two question-asking methods based on known information. The question-answer interaction text covers as many actual usage scenarios as possible, so that the first common language model can handle a variety of problems.

[0094] The first common language model may be OpenAI's chat-GPT model, or may be another trained and shared large language model. By inputting the first prompt information text into the first common language model, the first common language model may be instructed to generate the question-and-answer interaction text.

[0095] In a possible implementation, the questioning method may include a judgment questioning method, a multiple-choice questioning method, an essay questioning method, and a reasoning questioning method.

[0096] It should be noted that the questioning method is not limited to the judgment question method, the multiple-choice question method, the essay question method and the reasoning question method, but may also include other questioning methods, and the generated question types are not limited to these four types.

[0097] Please refer to Figure 3 , step S200 may further include the following sub-steps.

[0098] Step S204: detecting whether the word count of the live commentary knowledge information is greater than a threshold.

[0099] Step S205: If the word count of the live commentary knowledge information is not greater than the threshold, the question-answering interactive text is generated in the form of true or false questions.

[0100] Step S206: If the word count of the live commentary knowledge information is greater than the threshold, the question-answering interactive text is generated by selecting the multiple-choice question format, the essay question format, and the reasoning question format.

[0101] Specifically, the threshold can be 20 words. The fewer words in the live commentary knowledge information, the less known information is obtained, and the more difficult it is to generate the interactive question and answer text. Therefore, when the live commentary knowledge information has fewer words, the true or false question format is selected to generate the interactive question and answer text; when the live commentary knowledge information has more than 20 words, the multiple-choice question format, the essay question format, and the reasoning question format can be selected to generate the interactive question and answer text.

[0102] In a possible implementation, in order to increase the number of samples and enrich the diversity of samples, it is necessary to rewrite the question-answer interaction text generated in step S203. Figure 4 After step S200, the live question-and-answer interactive model sample processing method provided by this application also includes the following steps.

[0103] Step S211, obtain a second prompt information template, the second prompt information template includes the knowledge field to be processed, the first rewriting task indication field and the first rewriting sample field; the first rewriting task indication field is used to instruct the second common language model to rewrite part of the knowledge information in the question text in the knowledge field to be processed to generate a new first enhanced question-answer interactive text; the first rewriting sample field includes at least one rewriting sample.

[0104] In this embodiment, the question text in the knowledge field to be processed can be the question text in the question-answer interaction text generated in step S203. By replacing and reorganizing the subject, action, and content of the question text, one or more new question texts can be obtained, thereby increasing the number of question texts.

[0105] The first rewritten sample field may include the following content:

[0106] "Instruction: Please enhance the following XXX questions

[0107] Input: (Question: Which lane is suitable for XXX hero to develop in? Answer: XXX hero is suitable for developing in XXX lane.)

[0108] Output: (Question: Which lane should XXX hero choose to develop? Answer: XXX hero should choose XXX lane to develop.)

[0109] #The above is a sample"

[0110] Step S212: insert the question-answer interaction text into the to-be-processed knowledge field of the second prompt information template to obtain a second prompt information text.

[0111] Step S213: Input the second prompt information text into the second common language model, obtain the first enhanced question-answer interaction text obtained by rewriting the question-answer interaction text in the knowledge field to be processed based on the task indicated by the first rewriting task prompt field by the second common language model and taking the first rewriting sample field as a reference.

[0112] During the rewriting process, even if only one word is replaced, the model can correctly predict the result and will not be confused by the fixed position of the text. At the same time, it allows the model to have a better understanding of the style and method of the answer, enabling it to handle more diverse problems and improve the model's generalization ability.

[0113] To enrich the diversity of the generated first enhanced Q&A interactive text, the Q&A interactive text generated in step S203 can be rewritten to address the diversity of binary descriptions. For example, answer texts for judgment questions are not limited to "yes / no" but can also include "true / false," "agree / disagree," "agree / disagree," "conform / non-conform," "appropriate / inappropriate," "accurate / inaccurate," and so on. This enriches the generated first enhanced Q&A interactive text and improves the understanding and application scope of the second common language model.

[0114] Furthermore, when rewriting the question-and-answer interactive text generated in step S203, it can also be adapted to accommodate the diverse nature of task instructions. For example, during the rewriting process, a task description such as "Play the role of a master of XXX game and complete the following questions" may be generated. By setting different roles and situations, the model can learn to rewrite in different roles and contexts.

[0115] Exemplarily, the second common language model may also be a GPT model.

[0116] After rewriting the question-and-answer interaction text and generating the first enhanced question-and-answer interaction text, in step S300, a live question-and-answer interaction model can be trained based on the question-and-answer interaction text and the first enhanced question-and-answer interaction text.

[0117] In this embodiment, the live question-and-answer interaction model is trained using the question-and-answer interaction text and the first enhanced question-and-answer interaction text, thereby expanding the amount of data available for training and improving the training effect.

[0118] In a possible implementation, the questioning method may include a judgment questioning method, a multiple-choice questioning method, an essay questioning method, and a reasoning questioning method.

[0119] Please refer to Figure 5 After step S200, the live question-and-answer interactive model sample processing method provided by this application also includes the following steps.

[0120] Step S221, obtain a third prompt information template, the third prompt information template includes the knowledge field to be processed, a second rewriting task indication field and a second rewriting sample field; the second rewriting task indication field is used to instruct the third common language model to swap the positions of part of the knowledge information in the question text and part of the knowledge information in the answer text in the knowledge field to be processed to generate a new second enhanced question-answer interaction text; the second rewriting sample field includes at least one rewriting sample.

[0121] Step S222: for the question-and-answer interactive text generated by the question-and-answer question method and the reasoning question question method, insert the question-and-answer interactive text into the to-be-processed knowledge field of the third prompt information template to obtain a third prompt information text.

[0122] Step S223: input the third prompt information text into the third common language model, obtain the task indicated by the second rewriting task prompt field of the third common language model, and rewrite the question and answer interaction text in the knowledge field to be processed with reference to the second rewriting sample field to obtain the second enhanced question and answer interaction text.

[0123] The third common language model can be a GPT model. The GPT model is a language model based on the transformer structure. The transformer structure is a generative model that predicts the next word based on the previous word. Although in the normal question-and-answer mode, it is possible to predict the correct answer based on the existing question, if a reverse question is asked based on the answer, the prediction accuracy of the model will drop significantly. Therefore, it is necessary to perform reverse generation based on the question-and-answer interactive text, that is, to use the answer text in the question-and-answer interactive text as the question text, and to regenerate the answer based on the original input information. For example, the question-and-answer interactive text "Is Aguduo a tank-type hero?" "Yes, Aguduo is a tank-type hero with high health, control effects and continuous output capabilities. He is very suitable for the front row to withstand damage to protect teammates" can be changed to "Which hero has high health, control effects and continuous output capabilities, and is suitable for protecting teammates?" "Aguduo". In this way, not only can the model's ability to reversely rewrite the problem be increased, but also the amount of data for training the model can be increased.

[0124] It should be noted that, in some examples, the first common language model, the second common language model, and the third common language model can be the same common language model, for example, they can all be GPT models. However, optionally, in order to avoid mutual interference of task contexts when the first common language model, the second common language model, and the third common language model process interactive tasks, the first common language model, the second common language model, and the third common language model can be different interactive threads in the same common language model.

[0125] In some other examples, the first common language model, the second common language model, and the third common language model may be different language models.

[0126] After the third common language model reversely rewrites the question-and-answer interaction text generated by the first common language model and generates the second enhanced question-and-answer interaction text, in step S300, the live question-and-answer interaction model can be trained based on the question-and-answer interaction text and the second enhanced question-and-answer interaction text for the question-and-answer interaction text generated by the question-and-answer question method and the reasoning question method.

[0127] In other implementations of this embodiment, the third common language model may also reversely rewrite the first enhanced question-answer interaction text generated by the second common language model to generate the second enhanced question-answer interaction text.

[0128] In step S300, for the first enhanced question-and-answer interactive text generated using the question-and-answer question method and the reasoning question question method, a live question-and-answer interactive model can be trained based on the question-and-answer interactive text, the first enhanced question-and-answer interactive text, and the second enhanced question-and-answer interactive text.

[0129] In one possible implementation, see Figure 6 After step S200, the live question-and-answer interactive model sample processing method provided by this application also includes the following steps.

[0130] Step S231: determine whether the question text corresponds to the questioning method; if not, regenerate the question text.

[0131] Step S232, determining whether the answer text corresponds to the question text, and if not, regenerating the answer text.

[0132] Step S233, determining whether the question text and the answer text correspond to the live commentary knowledge information; if not, regenerating the question text and the answer text.

[0133] While the Q&A interactive text generated and rewritten through steps S203, S213, and S223 increases the amount of data and enriches its diversity, errors may occur during its generation. Directly training all Q&A interactive text may negatively impact the model's learning performance. Therefore, it is necessary to inspect the generated Q&A interactive text to enhance its usability.

[0134] Specifically, step S231 checks whether the question text meets the question type requirements, step S232 checks whether the answer text meets the question type requirements, and step S233 checks whether the question text and answer text conform to the live commentary knowledge information. The specific implementation process varies for different question types. Therefore, before checking the question and answer interactive text, it is necessary to first determine the question type corresponding to the question and answer interactive text.

[0135] For question-and-answer interactive texts of the true / false type, the first step is to determine whether the question text meets the binary classification requirements. If so, the next step is to determine whether the answer text meets the binary classification options in the question. For example, if the generated answer is "yes / no", it will be judged as not meeting the requirements because the default answer should be "yes / no". If the answer text meets the binary classification options in the question, the next step is to determine whether the question text and the answer text correspond to the live commentary knowledge information and whether the answer text truly meets the requirements of the question text.

[0136] For question-and-answer interactive texts of the multiple-choice type, it is first necessary to determine whether the question text meets the requirements of the multiple-choice question sentence. If so, then continue to determine whether the answer text meets the ABCD options in the question. If so, then continue to determine whether the question text and the answer text correspond to the live commentary knowledge information, and whether the answer text truly meets the requirements of the question text.

[0137] For question-and-answer interactive texts of the question-and-answer type, it is first necessary to determine whether the question text meets the sentence structure requirements of the question-and-answer question. If so, then continue to determine whether the answer text meets the known information. If so, then continue to determine whether the question text and the answer text correspond to the live commentary knowledge information, and whether the answer text truly meets the requirements of the question text.

[0138] For question-and-answer interactive texts of the reasoning question type, it is first necessary to determine whether the question text meets the sentence structure requirements of the reasoning question. If so, then continue to determine whether the answer text meets the known information. If so, then continue to determine whether the question text and the answer text correspond to the live commentary knowledge information, and whether the answer text truly meets the requirements of the question text.

[0139] In the above design, by checking the generated and rewritten question-and-answer interactive texts, the data quality is greatly guaranteed, the input of erroneous data is avoided, and higher-quality data is provided for the training of the live question-and-answer interactive model, thereby improving the training effect and model stability.

[0140] In a possible implementation, the questioning method may include a judgment questioning method, a multiple-choice questioning method, an essay questioning method, and a reasoning questioning method.

[0141] In step S203, for the question-answer interactive text generated in the multiple-choice question format, the frequencies of occurrence of the options in the answer text are adjusted to be equal.

[0142] Specifically, after generating the question-and-answer interactive text in the form of multiple-choice questions, the ABCD options in the answer text can be adjusted according to the principle of average distribution so that the frequency of appearance of each option in the multiple generated answer texts is as equal as possible. In this way, the overfitting phenomenon of the common language model can be better avoided.

[0143] Please refer to Figure 7 , Figure 7Example This embodiment provides a live Q&A interactive model sample processing system, which includes a server 100 and a terminal 200. The server 100 and the terminal 200 can communicate with each other via a wired network or a wireless network. The server 100 can be a standalone electronic device or a cluster of multiple electronic devices. The terminal 200 can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices.

[0144] The live Q&A interactive model sample processing method provided in this embodiment can be applied to Figure 7 As shown in the server 100, the live question-and-answer interactive model sample processing method can be implemented through an application installed in the server 100.

[0145] Based on the same inventive concept, this embodiment further provides an electronic device 700, which can be as follows: Figure 7 The server 100 shown is shown in FIG. Figure 8 , Figure 8 Schematic block diagram of the electronic device 700. The electronic device 700 includes a live Q&A interactive model sample processing device 730, a computer-readable storage medium 720, and a processor 710.

[0146] The computer-readable storage medium 720 and the processor 710 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The live question-and-answer interactive model sample processing device 730 includes a plurality of software function modules that can be stored in the computer-readable storage medium 720 in the form of software or firmware or solidified in the operating system (OS) of the live question-and-answer interactive model sample processing device 730. The processor 710 is used to execute the executable modules stored in the computer-readable storage medium 720, such as the software function modules and computer programs included in the live question-and-answer interactive model sample processing device 730.

[0147] The computer-readable storage medium 720 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The computer-readable storage medium 720 is used to store a program, and the processor 710 executes the program after receiving an execution instruction.

[0148] The processor 710 may be an integrated circuit chip with signal processing capabilities. The processor 710 may be a general-purpose processor, including a central processing unit (CPU) or a network processor (NP). It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor 710 may be a microprocessor or any conventional processor.

[0149] Please refer to Figure 9 The embodiment of the present application also provides a live Q&A interactive model sample processing device 730. The live Q&A interactive model sample processing device 730 includes multiple functional modules that can be stored in a computer-readable storage medium 720 in the form of software. From a functional perspective, the live Q&A interactive model sample processing device 730 can include a receiving module 731, a generating module 732, and a training module 733. Among them:

[0150] The receiving module 731 may be used to obtain live commentary knowledge information.

[0151] In this embodiment, the receiving module 731 can be used to perform Figure 1 As shown in step S100, for a detailed description of the receiving module 731, reference may be made to the description of step S100.

[0152] The generation module 732 can be used to generate a question-and-answer interactive text based on the live commentary knowledge information, which expresses the live commentary knowledge in at least two different questioning methods, and the question-and-answer interactive text includes a question text and an answer text.

[0153] In this embodiment, the generating module 732 can be used to execute Figure 1 As shown in step S200, for a detailed description of the generating module 732, reference may be made to the description of step S200.

[0154] The training module 733 may be used to train a live Q&A interaction model based on the Q&A interaction text.

[0155] In this embodiment, the training module 733 can be used to perform Figure 1 As shown in step S300, for the detailed description of the training module 733, please refer to the description of step S300.

[0156] In summary, the embodiments of the present application provide a live question-and-answer interactive model sample processing method, device, and electronic device, which generates question-and-answer interactive texts with at least two different question-asking methods through live commentary knowledge information, increases the diversity of question-and-answer interactive texts, expands the amount of training data, and enhances the generalization ability of the model.

[0157] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

[0158] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.

Claims

1. A live Q&A interactive model sample processing method, characterized in that: The method comprises: Obtain live commentary knowledge and information; Based on the live commentary knowledge information, a question-and-answer interactive text is generated, which expresses the live commentary knowledge in at least two different questioning methods, wherein the question-and-answer interactive text includes a question text and an answer text; the questioning methods include a true-or-false questioning method, a multiple-choice questioning method, a question-and-answer questioning method, and a reasoning questioning method; Training a live Q&A interaction model based on the Q&A interaction text; The step of generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning modes includes: Detecting whether the word count of the live commentary knowledge information is greater than a threshold; If the word count of the live commentary knowledge information is not greater than the threshold, selecting the judgment question format to generate the question-answer interactive text; If the word count of the live commentary knowledge information is greater than the threshold, the question-and-answer interactive text is generated by selecting the multiple-choice question format, the essay-and-answer question format, and the reasoning question format.

2. The method according to claim 1, characterized in that The step of generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning modes includes: Obtaining first prompt information templates corresponding to at least two different questioning methods, the first prompt information templates including a sample question and answer field, a sample knowledge field, and a knowledge field to be processed; the sample knowledge field including sample knowledge content, and the sample question and answer field including question and answer content text that is consistent with the questioning method and related to the sample knowledge content; For each questioning method, insert the live commentary knowledge information into the first prompt information template corresponding to the first prompt information template to obtain a first prompt information text; The first prompt information text is input into a trained first common language model to obtain at least one question-and-answer interaction text generated by the first common language model with reference to the sample question-and-answer field and the sample knowledge field and related to the knowledge field to be processed.

3. The method according to claim 2, characterized in that After generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning modes, the method further includes: Obtain a second prompt information template, the second prompt information template including the knowledge to be processed field, a first rewriting task indication field, and a first rewriting sample field; the first rewriting task indication field is used to instruct the second common language model to rewrite part of the knowledge information in the question text in the knowledge to be processed field to generate a new first enhanced question-answer interaction text; the first rewriting sample field includes at least one rewriting sample; Inserting the question-and-answer interactive text into the to-be-processed knowledge field of the second prompt information template to obtain a second prompt information text; Inputting the second prompt information text into a second common language model, obtaining a first enhanced question-answer interaction text by rewriting the question-answer interaction text in the to-be-processed knowledge field based on the task indicated by the first rewriting task prompt field and taking the first rewriting sample field as a reference, the second common language model obtains; The step of training the live Q&A interaction model based on the Q&A interaction text includes: A live question-and-answer interaction model is trained based on the question-and-answer interaction text and the first enhanced question-and-answer interaction text.

4. The method according to claim 2, characterized in that After the step of generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning formats, the method further includes: Obtaining a third prompt information template, the third prompt information template including the knowledge to be processed field, a second rewriting task indication field, and a second rewriting sample field; the second rewriting task indication field is used to instruct the third common language model to swap the positions of part of the knowledge information in the question text with part of the knowledge information in the answer text in the knowledge to be processed field to generate a new second enhanced question-answer interaction text; the second rewriting sample field includes at least one rewriting sample; For the question-and-answer interactive text generated by the question-and-answer question format and the reasoning question question format, inserting the question-and-answer interactive text into the to-be-processed knowledge field of the third prompt information template to obtain a third prompt information text; Inputting the third prompt information text into a third common language model, obtaining a second enhanced question-answer interaction text by rewriting the question-answer interaction text in the to-be-processed knowledge field based on the task indicated by the second rewriting task prompt field and taking the second rewriting sample field as a reference, the third common language model; The step of training the live Q&A interaction model based on the Q&A interaction text includes: For the question-and-answer interactive text generated using the question-and-answer question-asking method and the reasoning question-asking method, a live question-and-answer interactive model is trained based on the question-and-answer interactive text and the second enhanced question-and-answer interactive text.

5. The method according to claim 1, wherein After the step of generating, based on the live broadcast commentary knowledge information, a question-and-answer interactive text expressing the live broadcast commentary knowledge in at least two different questioning formats, the method further includes: Determine whether the question text corresponds to the questioning method, and if not, regenerate the question text; Determine whether the answer text corresponds to the question text, and if not, regenerate the answer text; Determine whether the question text and the answer text correspond to the live commentary knowledge information; if not, regenerate the question text and the answer text.

6. The method according to claim 1, characterized in that The method further comprises: For the question-and-answer interactive text generated in the multiple-choice question format, the frequency of occurrence of each option in the answer text is adjusted to be equal.

7. A live Q&A interactive model sample processing device, characterized in that: include: Receiving module, used to obtain live commentary knowledge information; A generation module is configured to generate, based on the live commentary knowledge information, a question-and-answer interactive text expressing the live commentary knowledge in at least two different questioning modes, wherein the question-and-answer interactive text includes a question text and an answer text; the questioning modes include a true-or-false questioning mode, a multiple-choice questioning mode, a question-and-answer questioning mode, and a reasoning questioning mode; A training module, used for training a live Q&A interaction model based on the Q&A interaction text; The generating module is further configured to detect whether the number of words in the live commentary knowledge information is greater than a threshold; If the word count of the live commentary knowledge information is not greater than the threshold, selecting the judgment question format to generate the question-answer interactive text; If the word count of the live commentary knowledge information is greater than the threshold, the question-and-answer interactive text is generated by selecting the multiple-choice question format, the essay-and-answer question format, and the reasoning question format.

8. An electronic device, characterized in that: include: a memory for storing one or more programs; The processor implements the method according to any one of claims 1 to 6 when the one or more programs are executed by the processor.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Question and answer model training method and related device

    CN115510215A

  • Method for training question generation model, question generation method, and related device

    WO2021217935A1