Plot extraction method, device, equipment and storage medium

Through the plot extraction model based on machine learning, the key characters and scene scripts are used to solve the problems of redundant and inaccurate plot summary in the existing technology, and a more streamlined and accurate plot extraction effect is achieved.

CN117851587BActive Publication Date: 2025-03-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately understand and extract key plots in film and television scripts, resulting in the generated plot summary being too redundant and inaccurate.

Method used

Using a machine learning-based plot extraction model, we extract key scene summary and generate episode summary by obtaining the key characters in the script and the key scene scripts in which they appear, focusing on the main plot in the script.

Benefits of technology

Improve the accuracy and focus of plot extraction, and the generated set summary is more streamlined and targeted, avoiding redundant plot descriptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117851587B_ABST
    Figure CN117851587B_ABST
Patent Text Reader

Abstract

The present application discloses a plot extraction method, device, equipment and storage medium, and relates to the field of computer technology. The method comprises: obtaining the key characters in the i-th episode script in the total script of the plot to be extracted; obtaining at least one key scene script in the i-th episode script according to the key characters in the i-th episode script, and the key scene script refers to the scene script in which the key characters in the i-th episode script appear; obtaining the key scene summaries corresponding to at least one key scene script in the i-th episode script according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script through the plot extraction model; obtaining the episode summary corresponding to the i-th episode script according to the key scene summaries corresponding to at least one key scene script in the i-th episode script. The present application focuses the plot extraction on the key characters in the episode script, and improves the accuracy of the episode 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 plot extraction method, device, equipment and storage medium. Background Art

[0002] Production companies receive many film and television scripts every day. For scripts that may have dozens of episodes and hundreds of thousands of words, how to quickly understand the content of each episode will help production companies quickly evaluate the value of the script.

[0003] In the related art, a plot summary is generated based on GPT (Generative Pre-Trained Transformer) 2 or GPT4 or GPT4 Turbo. By inputting the plot text of a certain episode and asking GPT questions, such as "Please summarize the main events of the following episode of the script, the script is: xxx", GPT will answer the plot summary of the input script.

[0004] However, the above methods cannot focus the plot understanding on the key characters in the script, resulting in the generated plot summary of each episode being too redundant and the plot understanding being inaccurate. Summary of the invention

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

[0006] 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:

[0007] Obtain the key characters in the i-th episode script of the total script of the plot to be extracted, wherein the key characters in the i-th episode script refer to the characters in the i-th episode script that have a driving effect on the plot, and i is a positive integer;

[0008] According to the key characters in the i-th episode script, at least one key scene script in the i-th episode script is obtained, wherein the key scene script refers to the scene script in which the key characters in the i-th episode script appear;

[0009] By using the plot extraction model, according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, key scene summaries corresponding to at least one key scene script in the i-th episode script are obtained, wherein the key scene summaries are used to indicate the plot summaries of the key characters in the i-th episode script in the key scene scripts;

[0010] According to the key scene summaries corresponding to at least one key scene in the i-th episode script, an episode summary corresponding to the i-th episode script is obtained, and the episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

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

[0012] 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 a key character in the i-th episode script in the sample total script, at least one key scene script in the i-th episode script, and a sample set summary corresponding to the i-th episode script, wherein the key character in the i-th episode script refers to a character in the i-th episode script that has a driving effect on the plot, the key scene script refers to a scene script in which the key character in the i-th episode script appears, and the sample set summary is used to indicate a plot summary of the key character in the i-th episode script in the i-th episode script, where i is a positive integer;

[0013] Using the plot extraction model, according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, obtain predicted scene summaries corresponding to at least one key scene script in the i-th episode script, wherein the predicted scene summaries are used to indicate the plot summaries of the key characters in the i-th episode script in the i-th episode script;

[0014] According to the predicted scene summaries corresponding to at least one key scene script in the i-th episode script, a predicted set summary corresponding to the i-th episode script is obtained, wherein the predicted set summary is used to indicate the plot summary of the i-th episode script;

[0015] According to the difference between the prediction set summary and the sample set summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

[0016] 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:

[0017] A character acquisition module is used to acquire a key character in the i-th episode script of the total script of the plot to be extracted, wherein the key character in the i-th episode script refers to a character in the i-th episode script that has a driving effect on the plot, and i is a positive integer;

[0018] A scene acquisition module, used for obtaining at least one key scene script in the i-th episode script according to the key characters in the i-th episode script, wherein the key scene script refers to the scene script in which the key characters in the i-th episode script appear;

[0019] A first extraction module is used to obtain, through the plot extraction model, key scene summaries corresponding to at least one key scene script in the i-th episode script according to key characters in the i-th episode script and at least one key scene script in the i-th episode script, wherein the key scene summary is used to indicate a plot summary of the key characters in the i-th episode script in the key scene script;

[0020] An episode summary generation module is used to obtain an episode summary corresponding to the i-th episode script based on the key scene summaries corresponding to at least one key scene in the i-th episode script, and the episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

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

[0022] 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 which includes a key character in the i-th episode script in the sample total script, at least one key scene script in the i-th episode script, and a sample set summary corresponding to the i-th episode script, wherein the key character in the i-th episode script refers to a character in the i-th episode script that has a driving effect on the plot, the key scene script refers to a scene script in which the key character in the i-th episode script appears, and the sample set summary is used to indicate a plot summary of the key character in the i-th episode script in the i-th episode script, where i is a positive integer;

[0023] A model prediction module, used to use the plot extraction model to obtain predicted scene summaries corresponding to at least one key scene script in the i-th episode script according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, wherein the predicted scene summary is used to indicate the plot summary of the key characters in the i-th episode script in the key scene script;

[0024] An episode summary generation module, for obtaining a predicted episode summary corresponding to the i-th episode script according to the predicted scene summary corresponding to at least one key scene script in the i-th episode script, wherein the predicted episode summary is used to indicate a plot summary of a key character in the i-th episode script in the i-th episode script;

[0025] The first training module is used to adjust the parameters of the plot extraction model according to the difference between the prediction set summary and the sample set summary to obtain a trained plot extraction model.

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

[0027] 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 plot extraction method based on the plot extraction model, or the training method of the plot extraction model.

[0028] 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 plot extraction method based on the plot extraction model, or the training method of the plot extraction model.

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

[0030] By obtaining the key characters in the i-th episode script in the total script of the plot to be extracted, and taking the scene scripts in which the key characters in the i-th episode script appear as the key scene scripts, the plot of the key characters in the i-th episode script in at least one key scene script is extracted through the plot extraction model, avoiding extracting the plots of non-key characters in the i-th episode script, thereby avoiding the generated key scene summaries from being unable to focus on the key characters in the i-th episode script, and avoiding extracting the plots in the non-key scene scripts in the i-th episode script, thereby avoiding the generated episode summary from being too redundant. Compared with the related art, the technical solution provided by the present application ignores the redundant plots in the episode scripts, focuses the plot extraction on the key characters in the episode scripts, thereby extracting the main plots in each episode script, streamlining the plot description of the generated episode summary, and improving the accuracy of the episode summary. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0033] Figure 3 It is a schematic diagram of a display interface of an episode summary of a plot extraction application provided by an embodiment of the present application;

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

[0035] Figure 5 is a flow chart of a method for extracting character relationships based on a plot extraction model provided by an embodiment of the present application;

[0036] Figure 6 is a flowchart of a method for extracting a general summary based on a plot extraction model provided by an embodiment of the present application;

[0037] Figure 7 It is a schematic diagram of a display interface of a full episode summary of a plot extraction application provided by an embodiment of the present application;

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

[0039] Fig. 9 is a schematic diagram of an extraction process of a plot extraction model provided by an embodiment of the present application;

[0040] Fig.10 is a flowchart of a method for training a plot extraction model provided by an embodiment of the present application;

[0041] Fig.11 is a block diagram of a plot extraction device based on a plot extraction model provided by an embodiment of the present application;

[0042] Fig.12 is a block diagram of a training device for a plot extraction model provided by an embodiment of the present application;

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

[0044] 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 with reference to the accompanying drawings.

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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.

[0051] 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.

[0052] 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.

[0053] 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.

[0054] 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.

[0055] 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 extract the plot summary of the input 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 input script. The specific model training method can refer to the following embodiment.

[0056] In one embodiment of the present application, the input data of the plot extraction model includes the key characters in the i-th episode script in the total script and at least one key scene script in the i-th episode script, and the output data is the key scene summary corresponding to the at least one key scene script.

[0057] In one embodiment of the present application, the input data of the plot extraction model includes the kth scene script in the total script, the main characters in the total script, and the character relationships corresponding to the kth target character in the kth scene script, and the output data is the character summary corresponding to the kth target character.

[0058] In one embodiment of the present application, the input data of the plot extraction model includes the j-th scene script and the key characters in the j-th scene script, and the output data is the character relationship corresponding to the j-th scene script.

[0059] In one embodiment of the present application, the input data of the plot extraction model includes the main characters in the total script and each episode script in the total script, and the output data is the plot summary corresponding to each episode script.

[0060] 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 the plot summary of the input script of the model needs to be extracted, the model using device 20 can achieve the above function through the trained plot extraction model.

[0061] 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.

[0062] 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.

[0063] Please refer to Figure 2 , 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 210 to 240:

[0064] Step 210, obtaining the key characters in the i-th episode script of the total script of the plot to be extracted, the key characters in the i-th episode script refer to the characters in the i-th episode script that have a driving role in the plot, and i is a positive integer.

[0065] The general script is a text that describes the plot of a film or TV work and is used to guide the filming of a film or TV work. One film or TV work corresponds to one general script. Each general script contains at least one episode script. The number of episode scripts contained in different general scripts is not necessarily the same, and the number of words in each episode script is not necessarily the same. The number of episode scripts is the number of episodes in the film or TV work corresponding to the general script. The episode script is a text that describes a plot in the general script. The i-th episode script is the text that describes the i-th plot in the general script, and the i-th plot is the continuation of the i-1-th plot in the general script. The duration of the plot described in each episode script in the film or TV work is roughly the same. For example, if the duration of the plot described in the i-th episode script in the film or TV work is 40 minutes, the duration of the plot described in the i-th episode script in the film or TV work can be 35 minutes to 45 minutes, without specific limitation.

[0066] Each episode script contains at least one scene script. The number of scene scripts contained in different episode scripts is not necessarily the same, and the number of words in different scene scripts is not necessarily the same. A scene can be used to indicate a scene, and a scene script refers to a text that describes the plot that occurs in a scene. The scene script includes the time and place of occurrence of the scene, the characters that appear in the scene plot, the behavior of each character, and the dialogue between each character. The episode script refers to the text that describes the plot that occurs in at least one scene corresponding to at least one scene script contained in the episode script, that is, the episode script includes the time and place of occurrence of at least one scene, the characters that appear in the scene plot, the behavior of each character, and the dialogue between each character.

