Scenario analysis method and device, electronic equipment and storage medium

By constructing heatmaps and setting thresholds to identify filler subplots, the problem of insufficient quantification of the correlation between subplots and main characters in existing technologies has been solved, enabling accurate identification and quantitative evaluation of filler subplots.

CN120851008APending Publication Date: 2025-10-28SHANGHAI IQIYI NEW MEDIA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510801012.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing technologies are unable to accurately quantify the degree of correlation between side plots and the core characters of the main plot, resulting in inaccurate identification of water-injected side plots.

Method used

By constructing a heat map, based on the person nodes and the heat propagation matrix, core person nodes and non-core person nodes are identified, and water injection branches are determined according to the heat propagation value. First and second thresholds are set to identify water injection branches.

Benefits of technology

It enables objective and accurate identification of water injection branches, overcomes the subjectivity of manual judgment and the superficial data focus of statistical methods, and provides a quantitative basis for script optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120851008A_ABST
    Figure CN120851008A_ABST
Patent Text Reader

Abstract

The invention provides a script analysis method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a to-be-processed script text; a thermodynamic map is constructed according to the to-be-processed script text, and the thermodynamic map comprises a character node set used for representing all character entities in a script; the heat propagation matrix is used for recording a heat propagation value between every two figure nodes; determining core character nodes and non-core character nodes from the character node set; for any two non-core character nodes in the thermodynamic map, when the thermodynamic propagation values between the two non-core character nodes and all core character nodes are lower than a first threshold value and the thermodynamic propagation value between the two non-core character nodes is higher than a second threshold value, the thermodynamic map is determined to be the thermodynamic map; and determining a plot line corresponding to the two non-core character nodes as a water injection branch line. Therefore, accurate identification of the water injection branch line is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of script analysis technology, and in particular to a script analysis method, apparatus, electronic device and storage medium. Background Technology

[0002] With the rapid development of film, television dramas, and online literature, scripts often feature numerous characters and complex subplots, leading to some storylines deviating from the main plot or becoming redundant and padded. This phenomenon not only affects the narrative rhythm and audience experience but also poses challenges to script evaluation and optimization.

[0003] Currently, the analysis of filler subplots in scripts mainly employs two methods: one is subjective judgment based on human experience, where professional screenwriters or editors read the script and identify subplots with weak connections to the main plot based on their experience; the other is a statistical method, which judges the importance of subplots by calculating surface indicators such as character appearance frequency and dialogue word count. For example, some methods count the proportion of subplots to the total word count of the script, and if it exceeds a certain threshold, it is judged as filler content.

[0004] However, existing methods for analyzing filler side quests cannot accurately quantify the connection between side quests and the main characters, leading to inaccurate identification of filler side quests. Summary of the Invention

[0005] The purpose of this application is to provide a script analysis method, apparatus, electronic device, and storage medium to solve the problem in existing methods for analyzing filler subplots that cannot accurately quantify the correlation between subplots and main characters, leading to inaccurate identification of filler subplots. The specific technical solution is as follows:

[0006] Firstly, this application provides a script analysis method, including:

[0007] Obtain the script text to be processed;

[0008] A heatmap is constructed based on the script text to be processed. The heatmap includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes.

[0009] From the set of character nodes, determine the core character nodes and non-core character nodes;

[0010] For any two non-core character nodes in the heat map, if the heat transfer value between the two non-core character nodes and all core character nodes is lower than the first threshold, and the heat transfer value between the two non-core character nodes is higher than the second threshold, then the storyline corresponding to the two non-core character nodes is determined to be a filler storyline.

[0011] In one possible implementation, constructing a heatmap based on the script text to be processed includes:

[0012] Extract at least one character entity and a first importance weight of each character entity from the script text to be processed, and extract at least one set of character relationships and a second importance weight of each character relationship from the script text to be processed.

[0013] Based on the first importance weight of each of the aforementioned individuals, character nodes are constructed, and based on the second importance weight of each of the aforementioned relationships, network edges are constructed to form an initial relationship network;

[0014] Perform heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes;

[0015] A heat map is generated based on the heat propagation values ​​between all character nodes.

[0016] In one possible implementation, the step of performing heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes includes:

[0017] For each pair of connected character nodes, calculate the direct heat value transmitted from the source node to the target node. When the source node and the target node are directly connected, the direct heat value is equal to the first importance weight corresponding to the source node multiplied by the proportion of the second importance weight of the network edge between the source node and the target node, wherein the proportion of the second importance weight is the ratio of the second importance weight of the network edge to the sum of the second importance weights of all outgoing edges of the source node.

[0018] Calculate the indirect heat transfer value from the source node to the target node, select several indirect paths with the largest heat transfer value between the source node and the target node, and the transfer value of each path is equal to the product of the first importance weight corresponding to the source node and the proportion of the second importance weight of each network edge on the path.

