Narrative emotion controllable long story generation method and system

By generating target story outlines, character control parameters, and emotion control parameters, and combining them with a layered generation strategy, the problem of uncontrollable global narrative emotions in long stories was solved, achieving improved emotional consistency and logical coherence, and enhancing the user experience.

CN121389989BActive Publication Date: 2026-06-19INST OF AUTOMATION CHINESE ACAD OF SCI +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INST OF AUTOMATION CHINESE ACAD OF SCI
Filing Date
2025-09-24
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing automatic story generation technologies struggle to achieve overall narrative emotional control in long stories, leading to plot fragmentation, character conflicts, and discontinuous emotional development, and lacking explicit control methods.

Method used

By generating target story outlines, character control parameters, and emotion control parameters, and combining them with a layered generation strategy, the emotional consistency and logical coherence of long stories are ensured. A large language model is used for consistency judgment and iterative adjustment.

Benefits of technology

It achieves precise control over the emotional evolution of long stories, improves the overall consistency of the story and user experience, and ensures the coherence of the plot and the systematic development of characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121389989B_ABST
    Figure CN121389989B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for generating long-form stories with controllable narrative emotions. The method includes: generating a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters. The lower-level control parameters are generated based on upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction during story generation. Character control parameters are generated based on the upper-level control parameters and the target story outline. Emotional control parameters are generated based on each story segment in the target story outline. Based on a hierarchical generation strategy, a story generation operation is performed on the target story outline, the character control parameters, and the emotional control parameters to obtain the long-form story text. This invention achieves precise control over the emotional evolution of long-form stories, generating long-form stories that conform to a specified emotional development trajectory, thus improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for generating long stories with controllable narrative emotions. Background Technology

[0002] With the development of artificial intelligence technology, automatic story generation technology has rapidly advanced and is widely used in fields such as film, games, and psychotherapy. Typical automatic story generation techniques include layered generation, role-playing, and interactive generation.

[0003] Despite advancements in story generation using Large Language Models (LLM) methods, significant shortcomings remain in generating long stories. These shortcomings primarily manifest in two ways: First, the inability to achieve global narrative emotional control. Some methods can only control emotions at the sentence or local plot point level, failing to effectively manage the overall emotional development of a long story. Second, maintaining global consistency is difficult. When processing long stories, issues such as character inconsistencies, plot breaks, and discontinuous emotional development easily arise, affecting story coherence. Furthermore, while existing methods can extract and analyze emotional trajectories, they lack explicit control methods within the generation process.

[0004] Therefore, there is an urgent need for a method and system for generating long stories with controllable narrative emotions to solve the above problems. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention provides a method and system for generating long stories with controllable narrative emotions.

[0006] This invention provides a method for generating long-form stories with controllable narrative emotions, comprising:

[0007] Based on the story summary information, target emotional trajectory information, and lower-level control parameters, a target story outline is generated. The lower-level control parameters are generated based on the upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction of the story generation process.

[0008] Based on the upper-level control parameters and the target story outline, character control parameters are generated;

[0009] Based on each story segment in the target story outline, generate emotion control parameters;

[0010] Based on a hierarchical generation strategy, a story generation operation is performed on the target story outline, the character control parameters, and the emotion control parameters to obtain a long story text.

[0011] According to a method for generating long-form stories with controllable narrative emotion provided by the present invention, the method further includes:

[0012] Based on the large language model, a consistency judgment is made between the story summary information and the target emotional trajectory information. If the story summary information and the target emotional trajectory information conflict, the corresponding alternative emotional trajectory information is re-matched according to the story summary information.

[0013] The candidate emotional trajectory information is used as the current target emotional trajectory information.

[0014] According to a method for generating a long story with controllable narrative emotion provided by the present invention, before generating a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters, the method further includes:

[0015] Based on the story summary information and the target emotional trajectory information, determine the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text;

[0016] The upper-level control parameters are generated based on the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text.

[0017] Based on the story summary information, the target emotional trajectory information, and the upper-level control parameters, determine the stage number, stage emotional primitive, stage character emotional description text, stage key event description text, and stage conflict description text for each emotional stage.

[0018] The lower-level control parameters are generated based on the stage number, the stage emotional primitive, the stage character emotional description text, the stage key event description text, and the stage conflict description text.

[0019] The upper-level control parameters and the lower-level control parameters are subjected to logical and emotional consistency verification. If the verification results are inconsistent, new lower-level control parameters are iteratively regenerated based on the upper-level control parameters until the new lower-level control parameters are consistent with the logical and emotional consistency verification results of the upper-level control parameters.

[0020] According to the present invention, a method for generating a long story with controllable narrative emotion is provided, wherein generating character control parameters based on the upper-level control parameters and the target story outline includes:

[0021] Using the upper-level control parameters as constraints, key character information in the target story outline is extracted to obtain character function positioning information, character emotional change trajectory information, character turning point event information, character personality traits, and inter-character relationship network information.

[0022] The character control parameters are constructed based on the character's functional positioning information, the character's emotional change trajectory information, the character's turning point event information, the character's personality traits, and the relationship network information between characters.

[0023] According to the present invention, a method for generating a long story with controllable narrative emotion is provided, wherein generating emotion control parameters based on each story fragment in the target story outline includes:

[0024] Based on a preset emotion control parameter format, the emotion trajectory in each story segment of the target story outline is quantified to obtain the emotion control parameters.

[0025] According to the present invention, a method for generating a long story with controllable narrative emotion is provided. The method involves performing a story generation operation on the target story outline, the character control parameters, and the emotion control parameters based on a hierarchical generation strategy to obtain a long story text, including:

[0026] Generate a story title based on the target story outline;

[0027] Generate a character list based on the target story outline and the character control parameters;

[0028] Based on the target story outline, the character list, and the emotion control parameters of the current story segment, a scene sequence is generated;

[0029] Based on the target story outline, the character list, the scene sequence, and the emotion control parameters of the current story segment, generate dialogue content;

[0030] The story title, the character list, the scene sequence, and the dialogue content are combined to obtain the long story text.

[0031] This invention also provides a long-form story generation system with controllable narrative emotions, comprising:

[0032] The control parameter generation module is used to generate a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters. The lower-level control parameters are generated based on the upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction in the story generation process.

[0033] The character control module is used to generate character control parameters based on the upper-level control parameters and the target story outline;