[0067] The key character in the i-th episode script refers to the character that appears in the i-th episode script and has a driving effect on the plot of the i-th episode script. Each episode script contains at least one key character. A character is a character with autonomous consciousness in the plot text. A character can be a human character based on a real person, for example, a human character in a film or television work that requires a real person to perform, or a virtual character based on an animal or plant, for example, a character can be a virtual character in a film or television work that does not require a real person to perform, and a virtual character is usually a character image that does not exist in real life.

[0068] In some embodiments, the process of obtaining the key characters in the i-th episode script includes at least one sub-step in steps 211 to 213 (not shown in the figure).

[0069] Step 211, obtain the leading characters in the i-th episode script, the key characters in the total script, and the main characters in the total script.

[0070] The leading characters in the i-th episode script are characters determined based on the number of appearances of each character in the i-th episode script, and refer to the characters that play a decisive role in the development of the plot in the i-th episode script. The leading characters in the i-th episode script can also be understood as the main characters in the i-th episode script. Each episode script contains at least one leading character. The leading character in the i-th episode script is the character that occupies the main plot description in the i-th episode script, which means that the leading character in the i-th episode script is the character that appears more frequently in the i-th episode script. The number of appearances of each character in the i-th episode script refers to the number of scenes in which the character appears in at least one scene script contained in the i-th episode script. The number of appearances of the character in the i-th episode script has nothing to do with the number of appearances of the character in the i-th episode script. For example, if the i-th episode script contains 10 scene scripts, and character a appears in 5 of the 10 scene scripts, then the number of appearances of character a in the i-th episode script is 5.

[0071] The key characters in the overall script are determined based on the number of times each character appears in the overall script. They refer to the characters in the overall script that have a driving role in the plot. Each overall script contains at least two key characters.

[0072] The main characters in the overall script are determined based on the number of appearances of each character in the overall script. They refer to the characters in the overall script that play a decisive role in the development of the plot. Each overall script contains at least one main character. The main characters in the overall script are the characters that occupy the main plot description in the overall script, which means that the main characters in the overall script are the characters that appear more frequently in the overall script. The main characters in the overall script are also commonly referred to as "protagonists".

[0073] It should be noted that the number of key characters in the total script is greater than the number of main characters in the total script. The main characters in the total script are the key characters in the total script, but the key characters in the total script are not necessarily the main characters in the total script. The leading characters in each episode script are not necessarily the main characters in the total script, and the main characters in the total script are not necessarily the leading characters in the episode script. And the leading characters in each episode script are not necessarily the key characters in the total script, and the key characters in the total script are not necessarily the leading characters in the episode script.

[0074] Step 212, taking the union of the leading characters in the i-th episode script, the key characters in the overall script and the main characters in the overall script, to obtain the i-th union corresponding to the i-th episode script.

[0075] Step 213, determine the characters that appear in the i-th episode script in the i-th union as the key characters in the i-th episode script.

[0076] The characters included in the ith union may all appear in the ith episode script, or at least one character may appear in the ith episode script. The leading characters in the ith episode script all appear in the ith episode script, while at least one character among the key characters or main characters in the total script may not appear in the ith episode script.

[0077] The key character in the i-th episode script refers to the character that has a driving effect on the plot in the i-th episode script, and each episode script contains at least one key character.

[0078] By taking the union of the leading characters in the i-th episode script, the key characters in the total script and the main characters in the total script, and determining the characters that appear in the i-th episode script in the union as the key characters in the i-th episode script, it is avoided that the key characters in the total script or the characters among the main characters in the total script are ignored during the plot extraction due to their small proportion in the i-th episode script, which affects the accuracy of the episode summary output by the model.

[0079] Step 220, based on the key characters in the i-th episode script, obtain at least one key scene script in the i-th episode script, where the key scene script refers to the scene script in which the key characters in the i-th episode script appear.

[0080] The key scene script in the i-th episode script refers to the scene script in which the key characters in the i-th episode script appear in all the scene scripts contained in the i-th episode script. Usually, the key scene script in the i-th episode script refers to the scene script in the i-th episode script that has a driving effect on the plot, for example, the scene script in the i-th episode script that describes the career, family, interpersonal relationships and other aspects of the key characters in the i-th episode script. The non-key scene script in the i-th episode script refers to the scene script in the i-th episode script that does not have a driving effect on the plot, for example, the scene script in the i-th episode script that describes the scene environment, or describes related events of non-key characters in the i-th episode script.

[0081] Step 220 is used to remove non-critical scene scripts from the i-th episode script to avoid extracting plots from non-critical scene scripts when generating the episode summary, which may result in an inaccurate generated episode summary.

[0082] Step 230, through the plot extraction model, according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, obtain the key scene summaries corresponding to at least one key scene script in the i-th episode script, and the key scene summaries are used to indicate the plot summaries of the key characters in the i-th episode script in the key scene scripts.

[0083] The plot extraction model is a machine learning model used to extract plot summaries. The plot extraction model can be used to extract scene summaries of the input scene script. In step 230, the input data of the plot extraction model includes key characters in the i-th episode script and at least one key scene script in the i-th episode script, and the output data is the key scene summary corresponding to at least one key scene script.

[0084] The scene summary is a condensed plot description text obtained by extracting the plot from the scene script. The scene summary is used to describe the plot corresponding to the scene script in general terms. Usually, the number of words in the scene summary is much smaller than the number of words in the scene script. The key scene summary is used to indicate the plot summary of the key characters in the key scene script of the i-th episode script, which means that the key scene summary does not contain the plot description of the non-key characters in the i-th episode script in the key scene script.

[0085] Step 240, obtaining an episode summary corresponding to the ith episode script based on the key scene summaries corresponding to at least one key scene in the ith episode script, wherein the episode summary is used to indicate a plot summary of a key character in the ith episode script in the ith episode script.

[0086] The key scene summaries corresponding to at least one key scene in the i-th episode script are spliced ​​together to obtain an episode summary corresponding to the i-th episode script. The episode summary corresponding to the i-th episode script is used to indicate the plot summary of the key characters in the i-th episode script in at least one key scene in the i-th episode script.

[0087] Figure 3 The display interface of the plot extraction application for episode summaries is shown. The plot extraction application is an application designed based on the plot understanding model. The plot extraction application is used to extract the summaries of each episode corresponding to each total script, as well as the total summary corresponding to the total script. The display interface of the plot extraction application includes the script name 301, the number of episodes contained in the total script 302 (i.e. the number of episodes of the film and television work), the selection button 303 of "full episode analysis" and the selection button 304 of "episode analysis". Click the selection button 304 of "episode analysis" to display the following information: Figure 3 As shown in the display interface, the display interface of the episode summary of the plot extraction application also includes selection buttons 305 and display boxes 306 for each episode summary. Select the episode number of the episode summary to be viewed. For example, select the episode summary of episode 1, and the episode summary corresponding to the episode script of episode 1 will be displayed in the display box 306.

[0088] The technical solution provided by the embodiment of the present application obtains the key characters in the i-th episode script in the total script of the plot to be extracted, and uses the scene script in which the key characters in the i-th episode script appear as the key scene script, and extracts the plot of the key characters in the i-th episode script in at least one key scene script through the plot extraction model, avoiding extracting the plot of non-key characters in the i-th episode script, thereby avoiding the generated key scene summaries from being unable to focus on the key characters in the i-th episode script, and avoiding extracting the plot in the non-key scene script in the i-th episode script, thereby avoiding the generated episode summary from being too redundant. Compared with the related art, the technical solution provided by the present application ignores the redundant plots in the episode script, focuses the plot extraction on the key characters in the episode script, thereby extracting the main plots in each episode script, streamlining the plot description of the generated episode summary, and improving the accuracy of the episode summary.

[0089] In some embodiments, the above step 211 includes at least one sub-step of steps 2111 to 2119 (not shown in the figure).

[0090] Step 2111, obtain at least one character in the total script, the number of appearances of at least one character in the total script in the total script, and the total number of appearances of each character in the total script. The number of appearances of each character in the total script refers to the number of scenes in which the character appears in each scene of the total script.

[0091] At least one character in the total script refers to a character that has appeared in the total script. The number of appearances of a character in the total script refers to the number of scenes in which the character appears in at least one scene script included in the total script. The number of appearances of a character in the total script has nothing to do with the number of times the character appears in the total script. For example, if the total script contains 100 scene scripts, and character a appears in 10 of the 100 scene scripts, then the number of appearances of character a in the total script is 10.

[0092] The number of appearances of at least one character in the total script is added up to obtain the total number of appearances of each character in the total script.

[0093] Step 2112, based on the number of appearances of at least one character in the total script and the total number of appearances of each character in the total script, obtain the first role ratio corresponding to at least one character in the total script, the first role ratio refers to the ratio of the number of appearances of the character in the total script to the total number of appearances of each character in the total script.

[0094] For each character in the total script, the number of appearances of the character in the total script is divided by the total number of appearances of each character in the total script to obtain the first play ratio corresponding to the character. For example, if the total number of appearances of each character in the total script is 200, and the number of appearances of character a in the total script is 10, then the first play ratio corresponding to character a is 5%.

[0095] Step 2113, obtaining the first maximum value of the first role ratio corresponding to at least one character in the total script.

[0096] According to the first role ratios respectively corresponding to at least one character in the total script, a maximum value of at least one first role ratio is obtained, which is called the first maximum value.

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

[0098] This application does not limit the value of the first proportion. For example, if the first maximum value is 50% and the first proportion is 50%, then the first value is 25%, and the character whose first role ratio is greater than 25% among at least one character in the total script is determined as the main character in the total script. Among them, the character corresponding to the first maximum value is also commonly referred to as the "first protagonist".

[0099] By extracting the main characters in the total script through the above method, the characters that occupy the main plot description in the total script can be considered when extracting the collection summary corresponding to the collection script, avoiding ignoring the plot extraction of some main characters in the total script due to the small number of appearances of these main characters in the collection script, thereby improving the accuracy of the generated collection summary.

[0100] Step 2115, among at least one character in the total script, the character whose first role ratio is greater than a second value is determined as a key character in the total script, the second value is the product of the first maximum value and the second ratio, and the second ratio is less than the first ratio.

[0101] The value of the second proportion is less than the value of the first proportion. For example, if the first proportion is 50%, the second proportion is any value less than 50%. If the first maximum value is 50% and the second proportion is 20%, the second value is 10%, and the character whose first role proportion is greater than 10% in the total script is determined as a key character in the total script.

