Training method, device, equipment and storage medium for plot extraction model

Through the trained plot extraction model, using the script, character relationship and data of the main characters in each scene, the problem of plot summary separation in the existing technology is solved, and a more accurate and coherent plot summary generation is achieved.

CN117875392BActive Publication Date: 2025-04-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410063236.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-04-04
Estimated Expiration
2044-01-16

AI Technical Summary

Technical Problem

In the generation of plot summary, the lack of context information of the script when the prior art generates plot summary, resulting in the plot summary of each scene, and the generated summary is inaccurate.

Method used

By obtaining the data set of the plot extraction model used for training, the data set includes each scene script, its corresponding character relationship and the main characters in the sample total script, using these data to adjust the model parameters to generate a more accurate plot summary.

Benefits of technology

By considering the context information of the script and the relationship between the main characters, the plot extraction model can generate more accurate and coherent plot summary, avoiding the phenomenon of separation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117875392B_ABST
    Figure CN117875392B_ABST
Patent Text Reader

Abstract

The present application discloses a training method, device, equipment and storage medium for a plot extraction model, and relates to the field of computer technology. The method comprises: obtaining a first training data set for training a plot extraction model, each first training sample comprising the i-th scene script, the character relationship corresponding to the i-th scene script, the main characters in the sample total script and the sample scene summary corresponding to the i-th scene script; using the plot extraction model to obtain the predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the sample total script; adjusting the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain the trained plot extraction model. The present application takes into account the character relationship corresponding to the i-th scene script and the main characters in the sample total script, and improves the accuracy of each generated scene summary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a training method, device, equipment and storage medium for a plot extraction model. Background Art

[0002] Before filming each scene, film and television works need to make various preparations based on the content of each scene in the script. Therefore, quickly understanding the plot of each scene will help the parties involved in the film and television production to understand the plot in advance, grasp the trend of the scenes, and better perform each scene.

[0003] In the related art, plot summaries are generated based on GPT (Generative Pre-Trained Transformer) 2 or GPT4. By inputting the plot text of a certain scene and asking GPT questions, such as "Please summarize the main events of the following script scene, the script is: xxx", GPT will answer the plot summary of the input script. Since the script is too long, GPT cannot understand the entire script at one time, so the scripts of each scene are input into GPT separately to generate the plot summary of each scene.

[0004] However, since the above method does not link the context information of the script, the plot summaries of each scene are separated, and the generated plot summaries of each scene are inaccurate. Summary of the invention

[0005] The present application embodiment provides a training method, device, equipment and storage medium for a plot extraction model. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a method for training a plot extraction model is provided, the method comprising:

[0007] Acquire a first training data set for training the plot extraction model, wherein the first training data set includes at least one first training sample, each of the first training samples includes an i-th scene script, a character relationship corresponding to the i-th scene script, a main character in a sample total script, and a sample scene summary corresponding to the i-th scene script, wherein the i-th scene script refers to the plot text of the i-th scene in the sample total script, the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and the sample scene summary is used to indicate the plot summary of the i-th scene script, where i is a positive integer;

[0008] The plot extraction model is used to obtain a predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script, wherein the predicted scene summary is used to indicate the plot summary of the i-th scene script;

[0009] According to the difference between the predicted scene summary and the sample scene summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

[0010] According to one aspect of an embodiment of the present application, a plot extraction method based on a plot extraction model is provided, wherein the plot extraction model is a machine learning model for extracting a plot summary, and the method comprises:

[0011] Obtain the i-th scene script in the total script of the plot to be extracted, wherein the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer;

[0012] According to the total script, the main characters in the total script are obtained, and according to the scene scripts of the first i scenes in the total script, the character relationships corresponding to the i-th scene script are obtained, wherein the character relationships corresponding to the i-th scene script include the character relationships corresponding to at least one key character appearing in the scene scripts of the first i scenes in the total script;

[0013] Through the plot extraction model, according to the i-th scene script, the character relationships corresponding to the i-th scene script and the main characters in the overall script, a scene summary corresponding to the i-th scene script is obtained.

[0014] According to one aspect of an embodiment of the present application, a training device for a plot extraction model is provided, the device comprising:

[0015] A data acquisition module is used to acquire a first training data set for training the plot extraction model, wherein the first training data set includes at least one first training sample, each of the first training samples includes an i-th scene script, a character relationship corresponding to the i-th scene script, a main character in a sample total script, and a sample scene summary corresponding to the i-th scene script, wherein the i-th scene script refers to the plot text of the i-th scene in the sample total script, the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and the sample scene summary is used to indicate the plot summary of the i-th scene script, where i is a positive integer;

[0016] A model prediction module, used to use the plot extraction model to obtain a predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the sample total script, wherein the predicted scene summary is used to indicate the plot summary of the i-th scene script;

[0017] The model training module is used to adjust the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain a trained plot extraction model.

[0018] According to one aspect of an embodiment of the present application, a plot extraction device based on a plot extraction model is provided, wherein the plot extraction model is a machine learning model for extracting a plot summary, and the device comprises:

[0019] A script acquisition module, used to acquire the i-th scene script in the total script of the plot to be extracted, wherein the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer;

[0020] A character acquisition module, for acquiring the main characters in the total script according to the total script, and acquiring the character relationships corresponding to the i-th scene script according to the scene scripts of the first i scenes in the total script, wherein the character relationships corresponding to the i-th scene script include the character relationships corresponding to at least one key character appearing in the scene scripts of the first i scenes in the total script;

[0021] The summary extraction module is used to obtain the scene summary corresponding to the i-th scene script through the plot extraction model according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the total script.

[0022] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned training method of the plot extraction model, or the plot extraction method based on the plot extraction model.

[0023] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned training method of the plot extraction model, or the plot extraction method based on the plot extraction model.

[0024] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program, and the computer program is loaded and executed by a processor to implement the above-mentioned training method of the plot extraction model, or the plot extraction method based on the plot extraction model.

[0025] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:

[0026] By taking the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script as the input data of the plot extraction model, the plot extraction model considers the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script when extracting the plot of the i-th scene script, avoiding the plot extraction model only considering the current scene script and the character relationship in the current scene script, thereby avoiding the scene summaries generated for each scene being separated. In addition, the main characters in the sample total script are considered, and by building the underlying foundation of the plot extraction, the plot extraction model can enhance the plot extraction of the main characters, and generate the scene summary connected to the previous text based on the underlying foundation, thereby improving the accuracy of each generated scene summary.

[0027] In addition, since the plot extraction model is a model obtained through additional training, compared with the models used in related technologies, the plot extraction model is more secure and can prevent script leakage, and the vertical domain model that focuses on specific tasks has better stability.

[0028] In addition, the plot extraction model supports the input of scripts for each scene in the total sample script. Compared with the model that inputs the total sample script, it reduces the cost of plot extraction, improves the efficiency of plot extraction, and is conducive to long-term use. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0030] Figure 2 is a flowchart of a method for training a plot extraction model provided by an embodiment of the present application;

[0031] Figure 3 is a schematic diagram of the reasoning process of a plot extraction model provided by an embodiment of the present application;

[0032] Figure 4 is a flow chart of a method for training a character extraction model provided by an embodiment of the present application;

[0033] Figure 5 is a schematic diagram of a plot extraction process of a plot extraction model provided by an embodiment of the present application;

[0034] Figure 6 is a flowchart of a plot extraction method based on a plot extraction model provided by an embodiment of the present application;

[0035] Figure 7 is a block diagram of a training device for a plot extraction model provided by an embodiment of the present application;

[0036] Figure 8 is a block diagram of a plot extraction device based on a plot extraction model provided by an embodiment of the present application;

[0037] Fig. 9 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0039] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0040] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, pre-trained models are also called large models and basic models. After fine-tuning, they can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0041] Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning. The pre-trained model is the latest development of deep learning, which integrates the above technologies.