[0034] The emotion control module is used to generate emotion control parameters based on each story segment in the target story outline;

[0035] The story generation module is used to perform story generation operations on the target story outline, the character control parameters, and the emotion control parameters based on a hierarchical generation strategy, to obtain a long story text.

[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a narrative emotion-controlled long story generation method as described above.

[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a narrative emotion-controlled long story generation method as described above.

[0038] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a narrative emotion-controlled long story generation method as described above.

[0039] The present invention provides a method and system for generating long stories with controllable narrative emotions. This method generates a target story outline that provides plot and emotional guidance by summarizing the story, defining the target emotional trajectory, and generating lower-level control parameters based on upper-level control parameters. Then, it generates character control parameters based on the upper-level control parameters and the target story outline, and generates emotional control parameters based on story fragments within the target story outline. Finally, it employs a layered generation strategy, combining the target story outline, character control parameters, and emotional control parameters to generate the long story text. This achieves precise control over the emotional evolution of the long story, generating a long story that conforms to a specified emotional development trajectory, thus enhancing the user experience. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this invention 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 A flowchart illustrating the narrative emotion-controlled long-form story generation method provided by this invention;

[0042] Figure 2A schematic diagram of the structure of the narrative emotion-controllable long story generation system provided by the present invention;

[0043] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0045] In existing automatic story generation technologies, emotional control is mostly limited to the sentence level or local fragment level. There is a lack of explicit modeling and control mechanisms for the overall emotional evolution trajectory of long stories, resulting in a lack of unified emotional direction in the generated stories, a fragmented story atmosphere, and difficulty in presenting a complete emotional progression effect.

[0046] Furthermore, in existing long-form story generation tasks, as the text length increases, story generation models struggle to maintain effective focus on earlier content. To address this issue, some existing methods employ segmented generation strategies, but these methods often only guarantee local coherence and lack a constraint mechanism for the overall narrative. Consequently, the generated results are prone to problems such as inconsistencies in character settings, broken plot lines, and inconsistent narrative styles, severely impacting the integrity and logic of long-form stories.

[0047] Furthermore, narrative modeling research indicates that the trajectory of emotional changes in a story is closely related to the quality of the work and reader preferences. Existing methods extract emotional trajectories (emotional arcs) and analyze their shape and dynamic characteristics, but they are mostly used for evaluation and classification, lacking explicit control methods in the generation process.

[0048] To address the problems existing in the prior art, this invention proposes using "emotional trajectory" as explicit input and gradually mapping it to the high-dimensional emotional space of each scene. This layered generation process achieves multi-granular emotional control from macro-narrative to micro-dialogue, thereby ensuring the overall emotional consistency and logical evolution of the long story. Furthermore, through a layered control process, this invention first establishes an overall story outline and narrative rhythm, and then, through character control and a layered script generation mechanism, ensures the coordination between the generation of local details and the global framework, significantly improving the overall consistency of long story generation.

[0049] Figure 1 The flowchart illustrating the narrative emotion-controlled long-form story generation method provided by this invention can be referred to. Figure 1 As shown, this invention provides a method for generating long stories with controllable narrative emotions, including:

[0050] Step 101: Generate a target story outline based on the story summary information, target emotional trajectory information, and lower-level control parameters. The story summary information refers to the input statements that outline the basic setting and overall direction of the story, such as, "An ordinary boy grows into a hero who saves the world after undergoing trials." The target story outline includes a story development line describing the overall development of the story based on key event nodes, such as, "Young Ahua lives an ordinary yet warm life in a village, unexpectedly obtaining clues to an ancient power, filled with anticipation and excitement; after embarking on his journey, he encounters betrayal and failure, the sacrifice of his companions, and the backlash of the power, causing him to almost lose confidence and fall into deep despair; with the encouragement of his mentor and self-reflection, he rekindles his fighting spirit, awakens his true power, defeats the enemy and protects the world, while regaining inner hope and peace." The lower-level control parameters are generated based on the upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process; the upper-level control parameters are used to determine the overall tone and emotional direction during the story generation process.

[0051] In this invention, an initialization operation is first performed to instantiate the large language model client and configure the API key, basic service address, and default model parameters. By calling the constructor method of the large language model client class, key parameters such as the interface key, basic URL, and default model are set, thereby achieving effective connection and communication with the large language model server.

[0052] Furthermore, it receives user input of story synopsis information (which can be a one-sentence summary to indicate the overall development of the story) and target emotional trajectory information (used to characterize narrative emotional patterns, such as specific type selection, natural language description trends, or reference story extraction).

[0053] Optionally, a filtering mechanism can be used to determine whether the story synopsis information and the target emotional trajectory information are consistent. If they are inconsistent, a re-matching mechanism can be used to regenerate an emotional trajectory that better matches the synopsis. For example, if the input story synopsis information is "a young painter pursues his faith and achieves his ideals amidst war," and the specified target emotional trajectory information is "tragedy" (i.e., the trajectory trend corresponding to the target emotional trajectory information is downward), then the accuracy of the target emotional trajectory information is evaluated. If it is determined that they do not match, a target emotional trajectory information that better matches the synopsis is regenerated (such as "Cinderella," from hope to despair to happiness, i.e., the trajectory trend corresponding to the target emotional trajectory information is downward first and then upward).

[0054] In this invention, based on the story outline information and the target emotional trajectory (emotional trajectory information after rematching), upper-level control parameters are generated, including narrative style (such as epic, realism and romanticism), global emotional change sequence (such as joy-sadness-ecstasy) and narrative rhythm distribution (such as smooth transition and concentrated climax), which are used to determine the overall tone and emotional direction of the story.

[0055] Next, lower-level control parameters are generated based on the upper-level control parameters, including emotional primitives for each stage (such as rising, falling, climax, and trough describing the trend and intensity of emotional changes), a summary of key events, the character's stage-specific emotions, and the main conflict for each stage. For example, the emotional primitive for the first act is "light and rising," the key event is "the protagonist leaving his hometown," and the corresponding main conflict is "the conflict between personal dreams and family responsibilities."

[0056] Optionally, based on the above embodiments, the method further includes:

[0057] The upper-level control parameters and the lower-level control parameters are subjected to logical and emotional consistency verification. If the verification results are inconsistent, new lower-level control parameters are iteratively regenerated based on the upper-level control parameters until the new lower-level control parameters are consistent with the logical and emotional consistency verification results of the upper-level control parameters.

[0058] In this invention, after generating upper-level and lower-level control parameters, a checking mechanism is used to verify their logical and emotional consistency. This involves comparing the degree of agreement between the lower-level stage-specific emotional primitives (corresponding to the lower-level control parameters) and the global emotional trajectory defined by the upper-level control parameters. Specifically, during the logical and emotional consistency verification process, the summary of key lower-level events, stage-specific conflicts, and character-specific emotions are compared to see if they align with the overall narrative style and the global emotional change sequence. If inconsistencies are found, the lower-level control parameters are iteratively regenerated based on the upper-level control parameters until the macro- and micro-level emotional logic are unified, resulting in lower-level control parameters that meet the criteria.

[0059] Furthermore, the story outline information, target emotional trajectory information, and lower-level control parameters are integrated and input into the large language model to generate an executable target story outline, which serves as input for subsequent steps.

[0060] Step 102: Generate character control parameters based on the upper-level control parameters and the target story outline.

[0061] In this invention, structured character control parameters are generated based on upper-level control parameters and the target story outline. These parameters include character functional positioning (e.g., protagonist, antagonist, and mentor), the trajectory of character emotional changes, pivotal events (e.g., betrayal, obtaining the truth, etc., important nodes that cause changes in the character's fate or mentality), personality traits, and the network of relationships between characters.

[0062] For example, in an adventure story, the protagonist's function is defined as an "explorer," their emotional trajectory is "from confidence to confusion to determination," their turning point is the "sacrifice of a companion," their personality trait is "resolute yet naive," and their relationship with the antagonist is "former comrade, later enemy." This approach ensures that the characters' images remain consistent with the overall narrative and emotional tone, achieving a systematic and controllable character development.

[0063] In this invention, the generation of character control parameters ensures that the characters in the story are no longer isolated emotional carriers, but are consistent with the overall narrative and global emotions, thereby achieving the systematization and controllability of character creation.

[0064] Step 103: Generate emotion control parameters based on each story segment in the target story outline.

[0065] In this invention, emotion control parameters are generated scene by scene based on the target story outline. Each scene's story fragment is mapped into a high-dimensional emotion space. The generated emotion control parameters can be represented in various forms, such as quantification using VAD emotion triples (pleasure, arousal, dominance), or modeling based on VADER emotion parameters.

[0066] For example, in a "war breaks out" scenario, the emotional control parameters might be (pleasure = 0.2, arousal = 0.9, dominance = 0.3), representing low pleasure, high arousal, and low sense of control. This invention, through this high-dimensional parameter modeling, quantifies abstract emotional trajectories into executable numerical controls to guide scene and dialogue generation in subsequent story creation, achieving fine-grained emotional control.

[0067] Step 104: Based on the hierarchical generation strategy, perform story generation operations on the target story outline, the character control parameters, and the emotion control parameters to obtain a long story text.

[0068] In this invention, a layered generation strategy is used to gradually generate a long narrative text, taking the target story outline, character control parameters, and emotion control parameters as inputs. The specific process is as follows:

[0069] First, a story title is generated. Then, a character list is generated based on character control parameters, including character names, roles, and descriptions, thus systematically defining the characters in the story. Next, based on the character list and the corresponding emotional control parameters for each part, scene-by-scene descriptions and dialogue content are generated. For example, in the "climax" scene, highly arousing scene descriptions and tense dialogues are generated; in the "valley" scene, a depressing atmosphere with low pleasure and low dominance is generated. Finally, by combining the title, character settings, scene-by-scene descriptions, and dialogues, a complete, structured long-form story text that conforms to the specified emotional development trend is generated based on a large language model, thereby ensuring that the story has controllability and consistency in both macro-narrative logic and micro-emotional details.

[0070] The present invention provides a method for generating long-form stories with controllable narrative emotions. This method generates a target story outline that provides plot and emotional guidance by summarizing the story, defining the target emotional trajectory, and generating lower-level control parameters based on upper-level control parameters. Then, it generates character control parameters based on the upper-level control parameters and the target story outline, and generates emotional control parameters based on story fragments within the target story outline. Finally, it employs a layered generation strategy, combining the target story outline, character control parameters, and emotional control parameters to generate the long-form story text. This achieves precise control over the emotional evolution of the long-form story, generating a long-form story that conforms to a specified emotional development trajectory, thus enhancing the user experience.

[0071] Based on the above embodiments, the method further includes:

[0072] Based on the large language model, a consistency judgment is made between the story summary information and the target emotional trajectory information. If the story summary information and the target emotional trajectory information conflict, the corresponding alternative emotional trajectory information is re-matched according to the story summary information.

[0073] The candidate emotional trajectory information is used as the current target emotional trajectory information.

[0074] In this invention, the large language model leverages its powerful text understanding and analysis capabilities to meticulously compare and evaluate the input story summary information with the target emotional trajectory information. Specifically, the large language model delves into the core plot, thematic direction, and potential emotional tone contained within the story summary information, while accurately interpreting the emotional direction and change patterns expressed in the target emotional trajectory information. By comprehensively considering these factors, the large language model calculates a matching score to quantify the degree of consistency between the story summary information and the target emotional trajectory information.

[0075] If the large language model determines that the match between the story summary information and the target emotional trajectory information is lower than a pre-set threshold, it indicates a significant inconsistency between the two. In this case, a re-matching operation will be automatically triggered. The re-matching operation is an automatic matching mechanism designed by the large language model based on its knowledge reserves and advanced algorithmic logic.

[0076] After the rematching operation is initiated, the large language model will use the story summary information as the core basis to conduct a comprehensive search and precise matching within its internal knowledge system and sentiment pattern database. It will comprehensively consider factors such as the story's theme, plot development, and character settings, and select the candidate sentiment trajectory information that best matches the story summary information from many possible sentiment trajectories.

[0077] For example, when a user inputs a story synopsis of "a lonely scientist exploring an unknown planet" and selects the emotional trajectory "comedy" (rising), the large language model analyzes and finds that the "comedy" emotional trajectory is inconsistent with the emotional logic of loneliness and exploration of the unknown contained in the story synopsis, resulting in a low match. Therefore, the large language model automatically triggers a rematch operation. After searching and matching, it recommends an emotional trajectory of "from sadness to joy" (falling then rising) as an alternative. This is because the "lonely scientist" may encounter many difficulties during the exploration process, leading to a low mood (sadness), and ultimately experience joy (joy) upon successfully exploring the unknown planet and achieving the goal. This emotional trajectory better aligns with the logical development of the story synopsis.

[0078] In this invention, the large language model determines the current target emotional trajectory information from the candidate emotional trajectory information obtained from multiple rematching operations, so as to replace the originally inconsistent emotional trajectory. This ensures a high degree of consistency between the emotional trajectory and the story summary information in the subsequent story generation process, laying the foundation for generating logically coherent and emotionally reasonable stories.

[0079] Based on the above embodiments, before generating the target story outline according to the story summary information, target emotional trajectory information, and lower-level control parameters, the method further includes:

[0080] Based on the story summary information and the target emotional trajectory information, determine the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text;

[0081] The upper-level control parameters are generated based on the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text.

[0082] Based on the story summary information, the target emotional trajectory information, and the upper-level control parameters, determine the stage number, stage emotional primitive, stage character emotional description text, stage key event description text, and stage conflict description text for each emotional stage.

[0083] The lower-level control parameters are generated based on the stage number, the stage emotional primitive, the stage character emotional description text, the stage key event description text, and the stage conflict description text.

[0084] In this invention, the system first receives a story synopsis and a target emotional trajectory input by the user. Based on factors such as the complexity of the plot presented in the story synopsis and the characteristics of emotional changes reflected in the target emotional trajectory, specific algorithms and rules are used to determine the number of emotional stages. For example, if the story synopsis describes an adventure story with a dramatic plot and rich emotional changes, and the target emotional trajectory shows multiple obvious emotional fluctuations, then a larger number of emotional stages may be determined.

[0085] In this invention, the global emotional change sequence is based on the target emotional trajectory information to sort out the overall emotional change trend of the whole story from beginning to end, such as whether it is from joy to sadness, or from calm to excitement.

[0086] The overall narrative style description text will combine the type of story outline (such as science fiction, fantasy, and reality) and the atmosphere created by the target emotional trajectory to determine whether the story adopts an epic and grand narrative style, a light and humorous narrative style, or a profound and restrained narrative style, and will accurately describe it in the text.

[0087] Narrative rhythm distribution describes how texts consider the tightness of the plot in the story outline and the speed of emotional changes in the target emotional trajectory to plan the narrative rhythm of the story at each stage. For example, whether to use a smooth transition rhythm to allow the plot and emotions to advance slowly, or to use a climax-concentrated rhythm to focus on intense plot and strong emotional changes at a specific stage, all presented in text form.

[0088] In this invention, based on the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text determined in the above embodiments, upper-level control parameters are generated according to a specific standard output format. Specifically, this information is filled into preset fields, for example, the number of emotional stages is stored in the Hierarchy_Count field, the global emotional change sequence is stored in the Emotion_Arc field, the overall narrative style description text is stored in the Narrative_Style field, and the narrative rhythm distribution description text is stored in the Rhythm_Distribution field, ultimately forming upper-level control parameters in a standardized format such as {"upper_controls":{"hierarchy count":"number of emotional stages", "story_arc":"global emotional change sequence", "narrative_style":"overall narrative style", "rhythm_distribution":"narrative rhythm distribution"}}.

[0089] Furthermore, based on the story summary information, target emotional trajectory information, and upper-level control parameters, the specific content of each emotional stage is further refined.

[0090] In this invention, based on the number of emotional stages determined in the upper-level control parameters, a stage number is assigned to each stage and stored in the Act_Number field.

[0091] The stage-based emotional primitives describe the trend and intensity of emotional changes at each stage. For example, rising indicates that the emotion is gradually increasing, falling indicates that the emotion is gradually decreasing, climax indicates that the emotion reaches its most intense level, and trough indicates that the emotion is at its lowest point. These are determined based on the characteristics of the stage, including the story outline and the target emotional trajectory.

[0092] The stage-specific character emotion description text combines the character settings and target emotional trajectory information from the story synopsis with the impact on the character's emotions at that stage, describing the emotional state of the character at each stage, such as happiness, sadness, or anger.

[0093] The key event description text for each stage extracts key events that occur during that emotional stage from the story synopsis information and provides a detailed description of them.

[0094] The stage conflict description text analyzes the various conflicts that exist in the story synopsis information at that stage, such as conflicts between characters, conflicts between characters and the environment, and describes them accurately in text.

[0095] After determining the stage number, stage emotional primitive, stage role emotional description text, stage key event description text, and stage conflict description text for each emotional stage, lower-level control parameters are generated according to a specific standard output format. In this invention, this information is filled into preset fields respectively. For example, the stage number is stored in the Act_Number field, the stage emotional primitive is stored in the Stage field, the stage role emotional description text is stored in the Role_Emotion field, the stage key event description text is stored in the Key_Event field, and the stage conflict description text is stored in the Conflict field. This ultimately forms lower-level control parameters in a standardized format such as {"stage_controls":{["act_number":"stage number","stage": "stage emotional primitive","role_emotion":"role emotional description","key_event":"key event description", "conflict":"stage conflict"]}}.

[0096] Based on the above embodiments, the step of generating character control parameters according to the upper-level control parameters and the target story outline includes:

[0097] Using the upper-level control parameters as constraints, key character information in the target story outline is extracted to obtain character function positioning information, character emotional change trajectory information, character turning point event information, character personality traits, and inter-character relationship network information.

[0098] The character control parameters are constructed based on the character's functional positioning information, the character's emotional change trajectory information, the character's turning point event information, the character's personality traits, and the relationship network information between characters.

[0099] In this invention, standardized upper-level control parameters are used as constraints and guidance frameworks to deeply analyze the input target story outline and accurately extract key information related to the characters.

[0100] The upper-level control parameters implicitly contain key elements such as the overall narrative direction, emotional trajectory, and plot structure of the story. Based on these elements, the first step is to analyze the role each character plays in driving the plot, shaping the story's atmosphere, and conveying the theme in the target story outline, thereby determining the character's functional positioning label. For example, in an adventure story outline, based on the grand narrative style and tense emotional pace set by the upper-level control parameters, one character might be positioned as a "brave leader," responsible for leading the team to overcome numerous difficulties; another character might be positioned as a "wise strategist," providing advice and solutions to problems for the team. These functional positioning labels are stored in the Character_Tag field of the character control parameters.

[0101] Information such as the global emotional change sequence and narrative rhythm distribution in the upper-level control parameters provides an important basis for determining the trajectory of a character's emotional changes. In this invention, by combining the specific behaviors, events encountered, and interactions with other characters of the characters in the target story outline, the author analyzes how the characters' emotions change throughout the story. For example, if the upper-level control parameters indicate that the emotional rhythm of the story is calm in the early stages, tense in the middle stages, and excited in the later stages, then a character in the story outline may start out calm and indifferent, become tense and anxious after experiencing a series of challenges, and finally be overjoyed upon achieving success. This sequence of character emotional changes is stored in the Role_Emotion_Curve field of the character control parameters.

[0102] In this invention, the emotional stages and key plot points defined by the upper-level control parameters help to accurately locate key events, i.e., turning points, that have a significant impact on character development from the target story outline. This is achieved by analyzing how these events trigger changes in a character's emotions, behavior, or fate, and recording the reasons for the turning points and specific descriptions of the key turning points. For example, in a coming-of-age story outline, based on the emotional stages set by the upper-level control parameters, a character might experience a major failure (the reason for the turning point) and then begin to reflect on their behavior and strive to change (the description of the key turning point). This information is organized and stored in the Turning_Points field of the character control parameters, presented in list form. Each turning point contains two subfields: "trigger" (the reason for the turning point) and "key event" (the description of the key turning point).

[0103] Furthermore, by comprehensively considering the story atmosphere and narrative style created by the upper-level control parameters, as well as the characters' language, behavior, and decision-making in the story outline, the character's personality traits are extracted. For example, in a humorous story outline, if a character frequently makes witty remarks and performs comical actions, then it can be inferred that the character has a humorous and witty personality; if a character consistently adheres to principles and perseveres in the face of difficulties, then their personality trait can be described as tenacious. These character personality descriptions are stored in the Personality field of the character control parameters.

[0104] In this invention, the overall story structure and plot development planned by the upper-level control parameters determine the interaction patterns and relationships between characters. By analyzing the interactions, cooperation, and conflicts between characters in the story outline, a complex network of relationships between characters is identified and described in detail using text. For example, in a family story outline, there may be multiple relationships such as father and son, husband and wife, and siblings. It is necessary to clarify the specific relationships between each character and other characters, such as "A is B's father and also has a business rivalry with C." These descriptions of the relationship networks between characters are stored in the Relation_Network field of the character control parameters.

[0105] After successfully extracting character function positioning information, character emotional change trajectory information, character turning point event information, character personality traits, and inter-character relationship network information, this information is integrated and constructed into character control parameters according to a preset standardized output format. Specifically, this information is filled into the various fields of the character control parameters, forming a standardized format of character control parameters such as "character_controls": [{"character_tag":"character function positioning tag","role_emotion_curve":"character emotional change sequence","turning_points": [{"trigger":"triggers the reason for the turning point","keyevent":"key turning point description"}],"character_personality":"character personality","character_relationship_network":"character's relationship network with other characters"}]}, so that this character information can be accurately and conveniently called and used in subsequent story generation or other related processing.

[0106] Based on the above embodiments, the step of generating emotion control parameters based on each story segment in the target story outline includes:

[0107] Based on a preset emotion control parameter format, the emotion trajectory in each story segment of the target story outline is quantified to obtain the emotion control parameters.

[0108] In this invention, a standardized format for emotion control parameters is pre-defined to provide a unified standard for subsequent quantification. This format is presented in a structure containing specific fields: the Scene field stores the scene number, identifying different segments in the story; the Valence field stores the pleasure score, reflecting the degree of pleasure or pain experienced by the story segment; the Arousal field stores the arousal score, reflecting the excitement or calm state evoked by the story segment; and the Dominance field stores the dominance score, indicating the strength of a character's control over the situation within the story segment. In this invention, these scores are all within a standardized range to ensure data consistency and comparability. An example of the standardized output format is: {"vad_curve":[{"scene": scene number, "valence": pleasure score, "arousal": arousal score, "dominance": dominance score}]}.

[0109] In this invention, the target story outline is divided into independent story segments according to the logic of plot development and scene transition. For example, an adventure story outline may be divided into different acts such as "preparations before departure", "encountering a mysterious creature", "first confrontation with the villain", and "finding key clues". Each act has its unique plot and emotional development.

[0110] Furthermore, for each story segment, based on its specific plot content, values ​​for three emotional dimensions—Valence, Arousal, and Dominance—are determined. This process requires comprehensive consideration of multiple factors:

[0111] Plot type: Positive and uplifting plots, such as the protagonist successfully overcoming difficulties and gaining friendships, usually have higher pleasure scores; while tense, exciting, and conflict-filled plots, such as war breaking out or life-or-death crises, may have lower pleasure scores but higher arousal scores. For example, in the segment "the protagonist wins the game," the pleasure score may be high, such as 0.8; the arousal score may be at a medium level, such as 0.5; and the dominance score depends on the protagonist's performance in the game. If the protagonist completely controls the pace of the game, the dominance score may be 0.7.

[0112] Character Emotional Expression: Analyzing the emotional state of characters in story segments reveals that when characters are happy or excited, their pleasure and arousal levels are likely to be high; when characters are frustrated or fearful, their pleasure levels decrease, while arousal may increase due to tension. For example, in a segment where the protagonist learns of their friend's death, pleasure levels would be very low, possibly 0.1; arousal might be higher due to sadness and shock, such as 0.7; and dominance might be lower, such as 0.2, because the protagonist often feels helpless at this time.

[0113] Overall Atmosphere Creation: The atmosphere created by story segments also affects the emotional dimension values. A warm and harmonious atmosphere corresponds to a higher level of pleasure and a moderate level of arousal; a depressing and terrifying atmosphere results in low pleasure, while the level of arousal may be higher due to fear. For example, in a segment where "a mysterious old house is filled with an eerie atmosphere," the pleasure level might be 0.2, the arousal level 0.6, and the dominance level 0.3, reflecting the character's unease and helplessness in this situation.

[0114] In this invention, emotion control parameters can be represented in various forms to adapt to different needs and scenarios. For example, the VAD (Valence, Arousal, and Dominance) emotional triad is quantified using three values: pleasure, arousal, and dominance. As in the above embodiment, for the "war outbreak" scenario, the quantification result might be (Valence=0.2, Arousal=0.9, Dominance=0.3), indicating that the scenario brings low pleasure, high arousal, and low sense of control.

[0115] VADER sentiment parameters: Based on the VADER sentiment analysis model, four parameters are used to characterize the sentiment tendency and intensity corresponding to the plot: positive (positive sentiment score), negative (negative sentiment score), neutral (neutral sentiment score), and compound (composite sentiment score). For example, for the plot of "war breaks out," the VADER sentiment parameters might be (positive=0.05, negative=0.72, neutral=0.23, compound=−0.65), indicating that the plot has a significant negative sentiment tendency.

[0116] Furthermore, taking the VAD emotional triad as an example, the quantified pleasure, arousal, and dominance scores for each story segment are filled into the corresponding fields along with the corresponding scene number, according to a preset standardized output format, forming complete emotional control parameters. For example, the emotional control parameters generated for the aforementioned story segments. These emotional control parameters will guide the generation of scenes and dialogues in the story generation module, achieving fine-grained emotional control and enabling the generated story to accurately present the preset emotional trajectory.

[0117] Based on the above embodiments, the step of performing story generation operations on the target story outline, the character control parameters, and the emotion control parameters using a hierarchical generation strategy to obtain a long story text includes:

[0118] Generate a story title based on the target story outline;

[0119] Generate a character list based on the target story outline and the character control parameters;

[0120] Based on the target story outline, the character list, and the emotion control parameters of the current story segment, a scene sequence is generated;

[0121] Based on the target story outline, the character list, the scene sequence, and the emotion control parameters of the current story segment, generate dialogue content;

[0122] The story title, the character list, the scene sequence, and the dialogue content are combined to obtain the long story text.

[0123] In this invention, the target story outline is first analyzed in depth to fully grasp key elements such as the core theme, main plot development, and overall narrative style. For example, if the story outline revolves around a solitary scientist exploring an unknown planet, and the narrative style is set as epic, the title generation submodule will integrate this information and use its own algorithms and logic to generate a title like "The Legend of the Lone Star," which accurately reflects the story's theme and aligns with the epic narrative style. The title must be highly concise and attractive, clearly conveying the core highlights of the story and stimulating the reader's interest.

[0124] Furthermore, a character list is generated based on the target story outline and character control parameters. First, basic information about the characters and general plot connections are obtained from the target story outline. Then, combined with the character control parameters, which include detailed information such as the character's functional positioning tags (e.g., protagonist, antagonist, supporting character), the sequence of emotional changes, character personality descriptions, turning points in the character's development, and descriptions of the character's relationship network with other characters, this information is then integrated and analyzed to determine a suitable name for each character and further clarify their functional positioning and detailed character description. For example, a character named Jason is generated, positioned as an antagonist and a tragic figure. The character description is that Jason was once a highly praised adventurer who chose to betray Medea for personal gain, marrying Creon's daughter, thus triggering a series of tragic events, ultimately forming a complete character list containing the character's name, functional positioning, and character description.

[0125] Furthermore, based on the target story outline, the overall structure and plot development of the story are understood. Simultaneously, referring to the character list, the participation and behavior of each character in different plot points are clarified, combined with the emotional control parameters of the current story segment. These parameters are presented in standardized numerical form, such as the VAD emotional triad (pleasure, arousal, dominance) or VADER emotional parameters, which can accurately reflect the emotional tendency and intensity of the current story segment. In this invention, the plot text is parsed and broken down, transforming the story segments into a structured sequence of scenes. Each scene object includes fields such as "location" (e.g., outside the palace, a mysterious forest), "plot elements" (e.g., beginning, development, climax, ending), "conflict" (e.g., the confrontation between good and evil, the conflict between individual interests and collective interests), and "beat description" (detailed description of the characters' actions, expressions, and the development of events in the scene), to ensure that the plot content can be expressed and managed in a systematic way. For example, in describing the scene outside the palace, the plot element is the climax, the conflict is the opposition between the murder plan and the escape plan, the beat is described as Jason returning, Medea begins to implement the plan, pretending to regret and shedding fake tears; then, Medea instructs her children to send the poisoned gift to Creon's daughter, and the children face the imminent threat of death, the whole scene is fast-paced and the emotions reach their peak.

[0126] Next, considering the story background and plot development set in the target story outline, the personality traits, functional roles, and relationships of each character in the character list, the specific context and conflicts of the current scene in the scene sequence, and the emotional state reflected by the emotional control parameters of the current story segment, natural language processing technology and a pre-set dialogue generation algorithm are used to generate dialogue content for each character that matches their identity, personality, and current situation. This ensures that the dialogue content drives the plot forward and aligns with the character's emotions and the tension of the plot. The generated dialogue includes the character's name, actions (such as smiling, frowning, waving, etc.), and dialogue content, collectively forming the main content of the story. For example, in a tense negotiation scene, based on the characters' personalities and emotional states, one character angrily slams the table and says, "You must agree to our conditions immediately!" The other character calmly responds, "We will not compromise on unreasonable demands."

[0127] Finally, the various parts generated in the above embodiments are combined in a unified manner. Following the logical order and narrative structure of the story, the story title is placed at the beginning to guide the reader through the entire text. Next, a list of characters is introduced sequentially, giving the reader an initial understanding of the characters in the story. Then, according to the sequence of scenes, the scene descriptions, character dialogues, and other content in each scene are arranged in an orderly manner, forming a complete and coherent storyline.

[0128] During the assembly process, consistency checks are performed to ensure that the story title matches the story content, that the characters' behavior and personality are consistent across different scenes, that transitions between scenes are natural and smooth, and that dialogue fits the atmosphere and plot development. The final output is a structured, full-length story text, presenting readers with a complete and engaging narrative.

[0129] Furthermore, the entire story generation process includes error handling and fault tolerance mechanisms, as well as configuration management mechanisms. The error handling and fault tolerance mechanisms employ multi-layered retry strategies in key processes. When an exception occurs during the execution of a component, it can revert to a previous stable standard data state via an error recovery prompt template. The large language model client has a retry function; when a network interruption or temporary unavailability of the model service occurs, a retry operation will be automatically executed, thereby improving the overall stability and reliability of the operation.

[0130] In this invention, a modular configuration management approach can also be introduced, which centrally manages API parameters, model settings, iteration control options, and parallel processing switches through configuration files. This enhances the configurability and scalability of the large language model system, enabling flexible adjustment of system operating characteristics according to specific needs. It also facilitates developers in expanding new functions or optimizing and upgrading existing algorithms.

[0131] This invention can use all current mainstream pre-trained models as agents, and can generate a complete story from an input outline without additional model training. For example, by inputting a story example or directly specifying several typical emotional development patterns to a large language model, the evolution of the plot can be guided and constrained, thereby generating a long story with a specified emotional development trend, and realizing the control of the overall emotional development trend of the story narrative.

[0132] Furthermore, in addition to general-purpose large language models, this invention can also employ open-source or commercial models such as Gemini, Claude, Qwen, Deepseek, and LLaMA. These models can be accessed via API calls or deployed locally, and fine-tuned pre-trained models can also be used. Simultaneously, a multi-model integration strategy can be adopted, with different functional modules calling their respective dedicated models. Through collaborative optimization of model combinations, the overall generation effect and quality can be improved.

[0133] Furthermore, regarding the methods of emotion representation, in addition to using VAD triples, this invention can also employ the PAD model, the Plutchik emotion wheel, and the Ekman basic emotion set, or even a custom multi-dimensional emotion parameter system, to adapt to the emotion modeling needs of different cultures, languages, and application scenarios. As for the input method of emotion trajectories, emotion trajectories can be input by users drawing visual curves, automatically extracted from reference works, or constructed through sequences of emotion keywords. In addition, candidate emotion trajectories can be automatically generated based on story type, target audience, etc., for users to directly select or further adjust.

[0134] The technical solution of this invention can be used for generating all long narratives, including novels, drama scripts, game scripts, film and television scripts, and murder mystery games. It can also be extended to fields such as education and psychology. In education, it can be used to automatically generate entertaining and educational stories to assist teaching. In the field of mental health, it can generate stories that meet specific emotional regulation needs to assist in psychological counseling.

[0135] Specifically, in the creation of film and television scripts and literary works, this invention can serve as an auxiliary creative tool, helping creators quickly generate long stories that conform to the expected emotional development trend. Directors and screenwriters can verify different versions of the story with different emotional directions in the early stages, and discover and adjust the narrative rhythm or character turning points in advance, thereby reducing the cost of large-scale revisions in the later stages.

[0136] In role-playing games and interactive narrative games, players' emotional experiences are closely related to the plot's development. This invention can generate plots based on the emotional trajectory set by the designer, ensuring that character development aligns with the story's atmosphere. Development teams can use this technology to guarantee logical coherence and emotional consistency across multiple storylines, thereby significantly enhancing player immersion and increasing the game's playability and commercial value.

[0137] In the field of mental health, this invention can generate customized stories based on user-provided emotional curves, thereby achieving personalized emotional intervention. By transforming the user's emotional state into a storyline, the user can not only experience emotional resonance within the story but also engage in self-reflection and emotional regulation through role-playing and situational immersion. This approach can assist mental health counselors in more effectively understanding the trajectory of users' emotional changes, enhancing the targetedness and precision of psychological interventions.

[0138] This invention, through explicit emotion control and automated generation mechanisms, reduces reliance on professional screenwriters and script revision teams, significantly lowering the human and time costs of creating long-form stories. Whether it's film and television production companies, game development teams, or individual creators and independent studios, all can leverage this technology to obtain high-quality text outputs with lower investment, thereby expanding the innovation space of digital entertainment and the creative industries, and possessing significant economic benefits and industrial promotion value.

[0139] This invention proposes a narrative emotion-controlled long-form story generation method based on a large language model. Through a multi-layered global-local emotion control mechanism, it achieves the unity of macro-narrative logic and micro-emotional details, overcoming the problems of emotional fragmentation and logical incoherence in traditional generation methods. The introduction of character control parameters makes character shaping systematic and consistent, avoiding the problem of disconnect between character behavior and emotional expression. The modular layered pipeline architecture supports flexible expansion and replacement, improving the system's adaptability and versatility. Combined with error recovery, retry strategies, and centralized configuration management mechanisms, it ensures the robustness, controllability, and cross-scenario applicability of the overall system, thereby significantly improving the quality and stability of long-form story generation.

[0140] In addition, this invention employs a standardized format to facilitate the flow of parameters and data between modules, ensuring the system's structure and scalability; it proposes a multi-stage matching and re-matching mechanism to achieve dynamic adaptation of story outlines and emotional trajectories; through a consistency verification mechanism between upper-level and lower-level control parameters, it achieves the unification of global and local emotional logic; character control parameters cover functional positioning, emotional curves, turning points, and relationship networks, ensuring the systematization and controllability of character development; based on high-dimensional emotional control parameter modeling, it transforms abstract emotional trajectories into executable numerical controls, supporting fine-grained scene and dialogue generation; and it introduces a hierarchical story generation framework, generating titles, characters, scenes, and dialogues sequentially based on a large language model, thereby constructing an efficient, reliable, and emotionally narrative-controllable long-form story generation method.

[0141] The narrative emotion controllable long story generation system provided by this invention will be described below. The narrative emotion controllable long story generation system described below and the narrative emotion controllable long story generation method described above can be referred to in correspondence.

[0142] Figure 2 This is a schematic diagram of the structure of the narrative emotion-controllable long-form story generation system provided by the present invention, as shown below. Figure 2As shown, this invention provides a narrative emotion-controllable long-form story generation system, including a control parameter generation module 201, a character control module 202, an emotion control module 203, and a story generation module 204. The control parameter generation module 201 generates a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters. The lower-level control parameters are generated based on upper-level control parameters and provide plot guidance and emotional control for the story generation process. The upper-level control parameters determine the overall tone and emotional direction during story generation. The character control module 202 generates character control parameters based on the upper-level control parameters and the target story outline. The emotion control module 203 generates emotion control parameters based on each story segment in the target story outline. The story generation module 204 performs story generation operations on the target story outline, the character control parameters, and the emotion control parameters based on a hierarchical generation strategy to obtain a long-form story text.

[0143] The narrative emotion controllable long-form story generation system provided by this invention generates a target story outline that provides plot and emotional guidance through story summaries, target emotional trajectories, and lower-level control parameters generated based on upper-level control parameters. Then, it generates character control parameters based on the upper-level control parameters and the target story outline, and generates emotion control parameters based on story fragments in the target story outline. Finally, it adopts a layered generation strategy to generate a long-form story text by combining the target story outline, character control parameters, and emotion control parameters, thereby achieving precise control of the emotional evolution of the long-form story, generating a long-form story that conforms to the specified emotional development trajectory, and improving the user experience.

[0144] The system provided in this embodiment of the invention is used to execute the above-described method embodiments. For specific processes and details, please refer to the above embodiments, which will not be repeated here.

[0145] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 3As shown, the electronic device may include: a processor 301, a communications interface 302, a memory 303, and a communication bus 304. The processor 301, communications interface 302, and memory 303 communicate with each other via the communication bus 304. The processor 301 can call logical instructions in the memory 303 to execute a narrative emotion-controlled long-form story generation method. This method includes: generating a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters. The lower-level control parameters are generated based on upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction during the story generation process. Character control parameters are generated based on the upper-level control parameters and the target story outline. Emotional control parameters are generated based on each story segment in the target story outline. Based on a hierarchical generation strategy, a story generation operation is performed on the target story outline, the character control parameters, and the emotional control parameters to obtain the long-form story text.

[0146] Furthermore, the logical instructions in the aforementioned memory 303 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0147] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer is able to execute the narrative emotion-controllable long story generation method provided by the above methods. The method includes: generating a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters, wherein the lower-level control parameters are generated based on upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process; the upper-level control parameters are used to determine the overall tone and emotional direction in the story generation process; generating character control parameters based on the upper-level control parameters and the target story outline; generating emotional control parameters based on each story segment in the target story outline; and performing story generation operations on the target story outline, the character control parameters, and the emotional control parameters based on a hierarchical generation strategy to obtain a long story text.

[0148] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the narrative emotion-controllable long-form story generation method provided in the above embodiments. The method includes: generating a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters, wherein the lower-level control parameters are generated based on upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process; the upper-level control parameters are used to determine the overall tone and emotional direction in the story generation process; generating character control parameters based on the upper-level control parameters and the target story outline; generating emotional control parameters based on each story segment in the target story outline; and performing story generation operations on the target story outline, the character control parameters, and the emotional control parameters based on a hierarchical generation strategy to obtain a long-form story text.

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

[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating long stories with controllable narrative emotions, characterized in that, include: Based on the story summary information, target emotional trajectory information, and lower-level control parameters, a target story outline is generated. The lower-level control parameters are generated based on the upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction of the story generation process. Based on the upper-level control parameters and the target story outline, character control parameters are generated; Based on each story segment in the target story outline, generate emotion control parameters; Based on a hierarchical generation strategy, a story generation operation is performed on the target story outline, the character control parameters, and the emotion control parameters to obtain a long story text. Before generating the target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters, the method further includes: Based on the story summary information and the target emotional trajectory information, determine the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text; The upper-level control parameters are generated based on the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text. Based on the story summary information, the target emotional trajectory information, and the upper-level control parameters, determine the stage number, stage emotional primitive, stage character emotional description text, stage key event description text, and stage conflict description text for each emotional stage. The lower-level control parameters are generated based on the stage number, the stage emotional primitive, the stage character emotional description text, the stage key event description text, and the stage conflict description text.

2. The method for generating long stories with controllable narrative emotion according to claim 1, characterized in that, The method further includes: Based on the large language model, a consistency judgment is made between the story summary information and the target emotional trajectory information. If the story summary information and the target emotional trajectory information conflict, the corresponding alternative emotional trajectory information is re-matched according to the story summary information. The candidate emotional trajectory information is used as the current target emotional trajectory information.

3. The method for generating long stories with controllable narrative emotion according to claim 1, characterized in that, The method further includes: The upper-level control parameters and the lower-level control parameters are subjected to logical and emotional consistency verification. If the verification results are inconsistent, new lower-level control parameters are iteratively generated based on the upper-level control parameters until the new lower-level control parameters are consistent with the logical and emotional consistency verification results of the upper-level control parameters.

4. The method for generating long stories with controllable narrative emotion according to claim 1, characterized in that, The step of generating character control parameters based on the upper-level control parameters and the target story outline includes: Using the upper-level control parameters as constraints, key character information in the target story outline is extracted to obtain character function positioning information, character emotional change trajectory information, character turning point event information, character personality traits, and inter-character relationship network information. The character control parameters are constructed based on the character's functional positioning information, the character's emotional change trajectory information, the character's turning point event information, the character's personality traits, and the relationship network information between characters.

5. The method for generating long stories with controllable narrative emotion according to claim 1, characterized in that, The generation of emotion control parameters based on each story fragment in the target story outline includes: Based on a preset emotion control parameter format, the emotion trajectory in each story segment of the target story outline is quantified to obtain the emotion control parameters.

6. The method for generating long stories with controllable narrative emotion according to claim 1, characterized in that, The hierarchical generation strategy involves performing story generation operations on the target story outline, the character control parameters, and the emotion control parameters to obtain a long story text, including: Generate a story title based on the target story outline; Generate a character list based on the target story outline and the character control parameters; Based on the target story outline, the character list, and the emotion control parameters of the current story segment, a scene sequence is generated; Based on the target story outline, the character list, the scene sequence, and the emotion control parameters of the current story segment, generate dialogue content; The story title, the character list, the scene sequence, and the dialogue content are combined to obtain the long story text.

7. A long-form story generation system with controllable narrative emotion, characterized in that, include: The control parameter generation module is used to generate a target story outline based on story summary information, target emotional trajectory information, and lower-level control parameters. The lower-level control parameters are generated based on the upper-level control parameters and are used to provide plot guidance and emotional control for the story generation process. The upper-level control parameters are used to determine the overall tone and emotional direction in the story generation process. The character control module is used to generate character control parameters based on the upper-level control parameters and the target story outline; The emotion control module is used to generate emotion control parameters based on each story segment in the target story outline; The story generation module is used to perform story generation operations on the target story outline, the character control parameters, and the emotion control parameters based on a hierarchical generation strategy to obtain a long story text. The system is also used for: Based on the story summary information and the target emotional trajectory information, determine the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text; The upper-level control parameters are generated based on the number of emotional stages, the global emotional change sequence, the overall narrative style description text, and the narrative rhythm distribution description text. Based on the story summary information, the target emotional trajectory information, and the upper-level control parameters, determine the stage number, stage emotional primitive, stage character emotional description text, stage key event description text, and stage conflict description text for each emotional stage. The lower-level control parameters are generated based on the stage number, the stage emotional primitive, the stage character emotional description text, the stage key event description text, and the stage conflict description text.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the narrative emotion-controlled long story generation method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the narrative emotion-controlled long story generation method as described in any one of claims 1 to 6.