[0019] For each pair of character nodes, the direct thermal value is added to the preset maximum number of indirect thermal values ​​to obtain the thermal propagation value between the source node and the target node.

[0020] In one possible implementation, determining core character nodes and non-core character nodes from the character node set includes:

[0021] Extract the plot importance score for each character node from the script text to be processed;

[0022] All character nodes are sorted in descending order of their importance in the plot, resulting in a character node sequence.

[0023] Select a preset number of character nodes as candidate character nodes before sorting;

[0024] Core character nodes are identified from the candidate character nodes, and character nodes other than the core character nodes in the character node set are identified as non-core character nodes.

[0025] In one possible implementation, determining the core character node among the candidate character nodes includes:

[0026] Calculate the score decrease between adjacent character nodes in the candidate character node;

[0027] Identify the maximum decrease from the decrease in scores of the candidate nodes;

[0028] All candidate nodes preceding the position corresponding to the maximum decrease are identified as core character nodes.

[0029] In one possible implementation, the method further includes:

[0030] When the maximum drop exceeds the target threshold, the step of determining all candidate nodes before the position corresponding to the maximum drop as core node is executed.

[0031] When the maximum decrease does not exceed the target threshold, the preset number of candidate nodes are determined as core character nodes.

[0032] In one possible implementation, the method further includes:

[0033] Calculate the sum of the first weight values ​​of the edges corresponding to all water-filled side storylines;

[0034] Calculate the sum of the second weight values ​​of all edges in the heatmap;

[0035] Divide the sum of the first weight values ​​by the sum of the second weight values ​​to obtain the proportion of watered-down scenes.

[0036] Secondly, this application provides a script analysis device, comprising:

[0037] The acquisition module is used to acquire the script text to be processed;

[0038] The construction module is used to construct a heat map based on the script text to be processed. The heat map includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes.

[0039] The first determining module is used to determine core character nodes and non-core character nodes from the set of character nodes;

[0040] The second determining module is used to determine the plot line corresponding to any two non-core character nodes in the heat map as a padded side story if the heat transfer value between the two non-core character nodes and all core character nodes is lower than a first threshold and the heat transfer value between the two non-core character nodes is higher than a second threshold.

[0041] In one possible implementation, the building module is specifically used for:

[0042] Extract at least one character entity and a first importance weight of each character entity from the script text to be processed, and extract at least one set of character relationships and a second importance weight of each character relationship from the script text to be processed.

[0043] Based on the first importance weight of each of the aforementioned individuals, character nodes are constructed, and based on the second importance weight of each of the aforementioned relationships, network edges are constructed to form an initial relationship network;

[0044] Perform heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes;

[0045] A heat map is generated based on the heat propagation values ​​between all character nodes.

[0046] In one possible implementation, the building module is further configured to:

[0047] For each pair of connected character nodes, calculate the direct heat value transmitted from the source node to the target node. When the source node and the target node are directly connected, the direct heat value is equal to the first importance weight corresponding to the source node multiplied by the proportion of the second importance weight of the network edge between the source node and the target node, wherein the proportion of the second importance weight is the ratio of the second importance weight of the network edge to the sum of the second importance weights of all outgoing edges of the source node.

[0048] Calculate the indirect heat transfer value from the source node to the target node, select several indirect paths with the largest heat transfer value between the source node and the target node, and the transfer value of each path is equal to the product of the first importance weight corresponding to the source node and the proportion of the second importance weight of each network edge on the path.

[0049] For each pair of character nodes, the direct thermal value is added to the preset maximum number of indirect thermal values ​​to obtain the thermal propagation value between the source node and the target node.

[0050] In one possible implementation, the first determining module is specifically used for:

[0051] Extract the plot importance score for each character node from the script text to be processed;

[0052] All character nodes are sorted in descending order of their importance in the plot, resulting in a character node sequence.

[0053] Select a preset number of character nodes as candidate character nodes before sorting;

[0054] Core character nodes are identified from the candidate character nodes, and character nodes other than the core character nodes in the character node set are identified as non-core character nodes.

[0055] In one possible implementation, the first determining module is further configured to:

[0056] Calculate the score decrease between adjacent character nodes in the candidate character node;

[0057] Identify the maximum decrease from the decrease in scores of the candidate nodes;

[0058] All candidate nodes preceding the position corresponding to the maximum decrease are identified as core character nodes.

[0059] In one possible implementation, the apparatus further includes an execution module for:

[0060] When the maximum drop exceeds the target threshold, the step of determining all candidate nodes before the position corresponding to the maximum drop as core node is executed.

[0061] When the maximum decrease does not exceed the target threshold, the preset number of candidate nodes are determined as core character nodes.