[0102] Since the second proportion is smaller than the first proportion, the second value is smaller than the first value. The number of key characters in the total script obtained based on the second value is greater than the number of main characters in the total script obtained based on the first value, that is, the key characters in the total script include the main characters in the total script.

[0103] By extracting the key characters in the overall script through the above method, it is possible to consider the characters in the overall script that have a driving role in the plot when extracting the episode summary corresponding to the episode script, thereby avoiding ignoring the plot extraction of some key characters in the overall script due to the small number of appearances of these key characters in the episode script, thereby improving the accuracy of the generated episode summary.

[0104] Step 2116, obtain at least one character in the i-th episode script, the number of appearances of at least one character in the i-th episode script in the i-th episode script, and the total number of appearances of each character in the i-th episode script. The number of appearances of each character in the i-th episode script refers to the number of times the character appears in each scene of the i-th episode script.

[0105] The at least one character in the i-th episode script refers to a character that has appeared in the i-th episode script. The number of appearances of a character in the i-th episode script refers to the number of scenes in which the character appears in at least one scene contained in the i-th episode script. The number of appearances of a character in the i-th episode script has nothing to do with the number of times the character appears in the i-th episode script.

[0106] The number of appearances of at least one character in the i-th episode of the script is added up to obtain the total number of appearances of each character in the i-th episode of the script.

[0107] Step 2117, based on the number of appearances of at least one character in the i-th episode script in the i-th episode script and the total number of appearances of each character in the i-th episode script, obtain the second role ratio corresponding to at least one character in the i-th episode script, the second role ratio refers to the ratio of the number of appearances of the character in the i-th episode script to the total number of appearances of each character in the i-th episode script.

[0108] For each character in the i-th episode, the number of appearances of the character in the i-th episode is divided by the total number of appearances of each character in the i-th episode to obtain the second role ratio corresponding to the character. The second role ratio and the first role ratio are both role ratios determined based on the number of appearances of the character.

[0109] Step 2118, obtaining the second maximum value of the second role ratio corresponding to at least one character in the i-th episode of the script.

[0110] According to the second role ratios respectively corresponding to at least one character in the i-th episode of the script, a maximum value of at least one second role ratio is obtained, which is called the second maximum value.

[0111] Step 2119, among at least one character in the i-th episode script, the character whose second role ratio is greater than a third value is determined as the leading character in the i-th episode script, and the third value is the product of the second maximum value and the third ratio.

[0112] This application does not limit the value of the third proportion, and the value of the third proportion is independent of the values ​​of the first proportion and the second proportion. For example, if the second maximum value is 50% and the third proportion is 50%, then the third value is 25%, and the character whose second role ratio is greater than 25% in at least one character in the i-th episode script is determined as the leading character in the i-th episode script.

[0113] Through the above method, the leading characters in each episode of the script can be obtained in a targeted manner according to the proportion of the second role of the characters in each episode of the script, avoiding ignoring the characters that occupy the main plot description in the episode of the script, so that the extracted episode summary is an episode summary of the main plot of each episode of the script, thereby improving the accuracy of the episode summary.

[0114] Please refer to Figure 4 , which shows a flow chart of a character summary 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 410 to 450.

[0115] Step 410, obtaining the kth scene script in the total script, where the kth scene script refers to the plot text of the kth scene in the total script, and k is a positive integer.

[0116] The kth scene script is the text describing the kth plot in the total script. The kth plot is the continuation of the k-1th plot in the total script. Each plot occurs in a scene, and each plot in a scene corresponds to a scene script. For example, if the first plot described in the total script occurs in scene 1, and the second plot described in the total 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.

[0117] The scenes corresponding to adjacent scenes in the total script are different, while the scenes corresponding to the alternate scenes 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.

[0118] Step 420, based on the overall script, obtain the main characters in the overall script, and based on the k-th scene script, obtain the leading characters in the k-th scene script.

[0119] With reference to the above embodiment, according to the above steps 2111 to 2114, the main characters in the overall script are obtained, which will not be described in detail here.

[0120] The leading character in the k-th script is a character determined based on the number of times each character appears in the k-th script, and refers to the character that plays a decisive role in the development of the plot in the k-th script. The leading character in the k-th script can also be understood as the main character in the k-th script. Each script contains at least one leading character. The leading character in the k-th script is the character that occupies the main plot description in the k-th script, which means that the leading character in the k-th script is the character that appears more frequently in the k-th script.

[0121] The number of times each character appears in the kth script refers to the number of times the character's name appears in the kth script. In some embodiments, a character may appear in the total script with different character names, and the number of times each character appears in the kth script refers to the sum of the number of times each character's name appears in the kth script. For example, the character names of character a in the total script include character name 1 and character name 2, and the number of times character a appears in the kth script refers to the sum of the number of times character name 1 appears in the kth script and the number of times character name 2 appears in the kth script. Exemplarily, if the number of times character name 1 of character a appears in the kth script is 10, and the number of times character name 2 appears in the kth script is 5, then the number of times character a appears in the kth script is 15.

[0122] In some embodiments, the process of obtaining the leading character in the kth scene script includes at least one sub-step in steps 421 to 424 (not shown in the figure).

[0123] Step 421, obtain at least one character in the k-th script, the number of appearances of at least one character in the k-th script in the k-th script, and the total number of appearances of each character in the k-th script. The number of appearances of each character in the k-th script refers to the number of times the character's name appears in the k-th script.

[0124] The at least one character in the k-th script refers to the character that has appeared in the k-th script, the number of appearances of each character in the k-th script refers to the number of times the character's name appears in the k-th script, and the number of appearances of at least one character in the k-th script in the k-th script is added together to obtain the total number of appearances of each character in the k-th script.

[0125] Step 422, based on the number of appearances of at least one character in the k-th script in the k-th script and the total number of appearances of each character in the k-th script, obtain the third role ratio corresponding to at least one character in the k-th script, the third role ratio refers to the ratio of the number of appearances of the character in the k-th script to the total number of appearances of each character in the k-th script.

[0126] For each character in the kth scene script, the number of times the character appears in the kth scene script is divided by the total number of times each character appears in the kth scene script to obtain the third role ratio corresponding to the character. Unlike the first role ratio and the second role ratio, the third role ratio is a role ratio determined based on the number of times the character appears.

[0127] Step 423, obtaining the third maximum value of the third role ratio corresponding to at least one character in the k-th scene script.

[0128] According to the third role ratios respectively corresponding to at least one character in the k-th scene script, a maximum value of at least one third role ratio is obtained, which is called the third maximum value.

[0129] Step 424, among at least one character in the k-th scene script, the character whose third role ratio is greater than a fourth value is determined as the leading character in the k-th scene script, and the fourth value is the product of the third maximum value and the fourth ratio.

[0130] This application does not limit the value of the fourth proportion, and the value of the fourth proportion is independent of the values ​​of the first proportion, the second proportion, and the third proportion. For example, if the third maximum value is 50% and the fourth proportion is 50%, then the fourth value is 25%, and the character whose third role ratio is greater than 25% in at least one character in the k-th scene script is determined as the leading character in the k-th scene script.

[0131] Through the above method, the leading characters in each scene script can be obtained in a targeted manner according to the proportion of the third part of the characters in each scene script, so that the plot summary can be extracted based on the leading characters in the scene script, making the extracted character summary more accurate.

[0132] Step 430, determine the characters that appear in the k-th scene script among the main characters in the total script, and the leading characters in the k-th scene script, as the k-th target characters corresponding to the k-th scene script.

[0133] Take the union of the main characters in the total script and the leading characters in the k-th scene script to obtain the k-th union corresponding to the k-th scene script, and determine the character in the k-th union that appears in the k-th scene script as the k-th target character corresponding to the k-th scene script.

[0134] The k-th target person may also be referred to as the k-th target person set, and the k-th target person set includes at least one persona.

[0135] Step 440, obtaining the character relationship corresponding to the k-th target character.

[0136] The character relationships corresponding to the k-th target character include the character relationships corresponding to the key characters in the k-th script, and the character relationships corresponding to each key character include the relationships of the characters appearing in the k-th script relative to the key character, and the relationship of the characters relative to the key character refers to the relationship of the characters whose third-part ratio is less than the third-part ratio of the key character relative to the key character. Character relationships can include father-son relationships, father-daughter relationships, mother-son relationships, mother-daughter relationships, husband-wife relationships, lovers relationships, teacher-student relationships, etc. If the overall script is a plot text in a modern scene, the character relationships can also include classmate relationships, colleague relationships, etc. If the overall script is a plot text in an ancient scene, the character relationships can also include master-servant relationships, etc.

[0137] The character relationship corresponding to the k-th target character is the character relationship obtained based on the total script. The specific process of obtaining the character relationship corresponding to the k-th target character can be referred to as follows Figure 5 The embodiment shown.

[0138] Step 450, through the plot extraction model, according to the character relationship between the main characters in the k-th scene script, the total script and the k-th target character, obtain the character summary corresponding to the k-th target character, and the character summary corresponding to the k-th target character is used to indicate the plot summary about the k-th target character in the k-th scene script.

[0139] The plot extraction model can also be used to extract the character summary corresponding to the kth target character in the input scene script. In step 450, the input data of the plot extraction model includes the kth scene script, the main characters in the total script and the character relationship corresponding to the kth target character in the kth scene script, and the output data is the character summary corresponding to the kth target character.

[0140] The character summary corresponding to the k-th target character is used to indicate the plot summary about the k-th target character in the k-th scene script, that is, the plot extraction model is used to extract the plot summary related to the k-th target character in the k-th scene script.

[0141] In some embodiments, the plot extraction model can be used to extract the character summary corresponding to the specific target character in the kth scene script, and the specific target character is one or more characters in the kth target character. For example, the plot extraction model can extract the character summary corresponding to character a in the kth scene script, and the plot extraction model can extract the character summaries corresponding to character a and character b in the kth scene script. Then the input data of the plot extraction model can include the character relationship corresponding to the kth scene script, the main characters in the total script, and the specific target character in the kth scene script, and the output data is the character summary corresponding to the specific target character.

[0142] The technical solution provided by the embodiment of the present application uses the character relationships corresponding to the kth scene script, the main characters in the total script, and the kth target character as the input data of the plot extraction model, so that the plot extraction model can extract the character summary corresponding to the kth target character in the kth scene script based on the character relationship corresponding to the kth target character, thereby avoiding the plot extraction model only considering the character relationships existing in the current kth scene script, which leads to errors in the extracted character summary corresponding to the kth target character, enhancing the plot extraction of the kth target character, and improving the accuracy of the character summary corresponding to the kth target character generated. In addition, since the plot extraction model supports the input of each scene script, compared with the model that inputs the total script, the plot extraction cost is reduced and the plot extraction efficiency is improved.

