Scenario processing method and device, electronic equipment and storage medium

By identifying and merging the scene and storyline information in the script, the problem of inaccurate extraction of script plot nodes is solved, and a more accurate and complete plot representation is achieved.

CN119886110APending Publication Date: 2025-04-25SHANGHAI IQIYI NEW MEDIA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411973764.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing technology is inaccurate when extracting script plot nodes, especially when cross-narrative, which leads to the dispersion of plot nodes and cannot fully represent a plot.

Method used

By obtaining the description information of the scenes and story lines of each episode in the script, identifying the identification information of the story lines to which the scene belongs, dividing the initial plot nodes, and combining them based on the description information of the initial plot node and the story line identification information, a more accurate target plot node is obtained.

Benefits of technology

The accuracy of the initial plot node is improved, making the target plot node more complete and accurate, and the plot nodes can be reasonably merged when multiple story lines cross narratives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886110A_ABST
    Figure CN119886110A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a script processing method and device, electronic equipment and a storage medium. The script processing method comprises the following steps: for each episode in a script, obtaining description information of each session and description information of each story line contained in the episode; for each session contained in the episode, identifying the identification information of the story line to which the session belongs based on the description information of the session and the description information of the story line; based on the description information of each session and the identification information of the story line to which each session belongs, the plurality of sessions are divided into a plurality of initial plot points, and each initial plot point comprises at least one session; and based on the description information of the sessions contained in each initial plot and the identification information of the story line to which the sessions contained in each initial plot belong, merging the plurality of initial plots to obtain a target plot. According to the embodiment of the invention, the accuracy of the plot can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a script processing method, device, electronic device and storage medium. Background Art

[0002] Script analysis is an important part of the creation and research process of film and television works. Plot point extraction is an important step in script analysis, which involves identifying and extracting key plot points in the script, which are the core elements that drive the story development and shape the story structure. Through the extraction of plot points, the skeleton of the story can be seen more clearly, so that creation, adaptation and evaluation can be carried out more effectively.

[0003] The current method of extracting plot points from a script mainly adopts a sliding window method to determine whether the current scene is related to the previous scene. If so, the current scene and the previous scene are classified into the same plot node. However, the plot points extracted by this method are not accurate. For example, in the case of cross-narration, the plot points extracted by this method are relatively scattered and cannot fully represent a plot. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a script processing method, device, electronic device and storage medium to solve the problem of inaccurate extraction of script plot points. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, a script processing method is provided, comprising:

[0006] For each episode in the script, obtain description information of each scene and description information of each story line contained in the episode;

[0007] For each scene included in the drama, based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs;

[0008] Based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, each of which contains at least one scene;

[0009] Based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, a plurality of the initial plot nodes are merged to obtain a target plot node.

[0010] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes identification information of the story line and content information of the story line; based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs, includes: inputting the content information of the scene, the content information of each story line, the identification information of each story line and first prompt information into a first large language model, and obtaining the identification information of the story line to which the scene belongs output by the first large language model; the first prompt information is used to guide the first large language model to identify the identification information of the story line to which the scene belongs.

[0011] Optionally, the description information of the scene includes identification information of the scene and character information of the scene; based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, including: based on the identification information of each scene, the multiple scenes are sorted in order of chronological order, and two adjacent scenes are used as the first scene and the second scene; when the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, the first scene and the second scene are divided into the same initial plot node.

[0012] Optionally, the description information of the scene includes identification information of the scene, character information of the scene and scene information of the scene; based on the description information of the scene contained in each of the initial plot nodes and identification information of the story line to which the scene belongs contained in each of the initial plot nodes, merging multiple initial plot nodes to obtain a target plot node includes:

[0013] Based on the identification information of the scenes contained in each of the initial plot nodes, the multiple initial plot nodes are sorted in order, and two non-adjacent initial plot nodes are used as the first initial plot node and the second initial plot node;

[0014] When the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are at least partially overlapped, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node, merge the first initial plot node and the second initial plot node;

[0015] The merged initial plot nodes and the unmerged initial plot nodes are both used as the target plot nodes.

[0016] Optionally, after merging a plurality of the initial plot nodes based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong to obtain a target plot node, the method further includes: for each target plot node, extracting summary information of the target plot point based on the description information of the scenes contained in the target plot node and the description information of the story lines to which the scenes contained in the target plot node belong.