[0042] Large Language Model (LLM) is an artificial intelligence algorithm based on deep learning technology, whose goal is to enable computers to understand and generate natural language. It learns the structure and rules of language by analyzing large amounts of language data, such as text, speech, or images, and uses this knowledge to complete various natural language processing tasks, such as machine translation, speech recognition, text classification, question-answering systems, etc. Large language models usually use the Transformer architecture in deep learning to model text sequences in order to understand context and semantics. Its training process usually involves a large amount of data and computing resources, such as large-scale corpora and high-performance computing platforms. During the training process, the large language model gradually learns the characteristics and rules of language, and forms the ability to understand and express language.

[0043] The Transformer architecture is a deep learning model that uses a self-attention mechanism, which can assign different weights according to the importance of each part of the input data. This architecture is mainly used in the fields of natural language processing and computer vision (CV). This architecture usually includes components such as self-attention mechanism (Self-Attention), multi-head attention (Multi-Head Attention), positional encoding (Positional Encoding), residual connection and normalization (Add&Norm), feed-forward neural network (Feed-Forward Network), position-wise feed-forward neural network (Position-wise Feed-Forward Network), etc. These components constitute the encoder and decoder.

[0044] Pre-training model (PTM), also known as cornerstone model or big model, refers to a deep neural network (DNN) with large parameters. It is trained on massive unlabeled data, and uses the function approximation ability of large-parameter DNN to extract common features from the data. After fine tuning, parameter-efficient fine-tuning (PEFT), prompt-tuning and other technologies, it is suitable for downstream tasks. Therefore, the pre-training model can achieve ideal results in few-shot or zero-shot scenarios. PTM can be divided into language models (ELMO, BERT, GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), multimodal models (ViBERT, CLIP, Flamingo, Gato), etc. according to the data modality processed. Among them, the multimodal model refers to a model that establishes feature representations of two or more data modalities. Pre-trained models are important tools for outputting artificial intelligence generated content (AIGC), and can also be used as a general interface to connect multiple specific task models.

[0045] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless cars, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (Artificial Intelligence Generated Content, AIGC), conversational interaction, smart medical care, smart customer service, game AI, virtual reality (Virtual Reality, VR), augmented reality (Augmented Reality, AR), etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0046] The technical solution of this application mainly involves machine learning technology in artificial intelligence technology, mainly involving the training and use process of the plot extraction model.

[0047] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as a plot extraction system. The solution implementation environment may include: a model training device 10 and a model use device 20.

[0048] The model training device 10 can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, a multimedia player, a vehicle terminal, a server, an intelligent robot, or other electronic devices with strong computing capabilities. The model training device 10 is used to train the plot extraction model.

[0049] In the embodiment of the present application, the plot extraction model is a machine learning model trained based on the training method of the plot extraction model, and is used to generate a scene summary corresponding to the scene script according to the scene script, the character relationship corresponding to the scene script, and the main characters in the sample total script. The model training device 10 can train the plot extraction model in a machine learning manner so that it has the ability to extract the plot summary of the scene script. The specific model training method can refer to the following embodiment.

[0050] In an embodiment of the present application, the input data of the plot extraction model includes the i-th scene script in the sample total script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script, and the output data is the scene summary corresponding to the i-th scene script.

[0051] The trained plot extraction model can be deployed in the model using device 20 for use. The model using device 20 can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, a multimedia player, a vehicle terminal, a server, an intelligent robot, or other electronic devices with strong computing capabilities. When it is necessary to extract the plot summary of each scene in the sample total script, the model using device 20 can achieve the above function through the trained plot extraction model.

[0052] The model training device 10 and the model using device 20 may be two independent devices or the same device. If the model training device 10 and the model using device 20 are the same device, the model training device 10 may be deployed in the model using device 20.

[0053] In the embodiment of the present application, the execution subject of each step may be a computer device, which may be as follows: Figure 1 The model training device 10 may also be a model using device 20. The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0054] Please refer to Figure 2, which shows a flow chart of a method for training a plot extraction model provided by an embodiment of the present application. The execution subject of each step of the method may be a computer device, such as the computer device may be the model training device described above. The method may include at least one of the following steps 210 to 230:

[0055] Step 210, obtaining a first training data set for training a plot extraction model, the first training data set includes at least one first training sample, each first training sample includes the ith scene script, the character relationship corresponding to the ith scene script, the main characters in the sample total script, and the sample scene summary corresponding to the ith scene script, the ith scene script refers to the plot text of the ith scene in the sample total script, the character relationship corresponding to the ith scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and the sample scene summary is used to indicate the plot summary of the ith scene script, and i is a positive integer.

[0056] The general script is a text that describes the plot of a film or television work and is used to guide the filming of the film or television work. One film or television work corresponds to one general script, and the number of scenes and words in each general script are not necessarily the same.

[0057] The sample general script is the general script used as training data for the plot extraction model. Each scene in the general script refers to the various scenes in which each plot in the general script occurs. Usually, one scene corresponds to one scene. For example, if the first plot described in the general script occurs in scene 1, and the second plot described in the general script occurs in scene 2, then the plot text corresponding to scene 1 is determined as the first scene script, and the plot text corresponding to scene 2 is determined as the second scene script. Adjacent scene scripts correspond to different scenes, and the scenes corresponding to alternating scene scripts can be the same or different. For example, the scene corresponding to the third scene script is any scene other than scene 2, which can be scene 1 or other scenes.

[0058] Each scene script in the sample script refers to the plot text describing each scene in the sample script. Each scene script mainly includes the time and place of each scene, the characters that appear in the scene plot, the behavior of each character, and the dialogue between each character.

[0059] The first training sample may be for each scene script in the same sample total script, for example, the first training sample may only include each scene script in total script 1; the first training sample may also be for each scene script in different total scripts, for example, the first training sample may include each scene script in total script 1 and each scene script in total script 2, and this application does not limit this.

[0060] The i-th scene script refers to the plot text of the i-th scene in a total script. The main characters in the sample total script refer to the characters with a larger proportion of scenes in the sample total script, including at least two characters. The main characters are also commonly referred to as "protagonists".

[0061] The character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene script of the first i scenes in the sample total script, and the character relationship corresponding to each key character includes the relationship of each character appearing in the scene script of the first i scenes relative to the key character, and the relationship of the character relative to the key character refers to the relationship of the character whose role ratio is less than the role ratio of the key character relative to the key character. The scene script of the first i scenes refers to all the scene scripts from the first scene to the i-th scene in the sample total script. The key character refers to the character role that has a driving effect on the plot in the scene script of the first i scenes, which can be the main character in the sample total script, or it can be other characters whose role ratio is less than the main character. The character relationship can include the father-son relationship, father-daughter relationship, mother-son relationship, mother-daughter relationship, husband-wife relationship, lover relationship, teacher-student relationship and other character relationships. If the sample total script is a plot text in a modern scene, the character relationship can also include classmate relationship, colleague relationship, etc. If the sample total script is a plot text in an ancient scene, the character relationship can also include master-servant relationship, etc. The character relationship corresponding to the i-th scene script is the character relationship obtained based on the scene scripts of the previous i scenes. The specific acquisition process can be referred to as follows Figure 4 The embodiment shown.

[0062] The sample scene summary is a scene summary that serves as the supervision information of the plot extraction model, and is used to indicate the plot summary of the i-th scene script. The scene summary is a simplified plot description text obtained after the plot extraction of the scene script of the scene. The scene summary is used to describe the plot corresponding to the scene script in general language. Usually, the number of words in the scene summary is much smaller than the number of words in the scene script.

[0063] Step 220, using the plot extraction model to obtain the predicted scene summary corresponding to the ith scene script according to the ith scene script, the character relationships corresponding to the ith scene script and the main characters in the sample total script, the predicted scene summary is used to indicate the plot summary of the ith scene script.