[0062] In one possible implementation, the device further includes a statistics module for:

[0063] Calculate the sum of the first weight values ​​of the edges corresponding to all water-filled side storylines;

[0064] Calculate the sum of the second weight values ​​of all edges in the heatmap;

[0065] Divide the sum of the first weight values ​​by the sum of the second weight values ​​to obtain the proportion of watered-down scenes.

[0066] Thirdly, an electronic device is provided, 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 through the communication bus;

[0067] Memory, used to store computer programs;

[0068] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect.

[0069] Fourthly, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the methods described in the first aspect.

[0070] Fifthly, a computer program product containing instructions is provided that, when run on a computer, causes the computer to execute any of the script analysis methods described above.

[0071] Beneficial effects of the embodiments in this application:

[0072] This application provides a script analysis method, apparatus, electronic device, and storage medium. In this embodiment, a set of character nodes and a matrix recording the heat dissipation values ​​between nodes are first established. Then, by comparing whether the heat dissipation values ​​between non-core character nodes and core character nodes are all below a first threshold, and whether the heat dissipation values ​​between non-core character nodes are above a second threshold, the padding subplots are objectively identified. This method of judgment based on quantitative heat dissipation values ​​overcomes the shortcomings of subjective human judgment and the fact that statistical methods only focus on surface data, achieving accurate identification of padding subplots.

[0073] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0074] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0075] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0076] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0077] Figure 1 A flowchart of a script analysis method provided in this application embodiment;

[0078] Figure 2 A flowchart of another script analysis method provided in this application embodiment;

[0079] Figure 3 A flowchart of yet another script analysis method provided in this application embodiment;

[0080] Figure 4 This is a schematic diagram of the structure of a script analysis device provided in an embodiment of this application;

[0081] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0082] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0083] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0084] Figure 1This is a flowchart illustrating a script analysis method provided in an embodiment of this application. This method can be applied to one or more electronic devices such as smartphones, laptops, desktop computers, portable computers, and servers. Furthermore, the execution entity of this method can be hardware or software. When the execution entity is hardware, it can be one or more of the aforementioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the execution entity is software, this method can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are made here.

[0085] like Figure 1 As shown, the method specifically includes:

[0086] S101. Obtain the script text to be processed.

[0087] The script text to be processed refers to the original script data that is the object of processing in this invention, which is a data set containing complete narrative content. Specifically: Data content includes complete text elements that constitute the narrative structure of the script, such as character dialogues, plot descriptions, and scene transition markers; Data format can be in the form of electronic documents (such as PDF, Word), structured text (JSON / XML format), or database records; Data characteristics retain the inherent characteristics of the script, such as consistency of character titles, chronological order, and plot coherence.

[0088] In this embodiment, the script text to be processed can be obtained through at least one of the following methods: file import: supporting the parsing of script files in formats such as .txt and .docx; interface call: obtaining structured data from the script management system through an API interface; database query: extracting text content with metadata tags from the script database. This acquisition process must maintain the integrity of the script's narrative structure and the consistency of character referencing.

[0089] S102. Construct a heat map based on the script text to be processed. The heat map includes: a set of character nodes to represent each character entity in the script; and a heat propagation matrix to record the heat propagation value between every two character nodes.

[0090] A character node set is a collection of all the character entities in the script, with each character node corresponding to a specific character in the script.

[0091] The heat propagation matrix is ​​a two-dimensional matrix data structure. Each element value represents the heat propagation intensity between two corresponding character nodes. This value is used to quantify the intensity of the interaction relationship between the two characters.

[0092] In this embodiment, a set of character nodes is constructed by extracting character entities from the script text to be processed, and a heat propagation matrix is ​​built by calculating the heat propagation value between each pair of character nodes, thereby forming a complete heat map. The calculation of the heat propagation value comprehensively considers characteristic factors such as the frequency and depth of interaction between characters in the script. This heat map construction method can completely and accurately reflect the network structure and interaction intensity of character relationships in the script, providing a reliable data foundation for subsequent analysis of filler subplots.

[0093] S103. Determine the core character nodes and non-core character nodes from the set of character nodes.

[0094] Key character nodes refer to crucial figures who play a leading role in the development of the plot, and they usually have a high degree of participation and influence in the plot.

[0095] Non-core character nodes refer to minor characters who have a relatively small impact on advancing the main storyline.

[0096] In this embodiment, all nodes in the character node set can be analyzed and calculated using preset evaluation criteria (such as character appearance frequency, plot participation, etc.). Based on the calculation results, the character nodes are divided into two categories: core character nodes and non-core character nodes. The determination of core character nodes can employ a ranking-based screening method, for example, selecting the top N characters in plot importance as core character nodes. This classification method can accurately identify key and secondary characters in the script, providing an important basis for subsequent analysis of the character relationship network structure and identification of filler subplots.

