Methods, devices, storage media, and computer equipment for restoring film and television scripts
By acquiring the video list and breakpoint information of the target drama title, and combining it with historical plot outlines and character profiles, a script information extraction model is used to generate a coherent plot text and consistent character settings. This solves the problem of inconsistent plot logic and character settings between dramas in existing technologies, and achieves efficient and automated script restoration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU XINGHUO SHENZHI ANIMATION CO LTD
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-30
Smart Images

Figure CN122309808A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and computer equipment for restoring film and television scripts. Background Technology
[0002] With the rapid development of digital media technology, film and television works are often widely disseminated on multiple platforms in video format. Therefore, production companies or research institutions often need to restore broadcast videos into script texts for archiving, retrieval, secondary creation, or compliance review.
[0003] Currently, traditional script reconstruction methods mostly rely on manually watching videos frame by frame and reconstructing the plot. This method is not only time-consuming and labor-intensive, but also prone to information omissions or errors due to human oversight. To address this, models have been introduced in some plot reconstruction scenarios. However, processing the entire series of videos can easily exceed the capabilities of these models. Therefore, most existing models can only extract independent text based on a single episode, making it difficult to guarantee the coherence of plot logic and the consistency of character settings across different series. Summary of the Invention
[0004] The purpose of this application is to at least solve one of the aforementioned technical defects, particularly the technical defect that most existing script reconstruction models can only extract text independently based on a single episode video, making it difficult to guarantee the coherence of plot logic and the consistency of character settings between different series.
[0005] This application provides a method for restoring film and television scripts, the method comprising:
[0006] Obtain the video list and breakpoint information corresponding to the target drama title, and determine the current episode video to be restored from the video list based on the breakpoint information, as well as load the historical plot outline and historical character files already generated for the target drama title;
[0007] The video of this episode, the historical plot synopsis, and the historical character files are input into a preset script information extraction model to obtain the episode's meta-information and episode's plot text output by the script information extraction model.
[0008] The historical plot synopsis and historical character profiles are updated based on the meta-information of this episode, and the main plot text of this episode is appended to the script output file corresponding to the target film and television drama in the database;
[0009] The next episode video of the current episode is retrieved from the video list and used as the new current episode video. The process then returns to the steps of loading the historical plot outline and historical character files generated for the target drama title and subsequent steps, until the script of the last episode video in the video list is restored.
[0010] Optionally, determining the current episode video to be restored from the video list based on the breakpoint information includes:
[0011] Determine whether the breakpoint information contains a historical restoration record of the target drama title;
[0012] If so, then identify the breakpoint episode video in the historical restoration record, and obtain the next episode video of the breakpoint episode video from the video list as the current episode video;
[0013] If not, then the first episode video is retrieved from the video list and used as the video for this episode.
[0014] Optionally, the script information extraction model includes an audio / video parsing network, a plot generation network, and a metadata extraction network;
[0015] The step of inputting the current episode video, the historical plot synopsis, and the historical character profiles into a preset script information extraction model to obtain the current episode's metadata and plot text output by the script information extraction model includes:
[0016] The video of this episode is input into the audio and video parsing network so that the audio and video parsing network can parse the video of this episode frame by frame to obtain audio and video features;
[0017] The plot generation network is used to perform character positioning and logical narration on the audio and video features, the historical plot outline, and the historical character files to generate the main plot of this episode.
[0018] The audio and video features and the main plot of the episode are structured and analyzed by the meta-information extraction network to extract the meta-information of the episode; the meta-information of the episode includes the plot summary of the episode and the character profiles of the episode.
[0019] Optionally, updating the historical plot synopsis and the historical character profiles based on the current episode's metadata includes:
[0020] Add the episode synopsis from the current episode's metadata to the historical synopsis to obtain the latest historical synopsis for the target drama title;
[0021] The historical character profiles are updated based on the current episode's character profiles in the current episode's metadata to obtain the latest historical character profiles for the target drama title.
[0022] Optionally, updating the historical character profile based on the current episode's character profile in the current episode's metadata to obtain the latest historical character profile for the target drama title includes:
[0023] Determine the character names in the character profile of this episode, the set of aliases for the character names, the character appearance in this episode, and the character relationships in the meta-information of this episode;
[0024] Obtain the directed graph of the historical character files, and determine whether the character name has a corresponding character node in the directed graph;
[0025] If so, then update the character attributes of the character node according to the alias set and the image of the current set, and update the directed edges of the character node according to the character relationship;
[0026] If not, then construct a new node for the character name in the directed character graph based on the alias set and the character image in this episode, and update the directed character graph based on the category of the new node and the character relationship;
[0027] Generate the latest historical character profile for the target drama title based on the updated character directed graph.
[0028] Optionally, the new node can be categorized into child nodes and parent nodes;
[0029] The step of constructing a new node for the character name in the directed character graph based on the alias set and the current character image, and updating the directed character graph based on the category of the new node and the character relationship, includes:
[0030] Determine whether any role alias in the alias set has a corresponding role node in the directed role graph;
[0031] If so, then the child nodes of the character node are constructed based on the character name, the alias set, and the current character image. After updating the node attributes and directed edges of the character node according to the child nodes and the character relationship, the child nodes are deleted.
[0032] If not, then a parent node is generated using the character name as the node name, the alias set and the current character image as node attributes, and the parent node is added to the character directed graph.
[0033] Optionally, the process of constructing the directed graph of roles includes:
[0034] Determine the names of each character in the historical character archive, as well as the set of aliases, character appearance, and character relationships for each character name;
[0035] Using the character name as the node name and the alias set and character image as the node attributes, a character node is generated for each character name, and directed edges are generated between the character nodes according to the character relationships of each character name, forming a directed character graph.
[0036] This application also provides a device for restoring film and television scripts, including:
[0037] The information acquisition module is used to acquire the video list and breakpoint information corresponding to the target drama title, and to determine the current episode video to be restored from the video list based on the breakpoint information, as well as to load the historical plot outline and historical character files already generated for the target drama title.
[0038] The model extraction module is used to input the current episode video, the historical plot summary, and the historical character files into a preset script information extraction model to obtain the current episode meta-information and the current episode plot text output by the script information extraction model.
[0039] The data update module is used to update the historical plot synopsis and the historical character files based on the current episode's metadata, and to append the current episode's plot text to the script output file corresponding to the target film and television drama in the database;
[0040] The script output module is used to retrieve the next episode video from the video list as the new episode video, and return to the process of loading the historical plot outline and historical character files generated for the target drama title and subsequent steps, until the script restoration of the last episode video in the video list is completed.
[0041] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the film and television script restoration method as described in any of the above embodiments.
[0042] This application also provides a computer device, including: one or more processors, and memory;
[0043] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the film and television script restoration method as described in any of the above embodiments.
[0044] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0045] The method, apparatus, storage medium, and computer equipment for restoring film and television scripts provided in this application can, during script restoration, first obtain the video list and breakpoint information corresponding to the target drama title, and then determine the current episode video to be restored from the video list based on the breakpoint information. This avoids repeated processing after interruptions during script restoration. Simultaneously, it can load the historical plot synopsis and historical character files already generated for the target drama title, providing basic information for subsequent video plot restoration. Here, the current episode video, historical plot synopsis, and historical character files can be input into a preset script information extraction model, ensuring that the meta-information of the current episode and the main plot text of the current episode are logically coherent and consistent in character settings. Subsequently, the historical plot synopsis and historical character files can be updated based on the current episode meta-information, and the main plot text of the current episode can be appended to the script output file corresponding to the target film and television drama in the database, ensuring that this data always reflects the latest plot developments and character changes. Once the current episode's video restoration is complete, the next episode's video can be automatically retrieved from the video list and used as the new current episode's video for a new round of script restoration, until the script restoration of the last episode's video in the video list is completed. This can greatly improve the efficiency of script restoration and ultimately obtain a complete script output file. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 A flowchart illustrating a method for restoring a film or television script, provided as an embodiment of this application;
[0048] Figure 2 A flowchart illustrating a script information extraction process provided in this application embodiment;
[0049] Figure 3 A schematic diagram of a film and television script restoration device provided in this application embodiment;
[0050] Figure 4 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] Currently, traditional script reconstruction methods mostly rely on manually watching videos frame by frame and reconstructing the plot. This method is not only time-consuming and labor-intensive, but also prone to information omissions or errors due to human oversight. To address this, models have been introduced in some plot reconstruction scenarios. However, processing the entire series of videos can easily exceed the capabilities of these models. Therefore, most existing models can only extract independent text based on a single episode, making it difficult to guarantee the coherence of plot logic and the consistency of character settings across different series.
[0053] Based on this, this application proposes the following technical solution, as detailed below:
[0054] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for restoring a film or television script, provided as an embodiment of this application. The method specifically includes the following:
[0055] S110: Obtain the video list and breakpoint information corresponding to the target drama title, and determine the video of the current episode to be restored from the video list based on the breakpoint information, as well as load the historical plot summary and historical character files generated for the target drama title.
[0056] In this step, when restoring a film or television script, you can first obtain the video list and breakpoint information corresponding to the target drama title, and then determine the video of the episode to be restored from the video list based on the breakpoint information. This can avoid repeatedly processing the restored episodes after the breakpoint during the script restoration process.
[0057] The target title refers to the name of the film or television series for which script reconstruction is required, uniquely identifying the work. The video list is a collection of video files for all episodes of the series, arranged chronologically. For example, if a series has 30 episodes, the video list would store episodes 1 through 30 sequentially. Furthermore, breakpoint information records the points where the script reconstruction process is interrupted. This information can include the target title, the last episode number that has been reconstructed, and the current processing progress, allowing the task to resume from where it left off without restarting.
[0058] Specifically, after receiving a script restoration request from a user, the computer device first parses the target drama title in the request, then retrieves and obtains the complete video list corresponding to that target drama title from a database or a specified storage path. Simultaneously, the computer device can query breakpoint information locally or in the cloud, thereby determining the starting episode for the target drama title in this restoration process and using it as the episode for script restoration. Subsequently, the computer device can further load the previously generated backstory for the target drama title, including historical plot summaries and historical character profiles. This historical data serves as contextual information to assist in the script restoration of the current episode, ensuring the continuity of plot logic and character settings. The historical plot summary is a general description of the main plot of the restored episode, while the historical character profiles contain structured data such as basic information, character appearance, and relationships of characters who have appeared. Together, they constitute an important basis for the model to understand the content of the current episode.
[0059] S120: Input the video of this episode, the historical plot summary, and the historical character profile into the preset script information extraction model to obtain the meta-information of this episode and the main plot of this episode output by the script information extraction model.
[0060] In this step, after determining the current episode video, historical plot summary, and historical character files through step S110, the computer device can input these three data together into the preset script information extraction model for plot analysis, and finally obtain the current episode meta-information and the current episode plot text output by the model. They have coherence in plot logic and consistency in character settings.
[0061] Specifically, the script information extraction model can comprehensively utilize multi-dimensional input information for in-depth plot reasoning. During the plot reasoning process, by introducing historical plot outlines for contextual constraints, the model can acquire cross-episode contextual awareness when processing single-episode videos, thereby effectively avoiding plot breaks caused by processing single episodes independently and improving the coherence of plot development. At the same time, by introducing historical character archives to constrain character attributes, it can ensure that the character's behavioral logic and settings remain consistent across different episodes, avoiding problems such as character personality drift or relationship misalignment. Based on this, the script information extraction model can ultimately generate plot content semantically related to previous episodes and output it as the meta-information and main plot text of the current episode.
[0062] The meta-information of this episode refers to the structured extraction of the core content of the episode's plot, including but not limited to the episode's plot summary, character profiles, key plot points, timeline markers, etc.; the main plot of this episode is the natural language textual presentation of the characters' dialogues, actions, scene descriptions, etc. in this episode's video. Its content is detailed and conforms to the narrative norms of film and television scripts, and can completely reproduce the plot development process in the video.
[0063] S130: Update the historical plot summary and historical character profiles based on the meta-information of this episode, and append the main plot of this episode to the script output file corresponding to the target film and television drama in the database.
[0064] In this step, after obtaining the episode's metadata and episode's plot text through step S120, the computer device can update the historical plot synopsis and historical character files based on the episode's metadata, and append the episode's plot text to the script output file corresponding to the target film and television drama in the database, ensuring that these materials can always reflect the latest plot developments and character changes.
[0065] Specifically, when updating historical plot outlines and historical character profiles, computer equipment can first parse the original information of the current episode and extract key information, such as key event information, character appearance information, relationship change information, and timeline node information. The extracted results are then integrated with the existing historical plot outline. For example, key events can be added or reordered according to chronological order, or existing event nodes can be supplemented and corrected to generate an updated historical plot outline. At the same time, computer equipment can also perform character increments or attribute corrections based on the extracted key information in the historical character profiles, thereby ensuring that the information of each character in the historical character profiles can correspond to the script restoration progress in real time.
[0066] In addition, it should be noted that the script output file refers to a text file used to store the complete script content of the target film or television drama. Its format follows the industry standards for film and television scripts and includes elements such as scene descriptions, character dialogues, and action instructions. Users can view and edit the script output file at any time.
[0067] S140: Retrieve the next episode video from the video list as the new episode video, and return to loading the historical plot summary and historical character profiles generated for the target show title and subsequent steps, until the script restoration of the last episode video in the video list is completed.
[0068] In this embodiment, after the plot restoration of the current episode is completed through step S130, the computer device can automatically obtain the next episode video from the video list as the new current episode video, and reload the latest historical plot summary and historical character files of the target drama title and enter a new round of plot restoration until the script restoration of the last episode video in the video list is completed, and the final complete script output file is obtained.
[0069] Specifically, after the computer device completes the script restoration of the current episode, it can automatically retrieve the video data corresponding to the next number of the current episode in the video list, use it as the new episode video, and re-execute the loading of the latest historical plot summary and historical character files of the target drama name. That is, the currently loaded historical data already contains the plot information of the episode that has just been restored. This ensures that the new round of restoration process can be based on the latest plot development and character status.
[0070] For example, after the computer device completes the script reconstruction of episode 5, it can automatically locate episode 6 in the video list as the new episode and load the historical plot synopsis and historical character profiles that have been updated to episode 5. The historical plot synopsis contains the key event outlines of the first 5 episodes, and the character profiles contain relevant information and images of the characters who appeared in the first 5 episodes. Then, based on this latest historical data, the computer device can use a script information extraction model to extract script information from episode 6, thereby achieving seamless connection between episodes.
[0071] Understandably, this cyclical processing mechanism allows the computer to sequentially reconstruct the scripts for all episodes in the video list according to the order of the episodes, without requiring manual intervention to start each episode, significantly improving overall processing efficiency. Once the script for the last episode in the video list has been reconstructed, the computer will automatically terminate the cyclical process. At this point, the script output file stored in the specified location in the database will contain the complete plot of the target film or television series, and the user can directly read the complete script text from this file.
[0072] In the above embodiments, during script reconstruction, the video list and breakpoint information corresponding to the target drama title can be obtained first. Based on the breakpoint information, the current episode video to be reconstructed is determined from the video list, thus avoiding repeated processing after interruptions during script reconstruction. Simultaneously, the historical plot synopsis and historical character profiles already generated for the target drama title can be loaded, providing basic information for subsequent video plot reconstruction. Here, the current episode video, historical plot synopsis, and historical character profiles can be input into a preset script information extraction model, ensuring that the meta-information of the current episode and the main plot text of the current episode are logically coherent and consistent in character settings. Subsequently, the historical plot synopsis and historical character profiles can be updated based on the current episode meta-information, and the main plot text of the current episode can be appended to the script output file corresponding to the target film / TV series in the database, ensuring that this data always reflects the latest plot developments and character changes. After the current episode video reconstruction is completed, the next episode video can be automatically retrieved from the video list as the new current episode video for a new round of script reconstruction, until the script reconstruction of the last episode video in the video list is completed. This greatly improves script reconstruction efficiency and ultimately yields a complete script output file.
[0073] In one embodiment, the process of determining the current episode video to be restored from the video list based on the breakpoint information in step S110 may include:
[0074] S111: Determine if there is a historical restoration record of the target drama title in the breakpoint information.
[0075] S112: If so, determine the breakpoint episode video in the history restoration record, and retrieve the next episode video of the breakpoint episode video from the video list as the current episode video.
[0076] S113: If not, retrieve the first episode video from the video list and use it as the video for this episode.
[0077] In this embodiment, after obtaining the breakpoint information of the target drama title, the computer device can first determine whether there is a historical restoration record of the target drama title in the breakpoint information. If there is, the breakpoint drama video in the historical restoration record can be determined, and the next episode video of the breakpoint drama video can be obtained from the video list as the current episode video; otherwise, the first episode video can be obtained from the video list as the current episode video.
[0078] Specifically, the historical restoration record refers to the operation log and status data generated for the target drama title during the script restoration process. This includes the processed episode numbers, historical plot summaries, and storage paths for historical character files. When a historical restoration record for the target drama title exists in the breakpoint information, the computer will parse the record to locate the breakpoint episode video—that is, the last episode video successfully processed during the historical restoration process. It will then retrieve the video data corresponding to the next number in the video list as the current episode to be processed, ensuring that processing continues from the episodes following the breakpoint. If no historical restoration record exists, meaning this is the first time a script restoration is performed for the target drama title, processing will begin by default from the beginning of the video list, i.e., the first episode video, establishing the initial foundation for the restoration of subsequent episodes.
[0079] For example, if a target drama title has a historical restoration record in its breakpoint information, and the record shows that the last successfully processed video was episode 8, then the computer device can obtain episode 9 from the video list as the current episode video; if the breakpoint information does not have a historical restoration record for the target drama title, then episode 1 is directly identified as the current episode video, and the first round of script restoration process begins.
[0080] In one embodiment, such as Figure 2 As shown, Figure 2 A flowchart illustrating a script information extraction process provided in this application embodiment; Figure 2In step S120, the script information extraction model includes an audio / video parsing network, a plot generation network, and a metadata extraction network. The process of inputting the current episode's video, historical plot synopsis, and historical character profiles into the preset script information extraction model to obtain the current episode's metadata and plot text output by the model can include:
[0081] S121: Input the video of this episode into the audio and video parsing network so that the audio and video parsing network can parse the video of this episode frame by frame to obtain audio and video features.
[0082] S122: By using a plot generation network, character positioning and logical narration are performed on audio and video features, historical plot outlines, and historical character archives to generate the main plot of this episode.
[0083] S123: The audio and video features and the main plot of this episode are structured and analyzed by a meta-information extraction network to extract the meta-information of this episode; the meta-information of this episode includes the plot summary of this episode and the character profiles of this episode.
[0084] In this embodiment, the script information extraction model of this application includes an audio-visual parsing network, a plot generation network, and a meta-information extraction network. Therefore, when the computer device uses the script information extraction model to extract the episode information of the current video, it can first input the current video into the audio-visual parsing network so that the audio-visual parsing network can parse the current video frame by frame to obtain audio-visual features. Then, the plot generation network can perform character positioning and logical narration on the audio-visual features, historical plot outlines, and historical character files to generate the main plot text of the current episode. Finally, the meta-information extraction network can perform structured analysis on the audio-visual features and the main plot text of the current episode to extract the meta-information of the current episode.
[0085] Specifically, the audio-video parsing network can adopt a multimodal fusion architecture. First, keyframes are extracted from the video stream, and visual information such as scene layout, character movements, and facial expressions are extracted from the images using a convolutional neural network (CNN). Simultaneously, speech recognition and sentiment analysis are performed on the audio stream, converting the dialogue content into a text sequence and extracting audio features such as speaker tone and background music emotion. Subsequently, the audio-video parsing network spatiotemporally aligns the visual and audio features to construct an audio-video feature vector containing multi-dimensional information, providing basic data support for subsequent plot understanding.
[0086] The plot generation network can be built based on a pre-trained large language model. Its core lies in combining historical plot outlines and historical character archives to perform deep semantic decoding of current audio and video features. In the character localization stage, the plot generation network can accurately identify the character's identity and interaction relationship in the current scene by comparing the character features in the historical character archives with the character information in the audio and video features. In the logical narration stage, the plot generation network uses the historical plot outline as the timeline anchor point to logically connect the event development in the audio and video features with the previous plot, and finally generates natural language narrative text that conforms to the character settings and plot direction, serving as the main text of this episode.
[0087] Meta-information extraction networks can extract elements and structure data from audio and video features and the episode's main plot to form the episode's metadata. Specifically, for the episode's plot summary, the network can semantically compress the main plot text to extract the core event sequence; for the episode's character profiles, the network can combine audio and video features and the main plot text to parse attributes such as each character's alias, appearance, and mission history, forming structured character data and providing updated character benchmarks for subsequent episodes.
[0088] In one embodiment, the process of updating the historical plot synopsis and historical character files based on the current episode's metadata in step S130 may include:
[0089] S131: Add the episode's plot summary from the episode's metadata to the historical plot summary to obtain the latest historical plot summary for the target series title.
[0090] S132: Update the historical character profiles based on the current episode's character profiles in the current episode's metadata to obtain the latest historical character profiles for the target series title.
[0091] In this embodiment, the computer device can update the backstory of the target drama title based on the episode's metadata. Specifically, for historical plot summaries, the computer device can add the episode's plot summary from the episode's metadata to the historical plot summary to obtain the latest historical plot summary for the target drama title; for historical character profiles, the computer device can update the historical character profiles based on the episode's character profiles from the episode's metadata to obtain the latest historical character profiles for the target drama title.
[0092] Specifically, when adding the current episode's plot summary to the historical plot summary, the computer device can align the two data according to the chronological order of the episodes. For example, key events in the current episode's plot summary are inserted into the corresponding positions in the historical plot summary according to their occurrence time. If there are events related to previous episodes, causal relationship labels are also established between the events, so that the updated historical plot summary can fully present the plot development of the target TV series from the beginning to the current episode. In addition, when the aligned and integrated historical plot summary is too long, the computer device can also perform summary compression processing on the integrated historical plot summary, retaining core events and key turning points, ensuring that the model can quickly obtain effective prior information when reconstructing subsequent episodes.
[0093] To update historical character profiles, the computer device can compare the current episode's character profile with historical character profiles and update the historical character profiles accordingly based on the comparison results. For example, for a newly added character, the computer device can directly add its relevant attribute data to the historical character profile; for an existing character, the computer device can supplement or correct the corresponding character's attribute fields in the historical character profile based on features such as aliases or character background that have appeared in the current episode, ensuring that the historical character profile can dynamically reflect the character's growth and changes.
[0094] In one embodiment, step S132, which updates the historical character archives based on the current episode's character archives in the current episode's metadata to obtain the latest historical character archives for the target series, may include:
[0095] S1321: Determine the character names in the character profile of this episode, the set of aliases for the character names, the character appearance in this episode, and the character relationships in the meta-information of this episode.
[0096] S1322: Obtain the directed graph of historical character files and determine whether the character name has a corresponding character node in the directed graph.
[0097] S1323: If so, update the character attributes of the character node based on the alias set and the image of the current episode, and update the directed edges of the character node based on the character relationship.
[0098] S1324: If not, construct new nodes for character names in the directed character graph based on the alias set and the character image in this episode, and update the directed character graph based on the category of the new nodes and the character relationships.
[0099] S1325: Generate the latest historical character profile for the target drama title based on the updated character directed graph.
[0100] In this embodiment, when updating the historical character archive, the computer device can first determine the character name, alias set, appearance, and relationship in the character archive of the current episode in the episode's metadata. Then, it can obtain the directed graph of the historical character archive and determine whether there is a corresponding character node in the directed graph for the character name. If so, the character attributes of the character node can be updated according to the alias set and appearance in the current episode, and the directed edges of the character node can be updated according to the relationship. Otherwise, a new node for the character name can be constructed in the directed graph according to the alias set and appearance in the current episode, and the directed graph can be updated according to the category and relationship of the new node. Finally, the computer device can generate the latest historical character archive for the target drama name according to the updated directed graph.
[0101] The character name refers to the main name of the character actually appearing in the episode's plot; the alias set can cover all forms of address for the character other than the character name mentioned in the episode, such as nicknames, professional designations, etc. Furthermore, the episode's image refers to the character's appearance as depicted in the episode's story; character relationships refer to the interactions and connections between the character and other characters in the episode, including kinship, cooperation, and conflict. With each update to the historical character archives, the computer device stores a corresponding directed graph of characters. This directed graph is a structured data model where nodes represent character names and directed edges represent character relationships. Each character node contains character attributes, including a set of aliases, character appearance, and character background.
[0102] Specifically, when updating the directed graph of characters, if a character name already exists in the character profile of the series, the computer device can first add the new name from its alias set to the "alias" attribute list of the corresponding node. If duplicate aliases exist, they are removed. Simultaneously, the newly added features from the current episode's appearance are integrated into the node's "current appearance" field. Regarding character relationships, the computer device can adjust the directed edges between character nodes based on the character relationships in the character profile of the series. If the character relationship is already labeled in its corresponding directed edge, no adjustment is needed; if a new character relationship appears, a corresponding directed edge is added and labeled.
[0103] If the character name is a newly added character, the computer device can first construct a new node for the new character in the directed character graph. Then, it can further determine whether the character name exists in the directed character graph under other names during the restoration of other episodes by using the alias set, thus avoiding the dispersion of information about the same character. For example, if the character name exists in the directed character graph under any of its aliases, the new node can be integrated into the character node corresponding to that alias. If it does not exist, the node can be treated as an independent node, and directed edges can be established to connect it to other character nodes through character relationships.
[0104] Finally, after updating the directed graph of characters, the computer equipment can convert it into a structured historical character archive, including character names, character attributes, character experiences, and other information. This ensures that when subsequent episodes are recreated, the script information extraction model can quickly call the latest character data for logical reasoning.
[0105] In one embodiment, the categories of the new nodes in step S1324 include child nodes and parent nodes; wherein, the process of constructing new nodes for character names in the character directed graph based on the alias set and the current set's image, and updating the character directed graph based on the categories of the new nodes and character relationships, may include:
[0106] S3241: Determine whether any role alias in the alias set has a corresponding role node in the directed role graph.
[0107] S3242: If so, construct the child nodes of the character node based on the character name, alias set, and image in this episode, and after updating the node attributes and directed edges of the character node according to the child nodes and the relationship between the character and the child nodes, delete the child nodes.
[0108] S3243: If not, then generate a parent node with the character name as the node name, the alias set and the current episode image as the node attributes, and add the parent node to the character directed graph.
[0109] In this embodiment, when a character name does not have a corresponding character node in the directed character graph, the computer device can further determine whether any character alias in its alias set has a corresponding character node in the directed character graph. If so, the computer device can construct a child node of the character node based on the character name, the alias set, and the current character image, and delete the child node after updating the node attributes and directed edges of the character node based on the child node and the character relationship. If not, a parent node can be generated using the character name as the node name and the alias set and the current character image as the node attributes, and the parent node can be added to the directed character graph.
[0110] Specifically, when the computer device detects an alias in the set of aliases for a character name that matches an existing character node in the directed character graph, it can create a temporary child node for that character name, using that character node as its parent node. This temporary child node's attributes can include the character name, the set of aliases, the character's appearance in the current episode, and character relationships. Subsequently, the computer device can merge the child node's attributes with those of its parent node. For example, it can add the character name and other aliases from the set to the parent node's alias list, supplement the parent node's appearance description with the character's appearance features, and update the directed edges between the parent node and other character nodes based on the child node's character relationships. After merging, the computer device can delete the child node, ensuring the structural simplicity of the directed character graph.
[0111] If none of the aliases in the alias set have a corresponding node in the directed character graph, the computer device can directly use the main name of the character's name as the node name, take the alias set and the character's image in this episode as the core attributes of the node, generate a new parent node, and establish corresponding directed edges in the directed character graph based on the relationship between the parent node and other characters in this episode, thereby achieving accurate positioning of the new character in the directed character graph.
[0112] In one embodiment, the process of constructing the directed graph of roles in step S1322 may include:
[0113] S3221: Determine the names of each character in the historical character archives, as well as the set of aliases, character appearance, and character relationships for each character name.
[0114] S3222: Generate a character node for each character name, using the character name as the node name and the alias set and character image as the node attributes. Then, generate directed edges between the character nodes based on the character relationships of each character name, forming a directed character graph.
[0115] In this embodiment, when constructing the directed graph of characters for the first time, the computer device can first determine the names of each character in the historical character archive, as well as the alias set, character image, and character relationship of each character name. Then, using the character name as the node name and the alias set and character image as the node attributes, a character node is generated for each character name, and directed edges between each character node are generated according to the character relationship of each character name, thus forming a directed graph of characters.
[0116] Specifically, the computer device can traverse all character names that have appeared in the character archives. For each character name, the computer device can extract its complete set of aliases, character appearance, and character relationships from the historical character archives. After extracting the basic data, the computer device can use the character name as a unique identifier for the node, and store the alias set and character appearance tag as the node's basic attributes. Then, based on the character relationships, it draws directed edges and relationship labels between related character nodes. The direction of the edge indicates the active and passive party in the relationship. For example, if character A is the superior of character B, the directed edge from node A to node B will be labeled with a "superior-subordinate" relationship. In this way, the computer device can construct a complete directed character graph containing character attributes and a relationship network, providing structured underlying data support for subsequent character archive updates and plot logic reasoning.
[0117] The following describes the film and television script restoration device provided in the embodiments of this application. The film and television script restoration device described below can be referred to in correspondence with the film and television script restoration method described above.
[0118] In one embodiment, such as Figure 3 As shown, Figure 3 This application provides a schematic diagram of a film and television script restoration device according to an embodiment of the present application; the present application also provides a film and television script restoration device, including an information acquisition module 210, a model extraction module 220, a data update module 230, and a script output module 240, specifically including the following:
[0119] The information acquisition module 210 is used to acquire the video list and breakpoint information corresponding to the target drama title, and to determine the current episode video to be restored from the video list based on the breakpoint information, as well as to load the historical plot summary and historical character files already generated for the target drama title.
[0120] The model extraction module 220 is used to input the current episode video, historical plot summary and historical character files into the preset script information extraction model to obtain the current episode meta-information and the current episode plot text output by the script information extraction model.
[0121] The data update module 230 is used to update the historical plot summary and historical character files based on the meta-information of this episode, and to append the main plot of this episode to the script output file corresponding to the target film and television drama in the database.
[0122] The script output module 240 is used to retrieve the next episode video from the video list as the new episode video, and return to loading the historical plot outline and historical character files generated for the target drama title and its subsequent steps, until the script restoration of the last episode video in the video list is completed.
[0123] In one embodiment, the information acquisition module 210 may include:
[0124] The history record judgment submodule is used to determine whether there is a history restoration record of the target drama name in the breakpoint information.
[0125] The first video acquisition submodule is used to determine the breakpoint episode video in the historical restoration record if the condition is met, and to retrieve the next episode video of the breakpoint episode video from the video list as the current episode video.
[0126] The second video acquisition submodule is used to retrieve the first episode video from the video list if no, and use it as the video for this episode.
[0127] In one embodiment, the script information extraction model in the model extraction module 220 includes an audio / video parsing network, a plot generation network, and a metadata extraction network; wherein, the model extraction module 220 may further include:
[0128] The audio and video parsing submodule is used to input the current episode of video into the audio and video parsing network, so that the audio and video parsing network can parse the current episode of video frame by frame to obtain audio and video features.
[0129] The plot generation submodule is used to generate the episode's main plot text by analyzing audio and video features, historical plot outlines, and historical character archives through a plot generation network to determine character positioning and logical narration.
[0130] The meta-information extraction submodule is used to perform structured analysis on audio and video features and the main plot of the episode through a meta-information extraction network to extract the meta-information of the episode. The meta-information of the episode includes the plot summary of the episode and the character profiles of the episode.
[0131] In one embodiment, the data update module 230 may include:
[0132] The Synopsis Update submodule is used to add the episode's plot synopsis from the episode's metadata to the historical plot synopsis, thus obtaining the latest historical plot synopsis for the target series title.
[0133] The Archive Update submodule is used to update the historical character archives based on the current episode's character archives in the current episode's metadata, so as to obtain the latest historical character archives for the target series name.
[0134] In one embodiment, the file update submodule may include:
[0135] The character information determination unit is used to determine the character name in the character file of this episode, the set of aliases for the character name, the character image in this episode, and the character relationship.
[0136] The node judgment unit is used to obtain the directed graph of the historical character files and determine whether the character name has a corresponding character node in the directed graph.
[0137] The first directed graph update unit is used to update the character attributes of the character node based on the alias set and the image of the current set if the condition is met, and to update the directed edges of the character node based on the character relationship.
[0138] The second directed graph update unit is used to construct new nodes for character names in the directed graph based on the alias set and the character image in the current episode if no, and update the directed graph based on the category of the new nodes and the character relationship.
[0139] The archive generation unit is used to generate the latest historical character archives for the target drama title based on the updated character directed graph.
[0140] In one embodiment, the categories of the new nodes in step S1324 include child nodes and parent nodes; wherein, the process of constructing new nodes for character names in the character directed graph based on the alias set and the current set's image, and updating the character directed graph based on the categories of the new nodes and character relationships, may include:
[0141] The node judgment sub-unit is used to determine whether any role alias in the alias set has a corresponding role node in the directed role graph.
[0142] The first directed graph sub-unit is used to construct the child nodes of the character node based on the character name, alias set, and image in this episode if the child node is the same as the character name. After updating the node attributes and directed edges of the character node based on the child nodes and the relationship between the character and the child nodes, the child nodes are deleted.
[0143] The second directed graph sub-unit is used to generate a parent node with the character name as the node name, the alias set and the current episode image as the node attributes, and add the parent node to the character directed graph if no.
[0144] In one embodiment, the process of constructing the directed graph of roles in step S1322 may include:
[0145] The Role Determination subunit is used to determine the names of each role in the historical role archives, as well as the set of aliases, character appearance, and character relationships for each role name.
[0146] The directed graph generation subunit is used to generate character nodes for each character name, using the character name as the node name and the alias set and character image as the node attributes. It also generates directed edges between the character nodes based on the character relationships of each character name, thus forming a directed character graph.
[0147] In one embodiment, this application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the film and television script restoration method as described in any of the above embodiments.
[0148] In one embodiment, this application also provides a computer device storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the film and television script restoration method as described in any of the above embodiments.
[0149] Indicatively, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 4 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the film and television script reconstruction method of any of the above embodiments.
[0150] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0151] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0152] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0153] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0154] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. 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 this application. Therefore, this application 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 disclosed herein.
Claims
1. A method for restoring film and television scripts, characterized in that, The method includes: Obtain the video list and breakpoint information corresponding to the target drama title, and determine the current episode video to be restored from the video list based on the breakpoint information, as well as load the historical plot outline and historical character files already generated for the target drama title; The video of this episode, the historical plot synopsis, and the historical character files are input into a preset script information extraction model to obtain the episode's meta-information and episode's plot text output by the script information extraction model. The historical plot synopsis and historical character profiles are updated based on the meta-information of this episode, and the main plot text of this episode is appended to the script output file corresponding to the target film and television drama in the database; The next episode video of the current episode is retrieved from the video list and used as the new current episode video. The process then returns to the steps of loading the historical plot outline and historical character files generated for the target drama title and subsequent steps, until the script of the last episode video in the video list is restored.
2. The method for restoring film and television scripts according to claim 1, characterized in that, The step of determining the current episode video to be restored from the video list based on the breakpoint information includes: Determine whether the breakpoint information contains a historical restoration record of the target drama title; If so, then identify the breakpoint episode video in the historical restoration record, and obtain the next episode video of the breakpoint episode video from the video list as the current episode video; If not, then the first episode video is retrieved from the video list and used as the video for this episode.
3. The method for restoring film and television scripts according to claim 1, characterized in that, The script information extraction model includes an audio and video parsing network, a plot generation network, and a metadata extraction network; The step of inputting the current episode video, the historical plot synopsis, and the historical character profiles into a preset script information extraction model to obtain the current episode's metadata and plot text output by the script information extraction model includes: The video of this episode is input into the audio and video parsing network so that the audio and video parsing network can parse the video of this episode frame by frame to obtain audio and video features; The plot generation network is used to perform character positioning and logical narration on the audio and video features, the historical plot outline, and the historical character files to generate the main plot of this episode. The audio and video features and the main plot of the episode are structured and analyzed by the meta-information extraction network to extract the meta-information of the episode; the meta-information of the episode includes the plot summary of the episode and the character profiles of the episode.
4. The method for restoring film and television scripts according to claim 1, characterized in that, The step of updating the historical plot synopsis and the historical character profiles based on the current episode's metadata includes: Add the episode synopsis from the current episode's metadata to the historical synopsis to obtain the latest historical synopsis for the target drama title; The historical character profiles are updated based on the current episode's character profiles in the current episode's metadata to obtain the latest historical character profiles for the target drama title.
5. The method for restoring film and television scripts according to claim 4, characterized in that, The step of updating the historical character profile based on the current episode's character profile in the current episode's metadata to obtain the latest historical character profile for the target drama title includes: Determine the character names in the character profile of this episode, the set of aliases for the character names, the character appearance in this episode, and the character relationships in the meta-information of this episode; Obtain the directed graph of the historical character files, and determine whether the character name has a corresponding character node in the directed graph; If so, then update the character attributes of the character node according to the alias set and the image of the current set, and update the directed edges of the character node according to the character relationship; If not, then construct a new node for the character name in the directed character graph based on the alias set and the character image in this episode, and update the directed character graph based on the category of the new node and the character relationship; Generate the latest historical character profile for the target drama title based on the updated character directed graph.
6. The method for restoring film and television scripts according to claim 5, characterized in that, The new node can be categorized into child nodes and parent nodes; The step of constructing a new node for the character name in the directed character graph based on the alias set and the current character image, and updating the directed character graph based on the category of the new node and the character relationship, includes: Determine whether any role alias in the alias set has a corresponding role node in the directed role graph; If so, then the child nodes of the character node are constructed based on the character name, the alias set, and the current character image. After updating the node attributes and directed edges of the character node according to the child nodes and the character relationship, the child nodes are deleted. If not, then a parent node is generated using the character name as the node name, the alias set and the current character image as node attributes, and the parent node is added to the character directed graph.
7. The method for restoring film and television scripts according to claim 1, characterized in that, The process of constructing the directed graph of roles includes: Determine the names of each character in the historical character archive, as well as the set of aliases, character appearance, and character relationships for each character name; Using the character name as the node name and the alias set and character image as the node attributes, a character node is generated for each character name, and directed edges are generated between the character nodes according to the character relationships of each character name, forming a directed character graph.
8. A device for restoring film and television scripts, characterized in that, include: The information acquisition module is used to acquire the video list and breakpoint information corresponding to the target drama title, and to determine the current episode video to be restored from the video list based on the breakpoint information, as well as to load the historical plot outline and historical character files already generated for the target drama title. The model extraction module is used to input the current episode video, the historical plot summary, and the historical character files into a preset script information extraction model to obtain the current episode meta-information and the current episode plot text output by the script information extraction model. The data update module is used to update the historical plot synopsis and the historical character files based on the current episode's metadata, and to append the current episode's plot text to the script output file corresponding to the target film and television drama in the database; The script output module is used to retrieve the next episode video from the video list as the new episode video, and return to the process of loading the historical plot outline and historical character files generated for the target drama title and subsequent steps, until the script restoration of the last episode video in the video list is completed.
9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the film and television script restoration method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the film and television script restoration method as described in any one of claims 1 to 7.