[0064] The predicted scene summary is the output data of the plot extraction model, which is used to indicate the plot summary of the i-th scene script.

[0065] Step 230 , adjusting the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain a trained plot extraction model.

[0066] In some embodiments, each word in the sample scene summary is marked with a first probability to obtain the marked words in the sample scene summary; each word in the sample scene summary is replaced with a second probability to obtain the replaced words in the sample scene summary, and the sum of the first probability and the second probability is less than 1; the marked words and the replaced words are set as the words to be predicted; according to the difference between the words at the position of the words to be predicted in the predicted scene summary and the words to be predicted, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

[0067] The first probability and the second probability are both in the value range of 0 to 1, and the sum of the first probability and the second probability is less than 1. For example, the first probability may be 0.8, and the second probability may be 0.1.

[0068] Optionally, each word in the sample scene summary may be marked only with the first probability to obtain the marked words in the sample scene summary, and the marked words are set as the words to be predicted. Alternatively, each word in the sample scene summary may be replaced only with the second probability to obtain the replaced words in the sample scene summary, and the replaced words are set as the words to be predicted.

[0069] Optionally, each word in the sample session summary may be further masked with the third probability to obtain masked words in the sample session summary, and the sum of the first probability, the second probability and the third probability is less than 1. The marked words, the replaced words and the masked words are set as words to be predicted.

[0070] The vocabulary to be predicted refers to the vocabulary with actual meanings such as verb vocabulary, noun vocabulary, adjective vocabulary, etc. The vocabulary to be predicted does not include the vocabulary without actual meanings such as adverb vocabulary, preposition vocabulary, etc.

[0071] Since the predicted scene summary and the sample scene summary have more words and more complex sentence structure, it is difficult to calculate the difference between the predicted scene summary and the sample scene summary. Therefore, the first loss function value is calculated according to the difference between the words at the position of the to-be-predicted words in the predicted scene summary and the corresponding words to be predicted in the sample scene summary, and then the parameters of the plot extraction model are adjusted according to the first loss function value to obtain the trained plot extraction model.

[0072] For calculating the first loss function value, a cross entropy loss function may be used. Exemplarily, the first loss function value may be expressed as:

[0073]

[0074] Where bs represents the number of first training samples in each batch, y[i] represents the label of each word in the dictionary, and p[i] represents the probability of each word in the dictionary being determined as a word to be predicted in the predicted session summary. If a word in the dictionary is selected as a word to be predicted in the predicted session summary, the label of the word is 1, and if a word in the dictionary is not selected as a word to be predicted in the predicted session summary, the label of the word is 0.

[0075] For example, for the first word in the predicted session summary, each word in the dictionary has a probability of being determined as the first word. The word corresponding to the highest probability of being determined as the first word among the words is selected as the first word, and the label of the word is 1. The probability of the word being determined as the first word can represent the similarity between the word and the word to be predicted at the corresponding position in the sample session summary. In this way, the words to be predicted in the predicted session summary and the probability of each word being determined as the word to be predicted are obtained.

[0076] In some embodiments, weights may be set for each word to be predicted in a sample scene summary. For example, the weight of words that play a major role in describing the plot may be set higher, while the weight of words that play an auxiliary role in describing the plot may be set lower, thereby strengthening the training of some words and improving the accuracy of extracting the plot summary.

[0077] Optionally, other loss functions that can represent the meaning of loss may be selected, such as mean square error loss function, log likelihood loss function, exponential loss function, etc., which are not limited in this application.

[0078] By determining the words to be predicted in the sample session summary, the calculation of the difference between the predicted session summary and the sample session summary is converted into the calculation of the difference between the words to be predicted in the predicted session summary and in the sample session summary, which simplifies the calculation process and improves the efficiency of model training.

[0079] In the above embodiment, the plot extraction model can output the scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script. In other embodiments, the plot extraction model can also output the scene summary corresponding to multiple consecutive scene scripts according to multiple consecutive scene scripts, the character relationship corresponding to the multiple consecutive scene scripts, and the main characters in the sample total script.

[0080] In some embodiments, the plot extraction model can also distinguish the main plot and the branch plot for the scene summary corresponding to the i-th scene script. Among them, the plot related to the main character in the sample total script is the main plot, and the plot related to the non-main character in the sample total script is the branch plot. The plot extraction model can output the main plot related to the main character in the sample total script corresponding to the i-th scene script, and the branch plot unrelated to the main character in the sample total script corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script, and the main character in the sample total script. The plot extraction model can also output the main plot related to the main character in the sample total script corresponding to the multiple consecutive scene scripts, and the branch plot unrelated to the main character in the sample total script corresponding to the multiple consecutive scene scripts according to the multiple consecutive scene scripts, the character relationship corresponding to the multiple consecutive scene scripts, and the main character in the sample total script.

[0081] Figure 3 The inference process of the plot extraction model is shown. First, according to each scene script in the total script, the key characters, main characters, and character relationships corresponding to at least one key character in each scene script, as well as the key characters, main characters, and character relationships corresponding to at least one key character in the total script are obtained. Then, through the plot extraction model, according to the i-th scene script, the character relationships corresponding to the i-th scene script, and the main characters in the total script, the scene summary corresponding to the i-th scene script is extracted.

[0082] The technical solution provided by the embodiment of the present application uses the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script as the input data of the plot extraction model, so that when the plot extraction model extracts the plot of the i-th scene script, it considers the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, thereby avoiding the plot extraction model only considering the current scene script and the character relationship in the current scene script, thereby avoiding the scene summaries generated for each scene being separated. In addition, the main characters in the sample total script are considered, and by building the underlying foundation for plot extraction, the plot extraction model can enhance the plot extraction of the main characters, and generate a scene summary that is connected to the previous text based on the underlying foundation, thereby improving the accuracy of each generated scene summary.

[0083] In addition, since the plot extraction model is a model obtained through additional training, compared with the models used in related technologies, the plot extraction model is more secure and can prevent script leakage, and the vertical domain model that focuses on specific tasks has better stability.

[0084] In addition, the plot extraction model supports the input of scripts for each scene in the total sample script. Compared with the model that inputs the total sample script, it reduces the cost of plot extraction, improves the efficiency of plot extraction, and is conducive to long-term use.

[0085] In some embodiments, please refer to Figure 4 , which shows a flow chart of a method for training a character extraction model provided by an embodiment of the present application. The execution subject of each step of the method may be a computer device, such as the computer device may be the model training device introduced above. The method may include at least one of the following steps 410 to 430:

[0086] Step 410, obtaining a second training data set for training a character extraction model, the second training data set including at least one second training sample, each second training sample including the scene scripts of the first k scenes in the total sample script, the key characters appearing in the scene scripts of the first k scenes, and the sample character relationships corresponding to the scene scripts of the first k scenes, the sample character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes, and k is a positive integer.

[0087] The first k scenes refer to all scenes from the 1st scene to the i-th scene in the total sample script. The key characters appearing in the first k scenes refer to the key characters appearing in all scenes from the 1st scene to the k-th scene in the total sample script, which means that the key characters appearing in the scenes after the k-th scene are not included in the key characters appearing in the first k scenes.

[0088] In some embodiments, the process of obtaining key characters appearing in the scene scripts of the first k scenes in the second training sample includes at least one sub-step in steps 411 to 413 (not shown in the figure).

[0089] Step 411, obtaining at least one character that appears in the first k scenes, and the number of appearances of at least one character that appears in the first k scenes in the first k scenes.

[0090] A character is a character with autonomous consciousness in a plot text. A character can be a human character based on a real person, or a fictional character based on an animal or plant.

[0091] According to the scene scripts of the first k scenes, at least one character appearing in the scene scripts of the first k scenes is obtained, and the number of appearances of at least one character appearing in the scene scripts of the first k scenes in the scene scripts of the first k scenes is obtained, and the corresponding number of appearances of at least one character appearing in the scene scripts of the first k scenes is obtained.