[0097] S104. For any two non-core character nodes in the heat map, if the heat transfer value between the two non-core character nodes and all core character nodes is lower than the first threshold, and the heat transfer value between the two non-core character nodes is higher than the second threshold, the plot line corresponding to the two non-core character nodes is determined to be a padded side story.

[0098] The first threshold is used to determine the strength of the association between non-core person nodes and core person nodes.

[0099] The second threshold is used to determine the strength of the association between non-core person nodes.

[0100] In this embodiment, firstly, non-core character node pairs with weak connections to all core character nodes (heat spread values ​​all below the first threshold) are selected. Then, among these node pairs, node pairs with strong internal connections (heat spread values ​​above the second threshold) are further selected. Finally, the plot lines corresponding to these node pairs are identified as filler subplots. This method is based on the finding that subplots with weak connections to the main plot but strong internal interactions are often redundant content. By setting reasonable threshold parameters, this method can objectively and accurately identify filler content in the script, solving the problems of low efficiency and inconsistent standards in traditional manual judgment methods, and providing a basis for script optimization.

[0101] In another embodiment, the method may further include the following steps: summing the first weight values ​​of the edges corresponding to all water-filled branch storylines; summing the second weight values ​​of all edges in the heat map; and dividing the sum of the first weight values ​​by the sum of the second weight values ​​to obtain the water-filled storyline ratio.

[0102] The first weighted sum refers to the cumulative weight of the edges corresponding to all storylines that are judged as watered-down branches.

[0103] The second weight sum refers to the cumulative weight of all edges in the heatmap.

[0104] In this embodiment, firstly, the edge weights corresponding to the padded plot lines are summed to obtain a first weight value sum. Then, the weights of all edges in the entire heatmap are calculated as a second weight value sum. Finally, the two are divided to obtain the proportion of padded plot. The edge weights reflect the closeness and importance of the relationships between the corresponding characters. This quantitative calculation method can accurately assess the proportion of padded content in the entire script, providing an objective and quantifiable reference indicator for script optimization. It solves the problem of traditional evaluation methods lacking quantitative basis, significantly improving the accuracy and scientific nature of script quality evaluation.

[0105] In this embodiment, a set of character nodes and a matrix recording the heat transfer values ​​between nodes are first established. Then, by comparing whether the heat transfer values ​​between non-core character nodes and core character nodes are all below a first threshold, and whether the heat transfer values ​​between non-core character nodes are above a second threshold, water-filled branches are objectively identified. This method of determination based on quantitative heat transfer values ​​overcomes the shortcomings of subjective human judgment and the fact that statistical methods only focus on surface data, thus achieving accurate identification of water-filled branches.

[0106] See Figure 2 This is a flowchart illustrating another embodiment of the script analysis method provided in this application. Figure 2 The process shown above Figure 1Based on the illustrated process, describe how to construct a heatmap from the script text to be processed. For example... Figure 2 As shown, the process may include the following steps:

[0107] S201. Extract at least one character entity and a first importance weight of each character entity from the script text to be processed, and extract at least one set of character relationships and a second importance weight of each character relationship from the script text to be processed.

[0108] Character entities: refers to individual characters with independent identities in a script, including protagonists, supporting characters, and other dramatic characters, identified by textual features such as character names and titles.

[0109] First Importance Weight: A numerical indicator used to quantify the importance of a character in the script. Its calculation takes into account features such as semantic importance and interaction frequency.

[0110] Character relationships: refers to the connections and interactions between two character entities, including the connections formed by narrative elements such as dialogue, co-occurrence, and conflict.

[0111] Second importance weight: A numerical indicator used to quantify the degree to which character relationships affect the plot, reflecting the strength of the role of relationships in the development of the narrative.

[0112] In this embodiment, a large-scale model is first used to identify character entities and relationships. The importance score (first importance weight) for each character entity and the importance score (second importance weight) for each character relationship in each episode's script are then calculated. The scores for each episode are then aggregated and normalized to obtain a unified character weight and relationship weight for the entire series. The character weight reflects the overall importance of the character in the entire plot, while the relationship weight represents the contribution of interactions between characters to the plot development. This large-scale model-based episode-by-episode processing and global normalization method effectively avoids data bias in individual episodes, ensuring the comprehensiveness and accuracy of weight calculations, and providing a reliable data foundation for subsequently constructing accurate heatmaps.

[0113] S202. Construct character nodes based on the first importance weight of each character entity, and construct network edges based on the second importance weight of each character relationship to form an initial relationship network.

[0114] A character node refers to a normalized character entity as a vertex, and its node weight is the corresponding first importance weight.

[0115] A network edge refers to an edge that connects people based on their relationships, and its weight is the second most important weight.