[0017] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes content information of the story line; based on the description information of the scene contained in the target plot node and the description information of the story line to which the scene contained in the target plot node belongs, extracting summary information of the target plot point, including: inputting the content information of the scene contained in the target plot node, the content information of the story line to which the scene contained in the target plot node belongs, and the second prompt information into a second largest language model to obtain summary information of the target plot point output by the second largest language model; the second prompt information is used to guide the second largest language model to extract summary information of the target plot point.

[0018] In a second aspect of the present invention, a script processing device is provided, comprising:

[0019] An acquisition module, for acquiring, for each episode in the script, description information of each scene and description information of each story line contained in the episode;

[0020] an identification module, configured to identify, for each scene included in the drama, identification information of the story line to which the scene belongs based on the description information of the scene and the description information of the story line;

[0021] A division module, for dividing the plurality of scenes into a plurality of initial plot nodes based on the description information of each scene and the identification information of the story line to which each scene belongs, each of which includes at least one scene;

[0022] The merging module is used to merge multiple initial plot nodes based on the description information of the scenes contained in each initial plot node and the identification information of the story line to which the scenes contained in each initial plot node belong, so as to obtain a target plot node.

[0023] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes identification information of the story line and content information of the story line; the recognition module is specifically used to input the content information of the scene, the content information of each story line, the identification information of each story line and the first prompt information into a first large language model to obtain the identification information of the story line to which the scene belongs, which is output by the first large language model; the first prompt information is used to guide the first large language model to identify the identification information of the story line to which the scene belongs.

[0024] Optionally, the description information of the scene includes identification information of the scene and character information of the scene; the division module is specifically used to sort the multiple scenes in chronological order based on the identification information of each scene, and take two adjacent scenes as the first scene and the second scene; when the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, the first scene and the second scene are divided into the same initial plot node.

[0025] Optionally, the description information of the scene includes identification information of the scene, character information of the scene and scene information of the scene; the merging module is specifically used to sort the multiple initial plot nodes in chronological order based on the identification information of the scene contained in each of the initial plot nodes, and use two non-adjacent initial plot nodes as the first initial plot node and the second initial plot node; the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the scene information of the first scene in the first initial plot node is the same as the scene information of the first scene in the second initial plot node. When the identification information of the story line to which the scenes included are belonged is the same as the identification information of the story line to which the scenes included in the second initial plot node belong, and the character information of the scenes included in the first initial plot node and the character information of the scenes included in the second initial plot node are at least partially overlapped, and the character information of the scenes included in the first initial plot node and the character information of the scenes included in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node, the first initial plot node and the second initial plot node are merged; and the merged initial plot node and the unmerged initial plot node are both used as the target plot node.

[0026] Optionally, the device further comprises: an extraction module for extracting summary information of each target plot point based on description information of the scene contained in the target plot node and description information of the story line to which the scene contained in the target plot node belongs.

[0027] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes content information of the story line; the extraction module is specifically used to input the content information of the scene contained in the target plot node, the content information of the story line to which the scene contained in the target plot node belongs, and the second prompt information into a second largest language model to obtain summary information of the target plot point output by the second largest language model; the second prompt information is used to guide the second largest language model to extract the summary information of the target plot point.

[0028] In another aspect of the implementation of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor is used to implement any of the above-mentioned script processing methods when executing the computer program stored in the memory.

[0029] In another aspect of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program runs on a computer, the computer implements any of the script processing methods described above.

[0030] In another aspect of the implementation of the present invention, a computer program product is provided, in which a computer program is stored. When the computer program is run on a computer, the computer is enabled to implement any of the script processing methods described above.

[0031] The script processing method, device, electronic device and storage medium provided by the embodiments of the present invention, on the one hand, when dividing the initial plot nodes, the division is performed in combination with the description information of the scenes and the identification information of the story lines to which the scenes belong, not only taking into account the relevance of the scenes themselves, but also adding the information of the story lines to which the scenes belong, thereby improving the accuracy of the initial plot points; on the other hand, after the initial plot nodes are divided, the initial plot nodes are further merged based on the description information of the scenes contained in the initial plot nodes and the identification information of the story lines to which the scenes contained in the initial plot nodes belong to obtain target plot nodes, so that when multiple story lines intersect in the narrative, the divided initial plot nodes can be merged according to the story lines, making the target plot nodes more complete and more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0033] Figure 1 The present invention is a flowchart of a script processing method according to an embodiment of the present invention.

[0034] Figure 2 A schematic diagram of a script processing process in an embodiment of the present invention.

[0035] Figure 3 The present invention is a flowchart of another script processing method in an embodiment of the present invention.