[0092] Step 412, sorting the at least one character that appears in the first k scenes in descending order of the number of appearances, to obtain a sorting sequence corresponding to the at least one character that appears in the first k scenes.

[0093] The sorting sequence refers to a sorting sequence of the number of appearances of at least one character appearing in the scene scripts of the first k scenes mentioned above from large to small, and the number of appearances of the characters ranked at the top in the sorting sequence is greater than the number of appearances of the characters ranked at the bottom.

[0094] Step 413: determine the first number of characters ranked at the top in the sorting sequence as key characters appearing in the scene scripts of the first k scenes.

[0095] That is, a first number of characters with the largest number of appearances among at least one character appearing in the scene scripts of the first k scenes are obtained, and they are determined as key characters appearing in the scene scripts of the first k scenes.

[0096] By obtaining the key characters appearing in the scene scripts of the first k scenes, we can further obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes, and discard other characters with fewer appearances, so that the plot extraction model can sort out the plot text according to the character relationships corresponding to the key characters and extract the plot from the scene scripts.

[0097] In some embodiments, the process of obtaining the sample person relationship in the second training sample includes at least one sub-step in steps 414 to 416 (not shown in the figure).

[0098] Step 414, obtaining at least one key character that appears in the scene scripts of the first k scenes, where the key character refers to a character that has a driving effect on the plot in the scene scripts of the first k scenes.

[0099] With reference to the above embodiment, according to the above steps 411 to 413, at least one key character appearing in the scene scripts of the first k scenes is obtained, which will not be described in detail here.

[0100] Step 415, obtaining at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes through a large language model based on the scene scripts of the first k scenes and at least one key character appearing in the scene scripts of the first k scenes, each character relationship being used to indicate the relationship of a first character role relative to the first key character, and the proportion of the first character role in the scene scripts of the first k scenes being less than the proportion of the first key character role in the scene scripts of the first k scenes.

[0101] The large language model can be any publicly available large language model, such as a natural language model based on a transformer structure obtained by training with a large amount of data. The large amount of data can reach a sample level of more than 100 million, and this application does not limit this. The large language model can be used to extract character relationships corresponding to key characters. The input data of the large language model is the scene scripts of the first k scenes and at least one key character appearing in the scene scripts of the first k scenes, and the output data is at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes.

[0102] The character relationship corresponding to the k-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes, and the character relationship corresponding to the first key character appearing in the scene scripts of the first k scenes includes the relationship between each first character role in the scene scripts of the first k scenes and the first key character. Each character relationship corresponding to the first key character is used to indicate the relationship between each first character role and the first key character. Among them, the first key character refers to any key character appearing in the scene scripts of the first k scenes, the first character role is a character role appearing in the scene scripts of the first k scenes, and the proportion of the first character role in the scene scripts of the first k scenes is less than the proportion of the first key character in the scene scripts of the first k scenes. The proportion of the key character's role in the scene scripts of the first k scenes refers to the ratio of the number of appearances of the key character in the scene scripts of the first k scenes to the total number of appearances of each character role in the scene scripts of the first k scenes. That is to say, in the first k scenes, the number of appearances of the first character is less than the number of appearances of the first key character. For example, if the total number of appearances of the characters in the first k scenes is 100, the number of appearances of the first character in the first k scenes is 9, and the number of appearances of the first key character in the first k scenes is 10, then the proportion of the first character in the first k scenes is 9%, which is less than the proportion of the first key character in the first k scenes by 10%.

[0103] The relationship of the first character to the first key figure can be expressed in colloquial terms as who the first character is of the first key figure. The relationship of the first character to the first key figure includes grandfather, grandmother, father, mother, brother, younger brother, sister, younger sister, son, daughter, grandson, granddaughter, husband, wife, grandmother, sister-in-law, teacher, classmate, colleague, superior, client, master, subordinate, partner, student, tenant, landlord, neighbor, boyfriend, girlfriend, bestie, friend, enemy, opponent, etc.

[0104] Exemplarily, the relationship between character a and character b is obtained through a large language model, and the question sentence can be: "According to the following script, answer the relationship between a and b, where the relationship includes boyfriend, girlfriend, son, daughter, father, mother, colleague, classmate, and the relationship cannot be inferred. Only answer the relationship that is certain. When the relationship is unclear, answer that the relationship cannot be inferred. The script is: xxx." Among them, if character b is a key character in the scene scripts of the previous multiple scenes, and the proportion of the role of character a in the scene scripts of the previous multiple scenes is less than the proportion of the role of character b in the scene scripts of the previous multiple scenes, then the large language model will answer the relationship of character a relative to character b, for example, the relationship of character a relative to character b can be mother. If character a is a key character in the scene scripts of the previous multiple scenes, and the proportion of the role of character b in the scene scripts of the previous multiple scenes is less than the proportion of the role of character a in the scene scripts of the previous multiple scenes, then the large language model will answer the relationship of character b relative to character a, for example, the relationship of key character b relative to key character a can be daughter.

[0105] For example, if the characters in the first k scenes of the script include character a, character b, character c, and character d, wherein the characters are arranged in order from small to large according to the proportion of the roles of each character, and the key characters in the first k scenes of the script are character c and character d, then the character relationships corresponding to the kth scene script include the character relationships corresponding to character c and the character relationships corresponding to character d. Among them, the character relationships corresponding to character c include the relationship of character a relative to character c, and the relationship of character b relative to character c. The character relationships corresponding to character d include the relationship of character a relative to character d, the relationship of character b relative to character d, and the relationship of character c relative to character d.

[0106] Step 416: determine at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes as a sample character relationship.

[0107] The sample character relationships include at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes.

[0108] By obtaining sample character relationships through a large language model, the accuracy of the sample character relationships can be improved, and then using the sample character relationships as supervision information for the character extraction model can improve the accuracy of plot extraction.

[0109] In some embodiments, sample character relationships may also be obtained through manual induction.

[0110] Step 420, using a character extraction model to obtain predicted character relationships corresponding to the scene scripts of the first k scenes based on the scene scripts of the first k scenes and the key characters appearing in the scene scripts of the first k scenes, the predicted character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes.

[0111] The predicted character relationship is the output data of the character extraction model, which is used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes. The predicted character relationship includes at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes predicted by the model.

[0112] Step 430 , adjusting the parameters of the character extraction model according to the difference between the predicted character relationship and the sample character relationship to obtain a trained character extraction model.

[0113] Since the number of words in the predicted character relationship and the sample character relationship is small, and the description of the character relationship is relatively simple, the second loss function value can be directly calculated based on the difference between the predicted character relationship and the sample character relationship, and then the parameters of the character extraction model can be adjusted based on the second loss function value to obtain the trained character extraction model.

[0114] For calculating the second loss function value, the cross entropy loss function can be used, or other loss functions that can represent the meaning of loss can be used, such as the mean square error loss function, the log-likelihood loss function, the exponential loss function, etc. This application does not limit this.

[0115] By additionally training the character extraction model to extract the character relationships corresponding to key characters, it is avoided that the large language model is directly used to extract character relationships, which may lead to script leakage. The character extraction model provided by this application is more secure and stable, and is conducive to long-term use.

[0116] In some embodiments, the character relationship corresponding to the i-th scene script is obtained using a trained character extraction model. The process of obtaining the character relationship corresponding to the i-th scene script in the first training sample includes at least one sub-step in steps 2101 to 2103 (not shown in the figure).

[0117] Step 2101, using the trained character extraction model, according to the scene scripts of the first j scenes in the total sample script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer.

[0118] The trained character extraction model is used to extract the character relationships corresponding to at least one key character appearing in the scene script. The training process of the character extraction model can refer to the above embodiment. The input data of the character extraction model includes the scene scripts of the first j scenes in the sample total script and the key characters appearing in the scene scripts of the first j scenes, and the output data is the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes.