[0143] In some embodiments, the plot extraction model may not be used, but a character summary extraction model may be used to obtain a character summary corresponding to the kth target character based on the character relationship between the main characters in the kth scene script, the total script, and the kth target character. That is to say, the plot extraction model mentioned in this application is a model with a single plot extraction capability, that is, the ability to extract key scene summaries corresponding to key scene scripts, and the character summary extraction model is also a model with a single plot extraction capability, that is, the ability to extract character summaries corresponding to target characters. The plot extraction model in the above embodiment is a model with multiple plot extraction capabilities, that is, it has the ability to extract key scene summaries corresponding to key scene scripts and the ability to extract character summaries corresponding to target characters.

[0144] Please refer to Figure 5 , which shows a flow chart of a method for extracting character relationships based on a plot extraction model provided by an embodiment of the present application. Each step of the method is a specific explanation of the above step 440, and the method may include at least one of the following steps 510-560.

[0145] Step 510, obtaining the j-th scene script in the i-th episode script, where the j-th scene script refers to the plot text of the j-th scene in the i-th episode script, and j is a positive integer.

[0146] The jth scene script is the text describing the jth plot in the ith episode script. The jth plot is the continuation of the j-1th plot in the ith episode script. Each plot occurs in a scene, and each plot in a scene corresponds to a scene script. For example, if the first plot described in the ith episode script occurs in scene 1, and the second plot described in the ith episode 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. The adjacent scene scripts in each episode script correspond to different scenes, and the scenes corresponding to the 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.

[0147] Step 520, based on the key characters in the i-th episode script, obtain the key characters in the j-th scene script, where the key characters in the j-th scene script refer to the characters in the i-th episode script that appear in the j-th scene script.

[0148] The key character in the i-th episode script refers to the character that appears in the i-th episode script in the i-th set, and the key character in the j-th scene script refers to the character that appears in the j-th scene script among the key characters in the i-th episode script. It can also be understood that the key character in the j-th scene script refers to the character that appears in the j-th scene script in the i-th set.

[0149] Step 530, using the plot extraction model, based on the j-th scene script and the key characters in the j-th scene script, obtain the character relationship corresponding to the j-th scene script.

[0150] The plot extraction model can also be used to extract the character relationships in the input scene script. In step 530, the input data of the plot extraction model includes the jth scene script and the key characters in the jth scene script, and the output data is the character relationships corresponding to the jth scene script.

[0151] The character relationships corresponding to the j-th scene script include the character relationships corresponding to each key character in the j-th scene script, and the character relationships corresponding to the first key character in the j-th scene script include the relationships between each first character role in the j-th scene script and the first key character. Among them, the first key character refers to any key character among the key characters in the j-th scene script, and the first character role refers to a character role whose third role ratio in the j-th scene script is less than the third role ratio of the first key character in the scene script.

[0152] 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.

[0153] For example, if the characters in the j-th scene 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 third part of each character, and the key characters in the j-th scene script are character c and character d, then the character relationships corresponding to the j-th 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.

[0154] By adopting the plot extraction model, based on the scene scripts and the key characters in the scene scripts, the character relationships corresponding to the scene scripts are extracted, so that the character relationships in the overall script can be obtained, which facilitates the subsequent extraction of the plot of the target character in the scene script based on the character relationships in the overall script, thereby improving the accuracy of the character summary corresponding to the target character.

[0155] In some embodiments, the plot extraction model may not be used, but the character relationship extraction model may be used to obtain the character relationship corresponding to the j-th scene script based on the j-th scene script and the key characters in the j-th scene script. That is to say, the plot extraction model mentioned in this application is a model with a single plot extraction capability, that is, the ability to extract key scene summaries corresponding to key scene scripts, and the character relationship extraction model is also a model with a single extraction capability, that is, the ability to extract character relationships corresponding to scene scripts. The plot extraction model in the above embodiment is a model with multiple extraction capabilities, that is, it has the ability to extract key scene summaries corresponding to key scene scripts and the ability to extract character relationships corresponding to scene scripts. In some embodiments, the plot extraction model may also have the ability to extract character summaries corresponding to target characters.

[0156] Step 540, using the plot extraction model, obtain the character relationships corresponding to each scene script in the total script. The character relationships corresponding to the scene script include the character relationships corresponding to each key character in the scene script, the character relationship corresponding to the first key character in the scene script includes the relationship between each first character role in the scene script and the first key character, and the third role ratio of the first character role in the scene script is less than the third role ratio of the first key character in the scene script.

[0157] The process of obtaining the character relationships corresponding to each scene script in the overall script may refer to the above steps 510 to 530.

[0158] Step 550, merging the character relationships corresponding to the scripts of each scene to obtain the character relationships corresponding to the overall script.

[0159] For example, if the character relationships corresponding to the j-th scene script include the relationship between character a and character b, which is relationship 1, and the relationship between character a and character c, which is relationship 2, and the character relationships corresponding to the j+1-th scene script include the relationship between character a and character b, which is relationship 3, and the relationship between character b and character c, which is relationship 4, wherein relationship 1, relationship 2, relationship 3 and relationship 4 are different from each other. Then the character relationships corresponding to the j-th scene script and the character relationships corresponding to the j+1-th scene script are merged to obtain the character relationship between character a and character b, the character relationship between character a and character c, and the character relationship between character b and character c. Among them, the character relationship between character a and character c is relationship 2, and the character relationship between character b and character c is relationship 4. Since the relationship between character a and character b exists between relationship 1 and relationship 3, it is necessary to select one of them to be determined as the character relationship between character a and character b.

[0160] In some embodiments, the process of obtaining the character relationships corresponding to the above-mentioned overall script includes at least one sub-step in steps 551 to 553 (not shown in the figure).

[0161] Step 551: if there are multiple relationships between the first person character and the first key person, the multiple relationships between the first person character and the first key person are graded according to kinship.

[0162] Kinship refers to character relationships based on blood relationships and the degree of association. For example, the relationships between family members can be set to the first level, including grandfather, grandmother, father, mother, brother, younger brother, sister, younger sister, son, daughter, grandson, granddaughter, husband, wife, grandmother, sister-in-law and other character relationships. Friendly relationships among related persons are set to the second level, including teacher, classmate, colleague, superior, customer, master, subordinate, partner, student, tenant, landlord, neighbor, boyfriend, girlfriend, bestie and other character relationships. Unfriendly relationships among related persons are set to the third level, including opponents, enemies and other character relationships. This application does not specifically limit the hierarchical setting of relationships, and can also be set hierarchically based on the number of contacts, distance, etc.

[0163] Grading the multiple relationships between the first persona and the first key persona refers to determining the levels of the multiple relationships between the first persona and the first key persona. For example, if the first persona and the first key persona have relationship 1 and relationship 2, then determining the relationship levels corresponding to relationship 1 and relationship 2, respectively.

[0164] Step 552: determine the highest-level relationship among the multiple relationships between the first character and the first key character as the character relationship between the first character and the first key character.

[0165] For example, if the relationship 1 between the first character and the first key character is the first level and the relationship 2 is the second level, the relationship 1 is determined as the character relationship of the first character and the first key character. For example, if the relationship between the first character and the first key character includes sister and colleague, the character relationship of the first character and the first key character is sister.

[0166] Step 553, according to the character relationship of each first character role relative to each first key character in the overall script, obtain the character relationship corresponding to the overall script.

[0167] According to the character relationships corresponding to the scenes in the overall script, at least one relationship between each first character role in the overall script and each first key character is obtained, and then the character relationships between each first character role in the overall script and each first key character are obtained. According to the character relationships between each first character role in the overall script and each first key character, the character relationships corresponding to the overall script are obtained after merging.

[0168] By merging the character relationships corresponding to each scene in the script, the highest-level relationship among the multiple relationships between each first character and each first key character is retained, thereby avoiding the influence of the lower-level relationships among the multiple relationships between the first character and the first key character on the plot extraction, thereby causing the generated plot summary to be inaccurate.

[0169] Step 560, obtaining the character relationship corresponding to the kth target character according to the character relationship corresponding to the total script.

[0170] According to the character relationships between each first character role and each first key character in the overall script, the character relationships between each first character role and the k-th target character are selected as the character relationships corresponding to the k-th target character.

[0171] The technical solution provided in the embodiment of the present application, by pre-acquiring the character relationships corresponding to the overall script, makes the subsequent extraction of the character relationships corresponding to the target characters in each scene script more convenient, improves the efficiency of acquiring the character relationships, and thus improves the extraction efficiency of the plot extraction model.

[0172] Please refer to Figure 6 , which shows a flow chart of a method for extracting a general summary 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.

[0173] Step 610, based on the overall script, obtain the main characters in the overall script, and obtain the scripts of each episode in the overall script.

[0174] With reference to the above embodiment, according to the above steps 2111 to 2114, the main characters in the overall script are obtained, which will not be described in detail here.

[0175] Step 620, using the plot extraction model, based on the main characters in the overall script and the individual episodes in the overall script, obtain the plot summaries corresponding to the individual episodes in the overall script.

[0176] The plot extraction model can also be used to extract the episode summary corresponding to the input episode script, which is different from the episode summary corresponding to the episode script involved above. The episode summary corresponding to the episode script is used to indicate the plot summary of the key characters in the ith episode script in the ith episode script, while the plot summary corresponding to the episode script is used to indicate the plot summary of the main characters in the overall script in the episode script. In step 620, the input data of the plot extraction model includes the main characters in the overall script and each episode script in the overall script, and the output data is the plot summary corresponding to each episode script in the overall script.

[0177] In some embodiments, the plot extraction model may not be used, but the plot summaries corresponding to the various episodes in the total script may be obtained by using the total summary extraction model according to the main characters in the total script and the various episodes in the total script. That is to say, the plot extraction model mentioned in this application is a model with a single plot extraction capability, that is, the capability to extract key scene summaries corresponding to key scene scripts, and the total summary extraction model is also a model with a single extraction capability, that is, the capability to extract plot summaries corresponding to episode scripts. The plot extraction model in the above embodiment is a model with multiple extraction capabilities, that is, the capability to extract key scene summaries corresponding to key scene scripts and the capability to extract plot summaries corresponding to episode scripts at the same time. In some embodiments, the plot extraction model may also have the capability to extract character summaries corresponding to target characters and the capability to extract character relationships corresponding to scene scripts.