[0116] In this embodiment, normalized character entities and their primary importance weights are first mapped to weighted nodes, and normalized character relationships and their secondary importance weights are mapped to weighted edges. An initial relationship network is constructed through the organic combination of nodes and edges. Node weights reflect the core importance of a character in the overall plot, while edge weights represent the criticality of character interactions. This network construction method based on quantified weights accurately reflects the topological structure and interaction intensity of character relationships in the script, providing precise input data for subsequent heatmap calculations. It solves the problem of strong subjectivity in weight assignment in traditional relationship network construction, significantly improving the objectivity and accuracy of network representation.

[0117] S203. Perform heat propagation calculation on the initial relationship network to determine the heat propagation value between every two connected character nodes.

[0118] Heat transfer value is a quantitative indicator that represents the intensity of influence transmission between nodes, calculated using graph theory algorithms.

[0119] In this embodiment, S203 may include the following steps: For each pair of connected character nodes, calculate the direct heat transfer value from the source node to the target node. When the source node and the target node are directly connected, the direct heat transfer value is equal to the first importance weight corresponding to the source node multiplied by the proportion of the second importance weight of the network edge between the source node and the target node, wherein the proportion of the second importance weight is the ratio of the second importance weight of the network edge to the sum of the second importance weights of all outgoing edges of the source node; calculate the indirect heat transfer value from the source node to the target node, select several indirect paths with the largest heat transfer value between the source node and the target node, and the transfer value of each path is equal to the first importance weight corresponding to the source node multiplied by the continuous product of the proportions of the second importance weights of each segment of the network edge on the path; for each pair of character nodes, add the direct heat transfer value to a preset number of maximum indirect heat transfer values ​​to obtain the heat transfer value between the source node and the target node.

[0120] Direct heat value characterizes the intensity of the influence transmitted from the source node to the target node through direct edges; indirect heat value reflects the intensity of the indirect influence transmitted through intermediate nodes.

[0121] In this scheme, firstly, when the source node and the target node are directly connected, the direct heat transfer value is determined by multiplying the weight of the source node by the weight of its outgoing edges. The corresponding calculation formula is: Heat transferred from A to B = Importance of A * (Importance of the relationship between A and B / Sum of the importance of all relationships of A). Secondly, several indirect paths (such as two) with the largest heat transfer values ​​are selected. The transfer value of each path is the continuous product of the weight of the source node and the weight of each edge of the path. For example, if person A affects person B through person C, that is, both entity A and entity B are connected to entity C, and heat transfer can be carried out through the path A->C->B. The corresponding calculation formula is: Heat transferred from A to B = Importance of A * (Importance of the relationship between A and C / Sum of the importance of all relationships of A) * (Importance of the relationship between C and B / Sum of the importance of all relationships of C). Finally, the direct heat transfer value is added to the two largest indirect heat transfer values ​​to obtain the total heat transfer value.

[0122] This scheme combines the influence of direct correlation strength and optimal indirect transmission path, and eliminates the bias of network degree by normalizing the edge weight ratio. It can more comprehensively and accurately quantify the actual influence transmission relationship between character nodes. Compared with the traditional single path analysis method, it significantly improves the scientificity and reliability of heat propagation value calculation, and provides accurate quantitative basis for subsequent plot analysis.

[0123] S204. Generate a heat map based on the heat propagation values ​​between all character nodes.

[0124] A heat map is a network diagram that visualizes the relationship between the intensity of heat propagation between various nodes in a matrix format.

[0125] In this embodiment, the heat transfer values ​​between all character nodes calculated in step S203 are systematically integrated to construct a complete heat transfer matrix, where the matrix element h_ij represents the heat transfer value from character node v_i to v_j. This heat map not only contains basic character node and relationship edge information, but more importantly, it accurately characterizes the intensity of influence transmission between characters through quantified heat transfer values. This graph representation method based on thermodynamic principles can intuitively display the core structure and influence distribution of character relationships in the script. Compared with traditional relationship network diagrams, it can more accurately reflect the actual development of the plot, providing a scientific and reliable quantitative basis for subsequent identification of filler subplots and plot analysis, and effectively solving the technical problem that traditional script analysis methods cannot objectively assess the transmission of character influence.

[0126] Figure 2The process described above extracts and normalizes character and relationship weights based on a large model, ensuring the objectivity of the evaluation. The initial relationship network constructed using weighted nodes and edges accurately reflects the topological structure of character relationships. The heat transfer values ​​calculated using a multi-path heat transfer model comprehensively quantify the influence transmission between characters. The final generated heat map visually displays the distribution of influence between character relationships in matrix form. This achieves a scientific modeling of the script's character relationship network, providing a reliable basis for subsequent analysis.