[0119] Among them, the key characters appearing in the scene scripts of the first j scenes refer to the key characters appearing in all scene scripts from the 1st scene to the jth scene of the total sample script, which means that the key characters appearing in the scene scripts after the jth scene are not included in the key characters appearing in the scene scripts of the first j scenes mentioned above.

[0120] Step 2102, construct a character relationship table based on the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script.

[0121] Each character relationship in the character relationship table represents the character relationship corresponding to at least one key character appearing in the corresponding scene script and the previous scene script.

[0122] Exemplarily, the character relationship corresponding to the first scene script in the character relationship table refers to the character relationship corresponding to at least one key character appearing in the first scene script, the character relationship corresponding to the second scene script refers to the character relationship corresponding to at least one key character appearing in the first two scene scripts, the character relationship corresponding to the third scene script refers to the character relationship corresponding to at least one key character appearing in the first three scene scripts, and the character relationship corresponding to the jth scene script refers to the character relationship corresponding to at least one key character appearing in the first j scene scripts.

[0123] Step 2103, according to the i-th scene script, obtain the character relationship corresponding to the i-th scene script in the character relationship table.

[0124] According to the i-th scene script, the character relationship corresponding to the i-th scene script in the character relationship table is obtained, that is, the character relationship corresponding to at least one key character appearing in the scene scripts of the previous i scenes.

[0125] By constructing a character relationship table for the sample script, the character relationships corresponding to each scene in the sample script can be directly presented in the character relationship table, which is convenient for calling the corresponding items in the character relationship table when the plot extraction model is used, thereby improving the efficiency of plot extraction. And by obtaining the character relationship corresponding to each scene through the character extraction model, the accuracy of character relationship extraction can be improved, thereby improving the accuracy of plot extraction.

[0126] In some embodiments, the character relationship corresponding to the i-th scene script may also be obtained by manual induction.

[0127] In some embodiments, the process of obtaining the main characters in the sample script in the first training sample includes at least one sub-step in steps 2104 to 2107 (not shown in the figure).

[0128] Step 2104, obtaining at least one key character in the sample overall script, and the number of appearances of at least one key character in the sample overall script in the overall script.

[0129] The process of obtaining at least one key character in the sample total script can refer to the above steps 411 to 413, including the following steps: obtaining at least one character in the sample total script, and the number of appearances of at least one character in the sample total script in the sample total script; sorting at least one character in the sample total script in descending order of the number of appearances to obtain a sorting sequence corresponding to at least one character in the sample total script; determining the second largest number of characters in the sorting sequence as at least one key character in the sample total script.

[0130] The numerical value corresponding to the second quantity and the numerical value corresponding to the first quantity may be the same or different, and this application does not limit this. The numerical value corresponding to the first quantity may be related to the position of the kth scene script in the total sample script. For example, the ratio of the first quantity to the second quantity may be equal to the ratio of the kth scene to the total scenes in the total sample script. For example, if the total sample script has a total of 100 scene scripts, the second quantity is 10, and it is necessary to obtain the key characters that appear in the scene scripts of the first 50 scenes, then the first quantity can be set to 5.

[0131] Step 2105, based on the number of appearances of at least one key character in the sample script and the total number of appearances of each character in the sample script, obtain the proportion of roles corresponding to at least one key character in the sample script. The proportion of roles refers to the ratio of the number of appearances of the key character in the sample script to the total number of appearances of each character in the sample script.

[0132] For example, if the total number of appearances of various characters in the sample script is 200, and the number of appearances of key character a in the sample script is 40, then the proportion of the role corresponding to key character a is 20%.

[0133] Step 2106, obtaining the maximum value of the proportion of roles corresponding to at least one key character in the sample script.

[0134] Step 2107, among at least one key character in the sample script, the key character whose role ratio is greater than a first value is determined as the main character in the sample script, and the first value is the product of the maximum value and the first proportion.

[0135] At least one key character in the sample script can be sorted in descending order of the proportion of roles, to obtain a sorting sequence corresponding to at least one key character in the sample script, and the key character with a high ranking in the sorting sequence and a role proportion greater than a first value is determined as the main character in the sample script. The first value is the product of the maximum value of the role proportions corresponding to at least one key character in the sample script and the first proportion, and the application does not limit the value of the first proportion.

[0136] Exemplarily, if the maximum value of the role ratio corresponding to at least one key character in the sample total script is 50% and the first proportion is 50%, the key character with a role ratio greater than 25% is determined as the main character in the sample total script.

[0137] By using the main characters in the sample script as the input data of the plot extraction model, the extraction of relevant plots of the main characters is enhanced, avoiding the situation where the plot extraction model ignores the plot description of the main characters due to the main characters appearing too few times in a certain scene script, thereby avoiding inaccurate scene summary generated for that scene.

[0138] In some embodiments, the process of obtaining the sample scene summary in the first training sample includes at least one sub-step in steps 2108 to 2110 (not shown in the figure).

[0139] Step 2108, obtaining the character relationships corresponding to the i-th scene script and the main characters in the sample total script.

[0140] Referring to the above embodiment, according to the above steps 2101 to 2103, the character relationship corresponding to the i-th scene script is obtained, and according to the above steps 2104 to 2107, the main characters in the sample total script are obtained, which will not be repeated here.

[0141] Step 2109, obtain the scene summary corresponding to the i-th scene script through the large language model according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the total sample script.

[0142] The large language model can also be used to extract the scene summaries corresponding to each scene script. The input data of the large language model is the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script, and the output data is the scene summary corresponding to the i-th scene script.

[0143] Exemplarily, the scene summary corresponding to the i-th scene script is obtained through the large language model, and the question sentence can be: "The following is the scene script of a certain scene in a play. It is known that B is xx of A, C is xx of A, C is xx of B, and the main characters are A and B. Please extract the scene summary of this scene, and describe the specific things that happened in the scene. Do not make guesses or abstract descriptions. The script is xxx." Among them, the scene scripts of the first i scenes include three key characters, namely key characters A, B, and C, and the proportions of key characters A, B, and C in the scene scripts of the first i scenes are key character C, key character B, and key character A from small to large. The scene summary corresponding to the i-th scene script obtained by the large language model can be called scene summary 0.

[0144] Step 2110, determine the revised scene summary corresponding to the i-th scene script as the sample scene summary, and the revised scene summary corresponding to the i-th scene script is a plot summary obtained by manually correcting the scene summary corresponding to the i-th scene script.

[0145] Since the scene plot 0 obtained by the large language model may have errors in details or misplaced characters, the scene plot 0 can be manually corrected to obtain the corrected scene summary corresponding to the i-th scene script, which can be called scene plot 1. Scene plot 1 is determined as the sample scene summary.

[0146] By obtaining sample scene summaries through a large language model, the accuracy of the sample scene summaries can be improved. After the scene summaries are obtained through a large language model, the scene summaries are manually corrected to further improve the accuracy of the sample scene summaries. Therefore, the sample scene summaries are used as supervision information for the plot extraction model to improve the accuracy of the plot extraction.

[0147] Figure 5The plot extraction process of the plot extraction model is shown, which involves the character extraction model and the training of the plot extraction model. For the training of the character extraction model, firstly, according to the i-th scene script, a large language model is used to ask questions about the character relationships in the i-th scene script, and the character relationships corresponding to the i-th scene script are obtained. The character extraction model is trained using the sample character relationships, and the parameters of the character extraction model are adjusted according to the first loss function value (loss1) to obtain the trained character extraction model.

[0148] For the training of the plot extraction model, the input data of the model is first obtained, including the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script. The plot summary of the i-th scene script is extracted using the large language model to obtain the scene summary 0 corresponding to the i-th scene script. After manually correcting the scene summary 0, the scene summary 1 is obtained. The scene summary 1 is used as the sample scene summary of the plot extraction model, and the plot extraction model is trained. The parameters of the plot extraction model are adjusted according to the second loss function value (loss2) to obtain the trained plot extraction model.