[0178] Step 630, based on the plot summaries corresponding to the various episodes in the total script, obtain a total summary corresponding to the total script, and the total summary is used to indicate the plot summary of the total script.

[0179] The plot summaries corresponding to the various episodes in the overall script are spliced ​​together to obtain an overall summary corresponding to the overall script. The overall summary corresponding to the overall script is used to indicate the plot summaries of the main characters in the overall script.

[0180] Figure 7 The display interface of the full episode summary of the plot extraction application is shown. The display interface of the plot extraction application includes the script name 301, the number of episodes 302 contained in the total script (i.e., the number of episodes of the film and television work), a selection button 303 for "full episode analysis" and a selection button 304 for "episode analysis". Click the selection button 303 for "full episode analysis" to display the following Figure 7 As shown in the display interface, the display interface of the full summary of the plot extraction application also includes a display box 701, in which the total summary corresponding to the total script is displayed.

[0181] The technical solution provided in the embodiment of the present application extracts the plot summaries corresponding to each episode of the total script through a plot extraction model, and then obtains the total summary corresponding to the total script based on the plot summaries corresponding to each episode. This can avoid the model directly extracting the plot summary based on the total script, and by inputting shorter fields, reduce the plot extraction cost and improve the plot extraction efficiency.

[0182] Figure 8 The schematic diagram of the reasoning process of the plot extraction model is shown. First, based on the overall script, the episode scripts in the overall script, and the scene scripts in each episode script, the basic capabilities used by the model are constructed, that is, the leading characters, key characters, and corresponding character relationships in each scene script are extracted, as well as the leading characters and key characters in each episode script, and the leading characters, key characters, and corresponding character relationships in the overall script are extracted. Secondly, each scene script is identified and the key scene script is extracted. Finally, based on the constructed basic capabilities and the extracted key scene scripts, the plot summary of the target character in each scene script, the episode summary corresponding to each episode script, and the overall summary corresponding to the overall script are obtained.

[0183] Fig. 9The schematic diagram of the extraction process of the plot extraction model is shown. According to the total script, each episode script in the total script and each scene script in each episode script are obtained. According to the total script, each episode script and each scene script, the main characters in the total script, the key characters in the total script and the starring characters in each episode script are obtained. Through the plot extraction model, according to the main characters in the total script and each episode script, the total summary corresponding to the total script is obtained. According to the main characters in the total script, the key characters in the total script and the starring characters in each episode script, the key characters in each episode script are obtained. Through the plot extraction model, according to the key characters in each episode script and the key scene scripts in each episode script, the episode summary corresponding to each episode script is obtained. According to the key characters in each episode script and each scene script, the key characters in each scene script are obtained. Through the plot extraction model, according to each scene script and the key characters in each scene script, the character relationship corresponding to each scene script is obtained, and then the character relationship corresponding to the total script is obtained, and the character relationship corresponding to the target character in each scene script is extracted from the character relationship corresponding to the total script. Through the plot extraction model, according to the character relationships corresponding to the target characters in each scene script, each scene script and the leading characters in each scene script, the character summary corresponding to the target character in each scene script is obtained.

[0184] Please refer to Fig.10 , 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 introduced above. The method may include at least one of the following steps 1010 to 1040.

[0185] Step 1010, obtaining a first training data set for training a plot extraction model, the first training data set including at least one first training sample, each first training sample including a key character in the i-th episode script in the sample total script, at least one key scene script in the i-th episode script, and a sample set summary corresponding to the i-th episode script, the key character in the i-th episode script refers to a character in the i-th episode script that has a driving effect on the plot, the key scene script refers to a scene script in which the key character in the i-th episode script appears, the sample set summary is used to indicate the plot summary of the key character in the i-th episode script in the i-th episode script, and i is a positive integer.

[0186] The steps of obtaining the key characters in the i-th episode script and at least one key scene script in the i-th episode script in the first training sample may refer to the above embodiment.

[0187] The sample set summary corresponding to the i-th episode script is a set summary serving as supervisory information for the plot extraction model, and is used to indicate a plot summary of a key character in the i-th episode script in at least one key scene script in the i-th episode script.

[0188] In some embodiments, the process of obtaining the sample set summary corresponding to the i-th set of scripts includes at least one sub-step in steps 1011 to 1013 (not shown in the figure).

[0189] Step 1011, obtaining key characters in the i-th episode script and at least one key scene script in the i-th episode script.

[0190] Step 1012, obtaining an episode summary corresponding to the i-th episode script based on key characters in the i-th episode script and at least one key scene script in the i-th episode script through a large language model.

[0191] The large language model can be any publicly available large language model, such as a natural language model based on a transformer structure trained 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.

[0192] The large language model can be used to extract the episode summary corresponding to each episode script. The input data of the large language model is the key characters in the i-th episode script and at least one key scene script in the i-th episode script, and the output data is the episode summary corresponding to the i-th episode script.

[0193] For example, the episode summary corresponding to the i-th episode script is obtained through the large language model, and the question sentence structure can be: "The following is the main plot of a certain episode of a certain film and television script, the protagonist is xxxx, please refine the plot of this episode: (key scene 1 plot, key scene 2 plot...)." Among them, the key scene plot is the plot text described in the key scene script. The episode summary corresponding to the i-th episode script obtained by the large language model can be called episode summary 0.

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

[0195] Since the set summary 0 obtained by the large language model may have detail errors or character misalignment, the set summary 0 can be manually corrected to obtain the corrected set summary corresponding to the i-th set script, which can be called set summary 1. Set summary 1 is determined as the sample set summary.

[0196] By obtaining the sample set summary through the large language model, the accuracy of the sample set summary can be improved. After the set summary is obtained through the large language model, the set summary is manually corrected to further improve the accuracy of the sample set summary. Therefore, the sample set summary is used as the supervision information of the plot extraction model to improve the accuracy of the plot extraction.

[0197] Step 1020, using a plot extraction model to obtain predicted scene summaries corresponding to at least one key scene script in the ith episode script based on the key characters in the ith episode script and at least one key scene script in the ith episode script, wherein the predicted scene summary is used to indicate the plot summary of the key characters in the ith episode script in the key scene script.

[0198] Step 1030, based on the predicted scene summaries corresponding to at least one key scene in the i-th episode script, obtain the predicted set summary corresponding to the i-th episode script, and the predicted set summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

[0199] Step 1040 , adjusting the parameters of the plot extraction model according to the difference between the prediction set summary and the sample set summary to obtain a trained plot extraction model.

[0200] In some embodiments, each word in the sample set summary is marked with a first probability to obtain the marked words in the sample set summary; each word in the sample set summary is replaced with a second probability to obtain the replaced words in the sample set 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 prediction set summary and the words to be predicted, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

[0201] 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.

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

[0203] Optionally, each word in the sample set summary may be further masked with the third probability to obtain the masked words in the sample set 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 the words to be predicted.

[0204] 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.

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

[0206] 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:

[0207]

[0208] 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 each word to be predicted in the prediction set summary. If a word in the dictionary is selected as a word to be predicted in the prediction set 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 prediction set summary, the label of the word is 0.

[0209] For example, for the first word in the prediction set 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 set summary. In this way, the words to be predicted in the prediction set summary and the probability of each word being determined as the word to be predicted are obtained.

[0210] In some embodiments, weights may be set for each word to be predicted in a sample set summary. For example, the weights of words that play a major role in describing the plot may be set higher, while the weights 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 plot extraction.

[0211] 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.

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

[0213] The technical solution provided in the embodiment of the present application uses the task of extracting the set summary of the set script to conduct targeted training on the plot extraction model. Compared with the models in the related art, the plot extraction model of the present application is more secure and can avoid script leakage. The vertical domain model focusing on specific tasks has better stability and more accurate plot extraction.

[0214] In some embodiments, the training of the plot extraction model may further include the following steps.

[0215] Step S01, obtaining a second training data set for training a plot extraction model, the second training data set includes at least one second training sample, each second training sample includes the kth scene script in the sample total script, the main characters in the sample total script, the character relationship corresponding to the kth target character corresponding to the kth scene script, and the sample character summary corresponding to the kth target character, the kth scene script refers to the plot text of the kth scene in the sample total script, the kth target character corresponding to the kth scene script includes the character roles of the main characters in the sample total script that appear in the kth scene script and the leading characters in the kth scene script, the sample character summary is used to indicate the plot summary about the kth target character in the kth scene script, and k is a positive integer.

[0216] The sample character summary corresponding to the k-th target character is the character summary that serves as supervisory information for the plot extraction model.

[0217] In some embodiments, the steps for obtaining the sample character summary corresponding to the kth target character are: obtaining the character summary corresponding to the kth target character through a large language model based on the character relationship between the main characters in the kth scene script, the sample total script, and the kth target character; determining the revised character summary corresponding to the kth target character as the sample character summary, the revised character summary corresponding to the kth target character is a plot summary obtained by manually correcting the character summary corresponding to the kth target character.

[0218] Exemplarily, the character summary corresponding to the kth target character is obtained through the large language model. The question sentence structure can be: "The following is the script of a scene in a play. It is known that B is A's xx, C is A's xx, C is B's xx, and the protagonist is xxxx. Please extract the plot summary about xx in this scene. You are required to describe the specific events that happened in the scene. Do not make guesses or abstract descriptions. The script is xxx." The "protagonist" is the main character in the total sample script, characters A, B and C are the target characters in the scene script, and the character summary to be extracted is for at least one of the target characters.

[0219] The character summary corresponding to the k-th target character obtained by the large language model can be called character summary 0, the character summary obtained by manually correcting character summary 0 can be called character summary 1, and character summary 1 is determined as the sample character summary.

[0220] Step S02, using the plot extraction model to obtain a predicted character summary corresponding to the kth target character according to the character relationships between the main characters in the kth scene script, the sample total script, and the kth target character, and the predicted character summary is used to indicate the plot summary about the kth target character in the kth scene script.

[0221] Step S03, adjusting the parameters of the plot extraction model according to the difference between the predicted character summary and the sample character summary to obtain a trained plot extraction model.

[0222] Calculating the difference between the predicted character summary and the sample character summary can be converted into calculating the difference between the to-be-predicted words in the predicted character summary and in the sample character summary. The second loss function value is obtained based on the difference between the words at the position of the to-be-predicted words in the predicted character summary and the words in the corresponding sample character summary. Then, the parameters of the plot extraction model are adjusted based on the first loss function value and the second loss function value to obtain the trained plot extraction model.

[0223] In some embodiments, the plot extraction model is a model with a single plot extraction capability, that is, it only has the capability of extracting key scene summaries corresponding to key scene scripts, and then the character summary extraction model is trained, and the character summary extraction model is a model with the capability of extracting character summaries corresponding to target characters. According to the second loss function value, the parameters of the character summary extraction model are adjusted to obtain a trained character summary extraction model.

