Generation method and device of commentary text, storage medium and electronic equipment
By acquiring target scene events and using event triggering logic to obtain target prompt text from the prompt text set, and combining real-person narration text and reference text to train the model, the problem of low accuracy of narration text is solved, achieving more accurate narration text generation and improving the audience experience.
Patent Information
- Application Number
- CN202410458469.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-10-28
AI Technical Summary
In existing technologies, the accuracy of generated commentary texts is low because the differences in commentary content and style under different types of competition scenarios are not taken into account.
By acquiring target scene events, the target prompt text is obtained from the prompt text set using event triggering logic. The real person's narration text and reference text are then input into the target narration text generation model to train the model to learn the real person's narration style and professional knowledge, thereby generating accurate narration text.
Improving the accuracy of commentary texts makes the generated texts more consistent with the style and professional knowledge of real commentators, thus enhancing the viewing experience for the audience.
Smart Images

Figure CN120849604A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for generating explanatory text, a storage medium, and an electronic device. Background Technology
[0002] In many competitive sports, to help viewers quickly understand the professional performances during the match and enhance their viewing experience, event organizers often arrange for live commentary. For example, in esports competitions, professional commentators familiar with the rules are typically assigned to provide simultaneous commentary. However, the shortage of professional commentators has led to increasingly high costs for game commentary, especially in large-scale game competitions where a team of multiple commentators is needed to complete the task, further exacerbating the problem of excessively high commentary costs.
[0003] To address the aforementioned issues, current technologies employ a method where different events occurring in the competition scenario are manually labeled. The labeled events, along with example explanatory sentences for reference, are then input into a pre-trained large-scale language model to generate a large amount of training data. This training data is then used to train an existing open-source large-scale language model, resulting in a target explanatory model that automatically generates explanatory content.
[0004] However, because the method of generating training data using large-scale language models combined with example sentences does not consider the differences in commentary content and style across different types of competition scenarios, the target commentary model trained on the existing model using this data will be unable to distinguish between various professional knowledge in different competition scenarios. In other words, the commentary text generation method provided by the related technology suffers from low accuracy.
[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0006] This application provides a method and apparatus for generating explanatory text, a storage medium, and an electronic device to at least solve the technical problem of low accuracy in the process of generating explanatory text.
[0007] According to one aspect of the embodiments of this application, a method for generating explanatory text is provided, comprising: acquiring a target scene event, wherein the target scene event includes events represented by screen content generated during the operation of a target application; acquiring a target prompt text corresponding to the target scene event from a prompt text set based on event triggering logic, wherein the prompt text set includes prompt texts corresponding to different types of scene events, the target prompt text is a prompt text determined based on a set of real-person narration texts and a set of reference texts, the set of real-person narration texts being texts related to the target scene event extracted from the set of real-person narration texts, the set of reference texts including texts related to the target scene event retrieved from the set of reference texts, the set of reference texts including professional descriptive texts describing different types of scene events from different dimensions; inputting the target prompt text and the target scene event description text into a target explanatory text generation model to obtain the target explanatory text corresponding to the target scene event, wherein the target explanatory text generation model is trained using a set of standard explanatory texts, a prompt text set, and a scene event description text set output by a language processing model, the scene event description text set including the target scene event description text.
[0008] Optionally, the above-mentioned method of obtaining the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic includes: determining the target state information corresponding to the target scene event based on the scene screen information corresponding to the target scene event; and obtaining the target prompt text corresponding to the target scene event from the prompt text set when the target state information meets the event triggering conditions.
[0009] Optionally, determining the target state information corresponding to the target scene event based on the scene screen information corresponding to the target scene event includes at least one of the following: determining the target action information corresponding to the target scene event when the target scene event indicates that the target object in the first scene screen of the target application is performing a target operation; determining the scene state information corresponding to the target scene event when the target scene event indicates that the second scene screen of the target application is in a combat state; determining the duration of the combat state when the target scene event indicates that a set of scene screens of the target application is in a combat state, wherein the target state information includes target action information, scene state information, and duration of the combat state.
[0010] Optionally, before obtaining the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the above method further includes: determining a set of real-person narration texts from a set of real-person narration texts based on a set of prompt questions, wherein the set of prompt questions is used to guide the language processing model to learn the deeper meaning of the target scene event; determining a set of reference texts from a set of reference texts based on a set of keywords; and concatenating the set of real-person narration texts and the set of reference texts according to a preset format to obtain the target prompt text.
[0011] Optionally, the above-mentioned method of determining a set of real-person narration texts from a set of prompt questions includes: generating a set of prompt questions based on the target scene event description text; and sampling a set of real-person narration texts corresponding to the set of prompt questions from the set of real-person narration texts.
[0012] Optionally, the above method of determining a set of reference texts from a set of reference texts based on a set of keywords includes: learning a set of keywords by using a language processing model to learn the target event scene description text; and selecting a set of reference texts from the set of reference texts based on the semantic similarity between each keyword in the set of keywords and the reference texts in the set of reference texts.
[0013] Optionally, before obtaining the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the above method further includes: inputting the target prompt text and the target scene event description text into a language processing model to obtain an initial explanatory text set corresponding to the target scene event; and performing data cleaning on the initial explanatory text set to obtain a set of standard explanatory texts.
[0014] Optionally, the above method further includes: training an initial explanatory text generation model using N sets of prompt texts, N sets of scene event description texts, and question-and-answer texts corresponding to N different types of scene events, until the target loss function corresponding to the initial explanatory text generation model satisfies a preset convergence condition, ending the training of the initial explanatory text generation model, and determining the initial explanatory text generation model at the end of training as the target explanatory text generation model, where N is a positive integer greater than or equal to 2; wherein the prompt text set includes N prompt texts, the scene event description text set includes N scene event description texts, and each text in the question-and-answer text set includes a preset question and a question. The corresponding answer is that the value of the target loss function is determined based on the values of the first loss function and the second loss function. The value of the first loss function represents the text similarity between a set of predicted explanation texts determined by the initial explanation text generation model based on the first part of the scene event description text and the first part of the prompt text, and a set of standard explanation texts. The value of the second loss function represents the loss value between the predicted type determined by the initial explanation text generation model based on the second part of the scene event description text and the second part of the prompt text, and the label type indicated by the answer to the question. The N scene event description texts include the first part of the scene event description text and the second part of the scene event description text.
[0015] Optionally, the above-mentioned training of the initial explanatory text generation model using N prompt texts, N scene event description texts, and question-and-answer text sets corresponding to N different types of scene events includes: training the initial explanatory text generation model in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N: selecting the i-th batch of scene event description texts from the N scene event description texts, and selecting the i-th batch of prompt texts from the N prompt texts; inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into the language processing model to obtain the first subgroup of standard explanatory texts, where the i-th batch of scene event description texts includes the first group of scene event description texts and the second group of scene event description texts; inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into the (i-1)-th round of training... The explanatory text generation model is used to obtain the i-th batch of predicted explanatory texts and the i-th batch of predicted types. The i-th batch of predicted explanatory texts is obtained by predicting the first set of scene description texts using the explanatory text generation model trained in the (i-1)th round, and the i-th batch of predicted types is obtained by predicting the second set of scene description texts using the explanatory text generation model trained in the (i-1)th round. Based on the i-th batch of predicted explanatory texts, the i-th batch of predicted types, the first subgroup of standard explanatory texts, and the i-th group of label types indicated by the answer to the question, the value of the target loss function for the i-th round of training is determined. If the value of the target loss function for the i-th round of training does not meet the target convergence condition, the parameters in the explanatory text generation model trained in the (i-1)th round are adjusted to obtain the explanatory text generation model trained in the i-th round.
[0016] Optionally, determining the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question includes: determining the value of the first loss function for the i-th round of training by calculating the text similarity between the i-th batch of predicted explanatory text and the first subgroup of standard explanatory text; determining the value of the second loss function for the i-th round of training based on the i-th batch of predicted types and the i-th group of label types; and determining the value of the target loss function for the i-th round of training based on the values of the first loss function and the second loss function for the i-th round of training.
[0017] According to another aspect of the embodiments of this application, a training method for an explanatory text generation model is also provided, comprising: training an initial explanatory text generation model in the i-th round through the following steps, wherein i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2: selecting the i-th batch of scene event description texts from N scene event description texts, and selecting the i-th batch of prompt texts from N prompt texts; obtaining a first subgroup of standard explanatory texts by inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into a language processing model, wherein the i-th batch of scene event description texts includes a first group of scene event description texts and a second group of scene event description texts; inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into the explanatory text generation model obtained in the (i-1)-th round of training to obtain the i-th batch of predicted explanatory texts and the i-th batch of predicted classes. The model is defined as follows: the i-th batch of predicted explanatory text is the text predicted by the explanatory text generation model trained in the (i-1)-th round to the first group of scene description texts; the i-th batch of predicted types is the predicted type predicted by the explanatory text generation model trained in the (i-1)-th round to the second group of scene description texts; based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set, the value of the target loss function for the i-th round of training is determined, where each text in the question-and-answer text set includes a preset question and the answer to the question; if the value of the target loss function for the i-th round of training does not meet the target convergence condition, the parameters in the explanatory text generation model trained in the (i-1)-th round are adjusted to obtain the explanatory text generation model trained in the i-th round.
[0018] Optionally, determining the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question includes: determining the value of the first loss function for the i-th round of training by calculating the text similarity between the i-th batch of predicted explanatory text and the first subgroup of standard explanatory text; determining the value of the second loss function for the i-th round of training based on the i-th batch of predicted types and the i-th group of label types; and determining the value of the target loss function for the i-th round of training based on the values of the first loss function and the second loss function for the i-th round of training.
[0019] According to another aspect of the embodiments of this application, an explanatory text generation apparatus is also provided, comprising: a first acquisition unit, configured to acquire target scene events, wherein the target scene events include events represented by screen content generated during the operation of a target application; a second acquisition unit, configured to acquire target prompt text corresponding to the target scene events from a set of prompt texts based on event triggering logic, wherein the set of prompt texts includes prompt texts corresponding to different types of scene events, the target prompt text is a prompt text determined based on a set of real-person explanatory texts and a set of reference texts, the set of real-person explanatory texts being texts related to the target scene events extracted from the set of real-person explanatory texts, the set of reference texts including texts related to the target scene events retrieved from the set of reference texts, the set of reference texts including professional descriptive texts describing different types of scene events from different dimensions; and a first processing unit, configured to input the target prompt text and the target scene event description text into a target explanatory text generation model to obtain target explanatory text corresponding to the target scene events, wherein the target explanatory text generation model is trained using a set of standard explanatory texts, a set of prompt texts, and a set of scene event description texts output by a language processing model, the set of scene event description texts including the target scene event description text.
[0020] According to another aspect of the embodiments of this application, a training apparatus for an explanatory text life model is also provided, comprising: a second processing unit, configured to perform an i-th round of training on an initial explanatory text generation model through the following steps, wherein i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2: selecting an i-th batch of scene event description texts from N scene event description texts and selecting an i-th batch of prompt texts from N prompt texts; inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into a language processing model to obtain a first subgroup of standard explanatory texts, wherein the i-th batch of scene event description texts includes a first group of scene event description texts and a second group of scene event description texts; inputting the i-th batch of scene event description texts and the i-th batch of prompt texts into the explanatory text generation model obtained from the (i-1)-th round of training to generate an i-th batch of predicted explanatory texts and an i-th batch of predicted explanatory texts. The batch prediction types are defined as follows: the i-th batch of predicted explanatory text is the text predicted by the explanatory text generation model trained in the (i-1)-th round to the first group of scene description texts; the i-th batch of predicted types is the prediction type predicted by the explanatory text generation model trained in the (i-1)-th round to the second group of scene description texts. Based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to questions in the question-and-answer text set, the value of the target loss function for the i-th round of training is determined. Each text in the question-and-answer text set includes a preset question and its corresponding answer. If the value of the target loss function for the i-th round of training does not meet the target loss condition, the parameters in the explanatory text generation model trained in the (i-1)-th round are adjusted to obtain the explanatory text generation model trained in the i-th round.
[0021] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the above-described method for generating explanatory text or to execute the training method for the above-described explanatory text generation model when it is run.
[0022] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0023] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for generating explanatory text or to execute the training method of the above-mentioned explanatory text generation model through the computer program.
[0024] Through the embodiments provided in this application, for a target scene event, target prompt text containing live commentary and reference text is obtained. This target prompt text and the target scene event description text are then input into a target commentary text generation model. This allows the model to learn the live commentary style used to describe the target scene event and the professional knowledge relevant to that type of scene event, thereby outputting more professional commentary text that conforms to the live commentary style. In other words, by integrating live commentary text and text content related to the target scene event into the target commentary text generation model, the model outputs target commentary text that accurately describes the target scene event, achieving the technical effect of improving the accuracy of the commentary text output by the model. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0026] Figure 1 This is a schematic diagram illustrating an application scenario of an optional method for generating explanatory text according to an embodiment of this application;
[0027] Figure 2 This is a flowchart of an optional method for generating explanatory text according to an embodiment of this application;
[0028] Figure 3 This is a flowchart of an optional training method for an explanatory text generation model according to an embodiment of this application;
[0029] Figure 4 This is an overall schematic diagram of an optional method for generating explanatory text according to an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of an optional different type of task according to an embodiment of this application;
[0031] Figure 6 This is a diagram illustrating the process of dividing the crawled data.
[0032] Figure 7 This is a schematic diagram of an optional QA dataset according to an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of an optional retrieval dataset according to an embodiment of this application;
[0034] Figure 9 This is a schematic diagram of an optional text dataset according to an embodiment of this application;
[0035] Figure 10This is a schematic diagram of an optional ASR dataset according to an embodiment of this application;
[0036] Figure 11 This is a schematic diagram of an optional few-shot dataset according to an embodiment of this application;
[0037] Figure 12 This is a schematic diagram comparing the effects of three models according to embodiments of this application;
[0038] Figure 13 This is a schematic diagram illustrating an optional method for training an explanatory text generation model according to an embodiment of this application;
[0039] Figure 14 This is a schematic diagram of an optional explanatory text generation device according to an embodiment of this application;
[0040] Figure 15 This is a schematic diagram of the structure of a training device for an optional explanatory text generation model according to an embodiment of this application;
[0041] Figure 16 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0042] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0043] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0044] The technical solutions in this application will comply with legal regulations during implementation. When performing operations according to the technical solutions in the embodiments, the data used will not involve user privacy, ensuring that the operation process is compliant and legal while guaranteeing data security.
[0045] Definitions:
[0046] FPS games: First-Ferson Shooter, is a general term for shooting video games played from the player's first-person perspective, and usually require the use of firearms or other weapons to fight;
[0047] Large models: Large models refer to machine learning models with a large number of parameters and computational resources. These models typically require a large amount of data and computing power during training and have millions to billions of parameters;
[0048] Prompt: This refers to processing the input text information according to a specific template, refactoring the task into a form that can better utilize the pre-trained language model.
[0049] SFT (Supervised Fine-Tuning): Supervised fine-tuning of the generative model GPT.
[0050] According to one aspect of the embodiments of this application, a method for generating explanatory text is provided. As an optional implementation, the above-described method for generating explanatory text can be applied, but is not limited to, to applications such as... Figure 1 The application scenarios shown are as follows. In, for example... Figure 1 In the application scenario shown, terminal device 102 can communicate with server 106 via network 104, but is not limited to this. Server 106 can perform operations on database 108, such as write or read data operations. Terminal device 102 may include, but is not limited to, a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen may be used to display target explanatory text and target scene events on terminal device 102. The processor may be used to respond to the human-computer interaction operations, execute corresponding operations, or generate corresponding instructions and send the generated instructions to server 106. The memory is used to store relevant processing data, such as a set of prompt texts, a set of reference texts, and target scene event description text.
[0051] As an optional approach, the following steps in the method for generating narration text can be executed on server 106: Step S102, obtaining target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application; Step S104, based on event triggering logic, obtaining target prompt text corresponding to the target scene events from a set of prompt texts, wherein the set of prompt texts includes prompt texts corresponding to different types of scene events, and the target prompt text is determined based on a set of live-action narration texts and a set of reference texts, wherein the set of live-action narration texts is extracted from the set of live-action narration texts and reference texts. The text associated with the target scene event includes a set of reference texts retrieved from the reference text set that are associated with the target scene event. The reference text set includes professional descriptive texts that describe different types of scene events from different dimensions. Step S106: Input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts, a set of prompt texts, and a set of scene event description texts output by the language processing model. The scene event description text set includes the target scene event description text.
[0052] By employing the above method and through the embodiments provided in this application, for a target scene event, target prompt text containing live commentary and reference text is obtained. This target prompt text and the target scene event description text are then input into a target commentary text generation model. This allows the target commentary text generation model to learn the live commentary style used to describe the target scene event and the professional knowledge of this type of scene event, thereby outputting more professional commentary text that conforms to the live commentary style. In other words, by integrating live commentary text and text content related to the target scene event into the target commentary text generation model, the model outputs target commentary text that accurately describes the target scene event, achieving the technical effect of improving the accuracy of the commentary text output by the model.
[0053] To address the issue of low accuracy in the generation of explanatory texts, this application proposes a method for generating explanatory texts. Figure 2 This is a flowchart of a method for generating explanatory text according to an embodiment of this application, the process including the following steps:
[0054] Step S202: Obtain target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application;
[0055] Step S204: Based on the event triggering logic, obtain the target prompt text corresponding to the target scene event from the prompt text set. The prompt text set includes prompt texts corresponding to different types of scene events. The target prompt text is a prompt text determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts that describe different types of scene events from different dimensions.
[0056] Step S206: Input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts, prompt texts, and scene event description texts output by the language processing model. The scene event description texts include the target scene event description text.
[0057] The technical solutions in this application embodiment can be applied, but are not limited to, to commentary scenarios in large-scale multiplayer online games. For example, in FPS games where the player's first-person perspective is the primary viewpoint, on-site commentary can help the audience better understand the game rules and improve the viewing experience.
[0058] To facilitate understanding, the following explanations will use commentary from FPS games as examples to illustrate the method for generating the above commentary text.
[0059] In this embodiment, a large number of professional articles related to game A in FPS games and video commentary sub-screens of game A professional league are first crawled from various communication platforms. Then, high-quality real-person commentary corpus datasets, high-quality question-and-answer datasets, and high-quality retrieval knowledge bases are constructed through data cleaning, fine-tuning and other methods.
[0060] Using the high-quality real-person narration corpus dataset, high-quality question-answer dataset, and high-quality retrieval knowledge base constructed in the above manner, the narration text generation model is trained, enabling the narration text generation model to learn the real-person narration style and professional knowledge of the target scene event related to the target scene event, thereby outputting target narration text with high accuracy.
[0061] Let's combine the following... Figure 4 The overall schematic diagram shown provides a simple description of the method for generating the above explanatory text.
[0062] S41, based on event triggering logic, retrieves target scene events from the event pool;
[0063] In the AI narration process, different types of scene events are set with certain triggering logic. When the triggering conditions of a specific type of scene event are met, the system will retrieve the target scene event from the event pool.
[0064] Among them, the event triggering logic may include, but is not limited to: (1) triggering the corresponding scene event when the target operation performed by the target object in the scene event meets the preset triggering conditions; (2) triggering the corresponding scene event when the scene screen indicated by the scene event is in a specific scene state; (3) triggering the corresponding scene event when the duration of the specific scene state in the scene screen indicated by the scene event is longer than the preset duration.
[0065] S42, in response to the trigger indication of the target scene event, retrieve the target prompt text corresponding to the event type of the target scene event from the commentary library;
[0066] The target prompt text can be, but is not limited to, understood as Figure 5 The specific Prompt template shown contains part of the live commentary text corresponding to the event type of the target scene event, as well as professional descriptive text for describing the target scene event. The following will describe in detail how to construct the target prompt text with specific examples.
[0067] When the target scene event is triggered, a specific feature template (which can also be understood as the target scene event description text) and a specific prompt template (which can also be understood as the target prompt text) that have been pre-debugged will be extracted from the underlying features of the commentary library.
[0068] S43, input the target prompt text and the target scene event description text into the base model to obtain the initial explanation text.
[0069] in, Figure 4 The base model shown can be understood, but is not limited to, as a target explanatory text generation model.
[0070] S44. By selecting events, the optimal explanatory text (which can also be understood as the optimal explanatory language) corresponding to the target scene event is determined.
[0071] The reason for executing step S44 is that, in addition to the analysis-type events generated by the large model, the event pool also contains real-time events that occur during the explanation process. Therefore, after the target explanation text generation model outputs the initial explanation text corresponding to the target scene event, it is still necessary to select events to output the optimal explanation text corresponding to the current target scene event.
[0072] For specific examples of analytical events, please refer to [link / reference]. Figure 5It mainly includes dual commentary, entry analysis, and interpretation of team operations.
[0073] As can be seen from the descriptions in the above embodiments, the data sources in this application embodiment are of two types: the first type is articles related to game A crawled from the Internet, and the second type is ASR (video subtitle) data of game A professional league (PEL) event videos.
[0074] The first category contains at least 3200 articles, and the second category contains at least 1100 ASR data sets. Based on these two data sources, the data is divided into the following 5 datasets. For details on the classification method, please refer to [link / reference needed]. Figure 6 .
[0075] (I) QA Dataset
[0076] In this application embodiment, but not limited to, using an existing language processing model (e.g., a model trained based on AIGC technology, referred to as an AIGC model) in a Self-QA manner, one can read the crawled first-type articles, and ask and answer questions from the articles, providing multiple-choice questions and corresponding answers, or providing open-ended questions and corresponding answers, etc.
[0077] AIGC (Artificial Intelligence Generated Content) refers to generative artificial intelligence, which is a technology based on artificial intelligence techniques such as generative adversarial networks and large-scale pre-trained models. It generates relevant content by learning from and recognizing existing data and using appropriate generalization capabilities.
[0078] The core idea of AIGC technology is to use artificial intelligence algorithms to generate content with a certain degree of creativity and quality. Through training models and learning from a large amount of data, AIGC can generate relevant content based on input conditions or guidance. For example, by inputting keywords, descriptions, or samples, AIGC can generate articles, images, audio, etc. that match them.
[0079] For ease of description and understanding, the AIGC language processing model is used as an example in the embodiments of this application to explain the above-mentioned method for generating explanatory text.
[0080] In this embodiment, the AIGC model can be, but is not limited to, a large-scale multimodal model capable of accepting image and text inputs and producing outputs in text form. The AIGC model is still an autoregressive word prediction task in terms of output tasks, which indicates that it still mainly processes text information.
[0081] Compared to traditional models, the AIGC model demonstrates enhanced writing capabilities, processing texts exceeding 25,000 words, and exhibits greater creativity and the ability to handle finer-grained instructions. Despite its design deviating from expectations, the AIGC model remains one of the largest natural language processing models currently available.
[0082] Self-QA is a framework for generating SFT data from unsupervised knowledge. Inspired by human self-questioning learning methods, Self-QA replaces manually written annotations used in other self-aligned models with a large amount of unsupervised knowledge. This alleviates the difficulty for language models to generate instruction data according to specific requirements, reduces reliance on human annotators, and can generate diverse, accurate, and domain-specific instruction data. For specific QA guidelines, please refer to [link / reference]. Figure 7 As shown.
[0083] It can be seen intuitively that the QA dataset (which can also be understood as a collection of question and answer texts) includes question descriptions in a pre-formatted format, as well as candidate answers and correct answers for multiple-choice questions.
[0084] (II) Retrieving Datasets
[0085] The retrieval dataset, which can also be understood as a set of reference texts, is used to retrieve proper nouns from the input feature templates (which can also be understood as scene event description texts) when constructing training data for a specific task (various different types of scene events) through the AIGC model, in order to enhance the AIGC model's ability to understand games.
[0086] In this embodiment of the application, the retrieval dataset is used only when constructing the training data; it is not needed when performing SFT (supervised training) using the pedestal model. The retrieval dataset is extracted from articles related to game A using the AIGC model; a detailed prompt can be found here. Figure 8 As shown.
[0087] (III) Text Datasets
[0088] The text dataset consists of high-quality articles refined from a large number of articles, used for pre-training of the base model. The Prompts selected by the AIGC model include... Figure 9 As shown.
[0089] (iv) ASR Dataset
[0090] The ASR dataset is a text dataset extracted from original ASR (video subtitles) using the AIGC model, after performing operations such as grammatical correction, sentence segmentation, and sentence merging. This dataset is used for pre-training the base model. The Prompt for cleaning the data using the AIGC model is as follows: Figure 10 As shown.
[0091] (V) few-shot dataset
[0092] The few-shot dataset, also known as a collection of real-person narration texts, is a dataset of discourse related to specific categories extracted from the ASR dataset by the AIGC model. It provides real-person narration discourse for the AIGC model to respond to specific tasks (different types of scene events) when constructing training data for the AIGC model, thereby enabling the AIGC model to learn the style of real-person narration. The corresponding extraction, such as the Prompt, is... Figure 11 As shown.
[0093] It's important to note that many current works opt for fine-tuning on a strong base model, often with good results, but this relies on the base model's strong performance on downstream tasks. However, when fine-tuning a domain-specific LLM, the knowledge within the pre-trained model becomes crucial. Since most pre-trained models learn on general training corpora, they lack a good understanding of concepts and terminology specific to certain domains, such as gaming. Therefore, we typically need to incorporate domain-specific data into the training corpus to help the model achieve better results within the designated domain.
[0094] In the application embodiment, the aforementioned text dataset and ASR dataset were used as the training dataset for pre-training. The pre-training approach is simple: input a set of text and have the model perform a Next Token Prediction task to enhance the original model's ability to learn domain-specific knowledge. Regarding model selection, traditional language processing models were prioritized, and the model pre-trained using the ASR text dataset was selected as the pre-trained base model.
[0095] Clearly, the above pre-training method is unsupervised training, which means that by using text datasets and ASR data, the traditional language processing model is trained in an unsupervised manner, so that the traditional language processing model can initially learn the text description content of the game domain to which game A belongs and the style of real-person narration, avoiding the need for manual annotation of sample data and improving the training efficiency of the model.
[0096] Traditional language processing models have significant advantages in basic Chinese language capabilities and contextual understanding. Experiments have shown that traditional language processing models outperform some other models. Since the training samples only contain game-specific text related to FPS games and not general text, the LoRa method can be used for pre-training to avoid losing the model's fundamental capabilities.
[0097] To compare the differences between the original model and the base model in understanding game domain knowledge, two types of evaluation sets were constructed in this embodiment: a multiple-choice dataset and a question-and-answer dataset. These datasets were derived from the aforementioned QA dataset, and 10% of the samples were randomly sampled from the QA dataset to evaluate the model's capabilities.
[0098] (1) Evaluation method for multiple-choice questions: The traditional language processing model, the base model after pre-training, and the language processing model in the technical solution of this application (e.g., AIGC model) are compared in turn. The same set of multiple-choice questions is input into the above three models respectively, and the accuracy of the output results and the standard answer is calculated. Figure 12 (a) records the scores of each model on the multiple-choice dataset;
[0099] (2) Question and answer evaluation method: Input the question and answer evaluation set into the three types of models mentioned above to obtain the answer text. Then, input the answer text and the standard answer into the AIGC model at the same time, and let the AIGC model judge whether the answer and the standard answer are consistent, and calculate the consistency rate of all questions and answers. Figure 12 (b) records the scores of each model on the question-and-answer dataset.
[0100] Based on the evaluation results of the two evaluation methods mentioned above, the pre-trained model shows a significant improvement over the original model in both multiple-choice and open-ended questions, and even outperforms the AIGC model. This indicates that the pre-trained base model has a strong ability to understand the game domain expertise of FPS games.
[0101] Using the above method, for a target scene event, target prompt text containing both live narration and reference text is obtained. This target prompt text and the target scene event description text are then input into a target narration text generation model. This allows the model to learn the live narration style used to describe the target scene event and the professional knowledge relevant to this type of scene event, thereby outputting more professional narration text that aligns with the live narration style. In other words, by integrating live narration text and text content related to the target scene event into the target narration text generation model, the model outputs target narration text that accurately describes the target scene event, achieving the technical effect of improving the accuracy of the model's output narration text.
[0102] As an optional example, the above-mentioned event-triggered logic retrieves the target prompt text corresponding to the target scene event from the prompt text set, including:
[0103] Based on the scene image information corresponding to the target scene event, determine the target state information corresponding to the target scene event;
[0104] If the target state information meets the event triggering conditions, retrieve the target prompt text corresponding to the target scene event from the prompt text set.
[0105] Specifically, based on the scene screen information corresponding to the target scene event, determine the action being performed by the controlled object in the current screen or the state of the event being performed by the controlled object. Then, according to the pre-set game strategy, determine whether the action or event state performed by the controlled object meets the pre-set event triggering conditions.
[0106] As an optional implementation, the above method of determining the target state information corresponding to the target scene event based on the scene screen information corresponding to the target scene event includes at least one of the following:
[0107] When the target scene event indicates that the target object in the first scene of the target application is performing a target operation, the target action information corresponding to the target scene event is determined.
[0108] When the target scene event indicates that the second scene screen of the target application is in a combat state, determine the scene state information corresponding to the target scene event;
[0109] When the target scene event indicates that a set of scene screens of the target application is in a continuous combat state, the duration of the combat state is determined. The target state information includes target action information, scene state information, and the duration of the combat state.
[0110] For example, suppose object 1 in the first scene is performing a shooting operation. If the action information of object 1 is determined to be shooting, then it is determined whether the shooting operation meets the preset event triggering conditions. If it does, then it is determined that the event triggering conditions are met, and the prompt text 1 corresponding to the first scene is obtained.
[0111] Assuming the two teams in the second scene are in battle, the scene state information corresponding to the target scene event is determined to be battle. By judging whether the battle state meets the preset event triggering conditions, if it does, it is determined that the event triggering conditions are met, and the prompt text 2 corresponding to the second scene is obtained.
[0112] Assuming that the two teams in the third scene have been fighting for 15 seconds, we determine whether the duration of the battle (15 seconds) exceeds a preset duration threshold. If it does, we determine that the event triggering condition is met and obtain the prompt text 3 corresponding to the third scene.
[0113] Therefore, the event triggering logic can be, but is not limited to: (1) triggering the corresponding scene event when the target operation performed by the target object in the scene event meets the preset triggering conditions; (2) triggering the corresponding scene event when the scene screen indicated by the scene event is in a specific scene state; (3) triggering the corresponding scene event when the duration of the specific scene state in the scene screen indicated by the scene event is longer than the preset duration.
[0114] Using the above method, the corresponding scene event can be triggered based on the scene state information corresponding to the scene event, and the prompt text corresponding to the triggered event can be accurately obtained. Then, by using the real-person explanation text and professional description text related to the triggered event, the target explanation text generation model can accurately output the explanation text corresponding to the triggered event.
[0115] As an optional example, before retrieving the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the above method also includes:
[0116] Based on a set of prompting questions, a set of real-person narration texts is determined from the set of real-person narration texts. The set of prompting questions is used to guide the language processing model to learn the deeper meaning of the target scene events.
[0117] Based on a set of keywords, identify a set of reference texts from the reference text collection;
[0118] According to the preset format, a set of real-person narration text and a set of reference text are spliced together to obtain the target prompt text.
[0119] like Figure 13 As shown, before inputting the prompt text and feature template (scene event description text) into the pre-trained base model, it is necessary to construct the prompt text corresponding to each scene event. The traditional method is to directly generate the prompt text by learning from crawled real-person narration articles and / or video narration subtitles. However, due to the large number of crawled real-person narration articles and video narration subtitles, it is difficult to distinguish the content or information related to different types of scene events. Therefore, the constructed prompt text cannot accurately describe the scene events.
[0120] To address the aforementioned problems, in this embodiment of the application, the method is as follows: Figure 13 The COT thinking chain, Random sampling, and RAG retrieval enhancement processes shown are used to construct target prompt text.
[0121] As an optional implementation, the above method determines a set of live commentary texts from a collection of live commentary texts based on a set of prompt questions, including:
[0122] Generate a set of prompt questions based on the target scene event description text;
[0123] Based on a set of prompt questions, sample a set of live commentary texts corresponding to the set of prompt questions from a collection of live commentary texts.
[0124] As another optional implementation, the above method determines a set of reference texts from a set of reference texts based on a set of keywords, including:
[0125] By using a language processing model to learn from the text describing the target event scenario, a set of keywords is obtained;
[0126] Based on the semantic similarity between each keyword in a set of keywords and the reference texts in the reference text set, a set of reference texts is selected from the reference text set.
[0127] Specifically, by learning the feature template (the text describing the target scene event), a set of prompt questions is generated. Following the prompts in this set of prompt texts, the language processing model (e.g., the AIGC model) is guided to sample real-person narration related to the description of the target scene event from the few-shot dataset (a collection of real-person narration texts). Then, by using the language processing model to learn a set of keywords in the text describing the target scene event, and then by calculating semantic similarity, a set of reference texts is retrieved from the retrieval dataset (a collection of reference texts).
[0128] According to a preset format, a set of sampled real-person narration texts and a set of reference texts are concatenated to obtain the target prompt text. For example, according to the preset format, a set of sampled real-person narration texts are arranged in area 1 of the prompt text template. The content displayed in area 1 is used to describe the basic information of the target scene event. A set of reference texts are arranged in area 2 of the prompt text template. The content displayed in area 2 is used to describe the professional knowledge information of the target scene event in different dimensions.
[0129] Specifically, based on the semantic similarity between each keyword in a set of keywords and the reference text in the reference text set, the set of keywords can be divided into different word sequences, but is not limited to. Then, the cosine similarity between the word sequence vector corresponding to each word sequence and the sentence feature vector in the reference text is calculated. If the cosine similarity is greater than a preset threshold, it is determined that the reference text retrieved from the retrieval dataset is closely related to the target scene event.
[0130] By using the above methods, real-person narration text and professional domain knowledge can be integrated into the target prompt text to generate target prompt text that accurately describes the target scene event. This allows the narration text generation model to learn the deeper meaning of the target scene event and professional domain knowledge, and finally output target narration text that is similar in style to real-person narration and accurately describes the target scene event.
[0131] As an optional example, before retrieving the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the above method also includes:
[0132] By inputting the target prompt text and the target scene event description text into the language processing model, an initial set of explanatory texts corresponding to the target scene event is obtained;
[0133] Data cleaning was performed on the initial set of explanatory texts to obtain a set of standard explanatory texts.
[0134] In a specific embodiment, during the data construction stage of the AIGC model, not only was the aforementioned few-shot dataset used, with different candidate example sentence pools for different tasks (different scenario events), but 5-8 sentences were randomly sampled from the candidate sentence pool each time a speech was generated, guiding the AIGC model to generate speech with a style similar to the target scenario event; also, a retrieval dataset was used for knowledge retrieval, using the RAG method to retrieve specific knowledge appearing in the feature template, and adding the retrieved specific knowledge to the Prompt (hint text) to improve the professional understanding ability of the explanatory text generation model; finally, by adding the CoT (Coding of Thought) derivation to the Prompt, the large model is guided step by step to mine deeper content from the given features and generate the corresponding explanatory text.
[0135] The aforementioned CoT thought chain, randomly sampled explanatory examples from the few-shot dataset, and professional knowledge retrieved from the retrieval dataset are all placed in a task-specific Prompt template, and input along with the task-specific feature template into the AIGC model to generate standard explanatory text for a specific task in a given scenario. The generated text typically contains multiple CoT word tasks. Subsequent data post-processing and cleaning work constructs a high-quality corpus for fine-tuning the large model. This high-quality corpus includes a set of standard explanatory texts. In other words, the high-quality corpus obtained in the above manner is the standard explanatory text corresponding to different scenario events output by the AIGC model. The role of this standard explanatory text is to serve as the true class label (the standard answer to the explanatory text corresponding to different scenario events) during the training process of the base model in the following embodiments.
[0136] Data cleaning methods include, but are not limited to, removing standard explanatory text containing anomalous symbols, recurring standard explanatory text, text with incoherent meaning, or text that is meaningless for model training.
[0137] The above method can solve the technical problems of high labor costs and low model training and inference efficiency caused by the traditional method of generating prompt text by manually annotating a large amount of corpus. At the same time, it can also improve the accuracy of the explanatory text.
[0138] As an optional approach, after obtaining a high-quality corpus for a specific task, it is also necessary to perform SFT training (supervised training) on the pre-trained base model (the pre-trained explanatory text generation model) to obtain the target explanatory text generation model, which specifically includes:
[0139] Using N different types of scene events, N prompt texts, N scene event description texts, and question-and-answer text sets, the initial explanation text generation model is trained until the value of the target loss function corresponding to the initial explanation text generation model meets the preset convergence condition. The training of the initial explanation text generation model ends, and the initial explanation text generation model at the end of training is determined as the target explanation text generation model, where N is a positive integer greater than or equal to 2.
[0140] The system includes N prompt text sets, N scene event description text sets, and a question-and-answer text set where each text includes a pre-defined question and its corresponding answer. The target loss function is determined based on the values of a first loss function and a second loss function. The first loss function represents the text similarity between a set of predicted explanation texts determined by the initial explanation text generation model based on the first part of the scene event description text and the first part of the prompt text, and a set of standard explanation texts. The second loss function represents the loss between the predicted type determined by the initial explanation text generation model based on the second part of the scene event description text and the second part of the prompt text, and the label type indicated by the answer to the question. The N scene event description texts include the first part of the scene event description text and the second part of the scene event description text.
[0141] In the above model training process, in addition to a set of standard explanatory texts (high-quality corpus) obtained in the above embodiments, the training dataset also includes a QA dataset. By mixing the high-quality corpus generated by the AIGC model with high-quality Q&A and multiple-choice questions in the game domain where game A is located for SFT training, the model's ability to understand professional knowledge can be greatly improved.
[0142] Furthermore, since the base model has been pre-trained on the ASR corpus, it can understand and imitate the style of real-person narration to generate speech. Therefore, the construction of the Prompt omits the CoT thought chain, the narration examples randomly sampled from the few-shot dataset, and the professional knowledge retrieved from the retrieval dataset. It only uses a specific simplified Prompt template and feature model for a specific task. This method not only ensures the quality of the model output, but also greatly improves the efficiency of training and inference.
[0143] In this embodiment, a high-quality corpus of multiple tasks, such as two-person narration, circle analysis, and group operation interpretation, is trained together with the aforementioned QA dataset using SFT to obtain the final integrated AI narration model (target narration text generation model).
[0144] As an optional example, the above-mentioned training of the initial explanatory text generation model utilizes N prompt texts, N scene event description texts, and a question-and-answer text set corresponding to N different types of scene events, including:
[0145] The initial explanatory text generation model is trained in the i-th round using the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N:
[0146] Select the i-th batch of scene event description texts from N scene event description texts, and select the i-th batch of prompt texts from N prompt texts;
[0147] By inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, the first subgroup of standard explanatory text is obtained, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text;
[0148] Input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round to obtain the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round for the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round for the second group of scene description text.
[0149] Based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question, determine the value of the target loss function for the i-th round of training;
[0150] If the value of the target loss function in the i-th training round does not meet the target convergence condition, the parameters in the explanatory text generation model obtained in the (i-1)-th training round are adjusted to obtain the explanatory text generation model obtained in the i-th training round.
[0151] In the embodiments of this application, the loss value of the target loss function in each round of training includes two parts. The first part is the value of the first loss function in the current round of training, which is determined by the pre-trained base model based on the input prompt text, scene event description text and high-quality corpus (a set of standard explanatory texts). The second part is the value of the second loss function in the current round of training, which is determined by the pre-trained base model based on the input prompt text, scene event description text and QA dataset.
[0152] In other words, during the fine-tuning or training of the pre-trained base model, the use of a set of standard explanatory texts output by the AIGC model and the answer set from the QA dataset as real labels avoids the high cost and low efficiency associated with extensive manual labeling. Furthermore, this supervised training method allows the explanatory text generation model to output more accurate explanatory texts.
[0153] For example, the value of the target loss function in each round of training can be obtained, but is not limited to, in the following ways:
[0154] The value of the first loss function in the i-th round of training is determined by calculating the text similarity between the predicted explanatory text of the i-th batch and the standard explanatory text of the first subgroup.
[0155] Based on the prediction type of the i-th batch and the label type of the i-th group, determine the value of the second loss function for the i-th round of training;
[0156] Based on the values of the first loss function and the second loss function in the i-th training round, determine the value of the target loss function in the i-th training round.
[0157] For example, suppose there are a total of 10 scene events in the i-th batch. Using the pre-trained base model, the input prompt text, the 10 scene event description texts corresponding to the 10 events, and the QA dataset, the output results include two parts. One part is the predicted explanation text, and the other part is the prediction type output by the pre-trained base model according to the questions in the QA dataset.
[0158] Based on the predicted explanatory text and 10 standard explanatory texts that match the target scene event obtained from a set of standard explanatory texts output by the AIGC model, the text similarity between the predicted explanatory text and the standard explanatory text is calculated, and the value of the first loss function in the i-th round of training is obtained.
[0159] In this embodiment, since the QA dataset contains multiple-choice questions, meaning that the answer to each question is one or more of the candidate options, the value of the second loss function in the i-th training round is calculated based on the prediction type of the questions output by the pre-trained base model and the standard answer in the QA dataset. Finally, the values of the first loss function and the second loss function in the i-th training round are summed or weighted to obtain the value of the target loss function in the i-th training round.
[0160] The above methods simplify the model training process, improve model training efficiency, and also improve the accuracy of model output.
[0161] In summary, this application proposes a foundational model for FPS games, incorporating a wealth of professional knowledge from the gaming field. This model possesses strong professional understanding and realistic characterization. Furthermore, it presents a complete pipeline process for training specific tasks (different types of scene events), significantly reducing the cost of manual scriptwriting, simplifying deployment, and demonstrating high intelligence.
[0162] Furthermore, the technical solutions in this application embodiment can be applied to various FPS game commentary sub-tasks, which will greatly improve the accuracy of AI commentary, reduce the cost of organizing esports events, and lay the foundation for esports for all.
[0163] To address the issue of low accuracy in the aforementioned explanatory text generation process, this application also proposes a training method for the explanatory text generation model, the specific process of which is as follows: Figure 3 The following steps are shown:
[0164] Step S302: Train the initial explanatory text generation model for the i-th round using the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2:
[0165] Step S302-1: Select the i-th batch of scene event description texts from N scene event description texts, and select the i-th batch of prompt texts from N prompt texts;
[0166] Step S302-2: By inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, the first subgroup of standard explanation text is obtained, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text;
[0167] Step S302-3: Input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round to obtain the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round for the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round for the second group of scene description text.
[0168] Step S302-4: Based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to the questions in the question-answer text set, determine the value of the target loss function for the i-th round of training. Each text in the question-answer text set includes a preset question and the answer to the question.
[0169] Step S302-5: If the value of the target loss function in the i-th training round does not meet the target convergence condition, adjust the parameters in the explanatory text generation model obtained in the (i-1)-th training round to obtain the explanatory text generation model obtained in the i-th training round.
[0170] In the embodiments of this application, the loss value of the target loss function in each round of training includes two parts. The first part is the value of the first loss function in the current round of training, which is determined by the pre-trained base model based on the input prompt text, scene event description text and high-quality corpus (a set of standard explanatory texts). The second part is the value of the second loss function in the current round of training, which is determined by the pre-trained base model based on the input prompt text, scene event description text and QA dataset.
[0171] In other words, during the fine-tuning or training of the pre-trained base model, the use of a set of standard explanatory texts output by the AIGC model and the answer set from the QA dataset as real labels avoids the high cost and low efficiency associated with extensive manual labeling. Furthermore, this supervised training method allows the explanatory text generation model to output more accurate explanatory texts.
[0172] For example, the value of the target loss function in each round of training can be obtained, but is not limited to, in the following ways:
[0173] The value of the first loss function in the i-th round of training is determined by calculating the text similarity between the predicted explanatory text of the i-th batch and the standard explanatory text of the first subgroup.
[0174] Based on the prediction type of the i-th batch and the label type of the i-th group, determine the value of the second loss function for the i-th round of training;
[0175] Based on the values of the first loss function and the second loss function in the i-th training round, determine the value of the target loss function in the i-th training round.
[0176] For example, suppose there are a total of 10 scene events in the i-th batch. Using the pre-trained base model, the input prompt text, the 10 scene event description texts corresponding to the 10 events, and the QA dataset, the output results include two parts. One part is the predicted explanation text, and the other part is the prediction type output by the pre-trained base model according to the questions in the QA dataset.
[0177] Based on the predicted explanatory text and 10 standard explanatory texts that match the target scene event obtained from a set of standard explanatory texts output by the AIGC model, the text similarity between the predicted explanatory text and the standard explanatory text is calculated, and the value of the first loss function in the i-th round of training is obtained.
[0178] In this embodiment, since the QA dataset contains multiple-choice questions, meaning that the answer to each question is one or more of the candidate options, the value of the second loss function in the i-th training round is calculated based on the prediction type of the questions output by the pre-trained base model and the standard answer in the QA dataset. Finally, the values of the first loss function and the second loss function in the i-th training round are summed or weighted to obtain the value of the target loss function in the i-th training round.
[0179] The above methods simplify the model training process, improve model training efficiency, and also improve the accuracy of model output.
[0180] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0181] According to another aspect of the embodiments of this application, as follows is also provided Figure 14 An explanatory text generation apparatus is shown, the apparatus comprising:
[0182] The first acquisition unit 1402 is used to acquire target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application;
[0183] The second acquisition unit 1404 is used to acquire target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic. The prompt text set includes prompt texts corresponding to different types of scene events. The target prompt text is a prompt text determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts describing different types of scene events from different dimensions.
[0184] The first processing unit 1406 is used to input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation text, prompt text set and scene event description text set output by the language processing model. The scene event description text set includes the target scene event description text.
[0185] Optionally, the second acquisition unit 1404 includes:
[0186] The fifth processing module is used to determine the target state information corresponding to the target scene event based on the scene screen information corresponding to the target scene event.
[0187] The first acquisition module is used to acquire the target prompt text corresponding to the target scene event from the prompt text set when the target state information meets the event triggering conditions.
[0188] Optionally, the fifth processing module mentioned above includes:
[0189] The first processing submodule is used to determine the target action information corresponding to the target scene event when the target object in the first scene screen of the target application performs the target operation.
[0190] The second processing submodule is used to determine the scene state information corresponding to the target scene event when the target scene event indicates that the second scene screen of the target application is in a combat state.
[0191] The third processing submodule is used to determine the duration of the combat state when the target scene event indicates that a set of scene screens of the target application is in a continuous combat state. The target state information includes target action information, scene state information, and the duration of the combat state.
[0192] Optionally, the above-mentioned device further includes:
[0193] The third processing unit is used to determine a set of real-person explanation texts from the set of real-person explanation texts based on a set of prompt questions before obtaining the target prompt text corresponding to the target scene event from the set of prompt texts based on the event triggering logic. The set of prompt questions is used to guide the language processing model to learn the deeper meaning of the target scene event.
[0194] The fourth processing unit is used to determine a set of reference texts from the set of reference texts based on a set of keywords;
[0195] The splicing unit is used to splice a set of real-person narration text and a set of reference text according to a preset format to obtain the target prompt text.
[0196] Optionally, the third processing unit mentioned above includes:
[0197] The sixth processing module is used to generate a set of prompt questions based on the target scene event description text;
[0198] The sampling module is used to sample a set of real-person narration texts corresponding to a set of prompt questions from a set of real-person narration texts.
[0199] Optionally, the fourth processing unit mentioned above includes:
[0200] The seventh processing module is used to learn a set of keywords from the target event scene description text by using a language processing model;
[0201] The filtering module is used to filter a set of reference texts from the reference text set based on the semantic similarity between each keyword in the set of keywords and the reference texts in the reference text set.
[0202] Optionally, the above-mentioned device further includes:
[0203] The eighth processing module is used to input the target prompt text and the target scene event description text into the language processing model to obtain the initial explanatory text set corresponding to the target scene event;
[0204] The cleaning module is used to clean the initial set of explanatory texts to obtain a set of standard explanatory texts.
[0205] Optionally, the above-mentioned device further includes:
[0206] The training unit is used to train the initial explanatory text generation model using N prompt texts, N scene event description texts, and question-and-answer text sets corresponding to N different types of scene events. The training continues until the value of the target loss function corresponding to the initial explanatory text generation model meets the preset convergence condition. The training of the initial explanatory text generation model ends, and the initial explanatory text generation model at the end of training is determined as the target explanatory text generation model. Here, N is a positive integer greater than or equal to 2.
[0207] The system includes N prompt text sets, N scene event description text sets, and a question-and-answer text set where each text includes a pre-defined question and its corresponding answer. The target loss function is determined based on the values of a first loss function and a second loss function. The first loss function represents the text similarity between a set of predicted explanation texts determined by the initial explanation text generation model based on the first part of the scene event description text and the first part of the prompt text, and a set of standard explanation texts. The second loss function represents the loss between the predicted type determined by the initial explanation text generation model based on the second part of the scene event description text and the second part of the prompt text, and the label type indicated by the answer to the question. The N scene event description texts include the first part of the scene event description text and the second part of the scene event description text.
[0208] Optionally, the above training unit includes:
[0209] The training module is used to train the initial explanatory text generation model in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N:
[0210] The first processing unit selects the i-th batch of scene event description texts from N scene event description texts, and selects the i-th batch of prompt texts from N prompt texts;
[0211] By inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, the first subgroup of standard explanatory text is obtained, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text;
[0212] Input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round to obtain the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round for the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round for the second group of scene description text.
[0213] Based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question, determine the value of the target loss function for the i-th round of training;
[0214] If the value of the target loss function in the i-th training round does not meet the target convergence condition, the parameters in the explanatory text generation model obtained in the (i-1)-th training round are adjusted to obtain the explanatory text generation model obtained in the i-th training round.
[0215] Optionally, the above training module includes:
[0216] The ninth processing module is used to determine the value of the first loss function in the i-th round of training by calculating the text similarity between the i-th batch of predicted explanatory texts and the first subgroup of standard explanatory texts;
[0217] The tenth processing module is used to determine the value of the second loss function for the i-th round of training based on the i-th batch prediction type and the i-th group label type.
[0218] The eleventh processing module is used to determine the value of the target loss function for the i-th training round based on the value of the first loss function and the value of the second loss function for the i-th training round.
[0219] According to another aspect of the embodiments of this application, as follows is also provided Figure 15 The diagram shows a training apparatus for an explanatory text generation model, the apparatus comprising:
[0220] The second processing unit 1502 is used to train the initial explanatory text generation model in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2:
[0221] The first processing module 1502-1 is used to select the i-th batch of scene event description texts from N scene event description texts and to select the i-th batch of prompt texts from N prompt texts;
[0222] The second processing module 1502-2 is used to obtain the first subgroup of standard explanatory text by inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model. The i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text.
[0223] The third processing module 1502-3 is used to input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round, and generate the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round from the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round from the second group of scene description text.
[0224] The fourth processing module 1502-4 is used to determine the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set. Each text in the question-and-answer text set includes a preset question and the answer to the question.
[0225] The adjustment module 1502-5 is used to adjust the parameters in the explanatory text generation model obtained in the (i-1)th training round when the value of the target loss function in the i-th training round does not meet the target loss condition, so as to obtain the explanatory text generation model obtained in the i-th training round.
[0226] Optionally, the fourth processing module 1502-4 mentioned above includes:
[0227] The fourth processing submodule is used to determine the value of the first loss function in the i-th round of training by calculating the text similarity between the i-th batch of predicted explanatory text and the first subgroup of standard explanatory text;
[0228] The fifth processing submodule is used to determine the value of the second loss function for the i-th round of training based on the i-th batch prediction type and the i-th group label type.
[0229] The sixth processing submodule is used to determine the value of the objective function for the i-th training round based on the value of the first loss function and the value of the second loss function for the i-th training round.
[0230] By applying the aforementioned apparatus to the embodiments provided in this application, for a target scene event, target prompt text containing live commentary and reference text is obtained. This target prompt text and the target scene event description text are then input into a target commentary text generation model. This allows the model to learn the live commentary style used to describe the target scene event and the professional knowledge relevant to that type of scene event, thereby outputting more professional commentary text that conforms to the live commentary style. In other words, by integrating live commentary text and text content related to the target scene event into the target commentary text generation model, the model outputs target commentary text that accurately describes the target scene event, achieving the technical effect of improving the accuracy of the commentary text output by the model.
[0231] It should be noted that the embodiments of the explanatory text generation device here can refer to the embodiments of the explanatory text generation method described above, and will not be repeated here.
[0232] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described method for generating explanatory text is also provided. This electronic device may be... Figure 16 The terminal device shown is illustrated in this embodiment, which uses this electronic device as an example of a backend device. Figure 16 As shown, the electronic device includes a memory 1602 and a processor 1604. The memory 1602 stores a computer program, and the processor 1604 is configured to execute the steps of any of the above method embodiments via the computer program.
[0233] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0234] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0235] S11, Obtain target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application;
[0236] S12, based on the event triggering logic, retrieve the target prompt text corresponding to the target scene event from the prompt text set. The prompt text set includes prompt texts corresponding to different types of scene events. The target prompt text is determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts describing different types of scene events from different dimensions.
[0237] S13, Input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts, prompt texts and scene event description texts output by the language processing model. The scene event description texts include the target scene event description text.
[0238] Alternatively, the processor described above can be configured to perform the following steps via a computer program:
[0239] S21, the initial explanatory text generation model is trained in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2:
[0240] S21-1, Select the i-th batch of scene event description texts from N scene event description texts and select the i-th batch of prompt texts from N prompt texts;
[0241] S21-2, by inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, the first subgroup of standard explanation text is obtained, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text;
[0242] S21-3, input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round to generate the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round for the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round for the second group of scene description text.
[0243] S21-4, based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set, determine the value of the target loss function for the i-th round of training, where each text in the question-and-answer text set includes a preset question and the answer to the question;
[0244] S21-5, if the value of the target loss function in the i-th training round does not meet the target loss condition, adjust the parameters in the explanatory text generation model obtained in the (i-1)-th training round to obtain the explanatory text generation model obtained in the i-th training round.
[0245] Alternatively, as those skilled in the art will understand, Figure 16The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other target terminals. Figure 16 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 16 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 16 The different configurations shown.
[0246] The memory 1602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the explanatory text generation method and apparatus in this embodiment. The processor 1604 executes various functional applications and data processing by running the software programs and modules stored in the memory 1602, thereby implementing the aforementioned explanatory text generation method or the training method for the explanatory text generation model. The memory 1602 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1602 may further include memory remotely located relative to the processor 1604, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1602 may be used, but is not limited to, to store target scene events, a set of reference texts, and a set of standard explanatory texts. As an example, such as Figure 16 As shown, the memory 1602 may include, but is not limited to, the first acquisition unit 1402, the second acquisition unit 1404, and the first processing unit 1406 in the explanatory text generation device, or the second processing unit 1502 in the training device for the explanatory text generation model. Furthermore, it may include, but is not limited to, other module units in the explanatory text generation device, which will not be elaborated upon in this example.
[0247] Optionally, the transmission device 1606 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1606 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1606 is a radio frequency (RF) module, used for wireless communication with the Internet.
[0248] In addition, the aforementioned electronic device also includes: a display 1608 for displaying directional information of the target sound; and a connection bus 1610 for connecting the various module components in the aforementioned electronic device.
[0249] In other embodiments, the target terminal or server can be a node in a distributed system, which can be a blockchain system. This blockchain system is formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer network, and any type of computing device, such as servers, terminals, or other electronic devices, can become a node in the blockchain system by joining this peer-to-peer network.
[0250] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the explanatory text generation method provided in various optional implementations of the above-described server verification processing, wherein the computer program is configured to execute the steps in any of the above-described method embodiments at runtime.
[0251] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0252] S11, Obtain target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application;
[0253] S12, based on the event triggering logic, retrieve the target prompt text corresponding to the target scene event from the prompt text set. The prompt text set includes prompt texts corresponding to different types of scene events. The target prompt text is determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts describing different types of scene events from different dimensions.
[0254] S13, Input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts, prompt texts and scene event description texts output by the language processing model. The scene event description texts include the target scene event description text.
[0255] Alternatively, the aforementioned computer-readable storage medium may also be configured to store a computer program for performing the following steps:
[0256] S21, the initial explanatory text generation model is trained in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2:
[0257] S21-1, Select the i-th batch of scene event description texts from N scene event description texts and select the i-th batch of prompt texts from N prompt texts;
[0258] S21-2, by inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, the first subgroup of standard explanation text is obtained, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text;
[0259] S21-3, input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round to generate the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round for the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round for the second group of scene description text.
[0260] S21-4, based on the i-th batch of predicted explanatory text, the i-th batch of predicted type, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set, determine the value of the target loss function for the i-th round of training, where each text in the question-and-answer text set includes a preset question and the answer to the question;
[0261] S21-5, if the value of the target loss function in the i-th training round does not meet the target loss condition, adjust the parameters in the explanatory text generation model obtained in the (i-1)-th training round to obtain the explanatory text generation model obtained in the i-th training round.
[0262] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the target terminal. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0263] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0264] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.
[0265] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0266] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0267] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0268] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0269] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating explanatory text, characterized in that, include: Acquire target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application; Based on event triggering logic, target prompt text corresponding to the target scene event is obtained from a set of prompt texts. The set of prompt texts includes prompt texts corresponding to different types of scene events. The target prompt text is determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts describing the different types of scene events from different dimensions. The target prompt text and the target scene event description text are input into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts output by a language processing model, the set of prompt texts, and the set of scene event description texts, and the set of scene event description texts includes the target scene event description text.
2. The method according to claim 1, characterized in that, The step of retrieving the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic includes: Based on the scene image information corresponding to the target scene event, determine the target state information corresponding to the target scene event; If the target state information meets the event triggering conditions, the target prompt text corresponding to the target scene event is obtained from the prompt text set.
3. The method according to claim 2, characterized in that, Determining the target state information corresponding to the target scene event based on the scene image information corresponding to the target scene event includes at least one of the following: When the target scene event indicates that a target object in the first scene screen of the target application is performing a target operation, the target action information corresponding to the target scene event is determined; When the target scene event indicates that the second scene screen of the target application is in a combat state, the scene state information corresponding to the target scene event is determined; When the target scene event indicates that a set of scene screens of the target application is in a continuous combat state, the duration of the combat state is determined, wherein the target state information includes the target action information, the scene state information, and the duration of the combat state.
4. The method according to claim 1, characterized in that, Before retrieving the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the method further includes: Based on a set of prompting questions, the set of real-person narration texts is determined from the set of real-person narration texts, wherein the set of prompting questions is used to guide the language processing model to learn the deeper meaning of the target scene event; Based on a set of keywords, the set of reference texts is determined from the set of reference texts; According to a preset format, the set of real-person narration text and the set of reference text are concatenated to obtain the target prompt text.
5. The method according to claim 4, characterized in that, The step of determining the set of live-action commentary texts from the set of live-action commentary texts based on a set of prompt questions includes: Based on the target scene event description text, generate the set of prompt questions; Based on the set of prompt questions, sample the set of live commentary texts corresponding to the set of prompt questions from the set of live commentary texts.
6. The method according to claim 4, characterized in that, The step of determining the set of reference texts from the set of reference texts based on a set of keywords includes: The set of keywords is obtained by learning the target event scene description text using the language processing model; The reference texts are selected from the reference text set based on the semantic similarity between each keyword in the set of keywords and the reference texts in the reference text set.
7. The method according to claim 1, characterized in that, Before retrieving the target prompt text corresponding to the target scene event from the prompt text set based on the event triggering logic, the method further includes: By inputting the target prompt text and the target scene event description text into the language processing model, an initial set of explanatory texts corresponding to the target scene event is obtained; Data cleaning is performed on the initial set of explanatory texts to obtain the set of standard explanatory texts.
8. The method according to claim 1, characterized in that, The method further includes: Using N sets of prompt texts, N sets of scene event description texts, and question-and-answer texts corresponding to N different types of scene events, the initial explanation text generation model is trained until the value of the target loss function corresponding to the initial explanation text generation model satisfies the preset convergence condition. The training of the initial explanation text generation model ends, and the initial explanation text generation model at the end of training is determined as the target explanation text generation model, where N is a positive integer greater than or equal to 2. The set of prompt texts includes the N prompt texts, the set of scene event description texts includes the N scene event description texts, and each text in the question-and-answer text set includes a preset question and the answer corresponding to the question. The value of the target loss function is determined based on the values of a first loss function and a second loss function. The value of the first loss function represents the text similarity between a set of predicted explanation texts determined by the initial explanation text generation model based on the first part of the scene event description text and the first part of the prompt texts and the set of standard explanation texts. The value of the second loss function represents the loss value between the predicted type determined by the initial explanation text generation model based on the second part of the scene event description text and the second part of the prompt texts and the label type indicated by the answer corresponding to the question. The N scene event description texts include the first part of the scene event description texts and the second part of the scene event description texts.
9. The method according to claim 8, characterized in that, The initial explanatory text generation model is trained using N sets of prompt texts, N set of scene event description texts, and question-and-answer texts corresponding to N different types of scene events, including: The initial explanatory text generation model is trained in the i-th round using the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N: Select the i-th batch of scene event description texts from the N scene event description texts, and select the i-th batch of prompt texts from the N prompt texts; By inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, a first subgroup of standard explanatory text is obtained, wherein the i-th batch of scene event description text includes a first group of scene event description text and a second group of scene event description text; The i-th batch of scene event description text and the i-th batch of prompt text are input into the explanation text generation model trained in the (i-1)-th round to obtain the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round to the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round to the second group of scene description text. Based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question, the value of the target loss function for the i-th round of training is determined; If the value of the target loss function in the i-th training round does not meet the target convergence condition, the parameters in the explanatory text generation model obtained in the (i-1)-th training round are adjusted to obtain the explanatory text generation model obtained in the i-th training round.
10. The method according to claim 9, characterized in that, The step of determining the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question includes: The value of the first loss function in the i-th round of training is determined by calculating the text similarity between the i-th batch of predicted explanatory texts and the first subgroup of standard explanatory texts. Based on the i-th batch prediction type and the i-th group label type, determine the value of the second loss function for the i-th round of training; The value of the target loss function in the i-th training round is determined based on the value of the first loss function and the value of the second loss function in the i-th training round.
11. A training method for an explanatory text generation model, characterized in that, include: The initial explanatory text generation model is trained in the i-th round using the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2: Select the i-th batch of scene event description texts from N scene event description texts, and select the i-th batch of prompt texts from N prompt texts; By inputting the i-th batch of scene event description text and the i-th batch of prompt text into the language processing model, a first subgroup of standard explanatory text is obtained, wherein the i-th batch of scene event description text includes a first group of scene event description text and a second group of scene event description text; The i-th batch of scene event description text and the i-th batch of prompt text are input into the explanation text generation model trained in the (i-1)-th round to obtain the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round to the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round to the second group of scene description text. Based on the i-th batch of predicted explanatory texts, the i-th batch of predicted types, the i-th group of standard explanatory texts of the first subgroup, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set, the value of the target loss function for the i-th round of training is determined, wherein each text in the question-and-answer text set includes a preset question and the answer corresponding to the question; If the value of the target loss function in the i-th training round does not meet the target convergence condition, the parameters in the explanatory text generation model obtained in the (i-1)-th training round are adjusted to obtain the explanatory text generation model obtained in the i-th training round.
12. The method according to claim 11, characterized in that, The step of determining the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory text, the i-th batch of predicted types, the first subgroup of standard explanatory text, and the i-th group of label types indicated by the answer to the question includes: The value of the first loss function in the i-th round of training is determined by calculating the text similarity between the i-th batch of predicted explanatory texts and the first subgroup of standard explanatory texts; Based on the i-th batch prediction type and the i-th group label type, determine the value of the second loss function for the i-th round of training; The value of the target loss function in the i-th training round is determined based on the value of the first loss function and the value of the second loss function in the i-th training round.
13. An apparatus for generating explanatory text, characterized in that, include: The first acquisition unit is used to acquire target scene events, wherein the target scene events include events represented by screen content generated during the operation of the target application; The second acquisition unit is used to acquire target prompt text corresponding to the target scene event from a set of prompt texts based on event triggering logic. The set of prompt texts includes prompt texts corresponding to different types of scene events. The target prompt text is determined based on a set of real-person narration texts and a set of reference texts. The set of real-person narration texts is texts related to the target scene event extracted from the set of real-person narration texts. The set of reference texts includes texts related to the target scene event retrieved from the set of reference texts. The set of reference texts includes professional descriptive texts describing the different types of scene events from different dimensions. The first processing unit is used to input the target prompt text and the target scene event description text into the target explanation text generation model to obtain the target explanation text corresponding to the target scene event. The target explanation text generation model is trained using a set of standard explanation texts output by a language processing model, the set of prompt texts, and the set of scene event description texts. The set of scene event description texts includes the target scene event description text.
14. A training device for an explanatory text generation model, characterized in that, include: The second processing unit is used to train the initial explanatory text generation model in the i-th round through the following steps, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2: The first processing module is used to select the i-th batch of scene event description texts from N scene event description texts and to select the i-th batch of prompt texts from N prompt texts; The second processing module is used to input the i-th batch of scene event description text and the i-th batch of prompt text into a language processing model to obtain the first subgroup of standard explanatory text, wherein the i-th batch of scene event description text includes the first group of scene event description text and the second group of scene event description text; The third processing module is used to input the i-th batch of scene event description text and the i-th batch of prompt text into the explanation text generation model trained in the (i-1)-th round, and generate the i-th batch of predicted explanation text and the i-th batch of predicted types. The i-th batch of predicted explanation text is the text predicted by the explanation text generation model trained in the (i-1)-th round from the first group of scene description text, and the i-th batch of predicted types is the predicted type predicted by the explanation text generation model trained in the (i-1)-th round from the second group of scene description text. The fourth processing module is used to determine the value of the target loss function for the i-th round of training based on the i-th batch of predicted explanatory texts, the i-th batch of predicted types, the i-th subgroup of standard explanatory texts, and the i-th group of label types indicated by the answers to the questions in the question-and-answer text set, wherein each text in the question-and-answer text set includes a preset question and the answer corresponding to the question; The adjustment module is used to adjust the parameters in the explanatory text generation model obtained in the (i-1)th training round when the value of the target loss function in the i-th training round does not meet the target loss condition, so as to obtain the explanatory text generation model obtained in the i-th training round.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to perform the method described in any one of claims 1 to 10, or to perform the method described in any one of claims 11-12.
16. A computer program product comprising a computer program / instructions, characterized in that, When executed by a processor, the computer program / instruction implements the steps of the method described in any one of claims 1 to 10, or performs the steps of the method described in any one of claims 11-12.
17. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 10, or the method described in any one of claims 11 to 12, through the computer program.