[0127] See Figure 3 This is a flowchart illustrating another embodiment of the script analysis method provided in this application. Figure 3 The process shown above Figure 1 Based on the illustrated process, describe how to determine core character nodes and non-core character nodes from the set of character nodes. For example... Figure 3 As shown, the process may include the following steps:

[0128] S301. Extract the plot importance score of each character node from the script text to be processed.

[0129] Plot Importance Score: This refers to a numerical indicator that quantifies a character's influence on the plot development. It is calculated based on features such as semantic analysis and plot relevance and is used to objectively evaluate a character's narrative value.

[0130] In this embodiment, natural language processing techniques (such as large models) are used to calculate the plot importance score for each character. This score comprehensively considers the character's role in driving key plot points, the intensity of their interaction with other characters, and their centrality within the narrative structure. Compared to traditional methods that rely solely on dialogue volume or screen time, this approach quantifies a character's actual influence through semantic understanding, enabling more accurate identification of core characters. This avoids misjudgments caused by screen time statistics (such as misclassifying characters with high screen time but low influence), ensuring that the score truly reflects the character's contribution to the plot and improving the accuracy of subsequent main character identification.

[0131] S302. Sort all character nodes in descending order according to the importance score of the plot, to obtain the character node sequence.

[0132] Descending order: Sort character nodes from highest to lowest according to their importance rating in the plot, forming an ordered list.

[0133] Character node sequence: refers to an ordered list of character nodes after sorting, in which the character nodes are arranged in descending order of their importance score.

[0134] In this embodiment, all character nodes are sorted in descending order of plot importance score, generating a character node sequence. This sequence is ordered based on the score, ensuring that characters with the greatest narrative influence are placed at the top. This process provides a structured data foundation for subsequent candidate selection, enabling the system to focus on high-scoring characters and reduce irrelevant interference.

[0135] S303. Select a preset number of character nodes as candidate character nodes before sorting.

[0136] Preset Quantity: The maximum number of candidates (e.g., 4-6 people) that is dynamically set according to business needs or script type, used to control the maximum scale of the main characters.

[0137] Candidate character nodes: High-rated characters selected from the character node sequence, serving as the candidate set for core character nodes.

[0138] In this embodiment, based on the sorted character node sequence, the top N (preset number) high-rated characters are selected as candidate character nodes. This conforms to the industry's conventional restrictions on the number of main characters (such as avoiding too many protagonists) while also covering the vast majority of core characters. Subsequent steps will further analyze within this candidate range to ensure the accuracy and practicality of the core character node determination.

[0139] S304. Determine the core character node among the candidate character nodes, and determine the character nodes other than the core character node in the character node set as non-core character nodes.

[0140] In this embodiment of the application, the core person nodes are first determined from the candidate person nodes based on preset rules (such as the top N in the score ranking or significant score difference), and then the remaining nodes are uniformly classified as non-core person nodes.

[0141] Specifically, determining the core character node among the candidate character nodes may include the following steps: calculating the score decrease between adjacent character nodes in the candidate character nodes; identifying the maximum decrease from the score decrease of the candidate character nodes; and determining all candidate character nodes before the position corresponding to the maximum decrease as core character nodes.

[0142] Rating Decrease: This refers to the relative difference in plot importance rating between two adjacent character nodes in the candidate character node sequence, usually expressed as a percentage, reflecting the degree of importance disparity between characters. Maximum Decrease: This refers to the largest rating difference among all adjacent character node pairs, used to locate significant discontinuities in the importance distribution.

[0143] This scheme first traverses the candidate character node sequence, calculating the relative decrease in score for each pair of adjacent character nodes (e.g., (previous score - subsequent score) / previous score). Then, it identifies the maximum value among all decreases, reflecting a significant shift in plot importance from core characters to non-core characters. Finally, all candidate character nodes preceding the location of the maximum decrease are identified as core character nodes. This automatic identification method based on abrupt changes in score distribution objectively captures the boundaries of the core character group in the script, avoiding the subjectivity of manually setting fixed thresholds. It ensures that the determination of core character nodes not only conforms to the score ranking results but also accurately reflects the actual narrative structure of the script, providing a scientifically reliable basis for determining core characters in subsequent analysis.

[0144] In another embodiment, the method may further include the following steps: when the maximum drop exceeds a target threshold, performing the step of determining all candidate nodes before the position corresponding to the maximum drop as core character nodes; when the maximum drop does not exceed the target threshold, determining the preset number of candidate nodes as core character nodes.

[0145] The target threshold is a pre-set critical value for the rate of decline in the score, used to determine whether there is a significant drop in the importance of a person.