[0224] In some embodiments, the training of the plot extraction model may further include the following steps.

[0225] Step S04, obtaining a third training data set for training a plot extraction model, the third training data set including at least one third training sample, each third training sample including the jth scene script in the i-th episode script, the key character in the j-th scene script and the sample character relationship corresponding to the j-th scene script, the j-th scene script refers to the plot text of the j-th scene in the total sample script, the key character in the j-th scene script refers to the character that appears in the j-th scene script among the key characters in the i-th episode script, the sample character relationship is used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script, and j is a positive integer.

[0226] The sample character relationship corresponding to the j-th scene script is the character relationship that serves as the supervisory information of the plot extraction model.

[0227] In some embodiments, the steps for obtaining the sample character relationship corresponding to the j-th scene script are: obtaining the character relationship corresponding to the j-th scene script through a large language model based on the j-th scene script and the key characters in the j-th scene script; determining the revised character relationship corresponding to the j-th scene script as the sample character relationship, and the revised character relationship corresponding to the j-th scene script is the character relationship obtained by manually correcting the character relationship corresponding to the j-th scene script.

[0228] Exemplarily, the character relationship corresponding to the j-th scene script is obtained through the 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 third role ratio of character a in the input script is less than the third role ratio of character b in the input script, then the large language model will answer the relationship of character a relative to character b. If character a is a key character in the scene scripts of the previous multiple scenes, and the third role ratio of character b in the input script is less than the third role ratio of character a in the input script, then the large language model will answer the relationship of character b relative to character a.

[0229] The character relationship corresponding to the j-th scene script obtained by the large language model can be called character relationship 0, and the character relationship obtained by manually correcting character relationship 0 can be called character relationship 1, and character relationship 1 is determined as the sample character relationship.

[0230] Step S05, using the plot extraction model to obtain the predicted character relationship corresponding to the j-th scene script based on the j-th scene script and the key characters in the j-th scene script, the predicted character relationship is used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script.

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

[0232] According to the difference between the predicted character relationship and the sample character relationship, the third loss function value is obtained. According to the first loss function value, the second loss function value and the third loss function value, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

[0233] In some embodiments, the plot extraction model is a model with a single plot extraction capability, that is, it only has the capability to extract key scene summaries corresponding to key scene scripts, and then the character relationship extraction model is trained, and the character relationship extraction model is a model with the capability to extract character relationships corresponding to scene scripts. According to the third loss function value, the parameters of the character relationship extraction model are adjusted to obtain a trained character relationship extraction model.

[0234] In some embodiments, the training of the plot extraction model may further include the following steps.

[0235] Step S07, obtaining a fourth training data set for training a plot extraction model, the fourth training data set including at least one fourth training sample, each fourth training sample including main characters in the sample total script, each episode script in the sample total script and a sample total summary corresponding to the sample total script, the sample total summary being used to indicate a plot summary of the sample total script.

[0236] The sample total summary corresponding to the sample total script is the plot summary that serves as the supervision information of the plot extraction model.

[0237] In some embodiments, the steps for obtaining the sample general summary corresponding to the sample general script are: obtaining the general summary corresponding to the sample general script through a large language model based on the main characters in the sample general script and the various episodes in the sample general script; determining the revised general summary corresponding to the sample general script as the sample general summary, and the revised general summary corresponding to the sample general script is a plot summary obtained by manually revising the general summary corresponding to the sample general script.

[0238] For example, the general summary corresponding to the sample total script is obtained through the large language model. The question sentence structure can be: "The following is the main plot of each episode of a film or television script. The protagonist is xxxx. Please summarize the plot of this episode: (Episode 1 plot, Episode 2 plot...)." The "protagonist" here refers to the main character in the sample total script.

[0239] The total summary corresponding to the sample total script obtained by the large language model can be called total summary 0, the total summary obtained by manually correcting the total summary 0 can be called total summary 1, and the total summary 1 is determined as the sample total summary.

[0240] Step S08, using the plot extraction model to obtain the predicted plot summaries corresponding to the respective episodes in the sample total script according to the main characters in the sample total script and the respective episodes in the sample total script.

[0241] Step S09, obtaining a predicted summary corresponding to the sample script according to the predicted plot summaries corresponding to the various episodes in the sample script, wherein the predicted summary is used to indicate the plot summary of the sample script.

[0242] Step S10, adjusting the parameters of the plot extraction model according to the difference between the predicted total summary and the sample total summary to obtain a trained plot extraction model.

[0243] Calculating the difference between the predicted total summary and the sample total summary can be converted into calculating the difference between the words to be predicted in the predicted total summary and in the sample total summary, and obtaining the fourth loss function value according to the difference between the words at the position of the words to be predicted in the predicted total summary and the words to be predicted in the corresponding sample total summary. According to the first loss function value, the second loss function value, the third loss function value and the fourth loss function value, the parameters of the plot extraction model are adjusted to obtain the trained plot extraction model.

[0244] In some embodiments, the plot extraction model is a model with a single plot extraction capability, that is, it only has the capability to extract key scene summaries corresponding to key scene scripts, and then the total summary extraction model is trained, and the total summary extraction model is a model with the capability to extract plot summaries corresponding to the set of scripts. Then, according to the fourth loss function value, the parameters of the total summary extraction model are adjusted to obtain a trained character summary extraction model.

[0245] The plot extraction method based on the plot extraction model and the training method of 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.

[0246] 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.

[0247] Please refer to Fig.11 , 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. Fig.11 As shown, the device 1100 may include: a character acquisition module 1110 , a scene acquisition module 1120 , a first extraction module 1130 , and a set summary generation module 1140 .

[0248] The character acquisition module 1110 is used to obtain the key characters in the i-th episode script of the total script of the plot to be extracted, where the key characters in the i-th episode script refer to the characters in the i-th episode script that have a driving role in the plot, and i is a positive integer.

[0249] The scene acquisition module 1120 is used to obtain at least one key scene script in the i-th episode script based on the key characters in the i-th episode script, and the key scene script refers to the scene script in which the key characters in the i-th episode script appear.

[0250] The first extraction module 1130 is used to obtain the key scene summaries corresponding to at least one key scene script in the i-th episode script according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script through the plot extraction model, wherein the key scene summary is used to indicate the plot summary of the key characters in the i-th episode script in the key scene script.

[0251] The episode summary generation module 1140 is used to obtain the episode summary corresponding to the i-th episode script based on the key scene summaries corresponding to at least one key scene script in the i-th episode script, and the episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

[0252] In some embodiments, the character acquisition module 1110 is used to:

[0253] Obtain the leading character in the i-th episode script, the key character in the overall script, and the main character in the overall script;

[0254] Taking the union of the leading characters in the i-th episode script, the key characters in the total script and the main characters in the total script, to obtain the i-th union corresponding to the i-th episode script;

[0255] The characters in the i-th set that appear in the i-th episode script are determined as the key characters in the i-th episode script.

[0256] In some embodiments, the character acquisition module 1110 is used to:

[0257] Obtain at least one character in the total script, the number of appearances of at least one character in the total script in the total script, and the total number of appearances of each character in the total script, wherein the number of appearances of each character in the total script refers to the number of scenes in which the character appears in each scene of the total script;

[0258] According to the number of appearances of at least one character in the total script in the total script and the total number of appearances of each character in the total script, a first role ratio corresponding to at least one character in the total script is obtained, wherein the first role ratio refers to the ratio of the number of appearances of the character in the total script to the total number of appearances of each character in the total script;

[0259] Obtaining a first maximum value of the first role ratios respectively corresponding to at least one character in the total script;

[0260] Among at least one character in the total script, the character whose first 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 first maximum value and the first proportion.

[0261] In some embodiments, the character acquisition module 1110 is used to:

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

[0263] In some embodiments, the character acquisition module 1110 is used to:

[0264] Obtain at least one character in the i-th episode script, the number of appearances of at least one character in the i-th episode script in the i-th episode script, and the total number of appearances of each character in the i-th episode script, where the number of appearances of each character in the i-th episode script refers to the number of scenes in which the character appears in each scene of the i-th episode script;

[0265] According to the number of appearances of at least one character in the i-th episode of the script in the i-th episode and the total number of appearances of each character in the i-th episode of the script, a second role ratio corresponding to at least one character in the i-th episode of the script is obtained, wherein the second role ratio refers to the ratio of the number of appearances of the character in the i-th episode of the script to the total number of appearances of each character in the i-th episode of the script;

[0266] Obtaining a second maximum value of the second role ratio corresponding to at least one character in the i-th episode script;

[0267] Among at least one character in the i-th episode of the script, the character whose second role ratio is greater than a third value is determined as the leading character in the i-th episode of the script, and the third value is the product of the second maximum value and the third proportion.

[0268] In some embodiments, the apparatus 1100 further includes a second extraction module, the second extraction module being configured to:

[0269] Obtaining the kth scene script in the total script, wherein the kth scene script refers to the plot text of the kth scene in the total script, and k is a positive integer;

[0270] According to the overall script, obtain the main characters in the overall script, and according to the k-th scene script, obtain the leading characters in the k-th scene script;

[0271] Determine the characters that appear in the k-th script among the main characters in the total script and the leading characters in the k-th script as the k-th target characters corresponding to the k-th script;

[0272] Obtaining the character relationship corresponding to the k-th target character;

[0273] Through the plot extraction model, a character summary corresponding to the kth target character is obtained according to the character relationship between the kth scene script, the main characters in the overall script and the kth target character. The character summary corresponding to the kth target character is used to indicate the plot summary about the kth target character in the kth scene script.

[0274] In some embodiments, the second extraction module is used to:

[0275] Obtain at least one character in the k-th scene script, the number of appearances of at least one character in the k-th scene script in the k-th scene script, and the total number of appearances of each character in the k-th scene script, wherein the number of appearances of each character in the k-th scene script refers to the number of appearances of the character name of the character in the k-th scene script;

[0276] According to the number of appearances of at least one character in the k-th scene script in the k-th scene script and the total number of appearances of each character in the k-th scene script, a third role ratio corresponding to at least one character in the k-th scene script is obtained, wherein the third role ratio refers to the ratio of the number of appearances of the character in the k-th scene script to the total number of appearances of each character in the k-th scene script;

[0277] Obtaining a third maximum value of the third role ratios respectively corresponding to at least one character in the k-th scene script;

[0278] Among at least one character in the k-th scene script, the character whose third role ratio is greater than a fourth value is determined as the leading character in the k-th scene script, and the fourth value is the product of the third maximum value and the fourth ratio.

