A method and system for generating literary scripts based on large language model
Through the Wensheng script generation method based on the large language model, the problem of unstable script generation quality in the existing technology is solved. Automatic character characteristics and background generation are adopted, and combined with the multi-head cross-attention mechanism, high-quality and highly logical scripts are achieved. Creation improves creative efficiency and user satisfaction.
Patent Information
- Application Number
- CN202411243058.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-05
AI Technical Summary
In the fields of creative writing and script creation, existing AI technologies are difficult to generate high-quality scripts, especially due to the unstable quality of generated scripts and lack of logic.
The Wensheng script generation method based on the large language model is adopted. By obtaining the user's script generation requirements, the character characteristics and perspective plot are automatically determined, and the script is generated using the character feature generator and plot generator, and the script is integrated with the multi-head cross-attention mechanism. Ensure the logic and coherence of the script.
It improves the efficiency and quality of script creation, enhances the logic and coherence of the storyline, provides dynamic character agency and plot-driven mechanism, and can generate personalized scripts based on user preferences, significantly improving user satisfaction.
Smart Images

Figure CN118761383B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data processing, and in particular to a method and system for generating a literary script based on a large language model. Background Art
[0002] In today's digital age, the rapid development of artificial intelligence technology has expanded to the field of content creation, especially in text generation and creative writing. With the help of advances in the field of natural language processing (NLP), especially the application of large language models (such as OpenAI's GPT series), computers are now able to generate text content with certain logic and creativity, including but not limited to news articles, poems, stories and even scripts.
[0003] Large pre-trained language models (such as GPT-3, GEMINI, etc.) have learned rich language structures and knowledge information by training on massive text data, which enables them to perform well in processing various natural language tasks. These models can generate coherent and logical text content based on given prompts, or perform NLP tasks such as text summarization and sentiment analysis. Using these models to explore the field of content creation, including automatically generating articles, writing stories, and composing music, is gradually becoming possible.
[0004] In the specific application field of creative writing and scriptwriting, there have been some attempts to use AI technology to assist in creation. These technical solutions usually combine the text generation capabilities of large language models with a certain degree of user interaction to achieve a personalized creation experience. Users can guide AI to generate stories or scripts by setting specific plots, characters, backgrounds and other elements. However, these solutions often face the challenge of unstable quality of generated scripts. Summary of the invention
[0005] An embodiment of the present invention provides a method for generating a Wensheng script based on a large language model, comprising:
[0006] Get the user's requirements for script generation;
[0007] Based on the pre-trained large language model, determine the role characteristics of multiple roles and the perspective plot of each role according to the requirements of the Wensheng script generation;
[0008] A literary script is generated based on the character traits of each character and the perspective of each character.
[0009] Optionally, obtaining the user's requirements for generating a literary script includes:
[0010] Display the preset front-end interface;
[0011] Obtaining the Wensheng script generation requirement input by the user based on the front-end interface;
[0012] The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
[0013] Optionally, the pre-trained large language model is used to determine the role characteristics of multiple roles and the perspective plot of each role according to the requirements for generating the Vincent script, including:
[0014] Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined;
[0015] The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
[0016] Optionally, generating a script based on the character characteristics of each character and the perspective of each character includes:
[0017] The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
[0018] Optionally, the method for generating a Vincent script based on a large language model further includes:
[0019] Obtain the user's script quality evaluation indicators;
[0020] Based on the script quality assessment indicators, determine the script quality assessment rules;
[0021] Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result;
[0022] The script quality assessment result is sent to the user.
[0023] The embodiment of the present invention provides a system for generating a literary script based on a large language model, comprising:
[0024] The acquisition module is used to obtain the user's requirements for generating literary scripts;
[0025] A determination module, for determining the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and the requirements for generating the script;
[0026] A generation module is used to generate a Wensheng script based on the role characteristics of each role and the perspective of each role.
[0027] Optionally, the acquisition module acquires the user's requirements for generating a literary script, including:
[0028] Display the preset front-end interface;
[0029] Obtaining the Wensheng script generation requirement input by the user based on the front-end interface;
[0030] The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
[0031] Optionally, the determination module determines the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and according to the requirements for generating the script, including:
[0032] Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined;
[0033] The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
[0034] Optionally, the generating module generates a script based on the character characteristics of each character and the perspective of each character, including:
[0035] The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
[0036] Optionally, the Wensheng script generation system based on the large language model further includes:
[0037] Quality assessment modules include:
[0038] Obtain the user's script quality evaluation indicators;
[0039] Based on the script quality assessment indicators, determine the script quality assessment rules;
[0040] Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result;
[0041] The script quality assessment result is sent to the user.
[0042] This application has achieved the following beneficial effects:
[0043] 1. Dynamic character agent creation and plot drive: One of the core innovations of the present invention is that the system automatically creates corresponding character agent objects based on the automatically generated characteristics and background of each character. These agent objects can interact and generate plots in preset or dynamically generated scenarios according to their respective attributes, thereby enhancing the logic and coherence of the storyline.
[0044] 2. Automatic character feature and background generation: The present invention uses a large pre-trained language model to automatically generate each character's personality, characteristics and background story based on the character name entered by the user. This degree of automation and personalization is an important innovation of the present invention, which improves the efficiency of the creation process and the richness of the generated content.
[0045] 3. User preference-driven script integration algorithm: By integrating user preference settings (such as story type, style, length, etc.) with the plots generated by all character agents, a set of optimization algorithms is used to generate a complete script that matches the user's preferences. This process can establish stronger interactions and connections between characters with the help of a multi-head cross-attention mechanism, thereby ensuring that the plots between the character perspectives are more coherent and the generated scripts are more logical, thereby improving the relevance and user satisfaction of the generated scripts. Compared with the prior art, the present invention shows significant advantages, especially in improving the efficiency and quality of script creation. First, by automatically generating character features and backgrounds, the present invention greatly reduces one of the most time-consuming parts of creative writing, namely building character profiles. This not only speeds up the creative process, but also provides more diverse and in-depth character personalities and backgrounds based on big data, thereby increasing the complexity and appeal of the story. In addition, the dynamic character agent and plot generation mechanism provide unprecedented flexibility for story creation, allowing each character to naturally develop the plot in a specific context according to its unique characteristics, which not only enhances the logic and coherence of the story, but also greatly promotes the creativity.
[0046] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0047] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0049] Figure 1It is a flow chart of a method for generating a Wensheng script based on a large language model in an embodiment of the present invention;
[0050] Figure 2 Schematic diagram of the application of the method for generating a literary script based on a large language model in an embodiment of the present invention;
[0051] Figure 3 Schematic diagram of another application of the method for generating a literary script based on a large language model in an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of a literary script generation system based on a large language model in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0054] The embodiment of the present invention provides a method for generating a literary script based on a large language model, such as Figure 1 As shown, including:
[0055] S1. Obtain the user's requirements for generating a literary script;
[0056] S2. Based on the pre-trained large language model, determine the role characteristics of multiple roles and the perspective of each role according to the requirements of the Wensheng script generation; the large language model can be an open source large language model running locally, or directly call the API of large language models such as Wenxin Yiyan and Tongyi Qianwen;
[0057] S3. Generate a literary script based on the character characteristics of each character and the perspective of each character.
[0058] In one embodiment, obtaining the user's requirements for generating a script includes:
[0059] Display the preset front-end interface;
[0060] Obtaining the Wensheng script generation requirement input by the user based on the front-end interface;
[0061] The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
[0062] In one embodiment, the pre-trained large language model is used to determine the role characteristics of multiple roles and the perspective of each role according to the requirements of the script generation, including:
[0063] Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined;
[0064] The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
[0065] In one embodiment, generating a Wensheng script based on the character characteristics of each character and the perspective plot of each character includes:
[0066] The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
[0067] In one embodiment, the method for generating a literary script based on a large language model further includes:
[0068] Obtain the user's script quality evaluation indicators;
[0069] Based on the script quality assessment indicators, determine the script quality assessment rules;
[0070] Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result;
[0071] The script quality assessment result is sent to the user.
[0072] In the above technical solution, if Figures 2 to 4 As shown, using a large language model includes:
[0073] Get user input;
[0074] Generate detailed character traits for each character and the storyline from each character’s perspective based on user input;
[0075] Based on the detailed characteristics of each character and the plot from each character's perspective, a written script is integrated.
[0076] When obtaining user input, a user input interface module is provided, which is responsible for providing a front-end interface. The user inputs the main information of the script through the front-end interface, including: character list, plot and story type. The input main information will be organized into an information form for processing.
[0077] When generating detailed character features for each character based on user input, a character feature generator is provided, which is responsible for generating detailed personality and background descriptions for each character in the character list based on the character list input by the user and using a large language model.
[0078] When generating the plot from each character's perspective based on user input, a plot generator is provided, which is responsible for using character agents to simulate interactions in set scenarios to generate storylines. Each agent generates a unique plot in a specific scenario based on the personality and background of the character it represents.
[0079] Based on the detailed characteristics of each character and the plot from the perspective of each character, when integrating into a live script, a script integrator is provided to integrate all independently generated plots and user preferences to produce a coherent and complete script text.
[0080] Classes and modules used in the technical solution of this application
[0081] 1. User Input Interface Module (UserInputInterfaceModule)
[0082] Attributes: None
[0083] Method: captureInputs() (capture script information entered by the user)
[0084] 2. Character Feature Generator
[0085] property:
[0086] characterList (input character list)
[0087] languageModel (large language model instance used)
[0088] method:
[0089] generateCharacterDetails() (generates personality and background descriptions for each character)
[0090] 3. Plot Generator
[0091] property:
[0092] characterAgents (a list of agent objects created based on character features)
[0093] scenario (the setting or context in which the story takes place)
[0094] method:
[0095] createCharacterAgents() (create character agent objects)
[0096] generateScenarios() (generates the scenario story corresponding to each proxy object)
[0097] 4. Script Integrator
[0098] property:
[0099] generatedScenarios (all scenarios collected from the scenario generator)
[0100] userPreferences (user preferences regarding script style, length, etc.)
[0101] languageModel (large language model instance used)
[0102] method:
[0103] integrateScript() (integrates all input and generated content to produce a complete script)
[0104] 5. Evaluation Module (ScriptEvaluationModule)
[0105] property:
[0106] analysedScripts (list of scripts generated and analyzed)
[0107] evaluationCriteria (a set of criteria used to evaluate the coherence and plausibility of a script)
[0108] languageModel (large language model instance used for text analysis and logic verification)
[0109] errorFeedback (generated feedback information, including logical contradictions found in the script and suggested improvement measures)
[0110] method:
[0111] evaluateCoherence() (evaluate the coherence of the script to ensure the natural flow and logical consistency of the story line)
[0112] evaluateLogicConsistency() (evaluate the logical rationality of character behavior and event development in the script)
[0113] generateFeedback() (generates feedback and suggestions for improving the script based on the evaluation results)
[0114] The detailed technical solution includes:
[0115] 1. User Input Interface Module (UserInputInterfaceModule)
[0116] Functional description: This module is responsible for providing a front-end interface through which users can easily input the main information of the script, such as characters, plots, and story types. This input information will be organized into an information form for processing.
[0117] Implementation method: Use modern web front-end technologies (such as React or Vue) to design and implement a user-friendly interface, collect user input through a form, and then serialize the information through the captureInputs() method to prepare for subsequent processing.
[0118] 2. Character Feature Generator
[0119] Functional description: Based on the list of characters entered by the user, a large language model is used to generate detailed personality and background descriptions of each character. This step is critical to creating rich, in-depth characters.
[0120] How to implement it: Initialize a large language model instance (such as OpenAI's GPT series) for use in this module. For each character in the user form, call the generateCharacterDetails() method to use the language model to generate a description text containing personality characteristics and background information.
[0121] 3. Plot Generator
[0122] Functional description: Use character agents to simulate interactions in set scenarios to generate storylines. Each agent can generate unique plots in specific scenarios based on the personality and background of the character it represents.
[0123] Implementation method: First, use the createCharacterAgents() method to generate agent objects based on the character details provided by CharacterFeatureGenerator. Then, use the generateScenarios() method to allow these agents to interact in one or more scenarios and use the language model to generate the corresponding plots.
[0124] 4. Script Integrator
[0125] Functional description: Integrate all independently generated plots and user preferences into a coherent and complete script text. This module takes into account the fluency, logic and specific requirements of the story, and is an important part of the final output.
[0126] Implementation method: The integrator first collects the various scene stories from the Plot Generator and combines them with the user's preferences (such as story length, tone, type preference, etc.). Then, the multi-perspective narrative network is called through the `integrateScript()` method to generate the final script based on these parameters, ensuring that its format is convenient for subsequent logical reasoning and evaluation module analysis.
[0127] The integration process uses the Multi-Perspective Narrative Network to integrate the character perspectives. The main steps are as follows:
[0128] Model input layer:
[0129] For each character’s perspective, the text is represented as a feature vector through a specific encoder (such as LSTM, GRU, or a pre-trained Transformer model). These feature vector sets are represented as ,in Number the characters.
[0130] Assume there are four characters, and the characters' perspectives are coded as .
[0131] Attention mechanism selection and operation:
[0132] In a multi-perspective narrative network, the Cross-Attention mechanism can be used to establish relationships across roles. This is different from the Self-Attention mechanism for a single role (i.e., the attention mechanism within each role itself). The Cross-Attention mechanism can enrich the perspective information of each role through information interaction with each other.
[0133] The specific steps are as follows:
[0134] Cross-Attention Mechanism:
[0135] 1. Query (Q): Feature representation from a role, for example, the feature vector of role 1 .
[0136] 2. Key (K) and Value (V): Feature representations from other roles (e.g., feature vectors for roles 2, 3, and 4) ), forming a complete set .
[0137] Through the Cross-Attention mechanism, we can calculate the comprehensive representation of the plot of character 1 after weighting the information of characters 2, 3, and 4: .
[0138] In this way, for each character's perspective, we performed weighted calculations based on the information of other characters.
[0139] In actual implementation, we need a multi-head cross-attention mechanism to further process and enhance features:
[0140]
[0141] The calculation method for each head is:
[0142]
[0143] Ultimately, the vector representation of each character draws on the information of other characters to form an updated feature vector.
[0144] Model output layer:
[0145] The outputs of the Transformer Blocks (after Cross-Attention processing) of all characters are concatenated to generate a comprehensive script feature representation. After being processed by the fully connected layer and activation function, the final script text is generated:
[0146]
[0147]
[0148] Through this Cross-Attention mechanism, we not only retain the unique perspective of each character, but also effectively combine the information of other characters, making the final script richer, more coherent, and more logical. At the same time, this design can make the interaction and connection between characters more natural, which is more in line with the needs of script narrative.
[0149] Iterative Optimization:
[0150] Initial conditions:
[0151] Set the initial state. The initial state of the script configuration is .
[0152] The initial script configuration can be determined by the first script generated by the language model.
[0153] Transition probability and acceptance criterion:
[0154] Transition probability: from the current state Transition to a new state Probability Depends on the score of the assessment module. The formula is:
[0155]
[0156] in, and are the evaluation scores of the new and old scripts respectively, Control the degree of exploration for the temperature parameter.
[0157] Acceptance criteria: If , then always accept the new state Otherwise, according to the probability Decide whether to accept.
[0158] Iteration process:
[0159] Update step: In each iteration, a random sampling is performed to decide whether to accept the new state. Specifically:
[0160]
[0161] Termination conditions:
[0162] Given a maximum number of iterations Or when the convergence criterion is met, the iteration stops.
[0163] Configured based on the highest rated scripts as the final output.
[0164] Output:
[0165] Output optimal script configuration , which is evaluated as the highest in the iterative process.
[0166] 5. Evaluation Module (ScriptEvaluationModule)
[0167] Functional description: The main responsibility of this module is to evaluate the quality of the generated scripts to ensure the logical coherence and rationality of their content. The evaluation module analyzes the character behavior, plot development, and story structure in the script, identifies any possible logical contradictions or inconsistencies, and provides specific feedback and improvement suggestions for the large language model.
[0168] Implementation method:
[0169] Logic and coherence check: The evaluation module introduces NLP algorithms and logical reasoning models to analyze the script text and evaluate its rationality and self-consistency in terms of character personality, plot coherence, story structure, etc. This can be done by setting a series of rules, such as checking whether the behavior of the characters in the script is consistent with their character descriptions, and whether there are logical loopholes in the storyline.
[0170] Evaluation Criteria Customization: Depending on the type of script, the evaluation module allows users or developers to customize the evaluation criteria and preferences to more accurately meet specific goals and requirements.
[0171] Generate evaluation score: Based on logic and coherence checks and user preference fit, the evaluation score is given according to a certain weight to help the script integrator determine whether the termination condition has been reached.
[0172] This series of operations can highly automate the script creation process, from character creation to plot development to the final script presentation, providing users with a new, interactive script creation experience. By utilizing the large language model, the generated scripts are highly creative and unpredictable, providing strong creative support for entertainment industries such as film, television and games.
[0173] The beneficial effects of this application include:
[0174] 1. Dynamic character agent creation and plot drive: One of the core innovations of the present invention is that the system automatically creates corresponding character agent objects based on the automatically generated characteristics and background of each character. These agent objects can interact and generate plots in preset or dynamically generated scenarios according to their respective attributes, thereby enhancing the logic and coherence of the storyline.
[0175] 2. Automatic character feature and background generation: The present invention uses a large pre-trained language model to automatically generate each character's personality, characteristics and background story based on the character name entered by the user. This degree of automation and personalization is an important innovation of the present invention, which improves the efficiency of the creation process and the richness of the generated content.
[0176] 3. User preference-driven script integration algorithm: By integrating user preference settings (such as story type, style, length, etc.) with the plots generated by all character agents, a set of optimization algorithms is used to generate a complete script that matches the user's preferences. This process can establish stronger interactions and connections between characters with the help of a multi-head cross-attention mechanism, thereby ensuring that the plots between the character perspectives are more coherent and the generated scripts are more logical, thereby improving the relevance and user satisfaction of the generated scripts. Compared with the prior art, the present invention shows significant advantages, especially in improving the efficiency and quality of script creation. First, by automatically generating character features and backgrounds, the present invention greatly reduces one of the most time-consuming parts of creative writing, namely building character profiles. This not only speeds up the creative process, but also provides more diverse and in-depth character personalities and backgrounds based on big data, thereby increasing the complexity and appeal of the story. In addition, the dynamic character agent and plot generation mechanism provide unprecedented flexibility for story creation, allowing each character to naturally develop the plot in a specific context according to its unique characteristics, which not only enhances the logic and coherence of the story, but also greatly promotes the creativity.
[0177] Secondly, the user preference-driven script integration algorithm enables the present invention to generate highly customized scripts while respecting the creator's personalized needs, which not only meets the user's specific preferences, but also realizes a "tailor-made" creative experience to a certain extent. This highly personalized service is rarely seen in the prior art, and it provides users with a higher level of participation and satisfaction. Finally, the front-end interactive interface design of the invention is simple and intuitive, ensuring that even users without professional backgrounds can easily participate in the script creation process, greatly reducing the creation threshold and expanding the potential user base of creative tools, which is of great significance in promoting the popularization and development of creative writing. In short, the present invention has shown obvious advantages in promoting personalized creation, improving creation efficiency and lowering the creation threshold.
[0178] The embodiment of the present invention provides a system for generating a script based on a large language model. Figure 4 As shown, including:
[0179] Acquisition module 1, used to obtain the user's requirements for generating a script;
[0180] Determination module 2, for determining the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and according to the requirements of the Wensheng script generation;
[0181] The generation module 3 is used to generate a Wensheng script based on the role characteristics of each role and the perspective of each role.
[0182] The acquisition module acquires the user's requirements for generating a literary script, including:
[0183] Display the preset front-end interface;
[0184] Obtaining the Wensheng script generation requirement input by the user based on the front-end interface;
[0185] The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
[0186] The determination module determines the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and the requirements for generating the script, including:
[0187] Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined;
[0188] The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
[0189] The generation module generates a script based on the role characteristics of each role and the perspective plot of each role, including:
[0190] The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
[0191] The script generation system based on the large language model also includes:
[0192] Quality assessment modules include:
[0193] Obtain the user's script quality evaluation indicators;
[0194] Based on the script quality assessment indicators, determine the script quality assessment rules;
[0195] Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result;
[0196] The script quality assessment result is sent to the user.
[0197] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating literary scripts based on a large language model. It is characterized in that include: Get the user's requirements for script generation; Based on the pre-trained large language model, determine the role characteristics of multiple roles and the perspective plot of each role according to the requirements of the script generation; Generate a script based on the character traits of each character and the perspective of each character; When generating a text script, a multi-perspective narrative network is used to integrate the character perspectives. The steps are as follows: For each character’s perspective, the text is represented as a feature vector through an encoder; These feature vector sets are represented as ,in is a character number; wherein the encoder includes at least: LSTM, GRU or pre-trained Transformer model; There are four characters, and the characters' perspectives are coded as ; Use the Cross-Attention mechanism to establish relationships across roles. The specific steps are as follows: Query (Q): Feature representation from a role, which is the feature vector of role 1 ; Key (K) and Value (V): Feature representations from other roles, which are the feature vectors of roles 2, 3, and 4 , forming a complete set ; Through the Cross-Attention mechanism, the plot of character 1 is calculated by weighting the comprehensive representation of the information of characters 2, 3, and 4: ; In this way, for each character's perspective plot, we performed a weighted calculation using the information of other characters; Process and enhance features through multi-head cross-attention mechanism: ; The calculation method for each head is: ; Finally, the vector representation of each character draws on the information of other characters to form an updated feature vector; The Transformer Block outputs of all characters are concatenated to generate a comprehensive script feature representation; after processing by the fully connected layer and activation function, the final script text is generated: 。 2. The method for generating a literary script based on a large language model as claimed in claim 1, It is characterized in that The obtaining of the user's requirements for generating a script includes: Display the preset front-end interface; Obtaining the Wensheng script generation requirement input by the user based on the front-end interface; The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
3. The method for generating a literary script based on a large language model as claimed in claim 1, It is characterized in that The pre-trained large language model is used to determine the role characteristics of multiple roles and the perspective plot of each role according to the requirements of the Wensheng script generation, including: Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined; The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
4. The method for generating a literary script based on a large language model as claimed in claim 1, It is characterized in that The step of generating a script based on the character characteristics of each character and the perspective of each character includes: The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
5. The method for generating a literary script based on a large language model as claimed in claim 1, It is characterized in that Also includes: Obtain the user's script quality evaluation indicators; Based on the script quality assessment indicators, determine the script quality assessment rules; Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result; The script quality assessment result is sent to the user.
6. A Wensheng script generation system based on a large language model, It is characterized in that include: The acquisition module is used to obtain the user's requirements for generating literary scripts; A determination module, for determining the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and the requirements for generating the script; A generation module, for generating a Wensheng script based on the character characteristics of each of the characters and the perspective plot of each of the characters; When generating a text script, a multi-perspective narrative network is used to integrate the character perspectives. The steps are as follows: For each character’s perspective, the text is represented as a feature vector through an encoder; These feature vector sets are represented as ,in is a character number; wherein the encoder includes at least: LSTM, GRU or pre-trained Transformer model; There are four characters, and the characters' perspectives are coded as ; Use the Cross-Attention mechanism to establish relationships across roles. The specific steps are as follows: Query (Q): Feature representation from a role, which is the feature vector of role 1 ; Key (K) and Value (V): Feature representations from other roles, which are the feature vectors of roles 2, 3, and 4 , forming a complete set ; Through the Cross-Attention mechanism, the plot of character 1 is calculated by weighting the comprehensive representation of the information of characters 2, 3, and 4: ; In this way, for each character's perspective plot, we performed a weighted calculation using the information of other characters; Process and enhance features through multi-head cross-attention mechanism: ; The calculation method for each head is: ; Finally, the vector representation of each character draws on the information of other characters to form an updated feature vector; The Transformer Block outputs of all characters are concatenated to generate a comprehensive script feature representation; after processing by the fully connected layer and activation function, the final script text is generated: 。 7. The system for generating a script based on a large language model as claimed in claim 6, It is characterized in that The acquisition module acquires the user's requirements for generating a literary script, including: Display the preset front-end interface; Obtaining the Wensheng script generation requirement input by the user based on the front-end interface; The requirements for generating the Wensheng script include: a character list, a storyline and a story type.
8. The system for generating a script based on a large language model as claimed in claim 7, It is characterized in that The determination module determines the role characteristics of multiple roles and the perspective plot of each role based on the pre-trained large language model and the requirements for generating the script, including: Using the character feature generator in the large language model, according to the character list in the script generation requirement, a plurality of the characters are determined; The plot generator in the large language model is used to determine the character characteristics of each character and the perspective plot of each character according to the storyline and story type in the Vincent script generation requirements.
9. The system for generating a script based on a large language model as claimed in claim 6, It is characterized in that The generation module generates a script based on the role characteristics of each role and the perspective of each role, including: The preset script integrator is used to integrate the character characteristics of each of the characters and the perspective plot of each of the characters to obtain the Wensheng script.
10. The system for generating a script based on a large language model as claimed in claim 6, It is characterized in that Also includes: Quality assessment modules include: Obtain the user's script quality evaluation indicators; Based on the script quality assessment indicators, determine the script quality assessment rules; Based on the script quality assessment rules, the quality of the Wensheng script is assessed to obtain a script quality assessment result; The script quality assessment result is sent to the user.
Citation Information
Patent Citations
Scenario generation method and related device
CN117149971A
Large language model-based script content generation method and device
CN117992568A
Language model role playing-based long script automatic generation method
CN118394926A
System and method for executing and manipulating a storyline
US20230135871A1
Automated creation of storyboards from screenplays
US9106812B1