[0146] This scheme dynamically selects a core character assessment strategy by comparing the maximum drop in score with a target threshold: when the maximum drop exceeds the threshold, it indicates a significant gap in character importance, and a break-point-based segmentation method is adopted; when the drop does not exceed the threshold, it reverts to a pre-set selection method. This dual assessment mechanism considers both the objective characteristics of the score distribution and ensures the stability of core character assessment through threshold settings, effectively avoiding misjudgments caused by an overly flat score distribution. This makes the determination of core character nodes more flexible and accurate, adaptable to the score distribution characteristics of different types of scripts.

[0147] Figure 3 The process described above provides an objective quantitative basis for character importance assessment based on plot importance scores extracted from a large model; it initially narrows down the range of important characters by sorting candidate nodes through score ranking; it accurately captures the distribution characteristics of character importance by calculating the decrease in adjacent scores; and finally, it scientifically classifies core and non-core characters based on the maximum decrease in score. This method realizes a complete calculation process from text features to character importance classification, overcomes the subjectivity of manual judgment, and can accurately identify the core character group that plays a key role in the development of the plot, providing reliable basic data for subsequent character relationship analysis and detection of filler subplots.

[0148] Based on the same technical concept, embodiments of this application also provide a script analysis device, such as... Figure 4As shown, the device includes:

[0149] Module 41 is used to acquire the script text to be processed;

[0150] Construction module 42 is used to construct a heat map based on the script text to be processed. The heat map includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes.

[0151] The first determining module 43 is used to determine core character nodes and non-core character nodes from the character node set;

[0152] The second determining module 44 is used to determine the plot line corresponding to any two non-core character nodes in the heat map as a padded side story if the heat transfer value between the two non-core character nodes and all core character nodes is lower than a first threshold and the heat transfer value between the two non-core character nodes is higher than a second threshold.

[0153] In one possible implementation, the building module is specifically used for:

[0154] Extract at least one character entity and a first importance weight of each character entity from the script text to be processed, and extract at least one set of character relationships and a second importance weight of each character relationship from the script text to be processed.

[0155] Based on the first importance weight of each of the aforementioned individuals, character nodes are constructed, and based on the second importance weight of each of the aforementioned relationships, network edges are constructed to form an initial relationship network;

[0156] Perform heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes;

[0157] A heat map is generated based on the heat propagation values ​​between all character nodes.

[0158] In one possible implementation, the building module is further configured to:

[0159] For each pair of connected character nodes, calculate the direct heat value transmitted from the source node to the target node. When the source node and the target node are directly connected, the direct heat value is equal to the first importance weight corresponding to the source node multiplied by the proportion of the second importance weight of the network edge between the source node and the target node, wherein the proportion of the second importance weight is the ratio of the second importance weight of the network edge to the sum of the second importance weights of all outgoing edges of the source node.

[0160] Calculate the indirect heat transfer value from the source node to the target node, select several indirect paths with the largest heat transfer value between the source node and the target node, and the transfer value of each path is equal to the product of the first importance weight corresponding to the source node and the proportion of the second importance weight of each network edge on the path.

[0161] For each pair of character nodes, the direct thermal value is added to the preset maximum number of indirect thermal values ​​to obtain the thermal propagation value between the source node and the target node.

[0162] In one possible implementation, the first determining module is specifically used for:

[0163] Extract the plot importance score for each character node from the script text to be processed;

[0164] All character nodes are sorted in descending order of their importance in the plot, resulting in a character node sequence.

[0165] Select a preset number of character nodes as candidate character nodes before sorting;

[0166] Core character nodes are identified from the candidate character nodes, and character nodes other than the core character nodes in the character node set are identified as non-core character nodes.

[0167] In one possible implementation, the first determining module is further configured to:

[0168] Calculate the score decrease between adjacent character nodes in the candidate character node;

[0169] Identify the maximum decrease from the decrease in scores of the candidate nodes;

[0170] All candidate nodes preceding the position corresponding to the maximum decrease are identified as core character nodes.

[0171] In one possible implementation, the apparatus further includes an execution module for:

[0172] When the maximum drop exceeds the target threshold, the step of determining all candidate nodes before the position corresponding to the maximum drop as core node is executed.

[0173] When the maximum decrease does not exceed the target threshold, the preset number of candidate nodes are determined as core character nodes.

[0174] In one possible implementation, the device further includes a statistics module for:

[0175] Calculate the sum of the first weight values ​​of the edges corresponding to all water-filled side storylines;

[0176] Calculate the sum of the second weight values ​​of all edges in the heatmap;

[0177] Divide the sum of the first weight values ​​by the sum of the second weight values ​​to obtain the proportion of watered-down scenes.

[0178] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 5 As shown, it includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0179] Memory 113 is used to store computer programs;

[0180] When processor 111 executes a program stored in memory 113, it performs the following steps:

[0181] Obtain the script text to be processed;