[0279] In some embodiments, the second extraction module is used to:

[0280] By using the plot extraction model, character relationships corresponding to each scene script in the total script are obtained, wherein the character relationships corresponding to the scene scripts include character relationships corresponding to each key character in the scene script, and the character relationships corresponding to the first key character in the scene script include relationships between each first character in the scene script and the first key character, and the third role ratio of the first character in the scene script is less than the third role ratio of the first key character in the scene script;

[0281] Merging the character relationships corresponding to the scripts of each scene to obtain the character relationships corresponding to the overall script;

[0282] According to the character relationships corresponding to the overall script, the character relationships corresponding to the k-th target character are obtained.

[0283] In some embodiments, the apparatus 1100 further includes a third extraction module, the third extraction module being configured to:

[0284] Obtain the j-th scene script in the i-th episode script, wherein the j-th scene script refers to the plot text of the j-th scene in the i-th episode script, and j is a positive integer;

[0285] According to the key characters in the i-th episode script, the key characters in the j-th scene script are obtained, wherein the key characters in the j-th scene script refer to the characters in the i-th episode script that appear in the j-th scene script;

[0286] Through the plot extraction model, according to the j-th scene script and the key characters in the j-th scene script, the character relationship corresponding to the j-th scene script is obtained.

[0287] In some embodiments, the second extraction module is used to:

[0288] If the first person role has multiple relationships with the first key person, the multiple relationships of the first person role with the first key person are graded according to kinship;

[0289] Determine the highest-level relationship among the multiple relationships between the first character and the first key person as the character relationship between the first character and the first key person;

[0290] According to the character relationships of each first character in the overall script relative to each first key character, the character relationships corresponding to the overall script are obtained.

[0291] In some embodiments, the apparatus 1100 further includes a fourth extraction module, the fourth extraction module being configured to:

[0292] According to the overall script, obtain the main characters in the overall script, and obtain the individual episodes in the overall script;

[0293] By using the plot extraction model, according to the main characters in the total script and the individual episodes in the total script, the plot summaries corresponding to the individual episodes in the total script are obtained;

[0294] According to the plot summaries corresponding to the respective episodes in the overall script, a general summary corresponding to the overall script is obtained, and the general summary is used to indicate the plot summary of the overall script.

[0295] Please refer to Fig.12 , 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. Fig.12As shown, the device 1200 may include: a data acquisition module 1210 , a model prediction module 1220 , a set summary generation module 1230 and a first training module 1240 .

[0296] The data acquisition module 1210 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, and each of the first training samples includes a key character in the i-th episode script in the sample total script, at least one key scene script in the i-th episode script, and a sample set summary corresponding to the i-th episode script, wherein the key character in the i-th episode script refers to a character in the i-th episode script that has a driving effect on the plot, and the key scene script refers to a scene script in which the key character in the i-th episode script appears, and the sample set summary is used to indicate a plot summary of the key character in the i-th episode script in the i-th episode script, and i is a positive integer.

[0297] The model prediction module 1220 is used to use the plot extraction model to obtain the predicted scene summaries corresponding to at least one key scene script in the i-th episode script according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, wherein the predicted scene summary is used to indicate the plot summary of the key characters in the i-th episode script in the key scene script.

[0298] The episode summary generation module 1230 is used to obtain the predicted episode summary corresponding to the i-th episode script based on the predicted scene summaries corresponding to at least one key scene script in the i-th episode script, and the predicted episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

[0299] The first training module 1240 is used to adjust the parameters of the plot extraction model according to the difference between the prediction set summary and the sample set summary to obtain a trained plot extraction model.

[0300] In some embodiments, the data acquisition module 1210 is used to:

[0301] Obtaining key characters in the i-th episode script and at least one key scene script in the i-th episode script;

[0302] Obtaining an episode summary corresponding to the i-th episode script according to key characters in the i-th episode script and at least one key scene script in the i-th episode script through a large language model;

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

[0304] In some embodiments, the first training module 1240 is used to:

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

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

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

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

[0309] In some embodiments, the apparatus 1200 further includes a second training module, wherein the second training module is configured to:

[0310] Acquire a second training data set for training the plot extraction model, wherein the second training data set includes at least one second training sample, each of the second training samples includes the kth scene script in the sample total script, the main characters in the sample total script, the character relationship corresponding to the kth target character corresponding to the kth scene script, and the sample character summary corresponding to the kth target character, the kth scene script refers to the plot text of the kth scene in the sample total script, the kth target character corresponding to the kth scene script includes the character roles among the main characters in the sample total script that appear in the kth scene script and the leading character in the kth scene script, the sample character summary is used to indicate the plot summary about the kth target character in the kth scene script, and k is a positive integer;

[0311] The plot extraction model is used to obtain a predicted character summary corresponding to the kth target character according to the character relationship between the kth scene script, the main characters in the sample total script, and the kth target character, wherein the predicted character summary is used to indicate a plot summary about the kth target character in the kth scene script;

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

[0313] In some embodiments, the apparatus 1200 further includes a third training module, wherein the second training module is configured to:

[0314] Acquire a third training data set for training the plot extraction model, wherein the third training data set includes at least one third training sample, each of the third training samples includes the jth scene script in the i-th episode script, the key characters in the j-th scene script, and the sample character relationship corresponding to the j-th scene script, wherein the j-th scene script refers to the plot text of the j-th scene in the sample total script, the key characters in the j-th scene script refers to the characters in the i-th episode script that appear in the j-th scene script, and the sample character relationship is used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script, and j is a positive integer;

[0315] Using the plot extraction model to obtain predicted character relationships corresponding to the j-th scene script according to the j-th scene script and key characters in the j-th scene script, the predicted character relationships are used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script;

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

[0317] In some embodiments, the apparatus 1200 further includes a fourth training module, the second training module being configured to:

[0318] Acquire a fourth training data set for training the plot extraction model, wherein the fourth training data set includes at least one fourth training sample, each of the fourth training samples includes a main character in the sample total script, each episode script in the sample total script, and a sample total summary corresponding to the sample total script, wherein the sample total summary is used to indicate a plot summary of the sample total script;

[0319] Using the plot extraction model to obtain predicted plot summaries corresponding to the respective episodes of the sample script according to the main characters in the sample script and the respective episodes of the sample script;

[0320] According to the predicted plot summaries corresponding to the respective episodes in the sample total script, a predicted total summary corresponding to the sample total script is obtained, wherein the predicted total summary is used to indicate the plot summary of the sample total script;

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

[0322] 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.

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

[0324] Typically, the computer device 1300 includes a processor 1301 and a memory 1302 .

[0325] The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 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 1301 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 1301 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 1301 may also include an AI processor, which is used to process computing operations related to machine learning.

[0326] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 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 1302 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 method based on the plot extraction model, or the training method of the plot extraction model.

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

[0328] 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 plot extraction method based on the plot extraction model or the training method of the plot extraction model is implemented. 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.

[0329] 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 plot extraction method based on the plot extraction model, or the training method of the plot extraction model.

[0330] 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.

[0331] 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.

[0332] 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 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: Obtain the leading character in the i-th episode of the total script of the plot to be extracted, the key character in the total script, and the main character in the total script, where i is a positive integer; Taking the union of the leading characters in the i-th episode script, the key characters in the total script and the main characters in the total script, to obtain the i-th union corresponding to the i-th episode script; Determine the characters that appear in the i-th episode script in the i-th set as the key characters in the i-th episode script, wherein the key characters in the i-th episode script refer to the characters that have a driving effect on the plot in the i-th episode script; According to the key characters in the i-th episode script, at least one key scene script in the i-th episode script is obtained, wherein the key scene script refers to the scene script in which the key characters in the i-th episode script appear; By using the plot extraction model, according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, key scene summaries corresponding to at least one key scene script in the i-th episode script are obtained, wherein the key scene summaries are used to indicate the plot summaries of the key characters in the i-th episode script in the key scene scripts; According to the key scene summaries corresponding to at least one key scene in the i-th episode script, an episode summary corresponding to the i-th episode script is obtained, and the episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

2. The method according to claim 1, characterized in that The obtaining of the main characters in the overall script includes: Obtain at least one character in the total script, the number of appearances of at least one character in the total script in the total script, and the total number of appearances of each character in the total script, wherein the number of appearances of each character in the total script refers to the number of scenes in which the character appears in each scene of the total script; According to the number of appearances of at least one character in the total script in the total script and the total number of appearances of each character in the total script, a first role ratio corresponding to at least one character in the total script is obtained, wherein the first role ratio refers to the ratio of the number of appearances of the character in the total script to the total number of appearances of each character in the total script; Obtaining a first maximum value of the first role ratios respectively corresponding to at least one character in the total script; Among at least one character in the total script, the character whose first 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 first maximum value and the first proportion.

3. The method according to claim 2, characterized in that The step of obtaining the key characters in the overall script includes: Among at least one character in the total script, the character whose first role ratio is greater than a second value is determined as a key character in the total script, the second value is the product of the first maximum value and a second ratio, and the second ratio is less than the first ratio.

4. The method according to claim 1, characterized in that: The step of obtaining the main characters in the i-th episode script includes: Obtain at least one character in the i-th episode script, the number of appearances of at least one character in the i-th episode script in the i-th episode script, and the total number of appearances of each character in the i-th episode script, where the number of appearances of each character in the i-th episode script refers to the number of scenes in which the character appears in each scene of the i-th episode script; According to the number of appearances of at least one character in the i-th episode of the script in the i-th episode and the total number of appearances of each character in the i-th episode of the script, a second role ratio corresponding to at least one character in the i-th episode of the script is obtained, wherein the second role ratio refers to the ratio of the number of appearances of the character in the i-th episode of the script to the total number of appearances of each character in the i-th episode of the script; Obtaining a second maximum value of the second role ratio corresponding to at least one character in the i-th episode script; Among at least one character in the i-th episode of the script, the character whose second role ratio is greater than a third value is determined as the leading character in the i-th episode of the script, and the third value is the product of the second maximum value and the third proportion.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining the kth scene script in the total script, wherein the kth scene script refers to the plot text of the kth scene in the total script, and k is a positive integer; According to the overall script, obtain the main characters in the overall script, and according to the k-th scene script, obtain the leading characters in the k-th scene script; Determine the characters that appear in the k-th script among the main characters in the total script and the leading characters in the k-th script as the k-th target characters corresponding to the k-th script; Obtaining the character relationship corresponding to the k-th target character; Through the plot extraction model, a character summary corresponding to the kth target character is obtained according to the character relationship between the kth scene script, the main characters in the overall script and the kth target character. The character summary corresponding to the kth target character is used to indicate the plot summary about the kth target character in the kth scene script.