[0149] For example, the main structure of the plot extraction model can be shown in Table 1 below:

[0150] Table 1

[0151]

[0152] Among them, the main structure of the Decoder Layer can be referred to as shown in Table 2 below:

[0153] Table 2

[0154]

[0155]

[0156] Please refer to Figure 6 , which shows a flow chart of a plot extraction method based on a plot extraction model provided by an embodiment of the present application. The execution subject of each step of the method may be a computer device, such as the computer device may be the model using device introduced above. The method may include at least one of the following steps 610 to 630:

[0157] Step 610, obtaining the i-th scene script in the total script of the plot to be extracted, where the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer.

[0158] Step 620, based on the overall script, obtain the main characters in the overall script, and based on the scene scripts of the first i scenes in the overall script, obtain the character relationships corresponding to the i-th scene script, the character relationships corresponding to the i-th scene script include the character relationships corresponding to at least one key character appearing in the scene scripts of the first i scenes in the overall script.

[0159] In some embodiments, the process of obtaining the main characters in the above-mentioned overall script includes at least one sub-step in steps 6201 to 6207 (not shown in the figure).

[0160] Step 6201, obtaining at least one character in the total script, and the number of appearances of at least one character in the total script in the total script.

[0161] Step 6202, sorting at least one character in the total script in descending order of the number of appearances, to obtain a sorting sequence corresponding to at least one character in the total script.

[0162] Step 6203, determining the first number of characters ranked high in the sorting sequence as at least one key character in the overall script.

[0163] Step 6204, obtaining at least one key character in the total script, and the number of appearances of at least one key character in the total script in the total script.

[0164] Step 6205, based on the number of appearances of at least one key character in the total script and the total number of appearances of each character in the total script, obtain the proportion of roles corresponding to at least one key character in the total script, where the proportion of roles refers to the ratio of the number of appearances of the key character in the total script to the total number of appearances of each character in the total script.

[0165] Step 6206, obtaining the maximum value of the proportion of roles corresponding to at least one key character in the total script.

[0166] Step 6207, among at least one key character in the total script, the key character whose role ratio is greater than a first value is determined as the main character in the total script, and the first value is the product of the maximum value and the first proportion.

[0167] In some embodiments, the process of obtaining the character relationship corresponding to the i-th scene script includes at least one sub-step in steps 6208 to 6210 (not shown in the figure).

[0168] Step 6208, using the trained character extraction model, according to the scene scripts of the first j scenes in the total script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer.

[0169] Step 6209, construct a character relationship table based on the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script.

[0170] Step 6210, based on the i-th scene script, obtain the character relationship corresponding to the i-th scene script in the character relationship table.

[0171] Step 630, through the plot extraction model, according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the total script, obtain the scene summary corresponding to the i-th scene script. The plot extraction model is a machine learning model used to extract the plot summary.

[0172] The relevant contents involved in step 620 and step 630 can be referred to the introduction in the above embodiment, which will not be repeated here.

[0173] The technical solution provided by the embodiment of the present application uses a plot extraction model to extract the plot of each scene in the total script, and obtains the scene summary corresponding to each scene script, so that the user can quickly understand the plot content of the total script. For example, in the planning stage of a movie, TV series or other media project, the plot extraction model can be used to help planners quickly understand the plot content of a large number of scripts, so as to effectively screen and make decisions on each script, such as selecting which scenes to focus on shooting and which scenes to merge and shoot based on the scene summaries corresponding to each scene script. For another example, in a movie or TV series recommendation system, the plot extraction model can be used to generate plot summaries of each episode, thereby helping users quickly understand the plot of each plot and make viewing decisions.

[0174] The training method of the plot extraction model and the plot extraction method based on the plot extraction model provided in the embodiment of the present application are the model training process and the use process corresponding to each other. For details not described in detail on one side, please refer to the introduction on the other side.

[0175] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0176] Please refer to Figure 7, which shows a block diagram of a training device for a plot extraction model provided by an embodiment of the present application. The device has the function of implementing the training method for the plot extraction model described above. Figure 7 As shown, the device 700 may include: a data acquisition module 710, a model prediction module 720 and a model training module 730.

[0177] The data acquisition module 710 is used to acquire a first training data set for training the plot extraction model, wherein the first training data set includes at least one first training sample, each of the first training samples includes the i-th scene script, the character relationship corresponding to the i-th scene script, the main characters in the sample total script, and the sample scene summary corresponding to the i-th scene script, wherein the i-th scene script refers to the plot text of the i-th scene in the sample total script, the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and the sample scene summary is used to indicate the plot summary of the i-th scene script, where i is a positive integer.

[0178] The model prediction module 720 is used to use the plot extraction model to obtain the predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationships corresponding to the i-th scene script and the main characters in the sample total script, and the predicted scene summary is used to indicate the plot summary of the i-th scene script.

[0179] The model training module 730 is used to adjust the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain a trained plot extraction model.

[0180] In some embodiments, the character relationship corresponding to the i-th scene script is obtained by using a trained character extraction model, and the data acquisition module 710 is used to:

[0181] Using the trained character extraction model, according to the scene scripts of the first j scenes in the total sample script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer;

[0182] Constructing a character relationship table according to the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script;

[0183] According to the i-th scene script, the character relationship corresponding to the i-th scene script in the character relationship table is obtained.

[0184] In some embodiments, the apparatus further comprises a second training module, wherein the second training module is configured to:

[0185] Acquire a second training data set for training the character extraction model, wherein the second training data set includes at least one second training sample, each of the second training samples includes the scene scripts of the first k scenes in the sample total script, the key characters appearing in the scene scripts of the first k scenes, and the sample character relationships corresponding to the scene scripts of the first k scenes, wherein the sample character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes, and k is a positive integer;

[0186] The character extraction model is used to obtain predicted character relationships corresponding to the scene scripts of the first k scenes according to the scene scripts of the first k scenes and the key characters appearing in the scene scripts of the first k scenes, wherein the predicted character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes;

[0187] According to the difference between the predicted character relationship and the sample character relationship, the parameters of the character extraction model are adjusted to obtain the trained character extraction model.

[0188] In some embodiments, the second training module is used to:

[0189] Obtaining at least one key character that appears in the scene scripts of the first k scenes, wherein the key character refers to a character that has a driving effect on the plot in the scene scripts of the first k scenes;

[0190] Obtaining, by means of a large language model, at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes according to the scene scripts of the first k scenes and at least one key character appearing in the scene scripts of the first k scenes, wherein each of the character relationships is used to indicate a relationship of a first character role relative to a first key character, and the proportion of the first character role in the scene scripts of the first k scenes is less than the proportion of the first key character role in the scene scripts of the first k scenes;

[0191] At least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes is determined as the sample character relationship.

[0192] In some embodiments, the second training module is used to:

[0193] Obtain at least one character that appears in the first k scenes, and the number of appearances of the at least one character that appears in the first k scenes in the first k scenes;

[0194] Sorting at least one character appearing in the first k scenes in descending order of the number of appearances, to obtain a sorting sequence corresponding to at least one character appearing in the first k scenes;

[0195] A first number of characters ranked high in the sorting sequence are determined as at least one key character appearing in the scene scripts of the first k scenes.

[0196] In some embodiments, the data acquisition module 710 is used to:

[0197] Obtaining at least one key character in the sample script and the number of appearances of at least one key character in the sample script in the sample script;

[0198] According to the number of appearances of at least one key character in the sample script and the total number of appearances of each character in the sample script, the proportion of scenes corresponding to at least one key character in the sample script is obtained, wherein the proportion of scenes refers to the ratio of the number of appearances of the key character in the sample script to the total number of appearances of each character in the sample script;

[0199] Obtaining the maximum value of the proportion of roles corresponding to at least one key character in the sample script;