[0182] A heatmap is constructed based on the script text to be processed. The heatmap includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes.

[0183] From the set of character nodes, determine the core character nodes and non-core character nodes;

[0184] For any two non-core character nodes in the heat map, if the heat transfer value between the two non-core character nodes and all core character nodes is lower than the first threshold, and the heat transfer value between the two non-core character nodes is higher than the second threshold, then the storyline corresponding to the two non-core character nodes is determined to be a filler storyline.

[0185] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0186] The communication interface is used for communication between the aforementioned electronic devices and other devices.

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

[0188] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0189] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described script analysis methods.

[0190] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the script analysis methods described in the above embodiments.

[0191] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0192] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0193] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0194] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A script analysis method, characterized in that, The method includes: Obtain the script text to be processed; A heatmap is constructed based on the script text to be processed. The heatmap includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes. From the set of character nodes, determine the core character nodes and non-core character nodes; For any two non-core character nodes in the heat map, if the heat transfer value between the two non-core character nodes and all core character nodes is lower than the first threshold, and the heat transfer value between the two non-core character nodes is higher than the second threshold, then the storyline corresponding to the two non-core character nodes is determined to be a filler storyline.

2. The method according to claim 1, characterized in that, The step of constructing a heatmap based on the script text to be processed includes: Extract at least one character entity and a first importance weight of each character entity from the script text to be processed, and extract at least one set of character relationships and a second importance weight of each character relationship from the script text to be processed. Based on the first importance weight of each of the aforementioned individuals, character nodes are constructed, and based on the second importance weight of each of the aforementioned relationships, network edges are constructed to form an initial relationship network; Perform heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes; A heat map is generated based on the heat propagation values ​​between all character nodes.

3. The method according to claim 2, characterized in that, The step of performing heat propagation calculations on the initial relationship network to determine the heat propagation value between every two connected character nodes includes: For each pair of connected character nodes, calculate the direct heat value transmitted from the source node to the target node. When the source node and the target node are directly connected, the direct heat value is equal to the first importance weight corresponding to the source node multiplied by the proportion of the second importance weight of the network edge between the source node and the target node, wherein the proportion of the second importance weight is the ratio of the second importance weight of the network edge to the sum of the second importance weights of all outgoing edges of the source node. Calculate the indirect heat transfer value from the source node to the target node, select several indirect paths with the largest heat transfer value between the source node and the target node, and the transfer value of each path is equal to the product of the first importance weight corresponding to the source node and the proportion of the second importance weight of each network edge on the path. For each pair of character nodes, the direct thermal value is added to the preset maximum number of indirect thermal values ​​to obtain the thermal propagation value between the source node and the target node.

4. The method according to claim 1, characterized in that, The step of determining core character nodes and non-core character nodes from the character node set includes: Extract the plot importance score for each character node from the script text to be processed; All character nodes are sorted in descending order of their importance in the plot, resulting in a character node sequence. Select a preset number of character nodes as candidate character nodes before sorting; Core character nodes are identified from the candidate character nodes, and character nodes other than the core character nodes in the character node set are identified as non-core character nodes.

5. The method according to claim 4, characterized in that, The process of determining the core character node from the candidate character nodes includes: Calculate the score decrease between adjacent character nodes in the candidate character node; Identify the maximum decrease from the decrease in scores of the candidate nodes; All candidate nodes preceding the position corresponding to the maximum decrease are identified as core character nodes.

6. The method according to claim 5, characterized in that, The method further includes: When the maximum drop exceeds the target threshold, the step of determining all candidate nodes before the position corresponding to the maximum drop as core node is executed. When the maximum decrease does not exceed the target threshold, the preset number of candidate nodes are determined as core character nodes.

7. The method according to claim 1, characterized in that, The method further includes: Calculate the sum of the first weight values ​​of the edges corresponding to all water-filled side storylines; Calculate the sum of the second weight values ​​of all edges in the heatmap; Divide the sum of the first weight values ​​by the sum of the second weight values ​​to obtain the proportion of watered-down scenes.

8. A script analysis device, characterized in that, The device includes: The acquisition module is used to acquire the script text to be processed; The construction module is used to construct a heat map based on the script text to be processed. The heat map includes: a set of character nodes, used to represent each character entity in the script; and a heat propagation matrix, used to record the heat propagation value between every two character nodes. The first determining module is used to determine core character nodes and non-core character nodes from the set of character nodes; The second determining module is used to determine the plot line corresponding to any two non-core character nodes in the heat map as a padded side story if the heat transfer value between the two non-core character nodes and all core character nodes is lower than a first threshold and the heat transfer value between the two non-core character nodes is higher than a second threshold.

9. 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, when executing a program stored in memory, implements the script analysis method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the script analysis method according to any one of claims 1-7.