[0036] Figure 4 It is a structural block diagram of a script processing device in an embodiment of the present invention.

[0037] Figure 5 The figure is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0039] First, the technical terms involved in the embodiments of the present invention are explained.

[0040] Script: The script is the textual basis of audiovisual works such as movies and TV series. It describes in detail the plot, character dialogues, scene settings, action instructions, etc.

[0041] Episode: An episode refers to a single unit in a TV series. In a TV series, each episode is an independent story, but also part of the entire series narrative. In the embodiment of the present invention, when the script is a TV series script, the script contains multiple episodes, and each episode refers to each episode in the TV series; when the script is a movie script, the script contains one episode, and the episode refers to the entire movie.

[0042] Scene: A scene is a division in the script structure, which divides the script into multiple parts, each of which has its own specific narrative task. Scenes help organize the flow and rhythm of the story and ensure the coherence and dynamic changes of the story. In the embodiment of the present invention, each episode can contain multiple scenes.

[0043] Storyline: A storyline refers to a main or secondary line that runs through a script, which describes the development of a character, the resolution of a conflict, etc. A storyline can be single or multiple, which together form a complex structure of the script. In an embodiment of the present invention, multiple storylines can be extracted from each episode.

[0044] Plot points: Plot points are key turning points in a script. They are important events that drive the story forward. Plot points usually mark major changes in the story, such as character decisions, unexpected events, intensified conflicts, etc. In the embodiment of the present invention, each plot point is composed of several scenes, and each plot point tells a relatively independent small event.

[0045] The following is a detailed introduction to the script processing method in the embodiment of the present invention.

[0046] Figure 1 The present invention is a flowchart of a script processing method according to an embodiment of the present invention.

[0047] like Figure 1 As shown, the script processing method may include the following steps:

[0048] Step 101, for each episode in the script, obtain description information of each scene and description information of each story line contained in the episode.

[0049] In the embodiment of the present invention, each episode in the script is processed separately to obtain the target plot point corresponding to the episode.

[0050] In the embodiment of the present invention, a drama may include multiple scenes and multiple story lines. Therefore, the description information of each scene and each story line included in the drama is obtained.

[0051] In the embodiment of the present invention, the description information of each scene can be obtained through the previous script basic information extraction process. The specific processing process can be processed according to actual experience, and this embodiment will not be discussed in detail here.

[0052] Exemplarily, the description information of a scene may include, but is not limited to: scene identification information, scene content information, scene role information, scene scene information, and so on. Among them, the scene identification information can uniquely identify a scene, and the scene identification information can be any applicable identification such as the scene number, and the scene identification information can represent the sequence of the scenes. The scene content information refers to the script content corresponding to the scene, etc. For example, the content information of a scene includes "Zhang is alone in the office, opens the drawer, and takes out a box of medicine. Zhang carefully opens the medicine box and replaces one of the capsules, making sure that the replaced capsule is the same as the other capsules. Zhang puts the replaced medicine box back in place." The scene role information refers to the various roles involved in the scene, such as human characters, etc. The scene information of a scene refers to the location and other scenes corresponding to the scene.

[0053] In the embodiment of the present invention, the description information of each story line can be obtained through the previous script basic information extraction process. The specific processing process can be processed according to actual experience, and this embodiment will not be discussed in detail here.

[0054] Exemplarily, the description information of a story line may include, but is not limited to: identification information of the story line, content information of the story line, and so on. After the story line is extracted through the previous script basic information extraction process, an identification information is automatically set for each story line. The identification information of the story line can uniquely identify a story line. The identification information of the story line can be any applicable identification such as the number of the story line. The content information of a story line refers to the plot summary corresponding to the story line, etc. For example, the content information of a story line includes "Zhang took advantage of Xu's physical problem and replaced the medicine she usually took. Xu took this medicine without knowing it, which made her sick."

[0055] Step 102: for each scene included in the drama, based on the description information of the scene and the description information of the story line, identify the identification information of the story line to which the scene belongs.

[0056] In the embodiment of the present invention, for the identification information of the story line to which each scene belongs, the identification information of the story line to which the scene belongs can be obtained by comparing and analyzing the content information of the scene and the content information of the story line. Therefore, for each scene included in the series, the identification information of the story line to which the scene belongs is identified based on the content information of the scene, the content information of each story line, and the identification information of each story line. The analysis is performed based on the content information of the scene and the content information of each story line, taking into account the content relevance between the scene and the story line, so the story line with the greatest relevance to the scene can be determined, so that the story line to which the scene belongs is more accurate.