[0200] Among at least one key character in the sample script, the key character whose role ratio is greater than a first value is determined as the main character in the sample script, and the first value is the product of the maximum value and the first proportion.

[0201] In some embodiments, the data acquisition module 710 is used to:

[0202] Obtaining the character relationship corresponding to the i-th scene script and the main characters in the sample total script;

[0203] Obtaining a scene summary corresponding to the i-th scene script according to the i-th scene script, character relationships corresponding to the i-th scene script, and main characters in the sample total script through a large language model;

[0204] The revised scene summary corresponding to the i-th scene script is determined as the sample scene summary, and the revised scene summary corresponding to the i-th scene script is a plot summary obtained by manually correcting the scene summary corresponding to the i-th scene script.

[0205] In some embodiments, the model training module 730 is used to:

[0206] Marking each word in the sample scene summary with a first probability to obtain the marked words in the sample scene summary;

[0207] replacing each word in the sample session summary with a second probability to obtain a replaced word in the sample session summary, wherein the sum of the first probability and the second probability is less than 1;

[0208] Setting the marked words and the replaced words as words to be predicted;

[0209] According to the difference between the word at the position of the word to be predicted in the predicted scene summary and the word to be predicted, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

[0210] The technical solution provided by the embodiment of the present application uses the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script as the input data of the plot extraction model, so that when the plot extraction model extracts the plot of the i-th scene script, it considers the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, thereby avoiding the plot extraction model only considering the current scene script and the character relationship in the current scene script, thereby avoiding the scene summaries generated for each scene being separated. In addition, the main characters in the sample total script are considered, and by building the underlying foundation for plot extraction, the plot extraction model can enhance the plot extraction of the main characters, and generate a scene summary that is connected to the previous text based on the underlying foundation, thereby improving the accuracy of each generated scene summary.

[0211] In addition, since the plot extraction model is a model obtained through additional training, compared with the models used in related technologies, the plot extraction model is more secure and can prevent script leakage, and the vertical domain model that focuses on specific tasks has better stability.

[0212] In addition, the plot extraction model supports the input of scripts for each scene in the total sample script. Compared with the model that inputs the total sample script, it reduces the cost of plot extraction, improves the efficiency of plot extraction, and is conducive to long-term use.

[0213] Please refer to Figure 8, which shows a block diagram of a plot extraction device based on a plot extraction model provided by an embodiment of the present application. The device has the function of implementing the plot extraction method based on the plot extraction model. Figure 8 As shown, the device 800 may include: a script acquisition module 810, a character acquisition module 820 and a summary extraction module 830.

[0214] The script acquisition module 810 is used to obtain the i-th scene script in the total script of the plot to be extracted, where the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer.

[0215] The character acquisition module 820 is used to acquire the main characters in the overall script based on the overall script, and to acquire the character relationships corresponding to the i-th scene script based on the scene scripts of the first i scenes in the overall script. The character relationships corresponding to the i-th scene script include the character relationships corresponding to at least one key character appearing in the scene scripts of the first i scenes in the overall script.

[0216] The summary extraction module 830 is used to obtain the scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationships corresponding to the i-th scene script and the main characters in the total script through the plot extraction model. The plot extraction model is a machine learning model for extracting plot summaries.

[0217] In some embodiments, the character acquisition module 820 is used to:

[0218] Obtaining at least one key character in the overall script and the number of appearances of at least one key character in the overall script in the overall script;

[0219] According to the number of appearances of at least one key character in the total script in the total script and the total number of appearances of each character in the total script, the proportion of scenes corresponding to at least one key character in the total script is obtained, wherein the proportion of scenes refers to the ratio of the number of appearances of the key character in the total script to the total number of appearances of each character in the total script;

[0220] Obtaining the maximum value of the proportion of scenes corresponding to at least one key character in the total script;

[0221] Among at least one key character in the total script, the key character whose role ratio is greater than a first value is determined as the main character in the total script, and the first value is the product of the maximum value and the first proportion.

[0222] In some embodiments, the character acquisition module 820 is used to:

[0223] Obtain at least one character in the total script, and the number of appearances of at least one character in the total script in the total script;

[0224] Sorting at least one character in the total script in descending order of the number of appearances to obtain a sorting sequence corresponding to at least one character in the total script;

[0225] A first number of characters ranked high in the sorting sequence are determined as at least one key character in the overall script.

[0226] In some embodiments, the character acquisition module 820 is used to:

[0227] Using the trained character extraction model, according to the scene scripts of the first j scenes in the total script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer;

[0228] Constructing a character relationship table according to the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script;

[0229] According to the i-th scene script, the character relationship corresponding to the i-th scene script in the character relationship table is obtained.

[0230] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0231] Please refer to Fig. 9 , which shows a block diagram of a computer device 900 provided in one embodiment of the present application. The computer device 900 may be Figure 1 The model training device 10 in the embodiment may also be a model using device 20. The computer device 900 may be used to implement the training method of the plot extraction model provided in the above embodiment, or the plot extraction method based on the plot extraction model.

[0232] Typically, the computer device 900 includes a processor 901 and a memory 902 .

[0233] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI processor for processing computing operations related to machine learning.

[0234] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned plot extraction model training method, or the plot extraction method based on the plot extraction model.

[0235] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the computer device 900, and the computer device 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0236] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor of a computer device, the computer program implements the training method of the plot extraction model or the plot extraction method based on the plot extraction model. Optionally, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0237] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned method for training a plot extraction model, or a plot extraction method based on a plot extraction model.

[0238] It should be noted that this application can display a prompt interface, pop-up window or output voice prompt information before collecting relevant data of users and during the process of collecting relevant data of users. The prompt interface, pop-up window or voice prompt information is used to prompt the user that relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are processed strictly in accordance with the requirements of relevant national laws and regulations, and the informed consent or separate consent of the subject of personal information is obtained with the consent and authorization of the user. The subsequent data use and processing behavior is carried out within the scope of authorization of laws and regulations and the subject of personal information, and the collection, use and processing of relevant user data shall comply with the relevant laws, regulations and standards of relevant countries and regions.

[0239] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0240] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A training method for a plot extraction model, characterized in that: The method comprises: Using the trained character extraction model, according to the scene scripts of the first j scenes in the total sample script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer; Constructing a character relationship table according to the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script; According to the i-th scene script, obtain the character relationship corresponding to the i-th scene script in the character relationship table, wherein the i-th scene script refers to the plot text of the i-th scene in the sample total script, and the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and i is a positive integer; Acquire a first training data set for training the plot extraction model, wherein the first training data set includes at least one first training sample, each of the first training samples includes the i-th scene script, the character relationship corresponding to the i-th scene script, the main characters in the sample total script, and the sample scene summary corresponding to the i-th scene script, wherein the sample scene summary is used to indicate the plot summary of the i-th scene script; The plot extraction model is used to obtain a predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script, and the main characters in the sample total script, wherein the predicted scene summary is used to indicate the plot summary of the i-th scene script; According to the difference between the predicted scene summary and the sample scene summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a second training data set for training the character extraction model, wherein the second training data set includes at least one second training sample, each of the second training samples includes the scene scripts of the first k scenes in the sample total script, the key characters appearing in the scene scripts of the first k scenes, and the sample character relationships corresponding to the scene scripts of the first k scenes, wherein the sample character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes, and k is a positive integer; The character extraction model is used to obtain predicted character relationships corresponding to the scene scripts of the first k scenes according to the scene scripts of the first k scenes and the key characters appearing in the scene scripts of the first k scenes, wherein the predicted character relationships are used to indicate the character relationships corresponding to at least one key character appearing in the scene scripts of the first k scenes; According to the difference between the predicted character relationship and the sample character relationship, the parameters of the character extraction model are adjusted to obtain the trained character extraction model.

