Method for generating role brief introduction in script and related device
By analyzing the related text content in the script to generate character tags, determine events and settings, and use large models and natural language models to write character introductions, the problem of subjective differences in character introductions in the script is solved, and objective and consistent character introduction generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
In the script, the evaluation of character descriptions is subjective and difficult to standardize, resulting in differences in character descriptions written by different evaluators.
By extracting the relevant text content of each scene in the script, a set of character tags is generated, character events and settings are determined, and the events are sorted according to the logic of the events. Character introductions are written using large models and natural language models to reduce subjective influence.
It achieves objective and consistent generation of character profiles, reduces the differences caused by subjective human analysis, and provides an objective reference for script character analysis.
Smart Images

Figure CN121809482A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and related apparatus for generating character profiles in a script. Background Technology
[0002] In narrative works, creators use literary techniques to shape the characters, describing them vividly and three-dimensionally through textual portrayal of their basic information, behaviors, and motivations. When evaluating works or scripts, production companies or platforms generally use the richness of the characters in the script as a standard to filter through a vast number of scripts.
[0003] Currently, when analyzing characters in a script, evaluators subjectively read the text of each scene and write a brief character description based on their own experience, including the character's background and the plot events they experience. Because of subjective differences among evaluators, the character descriptions written by different evaluators for the same character vary, making it difficult to standardize the process. Summary of the Invention
[0004] In view of the above problems, this application provides a method and related apparatus for generating character introductions in a script, so as to avoid subjective differences in character introductions. The specific solution is as follows:
[0005] The first aspect of this application provides a method for generating character introductions in a script, the method comprising:
[0006] Extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character;
[0007] Based on at least one character tag of the target character in the character tag set, determine at least one character event and character setting of the target character in the script, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script;
[0008] Based on the character settings and storyline of the target character, a character introduction of the target character is written.
[0009] In one possible implementation, the step of extracting the associated text content of the target character in each scene of the script, analyzing the associated text content of the target character, and generating at least one character tag for the target character in each scene includes:
[0010] Identify and extract the associated text content of the target character in each scene of the script, and input the associated text content and prompt words into the large model. The prompt words are text that guides the output content of the large model, so that the large model can extract the key description of the associated text content based on the prompt words, and extract at least one character tag of the target character from the key description.
[0011] Obtain at least one character tag from the output of the large model, find the tag most similar to each character tag from the output of the large model in the preset tag set, and use each found tag as the character tag of the target character in each scene.
[0012] In one possible implementation, each scene has a background, and based on at least one character tag of the target character in the character tag set, at least one character event of the target character in the script is determined, including:
[0013] At least one scene group is obtained from all scenes in the script, each scene group includes multiple adjacent scenes, and the similarity of the character tag of the target character in each scene of the same scene group meets the threshold requirement.
[0014] Based on the target character's character tags in each session of the same session group, determine the target character's character behavior in that session group;
[0015] The background of each match within the same match group is used as the background of the match group.
[0016] Establish the logical relationship between the character's behavior and the background, and reconstruct the character's behavior and the background of the scene group into a coherent narrative statement according to the logical relationship, so as to obtain the character events that occur to the target character in the scene group.
[0017] In one possible implementation, determining the character setting of the target character based on at least one character tag of the target character in the character tag set includes:
[0018] Calculate the similarity between any two character tags in the character tag set of the target character to obtain at least one character tag group, and the similarity of each character tag in the same character tag group meets the threshold requirement;
[0019] Input each character tag group into the large model to summarize the content and obtain the character setting of the target character in the script.
[0020] In one possible implementation, the step of sorting at least one character event of the target character according to at least one event logic to obtain the storyline of the target character in the script includes:
[0021] Analyze the temporal sequence of events between the at least one character, the spatial relationship between the locations of events between the at least one character, and the behavioral logic of the character in the at least one character event;
[0022] Based on one of the following sorting methods—the chronological order of the time intervals, the spatial order, and the behavioral logic of the characters—at least one character's events are initially sorted.
[0023] The initial order of at least one character event is adjusted sequentially using sorting methods other than the target sorting method.
[0024] Analyze and obtain the event logic chain in at least one character's events after the initial sorting is adjusted, and determine the event logic chain as the story line of the target character in the script.
[0025] In one possible implementation, the step of writing a character profile of the target character based on the target character's character settings and storyline includes:
[0026] The character settings and storyline of the target character are input into a natural language model. The natural language model generates content based on the character settings and storyline of the target character according to preset output content guide words, thereby obtaining the character introduction of the target character.
[0027] A second aspect of this application provides a character introduction generation device for a script, the device comprising:
[0028] The tag extraction unit is used to extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character.
[0029] The tag analysis unit is used to determine at least one character event and character setting of the target character in the script based on at least one character tag of the target character in the character tag set, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script.
[0030] The information generation unit is used to write a character introduction of the target character based on the character settings and storyline of the target character.
[0031] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0032] The memory is used to store computer programs;
[0033] The processor is used to execute the computer program so that the electronic device can implement the character profile generation method in the script of the first aspect or any implementation thereof.
[0034] The fourth aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the character introduction generation method in a script according to the first aspect or any implementation thereof.
[0035] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to generate a character profile in a script according to the first aspect or any implementation thereof.
[0036] This application provides a method and related apparatus for generating character introductions in a script, utilizing the aforementioned technical solution. This method extracts the associated text content of a target character in each scene of the script. By analyzing this associated text content, at least one character tag for the target character in each scene is generated, resulting in a set of character tags for the target character. Based on multiple character tags in the target character's tag set, at least one character event involving the target character in the script, as well as the target character's role setting in the script, can be determined. The at least one character event of the target character is then sorted according to at least one event logic to obtain the target character's storyline in the script. Based on the target character's role setting and storyline in the script, a character introduction for the target character is obtained. This method analyzes text content associated with the character to determine the corresponding character tags, analyzes the character tags to obtain information such as the character's character events and role setting, and summarizes and writes the character introduction to objectively describe the character in the script, avoiding differences in subjective human analysis and providing an objective reference for character analysis in scripts. Attached Figure Description
[0037] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0038] Figure 1 A flowchart illustrating a method for generating character profiles in a script, provided as an embodiment of this application;
[0039] Figure 2 A schematic diagram of the structure of a script provided in an embodiment of this application;
[0040] Figure 3 A schematic diagram of a character introduction generation device in a script provided in this application embodiment;
[0041] Figure 4 This application provides a hardware structure block diagram of an electronic device. Detailed Implementation
[0042] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0043] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0044] The terms “comprising” and “having”, and any variations thereof, in the specification and accompanying drawings of this application are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, product, or apparatus.
[0045] To address the issue of subjective differences and difficulty in standardizing character descriptions, this application provides a method for generating character descriptions in a script. The method for generating character descriptions in a script according to this application is described in detail below with reference to the accompanying drawings.
[0046] Reference Figure 1 , Figure 1 A flowchart illustrating a method for generating character profiles in a script, as provided in this application embodiment, is shown below. Figure 1 As shown in the embodiment of this application, a method for generating character profiles in a script may include steps S10 to S12, which are described in detail below.
[0047] S10. Extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character.
[0048] The script can refer to the basic text of performing arts such as drama, film and television drama, radio drama, and audio drama. The script can contain textual content such as plot description, dialogue of characters, and scene setting. Of course, the object of processing can also be the original novel or story text. It can be organized according to the text format of the script (episode-scene) before further processing.
[0049] In a script, a scene can refer to a unit of a scene or plot that is divided according to changes in location, time, plot twists, or changes in the behavior or psychology of the characters. For example, if the characters are arguing in an indoor living room and then on an outdoor road, they can be divided into two scenes: one in the indoor living room and another on the outdoor road.
[0050] Each scene can have a background, which may include information such as time and location. For example, the first episode of a script can be divided into scenes 1-1, 1-2, etc. The background of scene 1-1 could be: nighttime, a prison cell, while the background of scene 1-2 could be: daytime, a market. The text content of each scene can include the background, the characters, their actions, and their dialogue. Therefore, the text content related to the characters in a scene can refer to the text describing the characters within that scene. This can include descriptions of the characters' actions, dialogue, thoughts, and appearance. Action descriptions can refer to text describing the actions or behaviors performed by the characters in the scene. Dialogue descriptions can refer to text describing what the characters say in the scene. Psychological descriptions can refer to text describing the characters' inner thoughts. Appearance descriptions can refer to descriptions of the characters' height, build, clothing, appearance, skin color, and other external physical characteristics in that scene.
[0051] For example, match 1-1;
[0052] Time: Evening;
[0053] Location: Prison cell;
[0054] Character appearing: Jailer;
[0055] The text content for scene 1-1 could be: On a dark and stormy night, in a dimly lit cell (description of time, location, and environment), a jailer is on patrol (description of the jailer's behavior).
[0056] The jailer walked to a cell door and found that the prisoner inside was gone (description of the jailer's behavior). He thought to himself: How could this be? I need to notify the others immediately (description of the jailer's inner thoughts). So the jailer shouted: "Someone has escaped!" (description of the jailer's speech).
[0057] Matches 1-2;
[0058] Time: Daytime;
[0059] Location: Main street;
[0060] Characters appearing: Male protagonist, female protagonist, and environmental characters;
[0061] The text content for scenes 1-2 can be: daytime, people coming and going on the street (time, location, and environment).
[0062] (Camera zooms in) The male protagonist, who escaped from the prison last night, is covered in dirt and grime (description of the male protagonist's appearance), which contrasts sharply with the beautiful female protagonist (description of the female protagonist's appearance). The two stand face to face on the corner of the alley.
[0063] The male protagonist, with a serious expression, asked the female protagonist, "How did you know I was here?" (Description of the male protagonist's words);
[0064] Hearing the male protagonist's question, the female protagonist felt annoyed and secretly thought he was clueless about romance (female protagonist's inner thoughts). She then said to him contemptuously, "You don't need to know." After saying that, she turned and left (female protagonist's words and actions).
[0065] The target character can refer to a specific character in the script; every character appearing in the script can be considered the target character in this embodiment. Character tags can refer to various plot tags obtained by summarizing the text content of the script (the text content associated with the character). Character tags can have multiple different categories. For example, in this embodiment, character tags can be divided into motivation / intention category, plot function category, and internal touchpoint category. The motivation / intention category can include character tags such as returning home to start a business, seeking recognition, escaping reality, and restoring self-esteem. The plot function category can include character tags such as foreshadowing, emotional progression, plot twists, and conflict outbreaks. The internal touchpoint category can include character tags such as exposing weaknesses, emotional release, revealing core desires, and triggering growth.
[0066] For each character in the script, this embodiment can summarize and refine the related text content of the character in each scene, assigning the character multiple character tags related to the plot, which facilitates subsequent character analysis. Specifically, the process of determining the character tags in this embodiment can be as follows:
[0067] Identify and extract the associated text content of the target character in each scene of the script, input the associated text content and prompt words into the large model, obtain at least one character tag output by the large model, find the tag most similar to each character tag output by the large model in the preset tag set, and use the found tags as the character tags of the target character in each scene.
[0068] The preset tag set can be obtained by summarizing historical data on character evaluations in the script (such as a character's behavior and language, and the character's final evaluation). In addition to tags related to characters, the preset tag set can also include tags related to the plot rhythm of the scenes, such as tags related to motivation, intention, clues, arc, climax, turning point, foreshadowing, ending, and beginning.
[0069] The prompt words can refer to text that guides the output of the large model, such as instructions or questions, to facilitate the generation of expected output. In this embodiment, the large model can extract key descriptions from the associated text content based on the prompt words, and then extract at least one character tag for the target character from these key descriptions. The prompt words can specifically define the character tags or content processing methods, such as limiting the character tags to multiple words or short text segments. The key descriptions of the associated text content can refer to specific descriptive content related to the character, including specific descriptions of the character's actions, speech, identity, abilities, personality, etc. The large model can summarize and refine the extracted key descriptions, transforming them into concise and refined character tags.
[0070] In this embodiment, when summarizing content using a large model, the associated text content of characters in a scene can first be divided into multiple text blocks (partial text content), and then each text block is input into the large model for processing. When obtaining the character tags output by the large model, embedding technology can be used to convert each character tag in the preset tag set and the character tags output by the large model into corresponding embedding vectors. Then, the similarity between the embedding vectors corresponding to the character tags output by the large model and the embedding vectors corresponding to each character tag in the preset tag set is calculated, and the similarity is sorted. Finally, multiple character tags with high similarity (e.g., the top four in descending order of similarity) are selected as the character tags corresponding to the character in the scene. Here, embedding (feature embedding) can refer to a technique that maps data (such as text) to a low-dimensional vector space. In this embodiment, when calculating the similarity between embedding vectors, the cosine value of the angle between two embedding vectors is mainly calculated as the similarity between the two embedding vectors. Of course, other parameters can also be selected as the similarity between two embedding vectors, such as the Euclidean distance between two embedding vectors.
[0071] In this embodiment, when selecting character tags, multiple character tags can be selected directly from the preset tag set based on the character tags output by the large model. Alternatively, the category of character tags can be determined first based on the character tags output by the large model, and then multiple character tags can be selected from the category. For example, it can be determined that the character tags output by the large model are more inclined towards the internal touchpoint category. Then, the similarity between the character tags such as exposure of weaknesses, emotional release, core desire revelation, and growth trigger in the internal touchpoint category of the preset tag set and the character tags output by the large model can be calculated. Finally, some character tags can be selected as the character tags corresponding to the characters.
[0072] Each scene in the script can be assigned multiple character tags corresponding to the character in that scene according to the above process, thereby obtaining a set of character tags for the character in the script. This set of character tags can include at least one character tag corresponding to the character in all scenes of the script.
[0073] S11. Based on at least one character tag of the target character in the character tag set, determine at least one character event and character setting of the target character in the script, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script.
[0074] In this context, a character's "character events" refer to important plot points or events directly related to the character, which can significantly impact the character's development, emotional changes, or the story's direction. Therefore, multiple character events involved in a character's storyline constitute that character's narrative thread. This storyline can include changes in the character's behavior and emotions, better reflecting the character's dynamic development. Storylines can include various types, such as career storylines (e.g., opening a shop, starting a business), romantic storylines (e.g., confessing love, heartbreak), and family storylines (e.g., parents falling ill).
[0075] In a script, a scene is a unit for breaking down an event. A complete event generally cannot be completed in a single scene and needs to be broken down into multiple adjacent scenes to piece together the complete time and location of the event. For example, a complete event is the protagonist picking up a package, which can be broken down into three scenes. The backgrounds of these three adjacent scenes are: morning - living room at home, morning - elevator, and morning - next to the package locker. Linking these three scene backgrounds together forms the context of the protagonist picking up the package: the time is morning, and the location is from the living room at home to the elevator and then to the package locker. Therefore, this embodiment can merge multiple scenes to summarize the character's event. The specific process is as follows:
[0076] From all the scenes in the script, at least one scene group is selected. Each scene group includes multiple adjacent scenes. The character behavior of the target character in the scene group is determined. The background of each scene in the same scene group is associated as the background of the scene group. The logical relationship between the character behavior and the background is established. According to the logical relationship, the character behavior and the background of the scene group are reconstructed into a coherent narrative statement to obtain the character events that occur in the scene group.
[0077] The scene group includes multiple scenes with a relationship, which can be that multiple scenes are adjacent, and the similarity of the target character's character tags in each scene meets a threshold requirement. The similarity threshold requirement can be determined according to actual requirements, and this embodiment does not limit it. Since the script can be divided into multiple episodes, and each episode can be divided into multiple scenes, in this embodiment, scenes with an interval of no more than 2 episodes can be defined as adjacent scenes.
[0078] In this embodiment, when calculating the similarity between character tags corresponding to the same character across different sessions, the character tags can be vectorized first, and then the cosine of the angle between them can be calculated as the similarity between any two character tags. This embodiment can determine multiple related sessions based on information such as the character, the similarity of the character tags corresponding to the character, and the session time, and group them into sessions belonging to the same character event to obtain session groups. Therefore, each session group can correspond to one character event. Of course, in another optional embodiment, a single session can also be considered an independent character event. This embodiment can determine the target single session's corresponding character event and the specific event content within the character event based on the scene connections and content relevance among multiple sessions in a session group.
[0079] Specifically, this embodiment can determine the character's behavior in each session of the same session group based on the character tags of each session. Then, by linking the behaviors in each session of the same session group into a complete behavior chain according to behavioral logic, the character's behavior in the session group can be obtained. Here, behavioral logic can refer to the causal, progressive, or sequential relationships between the character's behaviors in each session; the behavior in a previous session can trigger the behavior in a subsequent session, or the behavior in a subsequent session is to solve a problem in a previous session or continue the goal of a previous session, forming a non-contradictory behavior chain.
[0080] For example, a session group includes session 1, session 2, and session 3, with Xiaoming as the main character. Based on Xiaoming's corresponding character tags in sessions 1, 2, and 3, his character behavior in each session is determined. In session 1, Xiaoming's character behavior is: Xiaoming calls his cat's name on the lawn downstairs. In session 2, Xiaoming's character behavior is: Xiaoming walks to the entrance of the community and continues to call his cat's name. In session 3, Xiaoming walks to the gatehouse at the entrance of the community, asks the gatekeeper if he has seen the cat, and finds the cat in the gatehouse.
[0081] Analyzing Xiaoming's behavioral logic in the three scenarios: Since Xiaoming couldn't find his cat on the lawn downstairs, he went to the entrance of the residential complex to continue searching. Finding it still not there, he went to the gatehouse to ask the guard if they had seen a cat. He then found his cat in the gatehouse. Therefore, by connecting Xiaoming's actions in these three scenarios based on this behavioral logic, we can determine his role in each scenario: Xiaoming went from the lawn downstairs to the entrance of the complex, then to the guardhouse, searching for his cat.
[0082] This embodiment can associate the backgrounds of each scene within the same scene group, unifying them into a single scene group background. The scene group background can refer to the context of the events occurring for the corresponding character, including time and location, or it can be the context of the character's actions. For example, in the scene group described above, the background of scene 1 is: 7:00 AM, on the lawn downstairs in the residential area; the background of scene 2 is: 9:00 AM, at the entrance of the residential area; and the background of scene 3 is: 9:10 AM, at the guardhouse at the entrance of the residential area. Therefore, the background of this scene group is: from 7:00 AM to 9:10 AM, within a residential area. This means that the background of the character's action, "Xiaoming goes from the lawn downstairs to the entrance of the residential area, and then to the guardhouse, to look for his cat," is: from 7:00 AM to 9:10 AM, within a residential area.
[0083] After obtaining the character behavior and background corresponding to the scene group, we can construct the logical relationship between the character behavior and the background. The background can be the rationale for the character behavior, explaining why the character has such behavior at this time and place. Constructing the logical relationship can make the character behavior more reasonable.
[0084] For example, the lawn downstairs is the cat's usual play area, so it was the first place to search. From 7 a.m. to 9 a.m., Xiaoming searched the lawn for two hours but still couldn't find it. As time went by, Xiaoming judged that the cat might have run far away. Also, the entrance to the community was the cat's only way in and out of the community, so Xiaoming moved to the entrance to search. He called at the entrance but still got no response. Another ten minutes passed, and Xiaoming needed a more effective method. The guardhouse was the community's security point, and the guards could keep an eye on the animals coming and going. Asking the people at the entrance was the most direct next step, so Xiaoming went to the guardhouse at the community entrance.
[0085] After obtaining the logical relationship between the character's behavior and background, the character's behavior and background are sorted out according to the logical relationship and described through a coherent narrative statement, thereby obtaining a character event.
[0086] For example, the character's behavior and background in the above example can be reconstructed into the character event of Xiaoming looking for his cat. This character event can be described as follows: At seven o'clock in the morning, Xiaoming went to the lawn downstairs and called his cat's name. This lawn is where the cat usually likes to play. However, after calling for a long time, he still couldn't find the cat. Before he knew it, it was already nine o'clock in the morning. Xiaoming did not give up. He searched all the way to the entrance of the community and continued to call the cat's name. Ten minutes later, at 9:10 in the morning, Xiaoming saw that there was no response when he called at the gate. With his last hope, he went to the guardhouse next door. He knocked on the door and asked the guard if he had seen his cat. Unexpectedly, a familiar meow came from the guardhouse. It turned out that the cat was in the guardhouse.
[0087] The above process can obtain multiple character events for a character. In this embodiment, at least one storyline involving a character can be summarized based on these multiple character events. The specific process is as follows:
[0088] Analyze the temporal sequence of events involving at least one character, the spatial relationship between the locations of these events, and the character's behavioral logic within these events. Perform a preliminary sorting of these events based on one of the following: temporal sequence, spatial relationship, or behavioral logic. Adjust the preliminary sorting of these events using other sorting methods besides the target sorting method. Analyze and obtain the event logic chain within the adjusted preliminary sorting of these events, identifying this event logic chain as the target character's storyline in the script.
[0089] The temporal sequence between character events can refer to the order in which they occur, such as one event occurring before another, or two events occurring simultaneously. The spatial relationship between the locations of the events can refer to the spatial relationship between their locations, such as both events occurring in the same location, or events occurring in different locations but with related locations (e.g., indoors / outdoors). The behavioral logic of a character within a role's events can refer to the connection between their actions, such as whether their actions in both events are related to a common goal, or whether their actions in the two events have a causal relationship.
[0090] Specifically, when sorting character events, at least one character event can be initially sorted according to the chronological order of time intervals. If multiple target character events with overlapping time intervals exist in the initially sorted character events, their order in the initial sorting is adjusted according to their spatial position to obtain at least one sorted character event. The sorted at least one character event is then validated through the character's behavioral logic. If there are logical contradictions in the character behavior among the sorted character events, the sorting of at least one character event is adjusted.
[0091] Overlapping time intervals can refer to situations where at least two character events occur at the same time or partially overlap. In such cases, it is difficult to determine the order of the character events based solely on the temporal relationship of the time intervals. Therefore, the order of the character events can be determined by the spatial relationship of the locations where the events occur and the character's behavioral logic.
[0092] For example, consider three simplified events involving Xiaohong: Xiaohong getting an extracurricular book from the classroom on the third floor, Xiaohong reading an extracurricular book in the library on the fifth floor, and Xiaohong returning the extracurricular book to the teacher in the office on the fourth floor. All three events occur between 10:00 AM and 10:30 AM. Due to the overlapping timeframes, it's difficult to sequence the events. The locations of the events are: the classroom on the third floor, the library on the fifth floor, and the office on the fourth floor. Based on the spatial relationship of the locations, the sequence could be: Xiaohong getting an extracurricular book from the classroom on the third floor - Xiaohong returning the book to the teacher in the office on the fourth floor - Xiaohong reading the book in the library on the fifth floor. However, by verifying the behavioral logic, the action of "returning the book" should occur after the action of "reading the book," not before. Therefore, the sequence should be adjusted to: Xiaohong getting an extracurricular book from the classroom on the third floor - Xiaohong reading the book in the library on the fifth floor - Xiaohong returning the book to the teacher in the office on the fourth floor.
[0093] Of course, when summarizing the storyline based on character events, one can also consider the character's emotional and psychological changes during each event. This embodiment can determine at least one storyline for a character based on the relationships between multiple character events. After obtaining the storyline, the type of the character's storyline can be determined based on the script's main plot summary, the plot summary of the target scene, and the character's tags. Alternatively, in another optional embodiment, if a character has only one event in the script, then that character's storyline can be the event development line within that single event, and the type of the storyline can be the type of that event.
[0094] Of course, in another alternative embodiment, tags related to the plot in a preset tag set can also be referenced to divide the plot rhythm of the script, thereby determining character events and storylines. (See also...) Figure 2 , Figure 2 A schematic diagram of the structure of a script provided in this application embodiment, such as Figure 2 As shown, a TV series can include 18 episodes. Each episode's script can be divided into one or more scenes, each scene corresponding to a specific setting. For the same target character, multiple tags can be summarized based on the script content of each scene, along with scene type tags. These scene type tags can define the overall plot pacing of the series. For example... Figure 2 As shown, events can be categorized into motivation, intention, clues, arc, climax, turning point, foreshadowing, ending, and beginning. When determining character events, based on character tags and the defined plot rhythm, the entire series can be divided into seven character events. Through correlation analysis between these events, they can be further divided into Event 1, Event 2, Event 3, and Event 4 for the target character. Multiple storylines for the target character are obtained based on the same event, and the character's settings are abstracted from multiple tags, including external persona such as personality and profession, or aspects such as changes, growth processes, and inner truths, like inner needs or internal transformations and growth. Figure 2 This is just an example to illustrate the script content processing here.
[0095] This embodiment, based on multiple character tags, can obtain not only the aforementioned character events and storylines, but also the character's setting. The character setting refers to various aspects of the character, including personality (extroverted or introverted, etc.), background (family, experiences, etc.), motivation (primary motivation, goals, etc.), and behavior (speaking style, behavioral habits, etc.). In this embodiment, the character setting can be mainly divided into external persona and internal persona, and the specific process is as follows:
[0096] Calculate the similarity between any two character tags in the target character's character tag set to obtain at least one character tag group. The similarity of each character tag in the same character tag group meets the threshold requirement. Input each character tag group into the large model to summarize the content and obtain the target character's role setting in the script.
[0097] The similarity threshold can be determined based on actual requirements, and this embodiment does not impose any limitations. This embodiment can determine the similarity between any two character tags in the tag set by vectorizing the tags and then calculating the cosine of the angle between them. At least one character tag pair with high similarity is selected and input into the large model for content summarization. In the large model, the input at least one character tag pair can be specifically mapped to categories such as the character's motivation, behavior, emotions, and turning points, thereby abstracting the character's inner and outer personas. Furthermore, in the large model, the character's events and character tag set can also be combined and specifically mapped to categories such as the character's motivation, behavior, emotions, and turning points, thereby abstracting the character's personality traits.
[0098] S12. Write a character introduction based on the target character's character setting and storyline.
[0099] The character introduction can refer to a summary of the character's portrayal within the entire script, facilitating a quick understanding of the character's role, core traits, key background, and behavioral storyline. This embodiment uses the character setting and storyline as the main framework for content writing, generating a character introduction. Specifically, in this embodiment, the process of obtaining the character introduction can be as follows:
[0100] The character settings and storyline of the target character are input into the natural language model. The natural language model then generates content based on the character settings and storyline of the target character, according to the preset output content guide words, to obtain the character introduction of the target character.
[0101] For example, the character Xiao Lü is set up as an elementary school student who likes to grow flowers. Her storyline is as follows: after learning that the school's flower bed was damaged by a rainstorm, she leads her classmates to repair the flower bed and replant flowers and plants in order to restore it.
[0102] The character settings and storyline of Xiao Lü were input into the natural language model for writing. The output guide word was: Xiao Lü's behavioral summary. The natural language model output Xiao Ming's character introduction: A primary school student who likes to plant flowers. A rainstorm destroyed the flower bed at the school gate. After learning about it, Xiao Ming was very anxious to see the damaged flower bed. So he took the initiative to lead his classmates to clean up the debris in the flower bed, loosen the soil, and replant various flowers and plants. In the end, with the joint efforts of Xiao Ming and his classmates, the flower bed was restored to life.
[0103] Here, a natural language model can refer to an artificial intelligence model specifically designed to understand and generate human language (natural language). Output guide words can refer to the pre-defined type of the character introduction, which may include internal / external conflict, character arc, emotional arc, etc. The natural language model can output corresponding character introductions based on the output guide words. For example, when the output guide words are "internal / external conflict," the natural language model will focus on describing the character's internal and external aspects, and then elaborate on the details of the internal and external conflicts. In addition to the character's background and storyline in the script, the natural language model can also include a summary of the main plot and the script's genre (such as romance or suspense) as supplementary information when generating character introductions.
[0104] This document describes the script processing procedure in this embodiment using a specific example. This embodiment can include four layers: a scene tagging layer, an event splicing layer, a character design summarization layer, and a comment output layer. The scene tagging layer processes the script content within a single scene, used to assign semantic tags (character tags) to characters. The event splicing layer processes the semantic tags of the same character across multiple scenes, used to create semantically continuous character events. The character design summarization layer processes the complete set of character events and tags for a single character, used to extract character settings. The comment output layer processes character settings and the character's storyline, used to generate character introductions.
[0105] For the character "Chen Lin" in the script, taking scene ID S08 as an example, the text content of scene ID S08 in the script is input into the scene tag layer. The scene tag layer outputs the character's character tag based on the relevant text description of the character "Chen Lin" contained in the scene. The data structure output by the scene tag layer can be as follows:
[0106] {"scene_id"S08",
[0107] “char” “Chen Lin”
[0108] "tags" ["seeking recognition", "emotional advancement", "emotional release"];
[0109] This yields a set of tags for the character "Chen Lin" across all episodes: ["Returning home to start a business", "Seeking recognition", "Exposing weaknesses", "Emotional progression", "Emotional release", "Growth trigger"].
[0110] The set of tags for the character "Chen Lin" is input into the event concatenation layer. At least one scene with similar character tags and adjacent scene times is grouped into scenes of the same character event, thereby obtaining at least one character event for the character "Chen Lin". The relationships between multiple character events for the character "Chen Lin" are analyzed to determine the storyline and type of the character "Chen Lin". The data structure of a character event output by the event concatenation layer can be as follows:
[0111] {"event_id" "E3",
[0112] “char” “Chen Lin”
[0113] "theme" and "emotional line"
[0114] "scene_span"["S08","S09","S11"],
[0115] "tags" ["returning home to start a business", "seeking recognition", "exposing weaknesses", "emotional drive", "emotional release", "growth trigger"]};
[0116] In this embodiment, the scenes with similar character tags and adjacent times for the character "Chen Lin" are: S08, S09, and S11. These three scenes can be grouped into one character event for the character "Chen Lin", with the character event ID being E3, and the storyline type to which this character event belongs is the emotional storyline.
[0117] Input all character events and character tags for the character "Chen Lin" into the character design summary layer. Analyze the motivations, behaviors, emotions, and turning points of the character "Chen Lin" based on the character events and character tag sets, and abstract the external and internal character designs of "Chen Lin". The data structure output by the character design summary layer can be as follows:
[0118] {"char"ChenLin",
[0119] “outer”{“Occupation”: “Coffee shop owner”, “Personality”: [“Enthusiastic”, “Extroverted”, “Enthusiastic”], “Social Identity”: “Young entrepreneur returning to his hometown”},
[0120] “inner” {“core desires”: “to be affirmed and understood”, “deep fears”: “loneliness and failure”, “key weaknesses”: “overly pleasing and self-denying”, “growth trends”: “learning to confide in others and accept oneself”}};
[0121] Input the character settings and storyline of "Chen Lin" obtained above, along with some script auxiliary information, into the comment output layer to generate a character introduction for "Chen Lin". When the output content guide word is "character arc", the character introduction output by the comment output layer can be as follows:
[0122] Chen Lin: On the surface, she is a warm and cheerful coffee shop owner, but deep down she is always afraid of loneliness and rejection. After experiencing emotional distress in the city, she returns to her hometown to seek self-redemption. In interpersonal interactions, she frequently suppresses her true feelings and gradually learns to face her emotions and express her vulnerability. Overall, she presents a dual personality arc of "bright on the surface and fluctuating inside".
[0123] This application provides a method for generating character introductions in a script. This method extracts the associated text content of a target character in each scene of the script. By analyzing this associated text content, at least one character tag for the target character in each scene is generated, resulting in a set of character tags for the target character. Based on multiple character tags in the target character's tag set, at least one character event involving the target character in the script, as well as the target character's role setting, can be determined. The at least one character event of the target character is then sorted according to at least one event logic to obtain the target character's storyline in the script. Based on the target character's role setting and storyline in the script, a character introduction is written to obtain the target character's introduction. This method analyzes text content associated with the character to determine the corresponding character tags, analyzes the character tags to obtain information such as the character's character events and role setting, and summarizes and writes the character introduction to objectively describe the character in the script, avoiding the differences caused by subjective human analysis, and providing an objective reference for character analysis in scripts.
[0124] The above describes a method for generating character profiles in a script according to embodiments of this application. The following describes an apparatus for applying the above-described method for generating character profiles in a script.
[0125] Please see Figure 3 , Figure 3 This is a schematic diagram of a character introduction generation device for a script provided in an embodiment of this application. Figure 3 As shown, the character introduction generation device in this script may include:
[0126] The tag extraction unit 100 is used to extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character.
[0127] The tag analysis unit 110 is used to determine at least one character event and character setting of the target character in the script based on at least one character tag of the target character in the character tag set, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script.
[0128] Information generation unit 120 is used to write and obtain a character introduction of the target character based on the character setting and storyline of the target character.
[0129] In one possible implementation, the tag acquisition unit 100 extracts the associated text content of the target character in each scene of the script, analyzes the associated text content of the target character, and generates at least one character tag for the target character in each scene. This can be specifically configured as follows:
[0130] Identify and extract the relevant text content of the target character in each scene of the script. Input the relevant text content and prompt words into the large model. The prompt words are text that guides the output content of the large model, so that the large model can extract the key description of the relevant text content based on the prompt words. Extract at least one character tag of the target character from the key description. Obtain at least one character tag output by the large model. Find the tag that is most similar to each character tag output by the large model in the preset tag set. Use the found tags as the character tags of the target character in each scene.
[0131] In one possible implementation, each scene has a background, and the tag analysis unit 110 determines at least one character event of the target character in the script based on at least one character tag of the target character in the character tag set. This can be specifically configured as follows:
[0132] At least one scene group is obtained from all scenes in the script. Each scene group includes multiple adjacent scenes, and the similarity of the character tags of the target character in each scene of the same scene group meets the threshold requirement. Based on the character tags of the target character in each scene of the same scene group, the character behavior of the target character in the scene group is determined. The background of each scene in the same scene group is associated as the background of the scene group. The logical relationship between the character behavior and the background is established, and the character behavior and the background of the scene group are reconstructed into coherent narrative sentences according to the logical relationship to obtain the character events that occur in the scene group.
[0133] In one possible implementation, the tag analysis unit 110 determines the role setting of the target role based on at least one role tag of the target role in the role tag set, which can be specifically configured as follows:
[0134] Calculate the similarity between any two character tags in the target character's character tag set to obtain at least one character tag group. The similarity of each character tag in the same character tag group meets the threshold requirement. Input each character tag group into the large model to summarize the content and obtain the target character's role setting in the script.
[0135] In one possible implementation, the tag analysis unit 110 sorts at least one character event of the target character according to at least one event logic to obtain the target character's storyline in the script. This can be specifically configured as follows:
[0136] Analyze the temporal sequence of events involving at least one character, the spatial relationship between the locations of these events, and the character's behavioral logic within these events. Perform a preliminary sorting of these events based on one of the following: temporal sequence, spatial relationship, or behavioral logic. Adjust the preliminary sorting of these events using other sorting methods besides the target sorting method. Analyze and obtain the event logic chain within the adjusted preliminary sorting of these events, identifying this event logic chain as the target character's storyline in the script.
[0137] In one possible implementation, the information generation unit 120 can be specifically configured as follows:
[0138] The character settings and storyline of the target character are input into the natural language model. The natural language model then generates content based on the character settings and storyline of the target character, according to the preset output content guide words, to obtain the character introduction of the target character.
[0139] This application also provides an electronic device in its embodiments. (See reference...) Figure 4 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), and desktop computers. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0140] like Figure 4 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. When the electronic device is powered on, the RAM 403 also stores various programs and data required for the operation of the electronic device. The processing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0141] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, memory cards, hard drives, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0142] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the character introduction generation methods in a script provided in this application.
[0143] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the character introduction generation methods in a script provided in this application.
[0144] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0146] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0147] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0148] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0149] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0150] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for generating character introductions in a script, characterized in that, The method includes: Extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character; Based on at least one character tag of the target character in the character tag set, determine at least one character event and character setting of the target character in the script, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script; Based on the character settings and storyline of the target character, a character introduction of the target character is written.
2. The method for generating character introductions in a script according to claim 1, characterized in that, The process involves extracting the associated text content of the target character in each scene of the script, analyzing the associated text content of the target character, and generating at least one character tag for the target character in each scene, including: Identify and extract the associated text content of the target character in each scene of the script, and input the associated text content and prompt words into the large model. The prompt words are text that guides the output content of the large model, so that the large model can extract the key description of the associated text content based on the prompt words, and extract at least one character tag of the target character from the key description. Obtain at least one character tag from the output of the large model, find the tag most similar to each character tag from the output of the large model in the preset tag set, and use each found tag as the character tag of the target character in each scene.
3. The method for generating character introductions in a script according to claim 1, characterized in that, Each scene has a background. Based on at least one character tag of the target character in the character tag set, at least one character event of the target character in the script is determined, including: At least one scene group is obtained from all scenes in the script, each scene group includes multiple adjacent scenes, and the similarity of the character tag of the target character in each scene of the same scene group meets the threshold requirement. Based on the target character's character tags in each session of the same session group, determine the target character's character behavior in that session group; The background of each match within the same match group is used as the background of the match group. Establish the logical relationship between the character's behavior and the background, and reconstruct the character's behavior and the background of the scene group into a coherent narrative statement according to the logical relationship, so as to obtain the character events that occur to the target character in the scene group.
4. The method for generating character introductions in a script according to claim 1, characterized in that, Determine the character settings of the target character based on at least one character tag of the target character in the character tag set, including: Calculate the similarity between any two character tags in the character tag set of the target character to obtain at least one character tag group, and the similarity of each character tag in the same character tag group meets the threshold requirement; Input each character tag group into the large model to summarize the content and obtain the character setting of the target character in the script.
5. The method for generating character introductions in a script according to claim 1, characterized in that, The step of sorting at least one character event of the target character according to at least one event logic to obtain the storyline of the target character in the script includes: Analyze the temporal sequence of events between the at least one character, the spatial relationship between the locations of events between the at least one character, and the behavioral logic of the character in the at least one character event; Based on one of the following sorting methods—the chronological order of the time intervals, the spatial order, and the behavioral logic of the characters—at least one character's events are initially sorted. The initial order of at least one character event is adjusted sequentially using sorting methods other than the target sorting method. Analyze and obtain the event logic chain in at least one character's events after the initial sorting is adjusted, and determine the event logic chain as the story line of the target character in the script.
6. The method for generating character introductions in a script according to claim 1, characterized in that, The process of writing a character profile based on the target character's character settings and storyline, including: The character settings and storyline of the target character are input into a natural language model. The natural language model generates content based on the character settings and storyline of the target character according to preset output content guide words, thereby obtaining the character introduction of the target character.
7. A device for generating character introductions in a script, characterized in that, The device includes: The tag extraction unit is used to extract the associated text content of the target character in each scene of the script, analyze the associated text content of the target character, generate at least one character tag for the target character in each scene, and obtain the character tag set of the target character. The tag analysis unit is used to determine at least one character event and character setting of the target character in the script based on at least one character tag of the target character in the character tag set, sort the at least one character event of the target character according to at least one event logic, and obtain the story line of the target character in the script. The information generation unit is used to write a character introduction of the target character based on the character settings and storyline of the target character.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the character profile generation method in a script as described in any one of claims 1 to 6.
9. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the character profile generation method in a script as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the character introduction generation method in a script as described in any one of claims 1 to 6.