[0057] In an optional implementation, considering that a large language model (LLM) has high accuracy and efficiency, the large language model can be used to analyze the story line to which the scene belongs.

[0058] Exemplarily, the process of identifying the identification information of the story line to which the scene belongs based on the content information of the scene, the content information of each story line and the identification information of each story line may include: inputting the content information of the scene, the content information of each story line, the identification information of each story line and the first prompt information into a first large language model, and obtaining the identification information of the story line to which the scene belongs output by the first large language model.

[0059] The first prompt information is used to guide the first language model to analyze the story line to which the scene belongs, so as to identify the identification information of the story line to which the scene belongs. The specific form of the first prompt information can be set according to actual needs, and this embodiment does not limit this. For example, the first prompt information can be "Please analyze the identification information of the story line to which the scene belongs based on the content information of the input scene, the content information of each story line, and the identification information of each story line".

[0060] Exemplarily, the first large language model mentioned above can adopt a large language model of any applicable structure such as GPT (Generative Pre-trained Transformer), BERT (Bidirectional Encoder Representations from Transformers), etc., and this embodiment does not impose any limitation on this.

[0061] Step 103 , based on the description information of each scene and the identification information of the story line to which each scene belongs, the plurality of scenes are divided into a plurality of initial plot nodes, each of which contains at least one scene.

[0062] When dividing the initial plot nodes, the description information of each scene and the identification information of the story line to which each scene belongs are combined to divide the multiple scenes contained in the series into multiple initial plot nodes, and each of the initial plot nodes contains at least one scene.

[0063] Exemplarily, the process of dividing the multiple scenes into multiple initial plot nodes based on the description information of each scene and the identification information of the story line to which each scene belongs may include: sorting the multiple scenes in chronological order based on the identification information of each scene, and taking two adjacent scenes as the first scene and the second scene; comparing the character information of the first scene with the character information of the second scene, and comparing the identification information of the story line to which the first scene belongs with the identification information of the story line to which the second scene belongs; when the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, dividing the first scene and the second scene into the same initial plot node.

[0064] Since the scene identification information can represent the sequence of scenes, the multiple scenes included in the series can be sorted in sequence according to the scene identification information. After sorting the multiple scenes, each two adjacent scenes can be analyzed as the first scene and the second scene.

[0065] The character information of the first scene at least partially overlaps with the character information of the second scene, indicating that the characters of the first scene and the second scene are related, and it is highly likely that the first scene and the second scene correspond to the same event. Therefore, the fact that the character information of the first scene at least partially overlaps with the character information of the second scene can be used as a restriction condition for the initial plot node division. Among them, the fact that the character information of the first scene at least partially overlaps with the character information of the second scene means that at least one character information in the first scene and the second scene is the same. Because different scenes may have characters leaving midway or characters joining later, it is not required that the character information in the first scene and the second scene be completely consistent.

[0066] The identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, which means that the first scene and the second scene belong to the same story line, and it is highly likely that the first scene and the second scene correspond to the same event. Therefore, the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, which can be used as a restriction condition for the initial plot node division.

[0067] By dividing the initial plot nodes in the above manner, it is possible to preliminarily divide the consecutive scenes whose character information at least partially overlaps and whose identification information of the story lines is the same into the same initial plot node.

[0068] Step 104 , based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, multiple initial plot nodes are merged to obtain a target plot node.

[0069] Through the initial plot node division method of step 103, when multiple story lines are intersecting, the interval (i.e., discontinuous) scenes in the same story line may be divided into different initial plot nodes, resulting in relatively scattered initial plot nodes. For example, when story lines A and B are intersecting, the sequence of scenes is arranged according to A1-B1-A2-B2. After the initial division, A1 and A2 are the two initial plot nodes of story line A, and B1 and B2 are the two initial plot nodes of story line B. It can be seen that A1 and A2 are dispersed, and B1 and B2 are dispersed.

[0070] Therefore, in the embodiment of the present invention, the initial plot nodes obtained by the preliminary division are further merged based on the description information of the scenes contained in the initial plot nodes and the identification information of the story lines to which the scenes contained in the initial plot nodes belong.

[0071] Exemplarily, based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, the process of merging a plurality of the initial plot nodes to obtain a target plot node may include:

[0072] Based on the identification information of the scenes contained in each of the initial plot nodes, the multiple initial plot nodes are sorted in order, and two non-adjacent initial plot nodes are used as the first initial plot node and the second initial plot node; the number of scenes between the first initial plot node and the second initial plot node is obtained; the scene information of the last scene contained in the first initial plot node is compared with the scene information of the first scene contained in the second initial plot node; the identification information of the story line to which the scenes contained in the first initial plot node belong is compared with the identification information of the story line to which the scenes contained in the second initial plot node belong; the character information of the scenes contained in the first initial plot node is compared with the character information of the scenes contained in the second initial plot node; the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are compared with the character information of the scenes contained in the initial plot nodes between the first initial plot node and the second initial plot node;

[0073] When the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are at least partially overlapped, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node, merge the first initial plot node and the second initial plot node;

[0074] The merged initial plot nodes and the unmerged initial plot nodes are both used as the target plot nodes.

[0075] Since the initial plot points are divided according to the order of scenes, the order of the initial plot points can be known according to the order of the scene identification information contained in the initial plot points. Specifically, if the order of scenes contained in the initial plot points is first, then the order of the initial plot points is also first.

[0076] If the number of scenes between the first initial plot node and the second initial plot node is too large, it means that the plot interval between the first initial plot node and the second initial plot node is far. In this case, the possibility that the first initial plot node and the second initial plot node belong to the same initial plot node is small. Therefore, the number of scenes between the first initial plot node and the second initial plot node can be less than the preset threshold as a restriction condition for merging the initial plot nodes, which can improve the accuracy of merging the initial plot nodes and reduce the amount of calculation. The specific value of the preset threshold can be set according to actual needs, and this embodiment does not limit this. For example, the preset threshold can be set to 4, 5, 6, and so on.

[0077] The scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, which means that the scenes of the first initial plot node are related to those of the second initial plot node, and it is highly likely that the first initial plot node and the second initial plot node correspond to the same event. Therefore, the scene information of the last scene contained in the first initial plot node and the scene information of the first scene contained in the second initial plot node can be used as a restriction condition for merging the initial plot nodes.

[0078] The identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, indicating that the first initial plot node and the second initial plot node belong to the same story line, and it is highly likely that the first initial plot node and the second initial plot node correspond to the same event. Therefore, the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, which can be used as a restriction condition for merging the initial plot nodes.

[0079] The character information of the scenes included in the first initial plot node and the character information of the scenes included in the second initial plot node are at least partially overlapped, indicating that the characters of the first initial plot node and the second initial plot node are related, and it is highly likely that the first initial plot node and the second initial plot node correspond to the same event. Therefore, the fact that the character information of the scenes included in the first initial plot node and the character information of the scenes included in the second initial plot node are at least partially overlapped can be used as a restriction condition for merging the initial plot nodes.

[0080] In the embodiment of the present invention, it is further considered that if the character information of the scene included in the first initial plot node or the character information of the scene included in the second initial plot node appears in the initial plot node between the first initial plot node and the second initial plot node, then the character information may have done something to affect the initial plot node between the first initial plot node and the second initial plot node, resulting in the first initial plot node and the second initial plot node not being able to be independent events. Therefore, it is also necessary to set the condition that the character information of the scene included in the first initial plot node and the character information of the scene included in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node as a restriction condition for merging the initial plot nodes.

[0081] In an embodiment of the present invention, on the one hand, when dividing the initial plot nodes, the division is performed in combination with the description information of the scenes and the identification information of the story lines to which the scenes belong, not only taking into account the relevance of the scenes themselves, but also adding the information of the story lines to which the scenes belong, thereby improving the accuracy of the initial plot points; on the other hand, after the initial plot nodes are divided, the initial plot nodes are further merged based on the description information of the scenes contained in the initial plot nodes and the identification information of the story lines to which the scenes contained in the initial plot nodes belong to obtain target plot nodes, so that when multiple story lines intersect in the narrative, the initial plot nodes obtained by division can be merged according to the story lines, making the target plot nodes more complete and more accurate.

[0082] Figure 2 FIG. 1 is a schematic diagram of a script processing process according to an embodiment of the present invention. Figure 2As shown, in the script processing process, first, for each episode, the scene information and story line information are extracted respectively. The scene information may include the description information of each scene contained in the episode, and the description information of the scene may include the identification information of the scene, the content information of the scene, the role information of the scene, and the scene information of the scene; the story line information may specifically include the description information of each story line contained in the episode, and the description information of the story line may include the identification information of the story line and the content information of the story line. Then, the initial plot nodes are preliminarily divided according to the story line information and the scene information; finally, the initial plot nodes obtained by the preliminary division are merged. For the specific processing process, the relevant description of the above embodiment can be referred to, and this embodiment will not be discussed in detail here.