6. The method according to claim 5, characterized in that The step of obtaining the leading characters in the k-th scene script according to the k-th scene script comprises: Obtain at least one character in the k-th scene script, the number of appearances of at least one character in the k-th scene script in the k-th scene script, and the total number of appearances of each character in the k-th scene script, wherein the number of appearances of each character in the k-th scene script refers to the number of appearances of the character name of the character in the k-th scene script; According to the number of appearances of at least one character in the k-th scene script in the k-th scene script and the total number of appearances of each character in the k-th scene script, a third role ratio corresponding to at least one character in the k-th scene script is obtained, wherein the third role ratio refers to the ratio of the number of appearances of the character in the k-th scene script to the total number of appearances of each character in the k-th scene script; Obtaining a third maximum value of the third role ratios respectively corresponding to at least one character in the k-th scene script; Among at least one character in the k-th scene script, the character whose third role ratio is greater than a fourth value is determined as the leading character in the k-th scene script, and the fourth value is the product of the third maximum value and the fourth ratio.

7. The method according to claim 5, characterized in that The obtaining of the character relationship corresponding to the k-th target character includes: By using the plot extraction model, character relationships corresponding to each scene script in the total script are obtained, wherein the character relationships corresponding to the scene scripts include character relationships corresponding to each key character in the scene script, and the character relationships corresponding to the first key character in the scene script include relationships between each first character in the scene script and the first key character, and the third role ratio of the first character in the scene script is less than the third role ratio of the first key character in the scene script; Merging the character relationships corresponding to the scripts of each scene to obtain the character relationships corresponding to the overall script; According to the character relationships corresponding to the overall script, the character relationships corresponding to the k-th target character are obtained.

8. The method according to claim 7, characterized in that The step of obtaining the character relationships corresponding to the various scenes in the total script through the plot extraction model includes: Obtain the j-th scene script in the i-th episode script, wherein the j-th scene script refers to the plot text of the j-th scene in the i-th episode script, and j is a positive integer; According to the key characters in the i-th episode script, the key characters in the j-th scene script are obtained, wherein the key characters in the j-th scene script refer to the characters in the i-th episode script that appear in the j-th scene script; Through the plot extraction model, according to the j-th scene script and the key characters in the j-th scene script, the character relationship corresponding to the j-th scene script is obtained.

9. The method according to claim 7, characterized in that: The character relationships corresponding to the scripts of each scene are merged to obtain the character relationships corresponding to the overall script, including: If the first person role has multiple relationships with the first key person, the multiple relationships of the first person role with the first key person are graded according to kinship; Determine the highest-level relationship among the multiple relationships between the first character and the first key person as the character relationship between the first character and the first key person; According to the character relationships of each first character in the overall script relative to each first key character, the character relationships corresponding to the overall script are obtained.

10. The method according to claim 1, characterized in that The method further comprises: According to the overall script, obtain the main characters in the overall script, and obtain the individual episodes in the overall script; By using the plot extraction model, according to the main characters in the total script and the individual episodes in the total script, the plot summaries corresponding to the individual episodes in the total script are obtained; According to the plot summaries corresponding to the respective episodes in the overall script, a general summary corresponding to the overall script is obtained, and the general summary is used to indicate the plot summary of the overall script.

11. A method for training a plot extraction model, characterized in that: The method comprises: Obtain the leading character in the i-th episode of the sample script, the key character in the sample script, and the main character in the sample script, where i is a positive integer; Taking the union of the leading characters in the i-th episode script, the key characters in the sample total script and the main characters in the sample total script, to obtain the i-th union corresponding to the i-th episode script; Determine the characters that appear in the i-th episode script in the i-th set as the key characters in the i-th episode script, wherein the key characters in the i-th episode script refer to the characters that have a driving effect on the plot in the i-th episode script; 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 a key character in the i-th episode script, at least one key scene script in the i-th episode script, and a sample set summary corresponding to the i-th episode script, wherein the key scene script refers to a scene script in which a key character in the i-th episode script appears, and the sample set summary is used to indicate a plot summary of the key character in the i-th episode script in the i-th episode script; Using the plot extraction model, according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, obtain predicted scene summaries corresponding to at least one key scene script in the i-th episode script, wherein the predicted scene summaries are used to indicate the plot summaries of the key characters in the i-th episode script in the key scene scripts; According to the predicted scene summaries corresponding to at least one key scene script in the i-th episode script, a predicted set summary corresponding to the i-th episode script is obtained, wherein the predicted set summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script; According to the difference between the prediction set summary and the sample set summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

12. The method according to claim 11, characterized in that The method further comprises: Acquire a second training data set for training the plot extraction model, wherein the second training data set includes at least one second training sample, each of the second training samples includes the kth scene script in the sample total script, the main characters in the sample total script, the character relationship corresponding to the kth target character corresponding to the kth scene script, and the sample character summary corresponding to the kth target character, the kth scene script refers to the plot text of the kth scene in the sample total script, the kth target character corresponding to the kth scene script includes the character roles among the main characters in the sample total script that appear in the kth scene script and the leading character in the kth scene script, the sample character summary is used to indicate the plot summary about the kth target character in the kth scene script, and k is a positive integer; The plot extraction model is used to obtain a predicted character summary corresponding to the kth target character according to the character relationship between the kth scene script, the main characters in the sample total script, and the kth target character, wherein the predicted character summary is used to indicate a plot summary about the kth target character in the kth scene script; According to the difference between the predicted character summary and the sample character summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

13. The method according to claim 11, characterized in that The method further comprises: Acquire a third training data set for training the plot extraction model, wherein the third training data set includes at least one third training sample, each of the third training samples includes the jth scene script in the i-th episode script, the key characters in the j-th scene script, and the sample character relationship corresponding to the j-th scene script, wherein the j-th scene script refers to the plot text of the j-th scene in the sample total script, the key characters in the j-th scene script refers to the characters in the i-th episode script that appear in the j-th scene script, and the sample character relationship is used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script, and j is a positive integer; Using the plot extraction model to obtain predicted character relationships corresponding to the j-th scene script according to the j-th scene script and key characters in the j-th scene script, the predicted character relationships are used to indicate the relationship between each character in the j-th scene script and each key character in the j-th scene script; According to the difference between the predicted character relationship and the sample character relationship, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

14. The method according to claim 11, characterized in that The method further comprises: Acquire a fourth training data set for training the plot extraction model, wherein the fourth training data set includes at least one fourth training sample, each of the fourth training samples includes a main character in the sample total script, each episode script in the sample total script, and a sample total summary corresponding to the sample total script, wherein the sample total summary is used to indicate a plot summary of the sample total script; Using the plot extraction model to obtain predicted plot summaries corresponding to the respective episodes of the sample script according to the main characters in the sample script and the respective episodes of the sample script; According to the predicted plot summaries corresponding to the respective episodes in the sample total script, a predicted total summary corresponding to the sample total script is obtained, wherein the predicted total summary is used to indicate the plot summary of the sample total script; According to the difference between the predicted general summary and the sample general summary, the parameters of the plot extraction model are adjusted to obtain a trained plot extraction model.

15. 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: The character acquisition module is used to obtain the leading characters in the i-th episode script of the total script of the plot to be extracted, the key characters in the total script and the main characters in the total script, where i is a positive integer; take the union of the leading characters in the i-th episode script, the key characters in the total script and the main characters in the total script to obtain the i-th union corresponding to the i-th episode script; determine the characters in the i-th union that appear in the i-th episode script as the key characters in the i-th episode script, and the key characters in the i-th episode script refer to the characters in the i-th episode script that have a driving effect on the plot; A scene acquisition module, used for obtaining at least one key scene script in the i-th episode script according to the key characters in the i-th episode script, wherein the key scene script refers to the scene script in which the key characters in the i-th episode script appear; A first extraction module is used to obtain, through the plot extraction model, key scene summaries corresponding to at least one key scene script in the i-th episode script according to key characters in the i-th episode script and at least one key scene script in the i-th episode script, wherein the key scene summary is used to indicate a plot summary of the key characters in the i-th episode script in the key scene script; An episode summary generation module is used to obtain an episode summary corresponding to the i-th episode script based on the key scene summaries corresponding to at least one key scene in the i-th episode script, and the episode summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script.

16. A training device for a plot extraction model, characterized in that: The device comprises: A data acquisition module is used to obtain the leading characters in the i-th episode script of the sample total script, the key characters in the sample total script and the main characters in the sample total script, where i is a positive integer; take the union of the leading characters in the i-th episode script, the key characters in the sample total script and the main characters in the sample total script to obtain the i-th union corresponding to the i-th episode script; determine the characters in the i-th union that appear in the i-th episode script as the key characters in the i-th episode script, where the key characters in the i-th episode script refer to the characters in the i-th episode script that have a driving effect on the plot; obtain a first training data set for training the plot extraction model, where the first training data set includes at least one first training sample, each of the first training samples includes the key characters in the i-th episode script, at least one key scene script in the i-th episode script and a sample set summary corresponding to the i-th episode script, where the key scene script refers to the scene script where the key characters in the i-th episode script appear, and the sample set summary is used to indicate the plot summary of the key characters in the i-th episode script in the i-th episode script; A model prediction module, used to use the plot extraction model to obtain predicted scene summaries corresponding to at least one key scene script in the i-th episode script according to the key characters in the i-th episode script and at least one key scene script in the i-th episode script, wherein the predicted scene summary is used to indicate the plot summary of the key characters in the i-th episode script in the key scene script; An episode summary generation module, for obtaining a predicted episode summary corresponding to the i-th episode script according to the predicted scene summary corresponding to at least one key scene script in the i-th episode script, wherein the predicted episode summary is used to indicate a plot summary of a key character in the i-th episode script in the i-th episode script; The first training module is used to adjust the parameters of the plot extraction model according to the difference between the prediction set summary and the sample set summary to obtain a trained plot extraction model.

17. 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 plot extraction method based on the plot extraction model as described in any one of claims 1 to 10, or to implement the training method of the plot extraction model as described in any one of claims 11 to 14.

18. 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 plot extraction method based on the plot extraction model as described in any one of claims 1 to 10, or to implement the training method of the plot extraction model as described in any one of claims 11 to 14.

19. 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 plot extraction method based on the plot extraction model as described in any one of claims 1 to 10, or to implement the training method of the plot extraction model as described in any one of claims 11 to 14.

Citation Information

Patent Citations

  • Script information processing method and device, electronic equipment and storage medium

    CN113553423A

  • Data processing method and device, electronic equipment and storage medium

    CN113821690A