3. The method according to claim 2, characterized in that The method further comprises: Obtaining at least one key character that appears in the scene scripts of the first k scenes, wherein the key character refers to a character that has a driving effect on the plot in the scene scripts of the first k scenes; Obtaining, by means of a large language model, at least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes according to the scene scripts of the first k scenes and at least one key character appearing in the scene scripts of the first k scenes, wherein each of the character relationships is used to indicate a relationship of a first character role relative to a first key character, and the proportion of the first character role in the scene scripts of the first k scenes is less than the proportion of the first key character role in the scene scripts of the first k scenes; At least one character relationship corresponding to at least one key character appearing in the scene scripts of the first k scenes is determined as the sample character relationship.

4. The method according to claim 3, characterized in that The step of obtaining at least one key character appearing in the scene scripts of the first k scenes comprises: Obtain at least one character that appears in the first k scenes, and the number of appearances of the at least one character that appears in the first k scenes in the first k scenes; Sorting at least one character appearing in the first k scenes in descending order of the number of appearances, to obtain a sorting sequence corresponding to at least one character appearing in the first k scenes; A first number of characters ranked high in the sorting sequence are determined as at least one key character appearing in the scene scripts of the first k scenes.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining at least one key character in the sample script and the number of appearances of at least one key character in the sample script in the sample script; According to the number of appearances of at least one key character in the sample script and the total number of appearances of each character in the sample script, the proportion of scenes corresponding to at least one key character in the sample script is obtained, wherein the proportion of scenes refers to the ratio of the number of appearances of the key character in the sample script to the total number of appearances of each character in the sample script; Obtaining the maximum value of the proportion of roles corresponding to at least one key character in the sample script; Among at least one key character in the sample script, the key character whose role ratio is greater than a first value is determined as the main character in the sample script, and the first value is the product of the maximum value and the first proportion.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining the character relationship corresponding to the i-th scene script and the main characters in the sample total script; Obtaining a scene summary corresponding to the i-th scene script according to the i-th scene script, character relationships corresponding to the i-th scene script, and main characters in the sample total script through a large language model; The revised scene summary corresponding to the i-th scene script is determined as the sample scene summary, and the revised scene summary corresponding to the i-th scene script is a plot summary obtained by manually correcting the scene summary corresponding to the i-th scene script.

7. The method according to claim 1, characterized in that The step of adjusting the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain a trained plot extraction model includes: Marking each word in the sample scene summary with a first probability to obtain the marked words in the sample scene summary; replacing each word in the sample session summary with a second probability to obtain a replaced word in the sample session summary, wherein the sum of the first probability and the second probability is less than 1; Setting the marked words and the replaced words as words to be predicted; According to the difference between the word at the position of the word to be predicted in the predicted scene summary and the word to be predicted, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

8. A plot extraction method based on a plot extraction model, characterized in that: The plot extraction model is a machine learning model for extracting plot summaries, and the method comprises: Obtaining the i-th scene script in the total script of the plot to be extracted, wherein the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer; According to the overall script, obtaining the main characters in the overall script; Using the trained character extraction model, according to the scene scripts of the first j scenes in the total script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer; Constructing a character relationship table according to the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, wherein each character relationship in the character relationship table corresponds to a scene script; According to the i-th scene script, obtain the character relationship corresponding to the i-th scene script in the character relationship table, wherein the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the total script; Through the plot extraction model, according to the i-th scene script, the character relationships corresponding to the i-th scene script and the main characters in the overall script, a scene summary corresponding to the i-th scene script is obtained.

9. The method according to claim 8, characterized in that The step of obtaining the main characters in the overall script according to the overall script includes: Obtaining at least one key character in the overall script and the number of appearances of at least one key character in the overall script in the overall script; According to the number of appearances of at least one key character in the total script in the total script and the total number of appearances of each character in the total script, the proportion of scenes corresponding to at least one key character in the total script is obtained, wherein the proportion of scenes refers to the ratio of the number of appearances of the key character in the total script to the total number of appearances of each character in the total script; Obtaining the maximum value of the proportion of scenes corresponding to at least one key character in the total script; Among at least one key character in the total script, the key character whose role ratio is greater than a first value is determined as the main character in the total script, and the first value is the product of the maximum value and the first proportion.

10. The method according to claim 9, characterized in that The obtaining of at least one key character in the overall script includes: Obtain at least one character in the total script, and the number of appearances of at least one character in the total script in the total script; Sorting at least one character in the total script in descending order of the number of appearances to obtain a sorting sequence corresponding to at least one character in the total script; A first number of characters ranked high in the sorting sequence are determined as at least one key character in the overall script.

11. A training device for a plot extraction model, characterized in that: The device comprises: The data acquisition module is used to use the trained character extraction model to obtain the character relationships corresponding to at least one key character appearing in the first j scenes of the sample total script based on the scene scripts of the first j scenes and the key characters appearing in the scene scripts of the first j scenes, where j is a positive integer; construct a character relationship table based on the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where each character relationship in the character relationship table corresponds to a scene script; obtain the character relationship corresponding to the i-th scene script in the character relationship table based on the i-th scene script, where the i-th scene script refers to the character relationship of the sample total script. The plot text of the i-th scene in the total script, the character relationship corresponding to the i-th scene script includes the character relationship corresponding to at least one key character appearing in the scene scripts of the first i scenes in the sample total script, and i is a positive integer; obtaining a first training data set for training the plot extraction model, the first training data set includes at least one first training sample, each of the first training samples includes the i-th scene script, the character relationship corresponding to the i-th scene script, the main characters in the sample total script, and the sample scene summary corresponding to the i-th scene script, and the sample scene summary is used to indicate the plot summary of the i-th scene script; A model prediction module, used to use the plot extraction model to obtain a predicted scene summary corresponding to the i-th scene script according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the sample total script, wherein the predicted scene summary is used to indicate the plot summary of the i-th scene script; The model training module is used to adjust the parameters of the plot extraction model according to the difference between the predicted scene summary and the sample scene summary to obtain a trained plot extraction model.

12. A plot extraction device based on a plot extraction model, characterized in that: The plot extraction model is a machine learning model for extracting plot summaries, and the device comprises: A script acquisition module, used to acquire the i-th scene script in the total script of the plot to be extracted, wherein the i-th scene script refers to the plot text of the i-th scene in the total script, and i is a positive integer; A character acquisition module is used to acquire the main characters in the total script according to the total script; using a trained character extraction model, according to the scene scripts of the first j scenes in the total script and the key characters appearing in the scene scripts of the first j scenes, obtain the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, where j is a positive integer; according to the character relationships corresponding to at least one key character appearing in the scene scripts of the first j scenes, construct a character relationship table, wherein each character relationship in the character relationship table corresponds to a scene script; according to the i-th scene script, obtain the character relationships corresponding to the i-th scene script in the character relationship table, wherein the character relationships corresponding to the i-th scene script include the character relationships corresponding to at least one key character appearing in the scene scripts of the first i scenes in the total script; The summary extraction module is used to obtain the scene summary corresponding to the i-th scene script through the plot extraction model according to the i-th scene script, the character relationship corresponding to the i-th scene script and the main characters in the total script.

13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the training method of the plot extraction model as described in any one of claims 1 to 7, or to implement the plot extraction method based on the plot extraction model as described in any one of claims 8 to 10.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the training method of the plot extraction model as described in any one of claims 1 to 7, or to implement the plot extraction method based on the plot extraction model as described in any one of claims 8 to 10.

15. A computer program product, characterized in that The computer program product includes a computer program, which is loaded and executed by a processor to implement the training method of the plot extraction model as described in any one of claims 1 to 7, or to implement the plot extraction method based on the plot extraction model as described in any one of claims 8 to 10.

Citation Information

Patent Citations

  • Method and device for generating movie script abstract

    CN112015890A

  • Controllable abstract joint generation method and system for movie script

    CN115269821A