[0083] Figure 3 The present invention is a flowchart of another script processing method in an embodiment of the present invention.

[0084] like Figure 3 As shown, the script processing method may include the following steps:

[0085] Step 301, for each episode in the script, obtain description information of each scene and description information of each story line contained in the episode.

[0086] Step 302: for each scene included in the drama, based on the description information of the scene and the description information of the story line, identify the identification information of the story line to which the scene belongs.

[0087] Step 303 , based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, each of which contains at least one scene.

[0088] Step 304: Based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, a plurality of the initial plot nodes are merged to obtain a target plot node.

[0089] Step 305 , for each target plot point, based on the description information of the scene contained in the target plot point and the description information of the story line to which the scene contained in the target plot point belongs, extract summary information of the target plot point.

[0090] In the embodiment of the present invention, after the initial plot nodes are divided and merged, summary information of the target plot point may be extracted for each target plot point so as to provide a general description of the plot of the target plot point.

[0091] Considering that if two initial plot nodes are far apart, they are not merged when the initial plot nodes are merged, but the plots of the two initial plot nodes are related and belong to the same story line, the content information of the story line to which the two initial plot nodes belong will contain the relevant plots of the two initial plot nodes. For example, in the first half of a certain drama, a scene tells about Zhang changing Xu's medicine, and the last scene tells about Xu's illness. The plots of these two scenes are related. According to the above-mentioned initial plot node division and initial plot node merging method, these two scenes are not merged, resulting in the inability to analyze that it was Zhang's change of medicine that caused Xu to get sick, and the content information of the story line to which the two scenes belong will contain these related plots.

[0092] Therefore, in order to make the summary information extracted from the target plot node more complete, the summary information of the target plot point can be extracted based on the content information of the scenes contained in the target plot node and the content information of the story line to which the scenes contained in the target plot node belong, thereby providing a global perspective of the story line to help understand the plot.

[0093] In an optional implementation, considering that a large language model has higher accuracy and efficiency, the large language model can be used to extract the scene summary information.

[0094] Exemplarily, the process of extracting summary information of the target plot point based on the description information of the scene contained in the target plot node and the description information of the story line to which the scene contained in the target plot node belongs may include: inputting content information of the scene contained in the target plot node, content information of the story line to which the scene contained in the target plot node belongs, and second prompt information into a second largest language model to obtain summary information of the target plot point output by the second largest language model.

[0095] The second prompt information is used to guide the second largest language model to extract the summary information of the target plot point. The specific form of the second prompt information can be set according to actual needs, and this embodiment does not limit this. For example, the second prompt information can be "Please analyze the summary information of the target plot point based on the content information of the input scene and the content information of the story line".

[0096] Exemplarily, the second largest language model may be a large language model of any applicable structure such as GPT, BERT, etc., which is not limited in this embodiment. The second largest language model may be the same as or different from the first largest language model.

[0097] Figure 4 It is a structural block diagram of a script processing device in an embodiment of the present invention.

[0098] like Figure 4 As shown, the script processing device may include the following modules:

[0099] The acquisition module 401 is used to acquire, for each episode in the script, description information of each scene and description information of each story line contained in the episode;

[0100] An identification module 402 is used to identify, for each scene included in the drama, identification information of the story line to which the scene belongs based on the description information of the scene and the description information of the story line;

[0101] A division module 403 is used to divide the multiple scenes into multiple initial plot nodes based on the description information of each scene and the identification information of the story line to which each scene belongs, each of which includes at least one scene;

[0102] The merging module 404 is used to merge the multiple initial plot nodes based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, so as to obtain a target plot node.

[0103] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes identification information of the story line and content information of the story line; the identification module 402 is specifically used to input the content information of the scene, the content information of each story line, the identification information of each story line and the first prompt information into a first large language model to obtain the identification information of the story line to which the scene belongs output by the first large language model; the first prompt information is used to guide the first large language model to identify the identification information of the story line to which the scene belongs.

[0104] Optionally, the description information of the scene includes identification information of the scene and character information of the scene; the division module 403 is specifically used to sort the multiple scenes in chronological order based on the identification information of each scene, and take two adjacent scenes as the first scene and the second scene; when the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, the first scene and the second scene are divided into the same initial plot node.

