Scenario creation method, device, equipment and program product
By applying neural network models to perform multi-task learning, comparative learning and reinforcement learning in the script creation process, the problem of difficult automation assistance in the entire process of script creation in the existing technology is solved, and the accuracy and degree of creation are improved.
Patent Information
- Application Number
- CN202411981606.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-22
AI Technical Summary
Existing script creation technology is difficult to achieve automation assistance for the entire script creation process, resulting in low efficiency, high cost and low automation.
By obtaining creative results and basic data from different creative stages, using neural network models for multi-task learning, comparative learning and reinforcement learning, we can achieve close correlation and automation of the script creation process.
It improves the accuracy and automation of script creation, reduces manual intervention, and improves the effectiveness and efficiency of script development.
Smart Images

Figure CN119865673A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and specifically to a script creation method, device, equipment and program product. Background Art
[0002] With the development of technology, the application of content-assisted technology in the script creation process has become increasingly extensive and in-depth, and has achieved remarkable results. The development of traditional film and television scripts requires the collaboration of screenwriters, directors, artists, etc., which takes months to years. The whole process is time-consuming and labor-intensive, with low efficiency and high cost. At present, the commonly used creation assistance schemes, such as the process of storyboard creation, mainly input various key information required for storyboard creation, such as story background, dramatic conflict, main character image characteristics, plot development context, ending setting, etc. into the model at one time, and then the model outputs a relatively complete storyboard content at one time based on the received information. However, this method not only has high requirements for the key information input, but also the less key information is mastered during the script auxiliary development, the worse the accuracy of the output result, which reduces the effect of script development; and many current creation assistance schemes can only obtain the results of a certain stage of script creation, and cannot realize the auxiliary development of the entire script creation process. A large amount of manpower intervention is still required, and the degree of automation of script development is low, which further reduces the effect of script development. Summary of the invention
[0003] Based on the above-mentioned defects and shortcomings of the prior art, the present application proposes a script creation method, device, equipment and program product, which can closely link the different creative stages in the script creation process, improve the accuracy and automation of script creation, and improve the script development effect.
[0004] According to a first aspect of an embodiment of the present application, a script creation method is provided, comprising: obtaining a first creative result corresponding to a first creative stage, wherein the script creation process includes a first creative stage and a second creative stage; obtaining basic creation data required for the second creative stage, wherein the basic creation data includes the first creative result; processing the basic creation data to obtain a second creative result, wherein if the second creative stage is the last creative stage of the script creation process, then the second creative result is a target script obtained after the script creation process is completed.
[0005] According to the script creation method provided in the first aspect of the embodiment of the present application, the first creation stage includes a story creation stage, and the first creation result includes a story framework; the second creation stage includes a character design stage; obtaining the first creation result corresponding to the first creation stage includes: obtaining basic story creation data required for the story creation stage; inputting the basic story creation data into a story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model with story creation sample data; based on the preliminary framework, obtaining the story framework.
[0006] According to the script creation method provided in the first aspect of the embodiment of the present application, the first creation stage includes a character design stage, and the first creation result includes character setting information; the second creation stage includes a scene design stage; the obtaining of the first creation result corresponding to the first creation stage includes: obtaining basic character creation data required for the character design stage; inputting the basic character creation data into a character creation model to obtain preliminary character setting information output by the character creation model, wherein the character creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using character creation sample data; based on the preliminary character setting information, obtaining the character setting information.
[0007] According to the script creation method provided in the first aspect of the embodiment of the present application, the character creation model training stage adopts a multi-task learning mechanism, a contrastive learning mechanism and a reinforcement learning mechanism; the training process of the character creation model is as follows: the character creation sample data is input into the neural network model based on the self-attention mechanism to obtain the sample results output by the neural network model based on the self-attention mechanism; the multi-task loss corresponding to the multi-task learning mechanism, the contrastive loss corresponding to the contrastive learning mechanism and the reward corresponding to the reinforcement learning mechanism are calculated; based on the multi-task loss, the contrastive loss and the reward, the comprehensive loss of the neural network model of the self-attention mechanism is obtained; based on the comprehensive loss, the internal parameters of the neural network model of the self-attention mechanism are adjusted until the training threshold of the neural network model of the self-attention mechanism is reached to obtain the character creation model.
[0008] According to the script creation method provided in the first aspect of the embodiment of the present application, the character setting information is obtained based on the preliminary character setting information, including: calculating the role rationality score corresponding to each preliminary designed role in the preliminary character setting information; determining whether the role rationality score corresponding to each of the preliminary designed roles is greater than or equal to a rationality threshold, and if not, re-calling the role creation model to generate preliminary character setting information until the role rationality score corresponding to each of the preliminary designed roles is greater than or equal to the rationality threshold, and obtaining the role setting information based on the preliminary character setting information.
[0009] According to the script creation method provided in the first aspect of the embodiment of the present application, the first creation stage includes a scene design stage, the first creation result includes a scene sequence, and the scene sequence includes at least two scenes; the second creation stage includes a dialogue generation stage; the processing of the first creation basic data to obtain the first creation result includes: inputting the scene design basic data into a scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using scene design sample data; based on the preliminary scene sequence, obtaining the scene sequence.
[0010] According to the script writing method provided in the first aspect of the embodiment of the present application, the scene sequence is obtained based on the preliminary scene sequence, including: calculating the coherence score between adjacent preliminary scenes in the preliminary scene sequence; judging whether the coherence score between each preliminary scene is greater than a coherence threshold, if not, re-calling the scene design model to generate a preliminary scene sequence, until the coherence score between each preliminary scene is greater than the coherence threshold, and obtaining the scene sequence based on the preliminary scene sequence.
[0011] According to the script creation method provided in the first aspect of the embodiment of the present application, the first creation stage includes a dialogue generation stage, and the first creation result includes a dialogue sequence; the second creation stage includes a script synthesis stage; the obtaining of the first creation result corresponding to the first creation stage includes: obtaining basic dialogue generation data required for the dialogue generation stage, wherein the basic dialogue generation data includes a scene sequence, and the scene sequence includes at least one scene; based on the scene complexity of each scene, calling a dialogue generation model to obtain a preliminary dialogue sequence, wherein the dialogue generation model is obtained by training a large model with dialogue generation sample data; based on the preliminary dialogue sequence, obtaining the dialogue sequence.
[0012] According to the script writing method provided in the first aspect of the embodiment of the present application, the dialogue sequence is obtained based on the preliminary dialogue sequence, including: integrating the recursive dialogue sequence corresponding to the first scene with the model-generated dialogue sequence corresponding to the second scene to obtain the recursive dialogue sequence corresponding to the second scene, wherein the preliminary dialogue sequence includes the model-generated dialogue sequence corresponding to each of the scenes, the first scene and the second scene are any two adjacent scenes in the scene sequence, and the model-generated dialogue sequence corresponding to the first scene in the scene sequence is used as the recursive dialogue sequence corresponding to the first scene; based on the recursive dialogue sequences corresponding to the respective scenes, the dialogue sequence is obtained.
[0013] According to the script creation method provided in the first aspect of the embodiment of the present application, the basic creation data required for the script synthesis stage also includes a story framework, character setting information, a scene sequence and a script type; the processing of the basic creation data to obtain a second creation result includes: inputting the story framework, the character setting information, the scene sequence, the dialogue sequence and the script type into a script synthesis model to obtain a preliminary script output by the script synthesis model, wherein the script synthesis model is obtained by training a large model based on script synthesis sample data; based on the preliminary script, obtaining the target script.
[0014] According to the script writing method provided in the first aspect of the embodiment of the present application, the script writing process includes a story writing stage, a character design stage, a scene design stage, a dialogue generation stage and a script synthesis stage which are performed in sequence; the first writing stage and the second writing stage are any two writing stages which are performed in sequence in the script writing process.
[0015] According to a second aspect of an embodiment of the present application, a script creation device is provided, comprising: a first acquisition module, used to acquire a first creation result corresponding to a first creation stage, wherein the script creation process includes a first creation stage and a second creation stage; a second acquisition module, used to acquire basic creation data required for the second creation stage, wherein the basic creation data includes the first creation result; a processing module, used to process the basic creation data to obtain a second creation result, wherein if the second creation stage is the last creation stage of the script creation process, then the second creation result is a target script obtained after the script creation process is completed.
[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device comprising a memory and a processor; the memory is connected to the processor and is used to store programs; the processor is used to implement a script creation method as described in any one of the first aspects by running the programs in the memory.
[0017] According to a fourth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, cause the processor to execute a script creation method as described in any one of the first aspects.
[0018] In the present application, the first creative result corresponding to the first creative stage is obtained, wherein the script creation process includes the first creative stage and the second creative stage; the basic creative data required for the second creative stage is obtained, and the basic creative data includes the first creative result; the basic creative data is processed to obtain the second creative result, wherein, if the second creative stage is the last creative stage of the script creation process, the second creative result is the target script obtained after the script creation process is completed. In the above process, the first creative result of the first creative stage in the script creation process, as the basic creative data required for the second creative stage, can provide more basic creative data even in the face of multiple creative stages in the entire script creation process, thereby avoiding the problem of poor accuracy of the creative results due to too little key information and improving the script development effect. And the entire script creation process is divided into stages to realize the automated creation process, realize fine-grained automated script creation in each creative stage, reduce unnecessary human intervention, and improve the degree of automation of script creation, thereby further improving the effect of script development. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0020] Figure 1 A flowchart of a script creation method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a story creation process provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a character design process provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a scenario design process provided for an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a dialogue generation process provided in an embodiment of the present application;
[0025] Figure 6A schematic diagram of a script synthesis process provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of interaction between the creator and each creation stage provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structural connection of a script creation device provided in an embodiment of the present application;
[0028] Fig. 9 A schematic diagram of the structural connection of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] Exemplary Methods
[0031] At present, although the existing content-assisted technology can quickly obtain a storyboard script framework to a certain extent, it still has certain limitations. For example, there are still great limitations in terms of accuracy, personalization, and in-depth mining of creativity. There is a big gap between the refined polishing and unique creative injection of professional creators. The more significant problems are as follows:
[0032] First, in terms of accuracy, script frameworks can often only be generated based on general templates or common plot patterns, which makes it difficult to accurately fit the unique needs, style characteristics and precise preferences of the target audience of a specific project, resulting in a deviation between the content and actual expectations.
[0033] Secondly, in terms of personalization, the generated storyboard script frameworks are mostly stereotyped, lacking in-depth reflection of the creator's personal style, brand characteristics or specific themes, unable to demonstrate unique artistic charm and personality identity, and difficult to stand out from the crowd of works.
[0034] Thirdly, in terms of creative depth, it mostly stays on the surface of plot connection and picture combination, making it difficult to deeply explore the emotional connotation, cultural heritage, novel narrative perspective and expression techniques behind the story, and unable to give the work depth and lasting appeal.
[0035] Finally, in terms of flexibility and interactivity, once the framework is generated, it lacks flexibility for modification and adjustment, and lacks effective interaction with creators during the creative process. It cannot be optimized and improved in a timely manner based on the creators' inspiration and immediate feedback, which limits dynamic adjustments and multiple attempts during the creative process.
[0036] In summary, existing solutions are difficult to perform well in terms of accuracy, personalization, and in-depth exploration of creativity, and are unable to fully meet the increasingly diversified and high-quality creative needs, limiting the artistic value and market competitiveness of creative results.
[0037] In view of the problems existing in the prior art, a script writing method is provided, which is implemented through a software algorithm. The software algorithm implementing the method can run on any device with data processing function, such as a remote server, a local computer, a smart mobile device, etc. Optionally, the device implementing the method has a human-computer interaction function to facilitate the script writer to input valid information and feedback optimization and other interactive processes.
[0038] In one embodiment, if Figure 1 As shown, the process steps for implementing the script creation method are as follows:
[0039] Step 101, obtaining a first creation result corresponding to a first creation stage, wherein the script creation process includes a first creation stage and a second creation stage.
[0040] In this embodiment, the script creation process is a relatively complex process, including multiple creation stages. The basic creation data and creation results used in each creation stage are different. Optionally, the script creation process includes five creation stages: story creation, character design, scene design, dialogue generation, and script synthesis. The basic creation data required for each creation stage and the final creation results are different. The first creation stage and the second creation stage are any two creation stages arranged in sequence in the script creation process. That is to say, in the entire script creation process, the execution order of the first creation stage is before the second creation stage, and the second creation stage is carried out after the first creation stage is completed.
[0041] In this embodiment, the first creative result may be a creative result manually created by a creator in the first creative stage, or may be a creative result automatically obtained by using an automated solution in the first creative stage.
[0042] Step 102, obtaining basic creation data required for the second creation stage, where the basic creation data includes the first creation result.
[0043] In this embodiment, after obtaining the first creative result of the first creative stage, the basic creation data required for the second creative stage is obtained. The basic creation data required for the second creative stage includes the first creative result, and may also include other basic data in addition to the first creative result. The other basic data may be basic data manually input by the creator, or may be other creative results automatically obtained by using an automated solution in other creative stages except the first creative stage and the second creative stage.
[0044] Step 103, processing the basic creative data to obtain a second creative result, wherein if the second creative stage is the last creative stage of the script creation process, the second creative result is the target script obtained after the script creation process is completed.
[0045] In this embodiment, the second creative stage is a creative stage that is ranked relatively later in the script creation process relative to the first creative stage. The first creative result can be reflected in the unique needs, style characteristics and / or personalized characteristics of the creator in the first creative stage contained in the first creative stage. The second creative stage implements the creative process based on the creative demand data including the first creative result, thereby obtaining the second creative result, ensuring that the second creative stage is closely related to the first creative stage during the creative process. Different first creative results have different effects on the second creative stage, and the final second creative results are also different. It can better dig into the depth information provided by the first creative stage in the second creative stage, ensure the coherence and consistency of the first and second creative stages, make the second creative result more in line with actual expectations, and improve the accuracy of script creation.
[0046] In this embodiment, the process of processing the basic creative data required for the second stage to obtain the second creative result can be automatically completed based on a pre-set processing logic. The pre-set processing logic can be any form of processing logic, such as a pre-trained model, a pre-set logic processing template, etc.
[0047] In this embodiment, the script creation process can be divided into multiple creation stages, and any two creation stages can use the script creation method provided by this application to obtain phased creation results. Of course, if the second creation stage is the last creation stage of the script creation process, then after the second creation stage implements the corresponding processing logic, the second creation result obtained is the target script obtained after the script creation process is completed, and the script creation process is completely completed.
[0048] In one embodiment, the script creation process includes a story creation phase, a character design phase, a scene design phase, a dialogue generation phase, and a script synthesis phase, which are performed in sequence. The first creation phase and the second creation phase are any two creation phases performed in sequence in the script creation process.
[0049] In this embodiment, according to the actual operation situation, the creation process is divided into the story creation stage, the character design stage, the scene design stage, the dialogue generation stage and the script synthesis stage, which are carried out in sequence. After the five creation stages of story creation, character design, scene design, dialogue generation and script synthesis, a complete script creation process is completed from scratch. Among them, the script synthesis stage is the last creation stage of the script creation process, and the target script can be obtained in the script synthesis stage.
[0050] In this embodiment, the first creative stage and the second creative stage are any two sequential creative stages in the script creation process. For example, the first creative stage is the story creation stage, and the second creative stage is the character design stage; for another example, the first creative stage is the story creation stage, and the second creative stage is the script synthesis stage. In the script creation process, the script creation method provided by this application can be implemented for any two creative stages, and the required stage creation results can be obtained. For example, if the currently required creation result is the character setting information, it is only necessary to use the story creation stage and the character design stage as the first creative stage and the second creative stage, respectively, and implement the script creation method provided by this application; it is also possible to implement the script creation method provided by this application for any two adjacent creative stages in the whole process of the script creation process, so as to realize the full process automation processing of the script creation process. Based on the above, the flexibility of this method in the script creation process is improved, which is more in line with the actual operation scene of script creation.
[0051] In one embodiment, the first creation stage includes a story creation stage, and the first creation result includes a story framework; the second creation stage includes a character design stage. Obtaining the first creation result corresponding to the first creation stage includes: obtaining story creation basic data required for the story creation stage; inputting the story creation basic data into a story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model using story creation sample data; and obtaining a story framework based on the preliminary framework.
[0052] In this embodiment, the story creation stage is used as the first creation stage, and the character design stage is used as the second creation stage to implement the script creation method provided by this application. The character creation basic data required in the character design stage includes the story framework and other character creation basic data such as character style and character type. Other character creation basic data can be manually input by the creator, thereby improving the flexibility and personalization of the character design stage.
[0053] In this embodiment, the story framework is obtained by a pre-trained story creation model. The training process of the model focuses on data quality, task-specific fine-tuning and continuous optimization. The story creation model is obtained by training a large model with story creation sample data. The story creation sample data can be obtained by screening, labeling and other pre-processing of a large number of high-quality literary works and scripts to ensure the data quality of the story creation sample data; the story creation sample data includes sample data in many aspects such as theme depth, structural integrity, character creation, market adaptability, and innovation feasibility, to achieve task-specific fine-tuning; through multiple rounds of instruction tuning and human expert feedback and other training methods, continuous optimization is achieved to ensure that the story creation model trained by the story creation sample data performs well in building a high-quality story framework.
[0054] In this embodiment, an adaptive learning rate optimization algorithm such as Adam can be used in the story creation model training process, or techniques such as gradient clipping can be used to prevent gradient explosion; a small batch gradient descent method can also be used for iterative training, or an early stopping strategy can be used to prevent overfitting.
[0055] In this embodiment, the basic story creation data required in the story creation stage includes data such as the target audience, the creation type, and the copywriting style. In this embodiment, the basic story creation data can be manually input by the creator, thereby improving the personalization level in the story creation stage. The basic story creation data is input into the story creation model to obtain a preliminary framework output by the story creation model.
[0056] In this embodiment, after obtaining the preliminary framework output by the story creation model, feedback can be provided to the preliminary framework generated by the model, such as Figure 2 The story creation process diagram shown in the figure, the specific implementation process of the story creation stage is as follows:
[0057] Step 201, inputting basic story creation data into a story creation model;
[0058] Step 202, the story creation model outputs a preliminary framework;
[0059] Step 203, the creator determines whether the preliminary framework needs to be adjusted. If so, the story creation model is re-called and step 202 is executed. If not, step 204 is executed.
[0060] In step 204, the creator makes detailed adjustments to the preliminary framework to obtain a story framework.
[0061] In this embodiment, the creator determines whether to make adjustments and the details of the adjustments, so as to achieve human-computer collaboration to optimize the story framework, improve the creative efficiency of the story creation stage, and ensure the uniqueness and artistic value of the story. Optionally, the basic data, preliminary framework and story framework of the story creation during the use of the story creation model can be updated to the story creation sample data as sample data, so that the story creation model can be retrained with the updated story creation sample data, so that the collaboration between the story creation model and the creator is smoother and more effective. The human-computer collaborative processing method ensures that the model can better meet the specific needs of each creator, thereby providing more accurate and valuable creative support. While ensuring the creative efficiency, the story creation model can also fully respect and give play to the personal style and creativity of the creator.
[0062] In this embodiment, the second creation stage includes a character design stage, and the second creation result includes character setting information. Processing the creation basic data to obtain the second creation result includes: inputting the character creation basic data into the character creation model to obtain preliminary character setting information output by the character creation model, wherein the character creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using character creation sample data; based on the preliminary character setting information, obtaining the character setting information. Specifically, the character creation model obtained by pre-training is used to process the character creation basic data including the story framework, and the character setting information is obtained based on the preliminary character setting information output by the character creation model.
[0063] In one embodiment, the first creation stage includes a character design stage, and the first creation result includes character setting information; the second creation stage includes a scene design stage. Obtaining the first creation result corresponding to the first creation stage includes: obtaining basic character creation data required for the character design stage; inputting the basic character creation data into a character creation model to obtain preliminary character setting information output by the character creation model, wherein the character creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using character creation sample data; and obtaining character setting information based on the preliminary character setting information.
[0064] In this embodiment, the character design stage is used as the first creation stage, and the scene design stage is used as the second creation stage to implement the script creation method provided by this application. The scene design basic data required in the scene design stage includes character setting information and other scene design basic data such as scene type and scene style. Other scene design basic data can be manually input by the creator, thereby improving the flexibility and personalization of the scene design stage.
[0065] In this embodiment, the role setting information is obtained through a pre-trained role creation model. The role creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using role creation sample data. The role creation sample data can be obtained by pre-processing such as screening, labeling, and structural processing of a large number of film and television scripts, ensuring that the role creation model training process has excellent performance in terms of the multi-faceted character personalization, rational motivation, and unique language style.
[0066] In this embodiment, the character creation model adopts a neural network architecture (Transformer architecture) based on the self-attention mechanism. The Transformer architecture has excellent performance in terms of parallelization capability, long-distance dependency, and flexibility. In the character creation model training process, an adaptive learning rate optimization algorithm such as Adam can be used, or gradient clipping and other technologies can be used to prevent gradient explosion; a small batch gradient descent method can also be used for iterative training, or an early stopping strategy can be used to prevent overfitting.
[0067] In this embodiment, the character creation basic data includes a story framework and other character creation basic data. Optionally, the story framework is obtained through a pre-trained story creation model. Specifically, the story creation basic data required for the story creation stage is obtained; the story creation basic data is input into the story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model using story creation sample data; based on the preliminary framework, the story framework is obtained. Optionally, the story framework can also be obtained through other methods such as manual input by the creator.
[0068] In this embodiment, the second creation stage includes a scene design stage, and the second creation result includes a scene sequence. Processing the creation basic data to obtain the second creation result includes: inputting the scene design basic data into the scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using scene design sample data; based on the preliminary scene sequence, obtaining a scene sequence.
[0069] In one embodiment, the character creation model training phase adopts a multi-task learning mechanism, a contrastive learning mechanism, and a reinforcement learning mechanism.
[0070] The training process of the character creation model is as follows: input the character creation sample data into the neural network model based on the self-attention mechanism to obtain the sample results output by the neural network model based on the self-attention mechanism; calculate the multi-task loss corresponding to the multi-task learning mechanism, the contrast loss corresponding to the contrastive learning mechanism, and the reward corresponding to the reinforcement learning mechanism; based on the multi-task loss, contrast loss and reward, obtain the comprehensive loss of the neural network model of the self-attention mechanism; based on the comprehensive loss, adjust the internal parameters of the neural network model of the self-attention mechanism until the training threshold of the neural network model of the self-attention mechanism is reached to obtain the character creation model.
[0071] In this embodiment, in order to handle multiple subtasks such as character background generation, motivation generation, relationship network generation, and growth trajectory generation, a multi-task learning mechanism is used in the character creation model training phase. The multi-task learning mechanism is a task structure that provides the basis for the character creation model. Multi-task learning refers to a learning method that solves multiple related tasks simultaneously in one model. By sharing the representation layer, the model can learn more common features from multiple tasks, thereby improving the performance of each task.
[0072] In this embodiment, a contrastive learning mechanism is introduced in the character creation model training stage to enhance the model's feature understanding and differentiation capabilities, so that the character creation model can better distinguish whether the character setting is reasonable. Contrastive learning is an unsupervised or semi-supervised learning method that extracts features by learning the similarities and differences between positive samples and negative samples.
[0073] In this embodiment, a reinforcement learning mechanism is introduced during the character creation model training phase so that the character creation model can learn optimal behaviors and create characters that are better and more attractive overall.
[0074] In this embodiment, joint training is performed based on a multi-task learning mechanism, a contrastive learning mechanism, and a reinforcement learning mechanism to achieve collaborative optimization. Specifically, when the character creation model is designed based on the Transformer architecture, a shared representation layer is designed to extract common features from the input data. On top of the shared representation layer, multiple task-specific heads are added, each head is responsible for a subtask, to achieve multi-task learning. A contrastive learning module is introduced to enhance the quality of feature representation. A reinforcement learning module is added to optimize the behavior strategy of the model. When preparing character creation sample data, multi-task data needs to be collected to ensure that the amount of data for each task is sufficient. And generate positive and negative samples required for contrastive learning. And define the environment and reward mechanism for reinforcement learning. When designing the loss function of the character creation model training phase, it is necessary to define multi-task loss, which is usually the weighted sum of the loss functions of each subtask. Introduce contrastive loss to optimize feature representation. Define the reward for reinforcement learning to optimize the behavior strategy of the model.
[0075] In this embodiment, the character creation model training process is as follows: when initializing the model, the model parameters are randomly initialized; input character creation sample data through the shared representation layer and the task-specific head, and calculate the sample results; calculate the multi-task loss, contrast loss and reinforcement learning reward to obtain the comprehensive loss; update the model parameters with the comprehensive loss; repeat the above steps until the training threshold is reached, optionally, the training threshold includes a model convergence index or the number of training rounds. The combination of multi-task learning mechanism, contrast learning mechanism and reinforcement learning mechanism enables the trained character creation model to better distinguish between reasonable and unreasonable character designs, and optimize the coherence and consistency of the character. Optionally, the character creation basic data, preliminary character setting information and character setting information in the process of using the character creation model can all be used as sample data to update the character creation sample data, so that the updated character creation sample data is used to re-train the character creation model, so that the collaboration between the character creation model and the creator is smoother and more effective.
[0076] In this embodiment, contrastive learning can be simplified as follows:
[0077] S=f(C A ,C B )
[0078] Wherein, S represents the similarity score; f represents the similarity evaluation function, which is a function for evaluating the similarity between two roles. Optionally, the similarity evaluation function is a function for calculating the cosine similarity; C A and C B Represent the two characters to be compared. The similarity score affects the contrast loss. The character creation model learns the features that distinguish good character designs from bad character designs by comparing the similarities between different characters.
[0079] In this embodiment, reinforcement learning can be simplified as follows:
[0080] R T =∑R s ×D F
[0081] Among them, R T represents the total reward; R S Represents the reward for each step; D F represents the time decay factor. The character creation model learns to generate coherent, consistent, and engaging characters by maximizing the total reward. The total reward can be used as a reward for reinforcement learning, for example, when the character exhibits consistent personality traits, it will be positively rewarded, while when it exhibits inconsistent behavior, it will be penalized.
[0082] In this embodiment, the overall goal of the model can be expressed as:
[0083] OT =Q G +D C +C L
[0084] Among them, O T Indicates the overall goal; Q G Indicates the quality of generation; D C Indicates the ability to identify roles; C L Represents long-term consistency. The model minimizes the overall objective O through training T , total reward R T and long-term consistency C L Positive correlation, multi-task loss and generation quality Q G Positive correlation, contrast loss and role discrimination ability D C Positive correlation. By optimizing the overall goal, the character creation model is able to continuously improve its generation capabilities and create more full, realistic, and engaging characters. This approach combines the creativity of multi-task learning, the discriminative ability of contrastive learning, and the long-term planning ability of reinforcement learning to achieve better results on the character creation task.
[0085] In one embodiment, based on preliminary role setting information, role setting information is obtained, including: calculating a role rationality score corresponding to each preliminary designed role in the preliminary role setting information; determining whether the role rationality score corresponding to each preliminary designed role is greater than or equal to a rationality threshold, and if not, re-calling the role creation model to generate preliminary role setting information until the role rationality score corresponding to each preliminary designed role is greater than or equal to the rationality threshold, and obtaining the role setting information based on the preliminary role setting information.
[0086] In this embodiment, a self-reflection mechanism is set in the character design stage, which can call the character creation model again to generate preliminary character setting information when the character design is unreasonable. Specifically, the self-reflection mechanism is completed by the character rationality scoring function obtained by pre-training. The principle of the self-reflection mechanism is as follows:
[0087]
[0088] Where x represents the current character, f(x) represents the character rationality scoring function, θ is the rationality threshold, and g(x) is the regeneration function used to re-call the character creation model. Optionally, the character rationality scoring function and the regeneration function can be pre-trained agents.
[0089] In this embodiment, Figure 3 The character design process diagram shown in the figure, the specific implementation process of the character design stage is as follows:
[0090] Step 301, inputting character creation basic data into the character creation model;
[0091] Step 302, the character creation model outputs preliminary character setting information;
[0092] Step 303, calling the role rationality scoring function to calculate the role rationality score corresponding to each preliminary designed role in the preliminary role setting information;
[0093] Step 304, determining whether the role rationality score corresponding to each preliminary design role is greater than or equal to the rationality threshold, that is, whether each preliminary design role is reasonable, if so, executing step 305, if not, calling the regeneration function, executing step 302;
[0094] Step 305: The creator makes detailed adjustments to the preliminary role setting information to obtain role setting information.
[0095] In this embodiment, the creator can adjust the details of each preliminary designed character in terms of its own contradictions, behavioral motivations, language style, etc. to ensure that the generated content meets the creation needs, realize human-computer collaboration to optimize the character setting information, improve the creation efficiency of the character design stage, and ensure the uniqueness and artistic value of each designed character.
[0096] In one embodiment, the first creation stage includes a scene design stage, the first creation result includes a scene sequence, and the scene sequence includes at least two scenes; the second creation stage includes a dialogue generation stage. Processing the first creation basic data to obtain the first creation result includes: inputting the scene design basic data into a scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using scene design sample data; based on the preliminary scene sequence, obtaining the scene sequence.
[0097] In this embodiment, the scenario design stage is used as the first creation stage, and the dialogue generation stage is used as the second creation stage to implement the script creation method provided by the present application. The dialogue generation basic data required in the dialogue generation stage includes the story framework, role setting information and scene sequence.
[0098] In this embodiment, the story framework is obtained by using a pre-trained story creation model. The basic story creation data required for the story creation stage is obtained; the basic story creation data is input into the story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model using story creation sample data; based on the preliminary framework, the story framework is obtained. Optionally, the story framework can also be obtained by other methods such as manual input by the creator.
[0099] In this embodiment, the role setting information is obtained through a pre-trained role creation model. Specifically, the basic role creation data required for the role design stage is obtained; the basic role creation data is input into the role creation model to obtain preliminary role setting information output by the role creation model, wherein the role creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using role creation sample data; based on the preliminary role setting information, the role setting information is obtained. Optionally, the role setting information can also be obtained through other methods such as manual input by the creator.
[0100] In this embodiment, the scene sequence is obtained by pre-training the scene design model. The scene design model is obtained by training a large model using a multi-layer neural network architecture (multi-layer transformer structure) based on a self-attention mechanism using scene design sample data. The multi-layer transformer structure has more advantages in terms of enhanced expression ability, better modeling of long-distance dependencies, parallelization and efficient training, strong adaptability, residual connection and layer normalization, adaptive attention mechanism and scalability. Optionally, the scene design basic data, preliminary scene sequence and scene sequence in the process of using the scene design model can be used as sample data to update the scene design sample data, so as to re-train the scene design model with the updated scene design sample data, so that the collaboration between the scene design model and the creator is smoother and more fruitful.
[0101] In this embodiment, an adaptive learning rate optimization algorithm such as Adam can be used in the scene design model training process, or techniques such as gradient clipping can be used to prevent gradient explosion; a small batch gradient descent method can also be used for iterative training, or an early stopping strategy can be used to prevent overfitting.
[0102] Furthermore, the scene design model introduces the Conditional Variational Autoencoder (CVAE). By introducing conditional information, CVAE enables the scene design model to generate data under given specific conditions, so that the scene design model can generate scene layout and elements based on the story framework and context, thereby ensuring the continuity of the scene sequence.
[0103] Furthermore, the scenario design model introduces Graph Neural Networks (GNN), which is a type of deep learning model used to process graph structured data. Unlike traditional deep learning models, GNN can operate directly on the graph structure and extract the features of nodes, edges, and subgraphs, so as to be applied to process graph structured data and perform effective feature extraction and information propagation on the graph.
[0104] In this embodiment, a large amount of labeled scene design sample data is used in the scene design model training process, and the model parameters are optimized by minimizing the loss function between the generated scene and the real scene. Optionally, the loss function includes reconstruction error, KL divergence and adversarial loss. Reconstruction error is an indicator to measure the difference between the original data and the reconstructed data, reflecting the degree of information loss of the scene design model during data compression and decompression. KL divergence (Kullback-Leibler Divergence) is an important concept in information theory, which is used to measure the difference between two probability distributions. Adversarial Loss is a key component in Generative Adversarial Networks (GANs), which is used to train the generator and discriminator, so that the generator can generate more realistic samples, while enabling the discriminator to better distinguish between real data and generated data.
[0105] The loss function is expressed as follows:
[0106] L=λ1L recon +λ2L KL +λ3L adv
[0107] Among them, L recon is the reconstruction error, L KL is the KL divergence, L adv For adversarial loss, λ1, λ2, and λ3 are different weight coefficients.
[0108] In this embodiment, the basic scene design data includes the story framework, scene tasks, historical and cultural background, and role setting information. The scene design model designs a scene sequence with smooth transitions based on the basic scene design data. The scene design model is expressed as follows:
[0109] S 1:n =f(C,H,T,P)
[0110] Where f represents the scenario design function; S 1:n Represents the generated scene sequence, including n scenes, where n is a positive integer; C represents the role setting information; H represents the historical and cultural background; T represents the scene task setting; and P represents the story framework.
[0111] In this embodiment, the creation basic data is processed to obtain a second creation result, including: obtaining the dialogue generation basic data required for the dialogue generation stage, wherein the dialogue generation basic data includes a scene sequence, and the scene sequence includes at least one scene; based on the scene complexity of each scene, calling a dialogue generation model to obtain a preliminary dialogue sequence, wherein the dialogue generation model is obtained by training a large model with dialogue generation sample data; based on the preliminary dialogue sequence, obtaining a dialogue sequence.
[0112] In one embodiment, based on the preliminary scene sequence, a scene sequence is obtained, including: calculating the coherence scores between adjacent preliminary scenes in the preliminary scene sequence; determining whether the coherence scores between the preliminary scenes are greater than the coherence threshold, and if not, re-calling the scene design model to generate the preliminary scene sequence until the coherence scores between the preliminary scenes are greater than the coherence threshold, and obtaining the scene sequence based on the preliminary scene sequence.
[0113] In this embodiment, the scene design model needs to ensure that each scene in the scene sequence has strict logical self-consistency in terms of the location, time, purpose of presence and other factors, and ensure that the transition between multiple scenes is natural and smooth without any sense of violation. To achieve this goal, the naturalness of the transition between adjacent scenes is evaluated by coherence scoring. Optionally, the coherence score is calculated by a pre-trained scene coherence scoring module based on a graph convolutional network (Graph Convolutional Network, GCN). GCN is a powerful deep learning method that can effectively process graph structured data. By aggregating the information of neighbor nodes, GCN can capture local and global structural features in the graph. The coherence score calculation process is as follows:
[0114] Score coherence =GCN(S i-1 ,S i ,S i+1 )
[0115] Among them, Score coherence represents the coherence score, S i-1 , S i , S i+1 Respectively represent three adjacent preliminary scenes.
[0116] In this embodiment, Figure 4 The scene design process diagram shown in the figure, the specific implementation process of the scene design stage is as follows:
[0117] Step 401, inputting scene design basic data into the scene design model;
[0118] Step 402, the scene design model outputs a preliminary scene sequence;
[0119] Step 403, calling the scene coherence scoring module to calculate the coherence scores between the preliminary scenes;
[0120] Step 404, determining whether the coherence score between any three consecutive scenes is greater than the coherence threshold, if so, executing step 405, if not, re-calling the scene design model and executing step 402;
[0121] In step 405, the creator makes detail adjustments to the preliminary scene sequence to obtain a scene sequence.
[0122] In this embodiment, the creator can adjust the scene details of any preliminary scene in the preliminary scene sequence to ensure that the generated content meets the creative needs, realize human-computer collaboration to optimize the scene sequence, improve the creative efficiency in the scene design stage, and ensure the uniqueness and artistic value of each scene.
[0123] In one embodiment, the first creation stage includes a dialogue generation stage, and the first creation result includes a dialogue sequence; the second creation stage includes a script synthesis stage. Obtaining the first creation result corresponding to the first creation stage includes: obtaining the dialogue generation basic data required for the dialogue generation stage, wherein the dialogue generation basic data includes a scene sequence, and the scene sequence includes at least one scene; based on the scene complexity of each scene, calling the dialogue generation model to obtain a preliminary dialogue sequence, wherein the dialogue generation model is obtained by training a large model using dialogue generation sample data; based on the preliminary dialogue sequence, obtaining the dialogue sequence.
[0124] In this embodiment, the script creation method provided by the present application is implemented by taking the dialogue generation stage as the first creation stage and the script synthesis stage as the second creation stage. The script synthesis basic data required in the script synthesis stage includes the story framework, role setting information, scene sequence and dialogue sequence.
[0125] In this embodiment, the story framework is obtained by using a pre-trained story creation model. Specifically, the basic story creation data required for the story creation stage is obtained; the basic story creation data is input into the story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model using story creation sample data; based on the preliminary framework, the story framework is obtained. Optionally, the story framework can also be obtained by other methods such as manual input by the creator.
[0126] In this embodiment, the role setting information is obtained through a pre-trained role creation model. Specifically, the basic role creation data required for the role design stage is obtained; the basic role creation data is input into the role creation model to obtain preliminary role setting information output by the role creation model, wherein the role creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using role creation sample data; based on the preliminary role setting information, the role setting information is obtained. Optionally, the role setting information can also be obtained through other methods such as manual input by the creator.
[0127] In this embodiment, the scene sequence is obtained through a pre-trained scene design model. Specifically, the scene design basic data is input into the scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using scene design sample data; based on the preliminary scene sequence, the scene sequence is obtained. Optionally, the scene sequence can also be obtained through other methods such as manual input by the creator.
[0128] In this embodiment, the dialogue sequence is obtained by a pre-trained dialogue generation model, and the dialogue generation model is obtained by training a large model using dialogue generation sample data. The basic dialogue generation data required for the dialogue generation stage includes the story framework, character setting information, and scene sequence. Based on the scene complexity of each scene in the scene sequence, the dialogue generation model is called to obtain a preliminary dialogue sequence. Optionally, the dialogue generation basic data, preliminary dialogue sequence, and dialogue sequence during the use of the dialogue generation model can all be used as sample data to update the dialogue generation sample data, so that the dialogue generation model can be re-trained using the updated dialogue generation sample data, making the collaboration between the dialogue generation model and the creator smoother and more effective.
[0129] In this embodiment, an adaptive learning rate optimization algorithm such as Adam can be used in the dialogue generation model training process, or a technique such as gradient clipping can be used to prevent gradient explosion; a small batch gradient descent method can also be used for iterative training, or an early stopping strategy can be used to prevent overfitting.
[0130] Furthermore, the scene complexity of each scene is calculated first. The scene complexity is directly related to the number of characters in the scene. The larger the number of characters in the scene, the greater the scene complexity. The complexity threshold α is set based on the number of characters.
[0131] Automatically switch the dialogue generation mode based on the scene complexity C. Assume that the scene sequence is S = {s1, s2, ..., s n}, the system traverses each scene s in S i :
[0132] If C(si )<α, then determine s i For simple scenarios, the dialogue generation model G is directly called based on the context ctx(s i ) Generate the scene i The corresponding dialogue is as follows:
[0133] D i =G(ctx(s i ))
[0134] Among them, ctx(s i ) including story framework, character setting information and scenes i Specific scene information.
[0135] If C(s i )≥α, then determine s i For complex scenes, the dialogue generation model is used for this scene s i The m roles in the game create corresponding dialogue agents, m dialogue agents A = {a1, a2, ..., a m}, each agent a j Generate scenes i Part of the dialogue below ij :
[0136] d ij =a j (ctx(s i ))
[0137] Then the conversations of m dialogue agents are integrated into scene s i The full conversation below:
[0138] D i =Merge({d i1 ,d i2 ,...,d im}).
[0139] In one embodiment, based on a preliminary dialogue sequence, a dialogue sequence is obtained, including: integrating a recursive dialogue sequence corresponding to a first scene with a model-generated dialogue sequence corresponding to a second scene to obtain a recursive dialogue sequence corresponding to the second scene, wherein the preliminary dialogue sequence includes a model-generated dialogue sequence corresponding to each scene, the first scene and the second scene are any two adjacent scenes in the scene sequence, and the model-generated dialogue sequence corresponding to the first scene in the scene sequence is used as the recursive dialogue sequence corresponding to the first scene; based on the recursive dialogue sequences corresponding to each scene, a dialogue sequence is obtained.
[0140] In this embodiment, in order to avoid content overlap between scenes, the recursive dialogue sequence corresponding to the first scene and the model-generated dialogue sequence corresponding to the second scene are integrated. Optionally, the integration is implemented by a pre-trained recursive integration function R. Specifically,
[0141]
[0142] The Integrate function integrates the model-generated dialogue sequence corresponding to the second scenario with the recursive dialogue sequence corresponding to the first scenario, and compresses the overlapping dialogues considering the contextual relationship.
[0143] The final generated dialogue sequence is:
[0144] D=R(n)=Integrate(R(n-1),D n )
[0145] The Integrate function can effectively handle content overlap between scenes and ensure the fluency and logical consistency of the overall dialogue.
[0146] In this embodiment, Figure 5 The specific implementation process of the dialogue generation stage is as follows:
[0147] Step 501, traverse each scene in the scene sequence;
[0148] Step 502, judging whether it is a simple scene based on the scene complexity, if so, executing step 503, if not, executing step 504;
[0149] Step 503, directly call the dialogue generation model to generate the dialogue in the scenario, and execute step 507;
[0150] Step 504, based on the dialogue generation model, create a dialogue agent corresponding to each role in the scene;
[0151] Step 505, each agent generates a dialogue for the corresponding character in the scene;
[0152] Step 506, integrating the dialogues of all characters in the scene;
[0153] Step 507, determine whether there is a next scene that has not been processed, if so, execute step 501, if not, execute step 508;
[0154] Step 508, calling a recursive integration function to integrate the dialogues in all scenarios and generate a preliminary dialogue sequence;
[0155] Step 509: The creator makes detailed adjustments to the preliminary dialogue sequence to obtain a dialogue sequence.
[0156] In this embodiment, the creator can make detailed adjustments to the dialogue content of any preliminary dialogue in the preliminary dialogue sequence to ensure that the generated content meets the creation needs, realize human-computer collaboration to optimize the dialogue sequence, improve the creation efficiency of the dialogue generation stage, and ensure the uniqueness and artistic value of each dialogue.
[0157] In one embodiment, the basic creative data required for the script synthesis stage also includes a story framework, character setting information, scene sequence, and script type. Processing the basic creative data to obtain a second creative result includes: inputting the story framework, character setting information, scene sequence, dialogue sequence, and script type into a script synthesis model to obtain a preliminary script output by the script synthesis model, wherein the script synthesis model is obtained by training a large model based on the script synthesis sample data; based on the preliminary script, obtaining a target script.
[0158] In this embodiment, the script synthesis basic data includes story framework, role setting information, scene sequence, dialogue sequence and script type. On the premise that the story framework, role setting information, scene sequence and dialogue sequence have been obtained, the creator can give the script type, for example, a movie or a TV series, and obtain the target script by the pre-trained script synthesis model. The script synthesis model is obtained by training the large model based on the script synthesis sample data. The script synthesis model is trained based on the script synthesis sample data extracted from a large amount of real script data, and can understand the structure and format characteristics of different types of scripts. The script synthesis model training process can also adopt a method combining supervised learning and reinforcement learning. Through the study of a large number of high-quality scripts, the script synthesis model has mastered the structural characteristics and writing skills of different types of scripts. At the same time, an expert scoring mechanism can also be introduced to evaluate and feedback the output of the script synthesis model according to factors such as the quality, creativity and market potential of the script, and continuously optimize the model performance. Optionally, the script synthesis basic data, preliminary script and target script in the use of the script synthesis model can all be updated to the script synthesis sample data as sample data, so as to retrain the script synthesis model with the updated script synthesis sample data, so that the collaboration between the script synthesis model and the creator is smoother and more fruitful.
[0159] In this embodiment, an adaptive learning rate optimization algorithm such as Adam can be used during the script synthesis model training process, or techniques such as gradient clipping can be used to prevent gradient explosion; a small batch gradient descent method can also be used for iterative training, or an early stopping strategy can be used to prevent overfitting.
[0160] In this embodiment, the workflow of the script synthesis model can be summarized by the following mathematical expression:
[0161] O=M(S,C,E,D,T)
[0162] Among them, S represents the story framework, C represents the character setting information, E represents the scene sequence, D represents the dialogue sequence, T represents the script type, M is the script synthesis model, and O is the output target script.
[0163] The working process of the script synthesis model M can be further decomposed into:
[0164] M(S,C,E,D,T)=f o (f f (S,C,E,D,T))·f c (S,C,E,D)
[0165] Among them, f c is a content checking function to ensure the rationality and coherence of the input content; f f is a formatting function that reorganizes and formats the content according to the script type; f o It is an optimization function that optimizes the script.
[0166] In this embodiment, Figure 6 The script synthesis process diagram shown in the figure, the specific implementation process of the script synthesis stage is as follows:
[0167] Step 601, inputting script synthesis basic data into the script synthesis model;
[0168] Step 602, the script synthesis model completes content checking, formatting content according to script type, optimizing script and other processing logic, and outputs a preliminary script;
[0169] Step 603, the creator determines whether the preliminary script needs to be adjusted. If so, the script synthesis model is re-called and step 602 is executed. If not, step 604 is executed.
[0170] In step 604, the creator makes detailed adjustments to the preliminary script to obtain the target script.
[0171] In this embodiment, the creator can submit feedback based on the script content and repeatedly drive the script synthesis model to meet the creation needs. The script synthesis model will readjust the relevant parameters based on the feedback and generate a new preliminary script until the creator's expected effect is achieved.
[0172] In an overall embodiment, Figure 7 The script creation process shown includes five creation stages: story creation, character design, scene design, dialogue generation, and script synthesis. The story creation model, character creation model, scene design model, dialogue generation model, and script synthesis model are trained in advance.
[0173] In this embodiment, based on the story creation basic data, the story creation model generates a preliminary framework, and after the creator participates in feedback or adjustment, the story framework is obtained; based on the character creation basic data including the story framework, the character creation model generates preliminary character setting information, and after the creator participates in feedback or adjustment, the character setting information is obtained; based on the scene design basic data including the story framework and the character setting information, the scene design model generates a preliminary scene sequence, and after the creator participates in feedback or adjustment, the scene sequence is obtained; based on the dialogue generation basic data including the story framework, the character setting information and the scene sequence, the dialogue generation model generates a preliminary dialogue sequence, and after the creator participates in feedback or adjustment, the dialogue sequence is obtained; based on the script synthesis basic data including the story framework, the character setting information, the scene sequence and the dialogue sequence, the script synthesis model generates a preliminary script, and after the creator participates in feedback or adjustment, the target script is obtained.
[0174] In this embodiment, the big model is integrated into the core creative stages of the script creation process, such as story creation, character design, scene design, dialogue generation, and script synthesis. Each creative stage is participated by the fine-tuned domain big model, which collaborates with the creators, combining the creators' professionalism with the creativity and efficiency of the big model. While maintaining a high level of accuracy, the overall creative efficiency is greatly improved. Not only can the script be accurately customized according to project details and the creator's intentions, but also a high degree of flexibility and interactivity can be maintained throughout the script creation process. It can respond to the creator's inspiration changes and optimization needs at any time, effectively breaking through the bottleneck of existing technologies, and bringing new vitality and unlimited possibilities to the creative field.
[0175] In the present application, the first creative result corresponding to the first creative stage is obtained, wherein the script creation process includes the first creative stage and the second creative stage; the basic creative data required for the second creative stage is obtained, and the basic creative data includes the first creative result; the basic creative data is processed to obtain the second creative result, wherein, if the second creative stage is the last creative stage of the script creation process, the second creative result is the target script obtained after the script creation process is completed. In the above process, the first creative result of the first creative stage in the script creation process, as the basic creative data required for the second creative stage, can provide more basic creative data even in the face of multiple creative stages in the entire script creation process, thereby avoiding the problem of poor accuracy of the creative results due to too little key information and improving the script development effect. And the entire script creation process is divided into stages to realize the automated creation process, realize fine-grained automated script creation in each creative stage, reduce unnecessary human intervention, and improve the degree of automation of script creation, thereby further improving the effect of script development.
[0176] Furthermore, a multi-stage human-machine collaborative creation process is realized, and human-machine collaboration is realized in the five main creation stages of story creation, character design, scene design, dialogue generation and script synthesis, which can more accurately meet the specific project requirements and style characteristics. In addition, multi-model collaboration can further explore the story connotation, cultural heritage and novel expression methods, and significantly improve the overall creation efficiency while ensuring high-quality output. Each stage allows creators to intervene, provide feedback and perform iterative optimization, fully reflecting personal style and brand characteristics, and improving the flexibility of the creation process. An adaptive intelligent generation mode is realized, and the self-reflection mechanism SR(x) in the character design stage ensures the rationality of the character setting through the scoring function f(x) and the regeneration function g(x). And the adaptive dialogue generation mode based on the scene complexity C can flexibly handle simple and complex scenes. A multi-agent collaboration mechanism is realized. In the dialogue generation of complex scenes, multiple dialogue agents are used to work together to improve the quality and coherence of the dialogue. Through the recursive integration function R, the fluency and logical consistency of the dialogue between multiple scenes are ensured.
[0177] Exemplary Devices
[0178] Accordingly, the present application embodiment also provides a script creation device, such as Figure 8 As shown, the device may include:
[0179] A first acquisition module 801 is used to acquire a first creation result corresponding to a first creation stage, wherein the script creation process includes a first creation stage and a second creation stage;
[0180] The second acquisition module 802 is used to acquire the creation basic data required for the second creation stage, where the creation basic data includes the first creation result;
[0181] The processing module 803 is used to process the basic creation data to obtain a second creation result. If the second creation stage is the last creation stage of the script creation process, the second creation result is the target script obtained after the script creation process is completed.
[0182] In one embodiment, the first creation stage includes a story creation stage, and the first creation result includes a story framework; the second creation stage includes a character design stage;
[0183] The first acquisition module 801 is used to obtain the basic story creation data required for the story creation stage; input the basic story creation data into the story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model with story creation sample data; based on the preliminary framework, a story framework is obtained.
[0184] In one embodiment, the first creation stage includes a character design stage, and the first creation result includes character setting information; the second creation stage includes a scene design stage;
[0185] The first acquisition module 801 is used to obtain basic character creation data required for the character design stage; input the basic character creation data into the character creation model to obtain preliminary character setting information output by the character creation model, wherein the character creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using character creation sample data; based on the preliminary character setting information, obtain the character setting information.
[0186] In one embodiment, the character creation model training stage adopts a multi-task learning mechanism, a contrastive learning mechanism and a reinforcement learning mechanism; the training process of the character creation model is as follows: inputting character creation sample data into a neural network model based on a self-attention mechanism to obtain sample results output by the neural network model based on the self-attention mechanism; calculating the multi-task loss corresponding to the multi-task learning mechanism, the contrastive loss corresponding to the contrastive learning mechanism and the reward corresponding to the reinforcement learning mechanism; based on the multi-task loss, contrastive loss and reward, obtaining the comprehensive loss of the neural network model of the self-attention mechanism; adjusting the internal parameters of the neural network model of the self-attention mechanism based on the comprehensive loss until the training threshold of the neural network model of the self-attention mechanism is reached to obtain the character creation model.
[0187] In one embodiment, the first acquisition module 801 is used to calculate the role rationality score corresponding to each preliminary designed role in the preliminary role setting information; determine whether the role rationality score corresponding to each preliminary designed role is greater than or equal to the rationality threshold, if not, re-call the role creation model to generate preliminary role setting information until the role rationality score corresponding to each preliminary designed role is greater than or equal to the rationality threshold, and obtain the role setting information based on the preliminary role setting information.
[0188] In one embodiment, the first creation stage includes a scene design stage, the first creation result includes a scene sequence, and the scene sequence includes at least two scenes; the second creation stage includes a dialogue generation stage;
[0189] The first acquisition module 801 is used to input the basic scene design data into the scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using scene design sample data; based on the preliminary scene sequence, a scene sequence is obtained.
[0190] In one embodiment, the first acquisition module 801 is used to calculate the coherence scores between adjacent preliminary scenes in the preliminary scene sequence; determine whether the coherence scores between the preliminary scenes are greater than the coherence threshold, and if not, re-call the scene design model to generate the preliminary scene sequence until the coherence scores between the preliminary scenes are greater than the coherence threshold, and acquire the scene sequence based on the preliminary scene sequence.
[0191] In one embodiment, the first creation stage includes a dialogue generation stage, and the first creation result includes a dialogue sequence; the second creation stage includes a script synthesis stage;
[0192] The first acquisition module 801 is used to acquire basic dialogue generation data required for the dialogue generation stage, wherein the basic dialogue generation data includes a scene sequence, and the scene sequence includes at least one scene; based on the scene complexity of each scene, the dialogue generation model is called to acquire a preliminary dialogue sequence, wherein the dialogue generation model is obtained by training a large model with dialogue generation sample data; based on the preliminary dialogue sequence, a dialogue sequence is acquired.
[0193] In one embodiment, the first acquisition module 801 is used to integrate the recursive dialogue sequence corresponding to the first scene with the model-generated dialogue sequence corresponding to the second scene to obtain the recursive dialogue sequence corresponding to the second scene, wherein the preliminary dialogue sequence includes the model-generated dialogue sequence corresponding to each scene, the first scene and the second scene are any two adjacent scenes in the scene sequence, and the model-generated dialogue sequence corresponding to the first scene in the scene sequence is used as the recursive dialogue sequence corresponding to the first scene; based on the recursive dialogue sequences corresponding to each scene, a dialogue sequence is obtained.
[0194] In one embodiment, the basic creative data required in the script synthesis stage also includes story framework, character setting information, scene sequence and script type;
[0195] The second acquisition module 802 is used to input the story framework, character setting information, scene sequence, dialogue sequence and script type into the script synthesis model to obtain a preliminary script output by the script synthesis model, wherein the script synthesis model is obtained by training a large model based on script synthesis sample data; based on the preliminary script, a target script is obtained.
[0196] In one embodiment, the script creation process includes a story creation stage, a character design stage, a scene design stage, a dialogue generation stage, and a script synthesis stage, which are performed in sequence; the first creation stage and the second creation stage are any two creation stages performed in sequence in the script creation process.
[0197] The script creation device provided in this embodiment belongs to the same application concept as the script creation method provided in the above embodiments of this application, and can execute the script creation method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the specific processing content of the script creation method provided in the above embodiments of this application, and will not be repeated here.
[0198] Exemplary Electronic Devices
[0199] The present application also provides an electronic device, such as Fig. 9 As shown, the electronic device includes: a memory 900 and a processor 901 .
[0200] The memory 900 is connected to the processor 901 and is used to store programs.
[0201] The processor 901 is used to implement the script creation method in the above embodiment by running the program stored in the memory 900.
[0202] Specifically, the electronic device may further include: a communication interface 902 , an input device 903 , an output device 904 and a bus 905 .
[0203] The processor 901, the memory 900, the communication interface 902, the input device 903 and the output device 904 are connected to each other via a bus.
[0204] Bus 905 may include a pathway for transferring information between the various components of the computer system.
[0205] The processor 901 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0206] The processor 901 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0207] The memory 900 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 900 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0208] The input device 903 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0209] Output device 904 may include a device that allows information to be output to a user, such as a display screen, printer, speaker, etc.
[0210] The communication interface 902 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0211] The processor 901 executes the program stored in the memory 900 and calls other devices, which can be used to implement the various steps of the script creation method provided in the above embodiments of the present application.
[0212] Exemplary computer program products and storage media
[0213] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the script creation method described in the embodiment of the present application.
[0214] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0215] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the script creation method described in the embodiment of the present application.
[0216] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0217] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0218] The steps in the methods of each embodiment of the present application can be adjusted in sequence, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0219] The modules and sub-modules in the devices and terminals provided in the embodiments of the present application can be combined, divided and deleted according to actual needs.
[0220] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0221] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0222] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0223] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0224] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0225] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0226] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A script creation method, characterized in that: include: Obtaining a first creation result corresponding to a first creation stage, wherein the script creation process includes a first creation stage and a second creation stage; Acquire basic creation data required for the second creation stage, wherein the basic creation data includes the first creation result; The basic creation data is processed to obtain a second creation result, wherein if the second creation stage is the last creation stage of the script creation process, then the second creation result is the target script obtained after completing the script creation process.
2. The script creation method according to claim 1, characterized in that: The first creation stage includes a story creation stage, and the first creation result includes a story framework; the second creation stage includes a character design stage; The obtaining of the first creation result corresponding to the first creation stage includes: Acquiring basic story creation data required for the story creation stage; Inputting the story creation basic data into the story creation model to obtain a preliminary framework output by the story creation model, wherein the story creation model is obtained by training a large model using the story creation sample data; Based on the preliminary framework, the story framework is obtained.
3. The script creation method according to claim 1, characterized in that: The first creation stage includes a character design stage, and the first creation result includes character setting information; The second creation stage includes a scene design stage; The obtaining of the first creation result corresponding to the first creation stage includes: Acquire basic character creation data required for the character design stage; Inputting the basic character creation data into a character creation model to obtain preliminary character setting information output by the character creation model, wherein the character creation model is obtained by training a large model using a neural network architecture based on a self-attention mechanism using the character creation sample data; Based on the preliminary role setting information, the role setting information is acquired.
4. The script creation method according to claim 3, characterized in that: The character creation model training stage adopts a multi-task learning mechanism, a contrastive learning mechanism and a reinforcement learning mechanism; The training process of the character creation model is as follows: Inputting the character creation sample data into the neural network model based on the self-attention mechanism to obtain a sample result output by the neural network model based on the self-attention mechanism; Calculating the multi-task loss corresponding to the multi-task learning mechanism, the contrastive loss corresponding to the contrastive learning mechanism, and the reward corresponding to the reinforcement learning mechanism; Based on the multi-task loss, the contrast loss and the reward, obtaining a comprehensive loss of the neural network model of the self-attention mechanism; Based on the comprehensive loss, the internal parameters of the neural network model of the self-attention mechanism are adjusted until the training threshold of the neural network model of the self-attention mechanism is reached to obtain the character creation model.
5. The script creation method according to claim 3, characterized in that: The acquiring the role setting information based on the preliminary role setting information includes: Calculating a role rationality score corresponding to each preliminary designed role in the preliminary role setting information; Determine whether the role rationality score corresponding to each of the preliminary designed roles is greater than or equal to a rationality threshold; if not, re-call the role creation model to generate preliminary role setting information, until the role rationality score corresponding to each of the preliminary designed roles is greater than or equal to a rationality threshold, and obtain the role setting information based on the preliminary role setting information.
6. The script creation method according to claim 1, characterized in that: The first creation stage includes a scene design stage, the first creation result includes a scene sequence, and the scene sequence includes at least two scenes; the second creation stage includes a dialogue generation stage; The step of processing the first creation basic data to obtain a first creation result includes: Inputting the scene design basic data into a scene design model to obtain a preliminary scene sequence output by the scene design model, wherein the scene design model is obtained by training a large model using a multi-layer neural network architecture based on a self-attention mechanism using the scene design sample data; Based on the preliminary scene sequence, the scene sequence is acquired.
7. The script creation method according to claim 6, characterized in that: The step of acquiring the scene sequence based on the preliminary scene sequence includes: Calculating coherence scores between adjacent preliminary scenes in the preliminary scene sequence; Determine whether the coherence score between each of the preliminary scenes is greater than a coherence threshold; if not, re-call the scene design model to generate a preliminary scene sequence until the coherence score between each of the preliminary scenes is greater than a coherence threshold, and obtain the scene sequence based on the preliminary scene sequence.
8. The script creation method according to claim 1, characterized in that: The first creation stage includes a dialogue generation stage, and the first creation result includes a dialogue sequence; The second creative stage includes the script synthesis stage; The obtaining of the first creation result corresponding to the first creation stage includes: Acquire basic dialogue generation data required for the dialogue generation stage, wherein the basic dialogue generation data includes a scene sequence, and the scene sequence includes at least one scene; Based on the scene complexity of each scene, a dialogue generation model is called to obtain a preliminary dialogue sequence, wherein the dialogue generation model is obtained by training a large model using dialogue generation sample data; Based on the preliminary dialog sequence, the dialog sequence is obtained.
9. The script creation method according to claim 8, characterized in that: The acquiring the dialogue sequence based on the preliminary dialogue sequence includes: Integrate the recursive dialogue sequence corresponding to the first scene with the model-generated dialogue sequence corresponding to the second scene to obtain a recursive dialogue sequence corresponding to the second scene, wherein the preliminary dialogue sequence includes the model-generated dialogue sequence corresponding to each of the scenes, the first scene and the second scene are any two adjacent scenes in the scene sequence, and the model-generated dialogue sequence corresponding to the first scene in the scene sequence is used as the recursive dialogue sequence corresponding to the first scene; The dialogue sequence is obtained based on the recursive dialogue sequences corresponding to the various scenarios.
10. The script creation method according to claim 8, characterized in that: The basic creative data required for the script synthesis stage also includes story framework, role setting information, scene sequence and script type; The step of processing the creation basic data to obtain a second creation result includes: Inputting the story framework, the character setting information, the scene sequence, the dialogue sequence and the script type into a script synthesis model to obtain a preliminary script output by the script synthesis model, wherein the script synthesis model is obtained by training a large model based on script synthesis sample data; Based on the preliminary script, the target script is obtained.
11. The script creation method according to claim 1, characterized in that: The script creation process includes a story creation stage, a character design stage, a scene design stage, a dialogue generation stage and a script synthesis stage, which are carried out in sequence; The first creation stage and the second creation stage are any two creation stages carried out in sequence during the script creation process.
12. A script creation device, characterized in that: include: A first acquisition module is used to acquire a first creation result corresponding to a first creation stage, wherein the script creation process includes a first creation stage and a second creation stage; A second acquisition module is used to acquire basic creation data required for the second creation stage, wherein the basic creation data includes the first creation result; A processing module is used to process the basic creation data to obtain a second creation result, wherein if the second creation stage is the last creation stage of the script creation process, then the second creation result is the target script obtained after completing the script creation process.
13. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the script creation method as described in any one of claims 1 to 11 by running the program in the memory.
14. A computer program product, characterized in that It comprises computer program instructions, which, when executed by a processor, enable the processor to execute the script creation method as described in any one of claims 1 to 11.
Citation Information
Cited By
Original script-oriented AI autonomous plot structure adaptive generation system
CN121233763A