Transform-based short episode generation method and application
Generating short scripts by using a large language model based on Transformer, the problem that manual creation cannot meet the needs of short videos is solved, and high-quality scripts are generated quickly and efficiently, reducing the creation cost.
Patent Information
- Application Number
- CN202411173535.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-02-07
AI Technical Summary
Artificially creating short scripts cannot meet the development needs of short videos, and the creative process is time-consuming and labor-intensive and difficult to guarantee quality.
Using a large language model based on Transformer, by obtaining text prompts and converting them into sequence representations, multiple candidate events are generated using the trained Transformer model, and a short play script with logical and semantic consistency is generated through event sorting technology.
It realizes the rapid and efficient generation of high-quality short scripts, meets the needs of short video development, and reduces the time and energy cost of the creative process.
Smart Images

Figure CN119398058A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of script generation methods, and in particular to a Transformer-based short play generation method and application. Background Art
[0002] A skit is a form of drama that tells a complete story in a short space, which is highly entertaining and communicable. In recent years, with the rise of short video platforms, the demand for the creation and viewing of short plays has also increased. Traditional short play creation mainly relies on the personal experience and creative ability of the screenwriter, which not only requires a lot of time and energy, but also makes it difficult to guarantee the quality of creation. With the growing trend of short videos, the demand for short video scripts is increasing in both the film and television, education and advertising industries, and the speed of manually creating scripts is gradually unable to meet the demand. Therefore, it is of great practical significance to develop a method that can automatically generate short plays. Summary of the invention
[0003] The present invention provides a Transformer-based skit generation method and application to solve the problem that manually created skit scripts cannot meet the development needs of short videos.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is: A Transformer-based skit generation method includes the following steps: Step 1: obtaining a text prompt, wherein the text prompt describes the theme, characters, scenes, plot development, dialogue content, and psychological activity information of the short play in the form of text information; Generate a Transformer model and train the Transformer model, and use the trained Transformer model to process the text prompt to obtain multiple candidate events; Step 2: Use the Transformer model trained in step 1 to sort multiple candidate events to obtain the short play script.
[0005] In a further step 1, the text information in the text prompt is converted into a sequence representation and then input into the trained Transformer model to obtain multiple candidate events.
[0006] In the further step 2, the trained Transformer model sorts the candidate events according to the logic between the candidate events and the consistency of the foreground and background descriptions in the scene.
[0007] In the further step 2, the trained Transformer model first constructs an event graph to represent the relationship between candidate events; Then, based on the logic between candidate events, the graph algorithm is used to calculate the logic scores between events; Next, based on the consistency of the foreground and background descriptions in the scene, the scene consistency score is obtained using the three-stage plot model combined with the graph algorithm; Finally, the candidate events are ranked according to the logic score and scene consistency score.
[0008] An application of the above-mentioned skit generation method in film and television scripts.
[0009] An application of the above-mentioned skit generation method in educational scripts.
[0010] An application of the above skit generation method in advertising scripts.
[0011] An application of the above skit generation method in game scripts.
[0012] An application of the above-mentioned skit generation method to generate a training script data set in artificial intelligence technology.
[0013] The present invention adopts the large language model Transformer model, which is a neural network model based on the attention mechanism and has powerful text understanding and generation capabilities. Through the Transformer model and event sorting technology, the generated short play script has strong logic and semantic consistency, and can generate high-quality short play scripts.
[0014] The present invention has broad application prospects and can be used in film and television creation, entertainment education, advertising industry, and game industry. It can also generate a large amount of short play script data for the training of artificial intelligence language models. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0017] like Figure 1 As shown, this embodiment discloses a Transformer-based skit generation method, comprising the following steps: Step 1: Get candidate events from text prompts. The process is as follows: (1.1) Obtain text prompts, which describe the theme, characters, scenes, plot development, dialogue content, character psychological activities and other information of the short play in the form of text information.
[0018] (1.2) Generate a Transformer model and train the Transformer model.
[0019] In this embodiment, the adopted Transformer model architecture includes an input layer, an encoder stacking layer, a decoder stacking layer, and an output layer.
[0020] In this embodiment, the collected short play scripts are used as the data of the training set to train the Transformer model. Through the training, the Transformer model is equipped with the event generation function.
[0021] (1.3) Using the trained Transformer model to process the text prompt, a plurality of candidate events are obtained.
[0022] Specifically, in this embodiment, a one-hot encoding method is firstly adopted to convert the text information in the text prompt into a sequence representation.
[0023] After obtaining the sequence representation, the sequence representation is input into the trained Transformer model to obtain multiple candidate events.
[0024] Step 2: Sort the candidate events obtained in step 1 and generate a short play script. The process is as follows: (2.1) Based on the logic between candidate events and the consistency of foreground and background descriptions in the scene, the Transformer model trained in step 1 sorts multiple candidate events to obtain the short play script. Among them, in the logic between candidate events, there should be a causal relationship or time sequence between events, and no logical contradictions should occur; in the consistency of foreground and background descriptions in the scene, the event description should be consistent with the characters and environment in the scene.
[0025] In this embodiment, the trained Transformer model first constructs an event graph to represent the relationship between candidate events.
[0026] Then, based on the logic between candidate events, the graph algorithm is used to calculate the logic scores between events.
[0027] Next, a scene consistency score is obtained based on the consistency of the foreground and background descriptions in the scene.
[0028] Finally, the candidate events are ranked according to the logic score and scene consistency score.
[0029] After sorting the candidate events, the skit script obtained in this embodiment includes the following contents: (A) Characters: the characters appearing in the skit and their basic information; (B) Scenes: the scenes where the skit takes place and their descriptions; (C) Events: a series of events that occur in the skit, including the time, location, characters and event descriptions of the events.
[0030] The skit generation method of this embodiment can be applied in the film and television industry to generate film and television scripts, in the education industry to generate educational scripts, in the advertising industry to generate advertising scripts, and in the online or offline game industry to generate online or offline game scripts. In addition, the skit generation method of this embodiment can be applied to the artificial intelligence large language model to generate a script data set for large language model training.
[0031] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. The embodiments described in the present invention are merely descriptions of the preferred embodiments of the present invention, and do not limit the concept and scope of the present invention. The various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction, and such combinations should also be regarded as the contents disclosed in the present disclosure as long as they do not violate the concept of the present invention. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
[0032] The present invention is not limited to the specific details of the above-mentioned embodiments. Within the technical concept of the present invention and without departing from the design concept of the present invention, various modifications and improvements made to the technical solution of the present invention by technical personnel in this field should fall within the protection scope of the present invention. The technical contents for which protection is sought in the present invention have been fully recorded in the claims.
Claims
1. A Transformer-based skit generation method, characterized in that: The following steps are involved: Step 1: obtaining a text prompt, wherein the text prompt describes the theme, characters, scenes, plot development, dialogue content, and psychological activity information of the short play in the form of text information; Generate a Transformer model and train the Transformer model, and use the trained Transformer model to process the text prompt to obtain multiple candidate events; Step 2: for the multiple candidate events obtained in step 1, the candidate events are sorted according to the logic between the events and the consistency of the foreground and background descriptions in the scene, according to the establishment of conflict, development of conflict, total outbreak of conflict and final result after the conflict; Get the skit script.
2. The Transformer-based skit generation method according to claim 1, characterized in that: In step 1, the text information in the text prompt is converted into a sequence representation and then input into the trained Transformer model to obtain multiple candidate events.
3. The Transformer-based skit generation method according to claim 1, characterized in that: In step 2, the trained Transformer model sorts the candidate events based on the logic between the candidate events and the consistency of the foreground and background descriptions in the scene.
4. The Transformer-based skit generation method according to claim 3, characterized in that: In step 2, the trained Transformer model first constructs an event graph to represent the relationship between candidate events; Then, based on the logic between candidate events, an event graph is constructed, and the logic scores between events are calculated using graph algorithms; Next, based on the consistency of the foreground and background descriptions in the scene, the scene consistency score is obtained using the three-stage plot model combined with the graph algorithm; Finally, the candidate events are ranked according to the logic score and scene consistency score.
5. An application of the skit generation method as described in any one of claims 1 to 4 in film and television scripts.
6. An application of the skit generation method as described in any one of claims 1 to 4 in educational scripts.
7. Application of the skit generation method as described in any one of claims 1 to 4 in advertising scripts.
8. Application of the skit generation method as described in any one of claims 1 to 4 in a game script.
9. An application of the skit generation method as described in any one of claims 1 to 4 to generate a training script data set in artificial intelligence technology.