[0105] Optionally, the description information of the scene includes identification information of the scene, character information of the scene and scene information of the scene; the merging module 404 is specifically used to sort the multiple initial plot nodes in chronological order based on the identification information of the scene contained in each of the initial plot nodes, and use two non-adjacent initial plot nodes as the first initial plot node and the second initial plot node; the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the first initial plot node is When the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are at least partially overlapped, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node do not appear in the initial plot nodes between the first initial plot node and the second initial plot node, the first initial plot node and the second initial plot node are merged; and the merged initial plot node and the unmerged initial plot node are both used as the target plot node.

[0106] Optionally, the device further comprises: an extraction module for extracting summary information of each target plot point based on description information of the scene contained in the target plot node and description information of the story line to which the scene contained in the target plot node belongs.

[0107] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes content information of the story line; the extraction module is specifically used to input the content information of the scene contained in the target plot node, the content information of the story line to which the scene contained in the target plot node belongs, and the second prompt information into a second largest language model to obtain summary information of the target plot point output by the second largest language model; the second prompt information is used to guide the second largest language model to extract the summary information of the target plot point.

[0108] In an embodiment of the present invention, on the one hand, when dividing the initial plot nodes, the division is performed in combination with the description information of the scenes and the identification information of the story lines to which the scenes belong, not only taking into account the relevance of the scenes themselves, but also adding the information of the story lines to which the scenes belong, thereby improving the accuracy of the initial plot points; on the other hand, after the initial plot nodes are divided, the initial plot nodes are further merged based on the description information of the scenes contained in the initial plot nodes and the identification information of the story lines to which the scenes contained in the initial plot nodes belong to obtain target plot nodes, so that when multiple story lines intersect in the narrative, the initial plot nodes obtained by division can be merged according to the story lines, making the target plot nodes more complete and more accurate.

[0109] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 , and the memory 503 communicate with each other via the communication bus 504 .

[0110] Memory 503, used for storing computer programs;

[0111] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:

[0112] For each episode in the script, obtain description information of each scene and description information of each story line contained in the episode;

[0113] For each scene included in the drama, based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs;

[0114] Based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, each of which contains at least one scene;

[0115] Based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, a plurality of the initial plot nodes are merged to obtain a target plot node.

[0116] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes identification information of the story line and content information of the story line; based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs, includes: inputting the content information of the scene, the content information of each story line, the identification information of each story line and first prompt information into a first large language model, and obtaining the identification information of the story line to which the scene belongs output by the first large language model; the first prompt information is used to guide the first large language model to identify the identification information of the story line to which the scene belongs.

[0117] Optionally, the description information of the scene includes identification information of the scene and character information of the scene; based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, including: based on the identification information of each scene, the multiple scenes are sorted in order of chronological order, and two adjacent scenes are used as the first scene and the second scene; when the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, the first scene and the second scene are divided into the same initial plot node.

[0118] Optionally, the description information of the scene includes identification information of the scene, character information of the scene and scene information of the scene; based on the description information of the scene contained in each of the initial plot nodes and identification information of the story line to which the scene belongs contained in each of the initial plot nodes, merging multiple initial plot nodes to obtain a target plot node includes:

[0119] Based on the identification information of the scenes contained in each of the initial plot nodes, the multiple initial plot nodes are sorted in order, and two non-adjacent initial plot nodes are used as the first initial plot node and the second initial plot node;

[0120] When the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are at least partially overlapped, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node, merge the first initial plot node and the second initial plot node;

[0121] The merged initial plot nodes and the unmerged initial plot nodes are both used as the target plot nodes.

[0122] Optionally, after merging a plurality of the initial plot nodes based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong to obtain a target plot node, the method further includes: for each target plot node, extracting summary information of the target plot point based on the description information of the scenes contained in the target plot node and the description information of the story lines to which the scenes contained in the target plot node belong.

[0123] Optionally, the description information of the scene includes content information of the scene, and the description information of the story line includes content information of the story line; based on the description information of the scene contained in the target plot node and the description information of the story line to which the scene contained in the target plot node belongs, extracting summary information of the target plot point, including: inputting the content information of the scene contained in the target plot node, the content information of the story line to which the scene contained in the target plot node belongs, and the second prompt information into a second largest language model to obtain summary information of the target plot point output by the second largest language model; the second prompt information is used to guide the second largest language model to extract summary information of the target plot point.

[0124] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0125] The communication interface is used for communication between the above terminal and other devices.

[0126] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0127] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0128] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is run on a computer, the computer implements the script processing method described in any of the above embodiments.

[0129] In another embodiment provided by the present invention, a computer program product is also provided, in which a computer program is stored. When the computer program is run on a computer, the computer implements the script processing method described in any of the above embodiments.

[0130] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0131] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0132] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0133] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A script processing method, characterized in that: include: For each episode in the script, obtain description information of each scene and description information of each story line contained in the episode; For each scene included in the drama, based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs; Based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, each of which contains at least one scene; Based on the description information of the scenes contained in each of the initial plot nodes and the identification information of the story lines to which the scenes contained in each of the initial plot nodes belong, a plurality of the initial plot nodes are merged to obtain a target plot node.

2. The method according to claim 1, characterized in that The description information of the scene includes content information of the scene, and the description information of the story line includes identification information of the story line and content information of the story line; Based on the description information of the scene and the description information of the story line, identifying the identification information of the story line to which the scene belongs includes: The content information of the scene, the content information of each story line, the identification information of each story line and the first prompt information are input into a first large language model to obtain the identification information of the story line to which the scene belongs, which is output by the first large language model; the first prompt information is used to guide the first large language model to identify the identification information of the story line to which the scene belongs.

3. The method according to claim 1, characterized in that The description information of the scene includes identification information of the scene and role information of the scene; Based on the description information of each scene and the identification information of the story line to which each scene belongs, the multiple scenes are divided into multiple initial plot nodes, including: Based on the identification information of each of the sessions, the plurality of sessions are sorted in order of precedence, and two adjacent sessions are taken as the first session and the second session; When the character information of the first scene and the character information of the second scene are at least partially overlapped, and the identification information of the story line to which the first scene belongs is the same as the identification information of the story line to which the second scene belongs, the first scene and the second scene are classified into the same initial plot node.

4. The method according to claim 1, characterized in that: The description information of the scene includes identification information of the scene, character information of the scene and scene information of the scene; based on the description information of the scene contained in each of the initial plot nodes and the identification information of the story line to which the scene belongs contained in each of the initial plot nodes, a plurality of the initial plot nodes are merged to obtain a target plot node, including: Based on the identification information of the scenes contained in each of the initial plot nodes, the multiple initial plot nodes are sorted in order, and two non-adjacent initial plot nodes are used as the first initial plot node and the second initial plot node; When the number of scenes between the first initial plot node and the second initial plot node is less than a preset threshold, and the scene information of the last scene contained in the first initial plot node is the same as the scene information of the first scene contained in the second initial plot node, and the identification information of the story line to which the scenes contained in the first initial plot node belong is the same as the identification information of the story line to which the scenes contained in the second initial plot node belong, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node are at least partially overlapped, and the character information of the scenes contained in the first initial plot node and the character information of the scenes contained in the second initial plot node do not appear in the initial plot node between the first initial plot node and the second initial plot node, merge the first initial plot node and the second initial plot node; The merged initial plot nodes and the unmerged initial plot nodes are both used as the target plot nodes.

5. The method according to claim 1, characterized in that: After merging a plurality of the initial plot nodes based on the description information of the scenes contained in the initial plot nodes and the identification information of the story lines to which the scenes contained in the initial plot nodes belong to obtain a target plot node, the method further includes: For each target plot point, summary information of the target plot point is extracted based on description information of the scene contained in the target plot point and description information of the story line to which the scene contained in the target plot point belongs.

6. The method according to claim 5, characterized in that The description information of the scene includes content information of the scene, and the description information of the story line includes content information of the story line; based on the description information of the scene contained in the target plot point and the description information of the story line to which the scene contained in the target plot point belongs, extracting summary information of the target plot point includes: The content information of the scenes contained in the target plot node, the content information of the story line to which the scenes contained in the target plot node belong, and the second prompt information are input into the second largest language model to obtain the summary information of the target plot point output by the second largest language model; the second prompt information is used to guide the second largest language model to extract the summary information of the target plot point.

7. A script processing device, characterized in that: include: An acquisition module, for acquiring, for each episode in the script, description information of each scene and description information of each story line contained in the episode; An identification module, configured to identify, for each scene included in the drama, identification information of the story line to which the scene belongs based on the description information of the scene and the description information of the story line; A division module, for dividing the plurality of scenes into a plurality of initial plot nodes based on the description information of each scene and the identification information of the story line to which each scene belongs, each of which includes at least one scene; The merging module is used to merge multiple initial plot nodes based on the description information of the scenes contained in each initial plot node and the identification information of the story line to which the scenes contained in each initial plot node belong, so as to obtain a target plot node.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 6 when executing a computer program stored in a memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 6.

10. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 6.