Large language model role interaction system based on plot driving and tool calling
By constructing a large language model character interaction system driven by plot and invoking tools, the problems of rigid character performance and lack of coherence in the interaction process in the existing system are solved. This system improves personalization, continuity and scene adaptability, and enhances the logic and practicality of the interaction.
Patent Information
- Application Number
- CN202610115084.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-01
- Estimated Expiration
- 2046-01-28
AI Technical Summary
Existing character interaction systems based on large language models have shortcomings in terms of personalization, continuity, scene adaptability, and integration of external resources. Character performances are rigid, the interaction process lacks depth, and tool calls are not naturally connected with plot development.
A large language model-based character interaction system is constructed based on plot-driven and tool-invoking, including a character mapping module, a state library module, a plot evolution module, a scene behavior constraint module, and a tool invoking module. Character mapping generates personalized language-personality traits, the state library module manages character states and plot progress, the plot evolution module drives the plot logic, the scene behavior constraint module adapts to complex scenarios, the tool invoking module integrates external tools, and the conversation generation module generates natural and coherent dialogues.
It achieves dynamic character behavior and high scene adaptation, improves the continuity, logic and practicality of interaction, enhances the personalization and immersion of character performance, and supports rule modeling and dynamic adaptation for diverse interaction scenarios.
Smart Images

Figure CN121598807B_ABST
Abstract
Description
A large language model-based character interaction system driven by plot and utilizing tools Technical Field
[0001] This invention belongs to the field of simulation, and in particular relates to a large language model character interaction system based on plot-driven and tool-calling. Background Technology
[0002] In the field of character interaction technology based on large language models, existing systems mostly focus on implementing single dialogue tasks or generating characters based on fixed templates, lacking in personalization, continuity, scene adaptability, and integration of external resources. Traditional methods typically rely on preset character attributes and dialogue scripts, making it difficult to dynamically create unique characters with distinct personalities, tones, and backgrounds based on user preferences, resulting in rigid and shallow character performances. Simultaneously, the interaction process often presents a discrete question-and-answer pattern, failing to integrate coherent plot logic and long-term dialogue memory, causing character behavior and tone to lack reasonable evolution with the progression of the plot. Furthermore, these systems generally lack rule modeling and dynamic adaptation capabilities for diverse interaction scenarios (such as classrooms, games, meetings, etc.), and cannot support random events and branching plots that conform to scene constraints. Regarding tool invocation, existing solutions often treat external functions (such as search and translation) separately from character dialogue, failing to naturally connect and integrate with the context based on plot development and character status, affecting the realism and usability of the interaction. Therefore, there is an urgent need to develop an interactive system that can deeply integrate plot-driven and intelligent tool invocation to improve the personalization, continuity, scene adaptability, and functional integration of character interactions. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention proposes a large language model-based character interaction system driven by plot and using tools, which enables dynamic, personalized, and highly scene-adaptable character behavior, and improves the continuity, logic, and practicality of the interaction.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] A large language model-based character interaction system driven by plot and utilizing tools includes:
[0006] The role mapping module is used to create parameters based on the user's input role and combine them with the role mapping parameter library to obtain the user's language-personality trait set.
[0007] The state library module is used to initialize the plot based on the user's language-personality trait set and the character-plot state library to obtain the user's initial plot parameters; the initial plot parameters include the initial character state, initial user preferences, initial plot progress and historical conversation context features.
[0008] The plot evolution module is used to initialize and advance the plot logic based on language-personality characteristic parameters and initial plot parameters, combined with a preset plot rule engine and a multi-scene behavior constraint rule library, and generate user character behavior goals, tone adjustment strategies and optional tool call requests or random branch events in real time.
[0009] The scene behavior constraint module is used to obtain a continuous scene behavior constraint rule set by combining the character scene identifier and behavior goal, tone adjustment strategy and optional tool call request or random branch event with a multi-scene behavior constraint rule library.
[0010] The tool invocation module is used to respond to the tool invocation request and obtain response result parameters by combining a preset external tool service interface;
[0011] The conversation generation module is used to obtain a set of character conversations in continuous scenes by combining a multimodal conversation model with a set of continuous scene behavior constraint rules and consistency indicators of behavior actions with speech rate, tone and micro-expressions at the same timestamp, based on behavioral goals, tone adjustment strategies, response result parameters, and initial plot progress.
[0012] Specifically, the role mapping module includes a parsing unit, a tone mapping unit, and a personality mapping unit;
[0013] The parsing unit is used to obtain a set of user role attribute keywords based on the user input text information and the configured entity-relation extraction model; the set of user role attribute keywords includes at least name, age, occupation, hobbies, and tone of voice.
[0014] The intonation mapping unit is used to obtain the intonation parameter set of the user role based on the user's age, occupation, intonation style keyword set and a preset intonation mapping relationship library; the intonation parameter set includes intonation identifier, speech rate level and language type;
[0015] The personality mapping unit is used to obtain a set of personality parameters for a user's role based on the user's age, occupation, interests, and a preset tone mapping relationship database; the personality parameter set includes a set of conversational vocabulary preferences and politeness level tags.
[0016] Specifically, the state library module includes a state initialization unit, a storage unit, and a query and update unit;
[0017] The state initialization unit is used to obtain initialization plot parameters based on the user character's tone parameter set and personality parameter set combined with a preset character-plot state library;
[0018] The storage unit is used to store initial plot parameters and dynamic context data generated during system operation; the dynamic context data includes real-time updated character status, plot progress status, historical dialogue memory, current scene identifier, and response result parameters from the tool call module.
[0019] Specifically, the plot evolution module includes a plot initialization unit and a plot deduction unit; the plot initialization unit is used to initiate a query request to the query and update unit to obtain all the context data required for the current interaction round; the context data includes the character status, user preferences, latest plot progress status and complete historical conversation context features before the current round corresponding to the current round;
[0020] The context data is parsed and extracted to obtain key historical dialogue sequences, a list of triggered key events, and character emotional state change markers; the character emotional state change markers include emotional type change markers and emotional intensity change markers under the corresponding emotional type.
[0021] The parsed and extracted context data is reorganized and encapsulated according to the data structure template required by the plot rule engine to obtain standardized context input parameters.
[0022] The plot deduction unit is used to load the standardized context input parameters and input the latest plot progress status and the list of triggered key events at the current moment into the rule base of the preset plot rule engine for rule matching, to obtain the current event node that uniquely corresponds to the current narrative position, and the set of state transition conditions associated with the current event node; wherein, the set of state transition conditions includes at least the emotional triggering conditions constructed based on the character's emotional state change markers, the dialogue triggering conditions constructed based on the core keywords in the historical dialogue sequence, and the personalized triggering conditions constructed based on the feature dimensions of user preferences;
[0023] Based on the semantic parsing results of the historical dialogue sequence and the quantitative features of the character's emotional state change markers, each condition in the state transition condition set is logically evaluated and satisfied according to a preset priority. Based on the determination results, the next event node that satisfies all mandatory conditions or a preset number of optional conditions, as well as the narrative logic rules corresponding to the next event node, are obtained from the rule base of the plot rule engine.
[0024] Based on the determined next event node and the corresponding narrative logic rules, a basic plot direction is generated, which includes a unique event identifier, a core plot text description, and an expected emotional tone tag.
[0025] Simultaneously, based on the node attributes of the next event node, the timestamp information of the plot progress status, and the node completion status rules, the updated plot progress status is calculated and output. The updated plot progress status includes at least a new node identifier, a node completion status identifier, and updated timestamp information.
[0026] Specifically, the plot progression module also includes event triggering units;
[0027] The event triggering unit is configured to: receive the basic plot direction, extract the new node identifier, node completion status identifier and updated timestamp information from the updated plot progress status as the current plot progress status feature parameters; input the current plot progress status feature parameters and the preset random trigger probability threshold into the conditional probability model constructed by the Bayesian neural network, and calculate the satisfaction judgment result of the random trigger condition.
[0028] When the satisfaction determination result is satisfied, feature matching is performed based on the expected emotional tone tag in the basic plot direction, the core plot text description and the preset random branch event library. The unique random branch event that meets the matching condition is selected from the preset random branch event library. Then, the selected random branch event is injected into the core plot text description of the basic plot direction according to the preset event injection rules, generating a plot development framework containing a unique event identifier, a core plot text description containing random branch event content, an expected emotional tone tag and an uncertain branch identifier.
[0029] When the satisfaction determination result is not satisfied, random branch events are not selected and preset event injection rules are not executed. Instead, a plot development framework containing unique event identifiers, original core plot text descriptions, expected emotional tone tags, and no uncertain branch identifiers is directly generated.
[0030] Specifically, the plot progression module also includes a decision generation unit;
[0031] The decision generation unit is configured to: receive the plot development framework, the initial character state, and the initial user preferences, and perform information integration to obtain an integrated dataset; the integrated dataset includes the core plot text description, expected emotional tone label, uncertainty branch identifier, tone parameter set and personality parameter set in the initial character state, and feature dimensions of the initial user preferences in the plot development framework.
[0032] Based on the integrated dataset, and combining semantic parsing algorithm and conditional random field target extraction algorithm, the correlation between the core plot text description, expected emotional tone label, uncertainty branch identifier and the tone parameter set and personality parameter set of the initial character state, and the feature dimension of the initial user preference of the plot development framework is analyzed to obtain the core behavioral target of the virtual character at the current plot node.
[0033] Based on the core behavioral objective, and combined with the tone parameter set and personality parameter set in the initial character state, a tone adjustment strategy that achieves the core behavioral objective and is consistent with the character's personality is derived through a matching algorithm based on cosine similarity.
[0034] Simultaneously, based on the plot logic contained in the core plot text description of the integrated dataset's plot development framework, it is determined whether the current plot advancement requires obtaining external information or services. When the determination result indicates that obtaining external information or services is required, a structured tool call request is generated according to the preset tool call request format. When the determination result indicates that obtaining external information or services is not required, no tool call request is generated. The final output is a set of behavioral decision instructions composed of the parsed core behavioral goals, the deduced tone adjustment strategies, the structured tool call request generated when the determination result indicates that it is required, and the random branch events existing in the plot development framework.
[0035] Specifically, the conversation generation module includes an input unit and a constraint parsing unit; the input unit is used to extract the behavioral objectives and tone adjustment strategies from the behavioral decision instruction set, the initial character state, the initial user preferences and response result parameters from the initial plot progress and the continuous scene behavioral constraint rule set, and to construct a conversation generation input dataset.
[0036] The constraint parsing unit generates an input dataset based on the conversation, parses the set of continuous scene behavior constraint rules, extracts behavior action norms, and calculates the consistency index of speech rate, tone, behavior action and micro-expression under the same timestamp based on the tone parameter set and the speech rate level and politeness level labels in the personality parameter set, and generates a standardized constraint condition set containing constraint thresholds and behavior action boundaries.
[0037] Specifically, the session generation module also includes a session generation unit;
[0038] The conversation generation unit obtains behavioral targets, tone adjustment strategies, response result parameters, and initial plot progress based on the conversation generation input dataset, as core driving parameters, and obtains the initial character state based on the initial plot progress.
[0039] Based on the standardized constraint set, quantitative constraint thresholds, behavioral action boundaries, and consistency judgment rules for speech rate and tone under the same timestamp are obtained to construct a dynamic constraint space.
[0040] The preset multimodal conversation model is invoked, and the core driving parameters and the language-personality feature parameters in the initial character state are input into the input encoding layer of the multimodal conversation model to obtain a unified semantic representation that integrates plot, character, tool and constraint information;
[0041] Based on the scene context adaptation layer of the current scene identifier and behavior action boundary combined with the multimodal conversation model, scene semantic enhancement is performed on the unified semantic representation to obtain the intermediate representation of scene adaptation.
[0042] Meanwhile, through the role personality feature mapping layer of the multimodal conversation model, the intonation identifier, speech rate level and conversation vocabulary preference set in the language-personality feature parameters are used as style control vectors and injected into the attention mechanism of the multimodal conversation model to obtain the generation state of personality feature enhancement.
[0043] During the generation process at each time step, the constraint verification layer based on the multimodal conversation model combines the quantization constraint threshold and the consistency judgment rule to perform real-time scoring and filtering of candidate outputs, and obtain the distribution of candidate tokens that meet the constraints.
[0044] Based on the intermediate representation adapted to the scene, the generated state of the personality feature enhancement, and the distribution of candidate tokens that satisfy the constraints, a coherent token sequence constituting the initial character conversation set is iteratively output through autoregressive decoding.
[0045] Specifically, the session generation module also includes a session optimization unit;
[0046] The session optimization unit is used to traverse the initial role session set sentence by sentence, and for each session unit, to perform a verification step, specifically:
[0047] Based on the various judgment rules in the standardized constraint set, the speech rate characteristics, tone intensity, word preference and accompanying action description of each initial role conversation are analyzed and verified to obtain the consistency deviation score and constraint violation mark verification results relative to the preset behavior target and tone adjustment strategy.
[0048] All verification results are evaluated, and based on the preset fault tolerance threshold, the initial role session set to be optimized and its corresponding specific deviation type are obtained.
[0049] The optimization process is initiated. For each target session in the initial set of character sessions to be optimized, based on its deviation type and constraint violation flag, and combined with the language-personality characteristic parameters, an optimization prompt containing specific correction instructions and character style context is constructed. This prompt drives the multimodal session model or its dedicated optimization submodule to regenerate content or make local adjustments to obtain the optimized target session.
[0050] The optimized target session is used to replace the original target session to obtain a set of role sessions in a continuous scenario that satisfies the dynamic constraint space.
[0051] Compared with the prior art, the beneficial effects of the present invention are:
[0052] This invention addresses the shortcomings of existing technologies by constructing a role mapping module that transforms user input into structured language-personality characteristic parameters. This enables precise control over the source of character personality and language style, fundamentally solving the problems of vague character personality and rigid performance in traditional interactions. The state library module provides unified management and real-time synchronization of character states, plot progress, and dialogue history, ensuring strict consistency between plot logic and character states in multi-turn interactions and effectively overcoming state drift and plot breaks. The plot evolution module, based on a preset rule engine and condition evaluation algorithm, drives dynamic plot progression and supports random branching events, making the interaction process both logical and unpredictable, significantly improving narrative continuity and appeal. The deep integration of the scene behavior constraint module and tool invocation module enables the system to adapt to complex scene rules and intelligently invoke external tools, greatly enhancing environmental adaptability and functional practicality. Finally, the conversation generation module, through multimodal fusion and multiple constraint verification, generates highly natural, distinctive, and coherent dialogues that perfectly fit the plot context, thus achieving a systemic breakthrough in immersion, intelligence, controllability, and practicality in simulation. Attached Figure Description
[0053] Figure 1 is a block diagram of the large language model character interaction system based on plot-driven and tool-calling disclosed in this invention;
[0054] Figure 2 is a flowchart of the session generation process disclosed in this invention. Detailed Implementation
[0055] Example 1
[0056] Please refer to Figure 1. One embodiment of the present invention provides a large language model-based character interaction system driven by plot and using tools, comprising:
[0057] The role mapping module is used to create parameters based on the user's input role and combine them with the role mapping parameter library to obtain the user's language-personality trait set.
[0058] It should be further explained that the role mapping module in this embodiment includes a parsing unit, a tone mapping unit, and a personality mapping unit;
[0059] The parsing unit is used to obtain a set of user role attribute keywords based on the user input text information and the configured entity-relation extraction model; the set of user role attribute keywords includes at least name, age, occupation, hobbies, and tone of voice.
[0060] It should be further noted that one implementation of the entity-relation extraction model in this embodiment includes:
[0061] A101. Based on user-input text information, the jieba word segmentation algorithm is first used for text segmentation, and the NLTK stop word list is used to perform stop word removal. Simultaneously, the jieba part-of-speech tagging tool is used for part-of-speech tagging to obtain preprocessed text fragments carrying part-of-speech information.
[0062] A102. Based on preprocessed text fragments carrying part-of-speech information, a BERT pre-trained language model fine-tuned by role attribute entity corpus is used as a feature extractor. An entity recognition sub-model is constructed by combining the conditional random field algorithm. The entity recognition sub-model performs sequence labeling and recognition on potential role-related entities corresponding to nouns, verbs and adjectives in the text fragments to obtain a set of candidate entities containing potential role attributes and the part-of-speech tags corresponding to each entity.
[0063] A103. Based on the candidate entity set and the part-of-speech tags corresponding to each entity, a bidirectional long short-term memory network model based on attention mechanism is adopted. The candidate entities and their corresponding part-of-speech tags are input into the model for semantic feature encoding to obtain the high-dimensional semantic feature vector of the candidate entities.
[0064] A104. Based on the semantic feature vector, and combined with the preset role attribute-entity relationship template library, the association degree between the candidate entity semantic feature vector and the five types of role attributes is calculated for each category. The one-to-one correspondence between the candidate entity and the five types of role attributes is extracted, and the correspondence between the candidate entity and the role attribute type and the association degree score of each correspondence are obtained. It should be further noted that the role attribute-entity relationship template library in this embodiment includes the entity feature vocabulary, part-of-speech constraint rules and attribute-entity mapping logic corresponding to the five types of role attributes: name, age, occupation, hobbies and interests, and tone style.
[0065] A105. Based on the correspondence between candidate entities and role attribute types and the relevance score of each correspondence, combined with the preset user role attribute type dictionary, the candidate entities are checked and matched for attribute type consistency. At the same time, a preset relevance score threshold is set to filter candidate entities with relevance scores lower than the threshold, and redundant entities with semantic conflicts or repeated annotations are removed. Finally, a set of user role attribute keywords containing five attribute types and corresponding entities, including name, age, occupation, hobbies, and tone style, is obtained. It should be further noted that the user role attribute type dictionary in this embodiment includes standard type definitions, standardized entity examples, and semantic boundary descriptions for the five types of role attributes.
[0066] For example, this embodiment assumes that the user inputs the text information "My name is Zhang San, I am 28 years old, I am a programmer, I usually like to play basketball and I speak directly. I hope to participate in the plot interaction in the game scene and call the translation tool to assist in communication when needed." Based on this text information, the jieba word segmentation algorithm is used for word segmentation, combined with the NLTK stop word list to remove stop words, and the preprocessed text fragment is obtained as "Zhang San, 28 years old, programmer, likes to play basketball, speaks directly, game scene translation tool to assist in communication". Based on this text fragment, the BERT + Conditional Random Field entity recognition sub-model is used to obtain the candidate entity set as "Zhang San, 28 years old, programmer, plays basketball, speaks directly, game scene translation tool". Based on the candidate entity set, the attention mechanism + bidirectional long short-term memory network model combined with the role attribute-entity relationship template library is used to obtain the correspondence between the candidate entities and the role attribute types as follows: Zhang San corresponds to name, 28 years old corresponds to age, programmer corresponds to occupation, and playing basketball corresponds to interest. The system identifies user role attributes based on their hobbies, speaking style, game scenarios, and translation tools. This is achieved by combining these attributes with a dictionary of user role attributes for matching and filtering. The resulting keyword set includes: name Zhang San, age 28, profession programmer, hobbies (basketball), direct speaking style, game scenario as the scenario identifier, and translation tool as the tool requirement. This keyword set breaks away from traditional system template limitations, dynamically generating full-dimensional role attributes based on user preferences. This lays the foundation for building a personalized language-personality trait set in the subsequent role mapping module. Furthermore, the scenario identifier and tool requirement parameters support multi-scenario behavioral constraint adaptation and real-time tool invocation, solving the problems of insufficient personalized role expression, difficulty in multi-scenario adaptation, and difficulty in integrating tool invocation with context in existing systems. This attribute set will be stored in the state library module as plot initialization parameters, ensuring the continuity and logic of plot-driven interactions.
[0067] The intonation mapping unit is used to obtain the intonation parameter set of the user role based on the user's age, occupation, intonation style keyword set and a preset intonation mapping relationship library; the intonation parameter set includes intonation identifier, speech rate level and language type;
[0068] It should be further explained that the process of obtaining the tone parameter set of the user role in this embodiment includes:
[0069] A111. Based on the age, occupation, and tone style keywords in the user role attribute keyword set output by the parsing unit, the string standardization processing method is used to regulate the expression of each keyword, unify the format of attribute values, eliminate expression differences, and obtain a standardized age-occupation tone style keyword set.
[0070] A112. Based on the standardized age-occupation tone style keyword set, a preset tone mapping relation library is retrieved. A matching algorithm based on weighted semantic similarity is used to calculate the matching degree between the standardized age keywords and the age range features in the tone mapping relation library, the matching degree between the standardized occupation keywords and the occupation type features in the tone mapping relation library, and the matching degree between the standardized tone style keywords and the tone style features in the tone mapping relation library. The tone mapping relation library in this embodiment includes candidate sets of tone identifiers, speech rate level ranges, language type adaptation rules, and weight allocation tables for each attribute of age, occupation, and tone style corresponding to different age ranges, occupation types, and tone styles.
[0071] A113. Based on the matching degree of age keywords and age range features, the matching degree of occupation keywords and occupation type features, and the matching degree of tone style keywords and tone style features, combined with the attribute weight allocation table in the tone mapping relation database, the optimal candidate parameter values of tone identifier, speech rate level, and language type are calculated by weighted summation algorithm respectively.
[0072] A114. Based on the optimal candidate parameter values of intonation identifier, speech rate level, and language type, and combined with the preset tone parameter rationality verification rules and the scene behavior constraints corresponding to the scene identifiers in the user role attribute keyword set output by the parsing unit, the optimal candidate parameter values are verified using a parameter validity verification method. Parameter values that do not conform to the character personality adaptation logic, scene constraint requirements, and tool call response tone consistency requirements are eliminated, and a user role tone parameter set containing intonation identifier, speech rate level, and language type is obtained.
[0073] The personality mapping unit is used to obtain a set of personality parameters for a user's role based on the user's age, occupation, interests, and a preset tone mapping relationship database; the personality parameter set includes a set of conversational vocabulary preferences and politeness level tags.
[0074] It should be further explained that the process of obtaining the user role's personality parameter set in this embodiment includes:
[0075] A121. Based on the age, occupation, and hobby keywords in the user role attribute keyword set output by the parsing unit, use string standardization processing method to remove redundant expressions, unify attribute value classification standards, and standardize the expression form and format of each keyword to obtain a standardized age-occupation-hobby keyword set.
[0076] A122. Based on the standardized age-occupation-interest keyword set, a preset tone mapping relation library is retrieved. A weighted semantic similarity-based matching algorithm is used to convert the standardized age, occupation, and interest keywords into low-dimensional vector representations. Cosine similarity is calculated between these vectors and the corresponding age range feature vectors, occupation type feature vectors, and interest feature vectors in the tone mapping relation library. The overall matching degree between each keyword and the corresponding features in the library is obtained by combining the weights of each attribute. The tone mapping relation library in this embodiment includes a candidate set of conversational vocabulary preferences (including domain-specific vocabulary and scenario-adaptive vocabulary) corresponding to different age ranges, occupation types, and interests, a candidate set of politeness level labels (including hierarchical politeness level definitions), and a fixed weight allocation table for each attribute of age, occupation, and interest.
[0077] A123. Based on the comprehensive matching degree of age keywords and age range features, occupation keywords and occupation type features, and interest keywords and interest features, combined with the attribute weight allocation table in the tone mapping relation database, a weighted summation algorithm is used to perform feature fusion on the candidate sets of conversational vocabulary preferences corresponding to each attribute, calculate the priority score of each candidate word, and select words with priority scores higher than a preset threshold to form the optimal candidate value of the conversational vocabulary preference set; at the same time, a weighted summation is performed on the candidate sets of politeness labels corresponding to each attribute to calculate the label adaptation score, and the label with the highest adaptation score is selected as the optimal candidate value of the politeness label;
[0078] A124. Based on the optimal candidate values of the conversational vocabulary preference set and the optimal candidate values of the politeness label, combined with the preset personality parameter rationality verification rules and the scene behavior constraints corresponding to the scene identifiers in the user role attribute keyword set output by the parsing unit, the parameter validity verification method is used to verify whether the conversational vocabulary preference set conforms to the domain characteristics corresponding to the role attributes and whether the politeness label is consistent with the scene behavior constraints. At the same time, it is verified whether there is a logical conflict between the two and the tone parameter set output by the intonation mapping unit. Candidate values with priority scores lower than the preset threshold, adaptation scores that do not meet the standards, or logical conflicts are filtered out. Finally, a user role personality parameter set containing the conversational vocabulary preference set and the politeness label is obtained.
[0079] The state library module is used to initialize the plot based on the user's language-personality trait set and the character-plot state library to obtain the user's initial plot parameters; the initial plot parameters include the initial character state, initial user preferences, initial plot progress and historical conversation context features.
[0080] It should be further noted that the state library module in this embodiment includes a state initialization unit, a storage unit, and a query and update unit;
[0081] The state initialization unit is used to obtain initial plot parameters based on the user character's tone parameter set and personality parameter set combined with a preset character-plot state library. It should be further explained that the initial character state in this embodiment carries the personalized character attributes corresponding to the user's language-personality feature set, providing a core basis for generating character behavior goals and tone adjustment strategies in the plot evolution module, ensuring the consistency of character performance. Initial user preferences are used to anchor user personalized needs, supporting multi-scenario behavior constraint adaptation and targeted tool calls, solving the problem of insufficient personalized performance in traditional systems. The initial plot progress serves as the starting point for plot-driven interaction, clarifying the plot stage the character is in, providing a foundation for the plot deduction unit to match event nodes and plan plot direction, ensuring the logic of plot evolution. Historical conversation context features are used to retain initial interaction information, providing data support for subsequent dialogue memory retrieval, continuous plot adjustment, and tone consistency verification, avoiding discrete question-and-answer sessions and improving interaction continuity.
[0082] The storage unit stores initialization plot parameters and dynamic context data generated during system operation. The dynamic context data includes real-time updated character states, plot progress states, historical dialogue memories, current scene identifiers, and response result parameters from the tool invocation module. Further explanation is needed: the real-time updated character states in this embodiment dynamically reflect changes in the character's language and personality traits, providing a real-time basis for the plot evolution module to generate appropriate behavioral goals and tone adjustment strategies, ensuring the personalization and consistency of character performance; the plot progress states record the real-time stages of plot advancement, providing data support for the plot deduction unit to match event nodes and plan plot directions, ensuring the continuity and logic of plot-driven interactions; historical dialogue memories retain past interaction information, providing memory support for subsequent dialogue responses, tone consistency checks, and plot coherence adjustments, avoiding discrete question-and-answer sessions; the current scene identifier clarifies the character's real-time scene, providing a basis for the scene behavior constraint module to match corresponding scene behavior constraint rules, solving the multi-scene adaptation problem; and the response result parameters from the tool invocation module integrate external tool output information, providing tool data support for the conversation generation module to output natural dialogue based on character states and plot requirements, solving the problem of difficulty in tool invocation and context integration.
[0083] The query and update unit is used for:
[0084] Provide a unified, real-time context data query service for the plot evolution module, scene behavior constraint module, tool call module, and session generation module;
[0085] The system receives updated plot progress status and behavior decisions from the plot evolution module, current scene identifier from the scene behavior constraint module, response result parameters from the tool invocation module, and final historical dialogue memory from the conversation generation module.
[0086] Based on the received updated data, the storage unit is driven to perform atomic storage state synchronization update operations in conjunction with the configuration text parsing algorithm.
[0087] The plot evolution module is used to initialize and advance the plot logic based on language-personality trait parameters and initial plot parameters, combined with a preset plot rule engine. It generates user character behavior goals, tone adjustment strategies, and optional tool call requests or random branch events in real time. It should be further explained that the random branch events in this embodiment refer to non-fixed plot events that are randomly triggered at key nodes in the plot advancement, based on a preset plot framework, current scene identifier, and character-personality trait parameters. These events maintain consistency with the core plot logic and adapt to user character attributes and scene constraints. The purpose is to break the single plot direction, enhance the flexibility and immersion of interaction, and solve the problem of traditional system plots lacking randomness and dynamic adjustment. Specific examples include triggering item drop prompts, sudden teammate requests for help, or random NPC interaction invitations in game scenes; triggering temporary questioning sessions, group discussion group notifications, or knowledge expansion tasks in classroom scenes; triggering temporary topic insertions, data supplementation requests, or notifications of temporary participant departures in meeting scenes; and triggering multilingual switching prompts, supplementary explanations of professional terms, or translation result verification requests in translation tool demand scenarios.
[0088] It should be further explained that the plot evolution module in this embodiment includes a plot initialization unit, a plot deduction unit, an event triggering unit, and a decision generation unit;
[0089] The plot initialization unit is used to initiate a query request to the query and update unit to obtain all the context data required for the current interaction round; the context data includes the character status, user preferences, latest plot progress status, and complete historical conversation context features before the current round corresponding to the current round;
[0090] The context data is parsed and extracted to obtain key historical dialogue sequences, a list of triggered key events, and markers of changes in character emotional states;
[0091] The parsed and extracted context data is reorganized and encapsulated according to the data structure template required by the plot rule engine to obtain standardized context input parameters;
[0092] It should be further explained that the character emotional state change marker in this embodiment includes an emotional type change marker and an emotional intensity change marker under the corresponding emotional type. In the context of this application solving the problems of insufficient personalized character performance and lack of continuity in plot interaction in traditional systems, the character emotional state change marker is the core identifier used to depict the dynamic changes of character emotions. The emotional type change marker set is a combination of identifiers containing different emotional categories (such as neutral, positive, negative, etc.) formed after classifying the key historical dialogue sequences by emotion, and is used to record the dynamic switching of the character's emotional type. The emotional intensity change marker under the corresponding emotional type is an identifier generated after quantifying the degree of expression of various emotions, and is used to accurately reflect the fluctuation of intensity under the same emotional type. Together, they provide data support for the plot deduction unit to construct emotional trigger conditions and plan the plot direction, ensuring that the character's behavior and tone adjustment fit the logic of emotional change, and improving the immersion and coherence of plot interaction.
[0093] It should be further explained that the implementation process of parsing and extracting the context data in this embodiment includes:
[0094] B101. Based on the character status, user preferences, latest plot progress status, and complete historical conversation context features of the current round, a string standardization processing algorithm is used to remove redundant characters, unify the encoding format, and standardize the expression form. Combined with the JSON data parsing algorithm, the structured fields are split according to the preset field template to clarify the attribute category of each field and obtain the standardized context data with clear field classification and unified format.
[0095] B102. Based on the complete historical conversation context features in the normalized context data, the jieba word segmentation algorithm is used for sentence segmentation and word segmentation. The bag-of-words model and TF-IDF algorithm are combined to calculate the weight value of each word in the conversation. Core words with weight values higher than the preset threshold are selected. Then, the core words are associated with the corresponding dialogue segments through the timestamp sequence alignment algorithm to extract the dialogue content containing the core words and with a coherent temporal sequence, thereby obtaining the key historical dialogue sequence. The preset threshold in this embodiment is set by the required number of extracted words and the extraction accuracy.
[0096] B103. Based on the plot node identifiers, current node positions, and key historical dialogue sequences contained in the latest plot progress status in the normalized context data, a data normalization algorithm is used to unify the text encoding format to eliminate expression differences and obtain data to be processed with a unified format.
[0097] B104. Call the BERT+CRF named entity recognition algorithm after fine-tuning the event entity corpus to perform sentence-by-sentence sequence annotation on the key historical dialogue sequence, identify event-type entities that contain event trigger words, event subjects, and event results, and use entity attribute annotation algorithm to extract the type attribute, trigger condition attribute, and trigger timestamp of each event-type entity to obtain the event entity set with attribute annotation.
[0098] B105. Based on the event entity set with attribute annotation, retrieve the plot node attribute set in the character-plot status library, and use the data normalization algorithm to unify the attribute field format of event entities and plot nodes to obtain a standardized event entity set and a standardized plot node attribute set.
[0099] B106. Using the Apriori association rule mining algorithm, analyze the association patterns between the type attributes and trigger condition attributes of standardized event entities and the matching event types and trigger thresholds of standardized plot nodes. Calculate the support and confidence of each association pattern, filter out valid association rules with support and confidence both higher than the corresponding preset thresholds, and establish a one-to-one mapping relationship between event entities and plot nodes based on the valid association rules.
[0100] B107. Based on the established mapping relationship between event entities and plot nodes, a rule matching algorithm is used to verify one by one whether each entity in the event entity set with attribute annotation has a corresponding matching plot node. At the same time, it is verified whether the triggering conditions of each entity meet the triggering threshold of the corresponding plot node. Event entities with valid matching plot nodes and triggering conditions are retained, while invalid event entities without matching plot nodes or whose triggering conditions are not met are removed to obtain a set of valid event entities.
[0101] B108. Based on the trigger timestamp information carried by each entity in the set of valid event entities, the valid event entities are sorted in chronological order using a timestamp ascending sorting algorithm. At the same time, a field structure organization method is used to supplement the core content of the event corresponding to the matching plot node identifier for each entity. Finally, a list of triggered key events containing event identifiers, event content, trigger timestamps, and matching plot node identifiers is obtained.
[0102] B109. Based on the tone parameter set in the key historical dialogue sequence and the role state, the jieba word segmentation algorithm is used to process the key historical dialogue sequence into sentences and words in turn. The NLTK stop word list is combined to perform stop word removal operation. The BosonNLP pre-trained sentiment dictionary is called to perform sentiment polarity labeling and original score extraction on the remaining words to obtain the lexical sentiment value of each word.
[0103] B110. Simultaneously, a data normalization algorithm is used to map the intonation identifiers in the intonation parameter set to intonation intensity values in a fixed range, convert speech rate levels into quantitative values, and assign language types to language type adaptation coefficients according to the adaptation scenarios, thereby obtaining preprocessed data containing word segmentation vocabulary sentiment values and standardized intonation parameters.
[0104] B111. Based on the word segmentation results in the preprocessed data, the Word2Vec word embedding algorithm (with a window size of 5 and a vector dimension of 300) is used to convert the word segments into fixed-dimensional word vectors. Combined with the TextCNN sentiment classification algorithm, a feature extraction network containing convolutional layers with three different-sized convolutional kernels and a max-pooling layer is constructed. The network weights are initialized with the sentiment scores of the sentiment dictionary pre-trained by BosonNLP. The word vectors of each round of dialogue are input into the network for sentiment feature extraction and dimensionality compression. The probability distribution of various sentiments is calculated through fully connected layers and softmax activation function. The sentiment category with the highest probability is selected as the sentiment type of the corresponding round of dialogue, and a sentiment type change label set containing neutral, positive and negative sentiment category identifiers is generated.
[0105] B112. Based on the lexical sentiment values and standardized tone parameters in the preprocessed data, a feature concatenation algorithm is used to sequentially concatenate the mean lexical sentiment values, speech rate level quantification values, intonation intensity values, and language type adaptation coefficients of each word segment into a high-dimensional feature vector. An SVM regression algorithm based on the RBF kernel function is used, and the penalty parameters and kernel function parameters are optimized through 5-fold cross-validation. The high-dimensional feature vector is then used to train and fit the model to establish a sentiment intensity quantification model. The high-dimensional feature vector of each round of dialogue is input into the model to calculate the sentiment expression intensity value normalized to the 0-10 range, and to generate a numerical sentiment intensity change label under the corresponding sentiment type.
[0106] B113. Based on the emotional type change marker set and the numerical emotional intensity change marker, a field association algorithm aligned by dialogue round is used to establish a one-to-one correspondence between the emotional type identifier and the intensity value corresponding to the same round of dialogue. The association results are integrated into a set with a unified format through a key-value pair structured organization method, and finally the character emotional state change marker containing the emotional type change marker set and the corresponding emotional intensity change marker is obtained.
[0107] The plot deduction unit is used to load the standardized context input parameters and input the latest plot progress status and the list of triggered key events at the current moment into the rule base of the preset plot rule engine for rule matching, to obtain the current event node that uniquely corresponds to the current narrative position, and the set of state transition conditions associated with the current event node; wherein, the set of state transition conditions includes at least the emotional triggering conditions constructed based on the character's emotional state change markers, the dialogue triggering conditions constructed based on the core keywords in the historical dialogue sequence, and the personalized triggering conditions constructed based on the feature dimensions of user preferences;
[0108] Based on the semantic parsing results of the historical dialogue sequence and the quantitative features of the character's emotional state change markers, each condition in the state transition condition set is logically evaluated and satisfied according to a preset priority. Based on the determination results, the next event node that satisfies all mandatory conditions or a preset number of optional conditions, as well as the narrative logic rules corresponding to the next event node, are obtained from the rule base of the plot rule engine.
[0109] Based on the determined next event node and its corresponding narrative logic rules, a basic plot development is generated, including a unique event identifier, a core plot text description, and an expected emotional tone tag. For example, when the next event node is determined to be "Project Meeting - Technical Solution Presentation," and its corresponding narrative logic rules require the character to introduce the module they are responsible for in the meeting scene, combining their "programmer" professional background with a "humorous" tone, the generated basic plot development would be: the unique event identifier is "EVT_MEETING_001," the core plot text description is: At the project review meeting on Monday, the project manager asked Xiaoming to briefly introduce the cache optimization solution he was responsible for, and Xiaoming needed to explain the technical details to the attending colleagues. The expected emotional tone tag is "professional and slightly humorous tension."
[0110] Meanwhile, based on the node attributes of the next event node, the timestamp information of the plot progress status, and the node completion status rules, the updated plot progress status is calculated and output. The updated plot progress status includes at least a new node identifier, a node completion status identifier, and updated timestamp information.
[0111] It should be further explained that the triggering conditions in this embodiment collectively provide multi-dimensional judgment criteria for the plot deduction unit, used to accurately select the next event node that conforms to the current context logic, ensuring that the plot transition not only fits the character's state and historical interactions, but also adapts to the user's personalized needs, avoiding the plot from deviating from the scene and character settings. Among them, the emotional triggering condition is based on the changes in the character's emotional type and intensity, ensuring that the plot transition conforms to the character's emotional logic; the dialogue triggering condition anchors to the core keywords of historical dialogue, echoing past interaction content and maintaining the continuity of the plot; the personalized triggering condition focuses on the user preference dimension, allowing the plot progression to adapt to user needs and enhance the personalization of the interaction. Example: Taking designer Li Si in a workplace project collaboration scenario as an example, the emotional trigger condition is set as "a project acceleration event is triggered if the emotion is neutral to positive and the intensity is ≥7" (his emotional marker is neutral to positive and the intensity is 7.3, which meets the condition); the dialogue trigger condition is set as "a tool configuration guidance event is triggered if the core keyword contains 'mind mapping tool'" (his historical dialogue core words contain this content, which meets the condition); the personalized trigger condition is set as "a collaboration task assignment event is triggered first if the user prefers 'workplace project collaboration'" (matching his preference, which meets the condition). The three together support the plot deduction unit in determining the next node as "tool configuration guidance + collaboration task assignment", ensuring that the plot progression fits the multi-dimensional context.
[0112] It should be further explained that the plot rule engine in this embodiment is used to load standardized context input parameters, receive the latest plot progress status and the list of triggered key events at the current moment, and locate the current event node that uniquely corresponds to the current narrative position through precise matching of preset rules in the rule base and input data. It also extracts the set of state transition conditions associated with this node, providing core rule support and data output for the plot deduction unit to subsequently evaluate state transition conditions and determine the next event node. Its construction method is as follows: It uses a production rule representation method to sort out the event node association logic, plot progress jump rules, and condition judgment criteria in the preset plot framework, constructing an initial rule base. The rule entries in the initial rule base include the current node identifier, input data matching mode, triggered event node, and set of state transition conditions. The Apriori association rule mining algorithm was used to analyze the association patterns between event node transitions and context data in historical plot progression data. Association rules with high support and confidence were selected to supplement the rule base, completing the rule base initialization. The Rete inference algorithm was introduced to build the core module of the inference engine, optimizing the matching efficiency of multiple rules and multiple input data, and realizing the rapid matching of the latest plot progress status, the list of triggered key events, and rules in the rule base. A data adaptation module was configured, using a data warping algorithm to convert the standardized context input parameters into a unified data format that the inference engine can recognize, ensuring data compatibility. A rule dynamic update module was added, using an incremental learning algorithm based on user interaction feedback data to periodically optimize the matching weights and condition thresholds of rules in the rule base, improving the rule engine's adaptability to the plot progression logic.
[0113] It should be further explained that the specific implementation steps of this embodiment for logically evaluating and determining the satisfaction of each condition in the state transition condition set according to a preset priority include:
[0114] C101. Based on the semantic parsing results of historical dialogue sequences, the quantitative features of character emotional state change markers, and the set of state transition conditions, a data warping algorithm is used to unify the encoding format, field dimensions, and expression standards of the three types of data. The core information of each condition in the set of state transition conditions is extracted, including condition type, judgment threshold, logical relationship (AND / OR), preset priority weight, and mandatory or optional attributes, generating a standardized condition information table and input data matrix. Among them, the semantic parsing results of historical dialogue sequences are preprocessed into fixed-dimensional semantic vectors and core keyword sets through the BERT semantic understanding model, and the quantitative features of character emotional state change markers are normalized emotional intensity values and emotional type identifiers.
[0115] C102. Based on the preset priority weights in the standardized condition information table, a priority sorting algorithm is used to sort the conditions in the state transition condition set in descending order of weight to construct a priority-ordered condition sequence. Among them, the preset priority weights of mandatory conditions are higher than those of optional conditions, and conditions of the same type are sorted according to the difference in preset weights to ensure that high-priority conditions enter the evaluation process first.
[0116] C103. Initialize the condition satisfaction status record table, use Boolean values to mark each condition satisfaction status (initially false), and set a mandatory condition satisfaction counter and an optional condition satisfaction counter (both initially 0). Call the loop iteration algorithm to traverse the priority-ordered condition sequence and extract individual target conditions in order.
[0117] C104. For a single objective condition, the satisfaction determination is performed by matching the corresponding evaluation algorithm according to its condition type. Specifically:
[0118] C1041. If the target condition is an emotion trigger condition, based on the quantitative characteristics of the character's emotion state change marker, a threshold comparison algorithm is used to compare the emotion intensity value with the preset threshold of the condition. The consistency is checked by combining the emotion type identifier with the emotion type required by the condition. If both are met, the condition is determined to be satisfied, and the corresponding entry in the satisfied state record table is updated to true. At the same time, if it is a mandatory condition, the mandatory counter is incremented by 1, and if it is an optional condition, the optional counter is incremented by 1.
[0119] C1042. If the target condition is a dialogue trigger condition, based on the semantic parsing results of the historical dialogue sequence, the cosine similarity algorithm is used to calculate the semantic similarity between the core keyword set and the condition preset keyword set. At the same time, the TF-IDF algorithm is used to calculate the keyword matching weight. When both the similarity and the weight are higher than the corresponding preset threshold, it is determined that the condition is met, and the record and counter are updated according to the rules of C1041.
[0120] C1043. If the target condition is a personalized trigger condition, based on the feature dimension data of user preferences, an SVM classification algorithm is used to construct a preference adaptation model. The personalized requirements of the target condition are used as the model input, and the adaptation result is output. If the adaptation result is "compliant", the condition is determined to be satisfied, and the records and counters are updated according to the rules of C1041.
[0121] C105. After each objective condition is evaluated, the condition dependency check algorithm is called to check the logical dependency relationship between the current condition and the evaluated high-priority conditions. If there is an "AND" logical dependency, the current condition can only be confirmed as satisfied if all evaluated high-priority conditions are satisfied. If there is an "OR" logical dependency, the current condition can be confirmed as satisfied if any evaluated high-priority condition is satisfied, and the condition satisfaction record table is corrected.
[0122] C106. After traversal, count the value of the mandatory condition satisfaction counter and the total number of mandatory conditions in the state transition condition set. If the mandatory condition satisfaction counter is equal to the total number of mandatory conditions, it is determined that all mandatory conditions are satisfied. If not all mandatory conditions are satisfied, count the value of the optional condition satisfaction counter and compare it with the preset optional condition satisfaction threshold to determine whether the preset number of optional conditions are satisfied.
[0123] C107. Output the conditional logic evaluation results, including the satisfaction status of each condition, the satisfaction status of mandatory conditions, the number of optional conditions satisfied, and whether the core judgment criterion of "satisfying all mandatory conditions or the preset number of optional conditions" is met.
[0124] C108. Based on the achievement status of the core judgment criteria in the conditional logic evaluation results, a data structuring algorithm is used to construct the rule base query conditions. The query conditions include the current event node identifier, the status of the mandatory conditions being met, the number of optional conditions being met, and the achievement status of the core judgment criteria.
[0125] C109. Call the rule base query interface of the plot rule engine and use the Rete pattern matching algorithm to quickly match the constructed query conditions with the preset event node transfer rules in the rule base. Each rule entry in the rule base contains the trigger condition, the next event node identifier, the node priority and the narrative logic rule index. The trigger condition and the query condition fields correspond one-to-one.
[0126] C110. Based on the matching results, a priority filtering algorithm is used to select the candidate next event node with the highest node priority. If there are multiple candidate nodes with the same priority, a unique candidate node is selected by a random number generation algorithm to ensure the uniqueness of the result.
[0127] C111. Based on the identifier of the candidate next event node, call the rule extraction interface of the rule base, and use the index query algorithm to obtain the narrative logic rules corresponding to the node. The narrative logic rules include the direction of plot development, character behavior norms, dialogue style constraints, event duration and subsequent node associations.
[0128] C112. Use a logical consistency check algorithm to check whether the candidate next event node and its corresponding narrative logic rule are consistent with the semantic logic of the current plot progress state and the historical dialogue sequence. If they are consistent, the node is confirmed as the final next event node and its corresponding narrative logic rule is a valid rule. If they are inconsistent, return to C109 to match again. If the retry fails, output the default next event node and the basic narrative logic rule.
[0129] C113. Output the final determined next event node and the corresponding narrative logic rules. The next event node includes node identifier, node name, and node type, providing the core basis for the plot evolution module to generate the basic plot direction.
[0130] It should be further explained that the specific implementation steps for calculating and outputting the updated plot progress status in this embodiment are as follows:
[0131] D101. Based on the determined next event node, the current plot progress status, and the preset node completion status rules, the data normalization algorithm is used to unify the encoding format, field dimensions, and expression specifications of the three. The node identifier, node type, node level of the next event node, the current timestamp of the current plot progress status, the timestamp generation rules, the completion judgment conditions in the node completion status rules, and the status identifier mapping relationship are extracted to obtain a standardized input dataset.
[0132] D102. Based on the current plot progress status timestamp information in the standardized input dataset, a timestamp increment algorithm is used in combination with the time interval rules corresponding to the node level of the next event node to generate new timestamp information, and obtain new timestamp information that is ordered and unique according to preset rules.
[0133] D103. Based on the next event node attributes and node completion status rules in the standardized input dataset, a rule matching algorithm is used to compare the node type and node level of the next event node with the completion judgment conditions in the node completion status rules one by one to determine the completion status of the next event node. Combined with the status identifier mapping relationship, the corresponding node completion status identifier is obtained.
[0134] D104. Based on the node sequence information in the current plot progress state, the sequence appending algorithm is used to append the node identifier of the next event node, the corresponding node completion status identifier, and the new timestamp information to the end of the node sequence to obtain the updated plot progress node advancement trajectory.
[0135] D105. Based on the newly generated timestamp information, the temporal logic of the node sequence, and the matching logic between the node completion status identifier and the node completion status rule, the logical consistency verification algorithm is called to perform verification. If there is a logical conflict, it is adjusted based on the preset correction rule to obtain logically reasonable verified and adjusted data.
[0136] D106. Based on the verified and adjusted plot node data, including the updated node identifier, node completion status identifier, new timestamp information and updated node sequence information, a data structuring algorithm is used to integrate and encapsulate the above information according to a preset standardized data format to generate a structured and updated plot progress status.
[0137] D107. The updated plot progress status is output in real time through the status output interface according to the preset data transmission protocol and returned to the subsequent processing unit of the plot evolution module, so as to provide accurate and complete standardized data input for the event triggering unit to extract the current plot progress status feature parameters.
[0138] The event triggering unit is configured to: receive the basic plot direction, extract the new node identifier, node completion status identifier and updated timestamp information from the updated plot progress status as the current plot progress status feature parameters; input the current plot progress status feature parameters and the preset random trigger probability threshold into the conditional probability model constructed by the Bayesian neural network, and calculate the satisfaction judgment result of the random trigger condition.
[0139] When the satisfaction determination result is satisfied, feature matching is performed based on the expected emotional tone tag in the basic plot direction, the core plot text description and the preset random branch event library. The unique random branch event that meets the matching condition is selected from the preset random branch event library. Then, the selected random branch event is injected into the core plot text description of the basic plot direction according to the preset event injection rules, generating a plot development framework containing a unique event identifier, a core plot text description containing random branch event content, an expected emotional tone tag and an uncertain branch identifier.
[0140] When the satisfaction determination result is not satisfied, random branch events are not selected and preset event injection rules are not executed. Instead, a plot development framework containing a unique event identifier, original core plot text description, expected emotional tone label, and no uncertain branch identifier is directly generated.
[0141] For example, this embodiment is based on a product development project scenario. The basic plot direction received by the event triggering unit is set as follows: a unique event identifier "YJ008", a core plot text description "After completing the product requirements decomposition meeting, the R&D, design, and testing team members are organized to use prototyping tools to build a preliminary product framework", and the expected emotional tone tag "focused and efficient". The new node identifier "CY012", the node completion status identifier "started", and the updated timestamp information are extracted from the updated plot progress status and used as the current plot progress status feature parameters. After inputting these parameters and a preset random trigger probability threshold into a conditional probability model constructed by a Bayesian neural network, the result is determined to be satisfied. Based on the expected emotional tone tag of "focused and efficient" and the core plot of "building a product framework using prototyping tools," a matching event, "synchronously sharing the product prototype design specification manual and cross-departmental collaboration annotation process instructions," is selected from the random branch event library. Following the injection rule of "supplementing tool usage auxiliary information after the core plot," a plot development framework is generated containing the unique event identifier "YJ008," the core plot text description "After completing the product requirements decomposition meeting, organize R&D, design, and testing team members to use prototyping tools to build a preliminary product framework, and simultaneously share the product prototype design specification manual and cross-departmental collaboration annotation process instructions," the expected emotional tone tag "focused and efficient," and the uncertainty branch identifier "FC015." If the conditional probability model determines that the condition is not met, a plot development framework is directly generated containing the unique event identifier "YJ008," the original core plot text description "After completing the product requirements decomposition meeting, organize R&D, design, and testing team members to use prototyping tools to build a preliminary product framework," the expected emotional tone tag "focused and efficient," and no uncertainty branch identifier.
[0142] The decision generation unit is configured to: receive the plot development framework, the initial character state, and the initial user preferences, and perform information integration to obtain an integrated dataset; the integrated dataset includes the core plot text description, expected emotional tone label, uncertainty branch identifier, tone parameter set and personality parameter set in the initial character state, and feature dimensions of the initial user preferences in the plot development framework.
[0143] Based on the integrated dataset, and combining semantic parsing algorithm and conditional random field target extraction algorithm, the correlation between the core plot text description, expected emotional tone label, uncertainty branch identifier and the tone parameter set and personality parameter set of the initial character state, and the feature dimension of the initial user preference of the plot development framework is analyzed to obtain the core behavioral target of the virtual character at the current plot node.
[0144] Based on the core behavioral objective, and combined with the tone parameter set and personality parameter set in the initial character state, a tone adjustment strategy that achieves the core behavioral objective and is consistent with the character's personality is derived through a matching algorithm based on cosine similarity.
[0145] Simultaneously, based on the plot logic contained in the core plot text description of the integrated dataset's plot development framework, it is determined whether the current plot advancement requires obtaining external information or services. When the determination result indicates that obtaining external information or services is required, a structured tool call request is generated according to the preset tool call request format. When the determination result indicates that obtaining external information or services is not required, no tool call request is generated. The final output is a set of behavioral decision instructions composed of the parsed core behavioral goals, the deduced tone adjustment strategies, the structured tool call request generated when the determination result indicates that it is required, and the random branch events existing in the plot development framework.
[0146] For example, this embodiment is based on a workplace product iteration project scenario. The plot development framework received by the decision generation unit is as follows: the core plot text description is "After completing the product requirement decomposition meeting, the R&D, design, and testing team members are organized to use prototyping tools to build a preliminary product framework, and the product prototype design specification manual and cross-departmental collaboration annotation process description are shared simultaneously", the expected emotional tone label is "focused and efficient", and the uncertainty branch identifier is "FC015"; the initial role status is project leader, the tone parameter set is gentle and professional, and the personality parameter set is rigorous and efficient; the initial user preference is to focus on task decomposition logic, need practical tool operation step guidance, and prefer a concise and clear communication style.
[0147] The decision generation unit integrates the above information into a dataset, which includes core plot text descriptions, focused and efficient emotional tone tags, uncertainty branch identifiers, a set of gentle and professional tone parameters, a set of rigorous and efficient personality parameters, and user preference features that emphasize task breakdown and tool practice. By analyzing the relationships between these information, it clarifies that the core behavioral goal of the virtual character at the current plot node is to "clearly break down the specific task modules of the product framework to team members, explain the prototype design specifications and collaborative annotation process in detail, provide key points for tool use based on users' needs for practical guidance, and maintain a focused and efficient communication atmosphere."
[0148] Based on this core behavioral goal, and combining a set of gentle and professional tone parameters with a set of rigorous and efficient personality parameters, the tone adjustment strategy is derived as follows: "Adopt a point-by-point expression logic, use a gentle tone while highlighting key points, avoid redundant expressions, maintain professional rigor when explaining standards, and increase patient guidance when providing practical instruction."
[0149] At the same time, based on the plot logic described in the core plot text, it is determined that the current plot development requires obtaining the latest practical tutorials for prototyping tools and standard templates for cross-departmental collaborative annotations. Therefore, a structured tool call request is generated according to the preset format, and the request content includes obtaining the practical tutorials for prototyping tools and standard templates for cross-departmental collaborative annotations.
[0150] The final output set of behavioral decision instructions includes: core behavioral objectives (breaking down task modules for the team, explaining specifications and processes, and providing key points for tool usage), tone adjustment strategies (point-by-point expression, gentle and professional tone, highlighting key points, and patient guidance), structured tool call requests (obtaining practical tutorials for prototyping tools and standard templates for collaborative annotations), and random branching events (sharing product prototyping specification manuals and cross-departmental collaborative annotation process instructions).
[0151] The scene behavior constraint module is used to obtain a continuous scene behavior constraint rule set by combining the character scene identifier and behavior goal, tone adjustment strategy and optional tool call request or random branch event with a multi-scene behavior constraint rule library.
[0152] It should be further explained that the method for constructing the multi-scenario behavior constraint rule base in this embodiment is as follows:
[0153] D111. Based on the pre-set role and scene identification system, the scene ontology modeling method is used to sort out the scene types in multiple fields, covering core scenes such as workplace collaboration, campus interaction, and social communication. The core attributes such as scene environment features, role identity positioning, behavior boundary range, and tone adaptation range of each scene are extracted. The K-means clustering algorithm is used to classify the scenes hierarchically, forming a scene classification catalog, and obtaining a basic scene dataset containing classified scenes and core attributes.
[0154] D112. Based on the collected multi-scenario behavioral norm data, a BERT-based named entity recognition algorithm is used to extract core constraint elements for each scenario. These core constraint elements include role / scenario identifiers, behavioral target types, tone adjustment thresholds, tool access permissions, random branch events, and their applicable range. Simultaneously, combined with the Apriori association rule mining algorithm, frequently occurring constraint patterns are extracted from historical interaction data. A preliminary screening is performed by combining the core constraint elements and frequently occurring constraint patterns to obtain a candidate constraint rule set. The behavioral norm data includes industry behavioral guidelines, scenario common sense norms, historical role interaction cases, and user feedback data.
[0155] D113. Based on the candidate constraint rule set, a production rule representation is used to structurally describe each rule. Each rule entry contains three core modules: preconditions, constraint content, and output results. The preconditions are associated with input fields such as role / scene identifiers, behavioral goals, tone types, and tool call requirements. The constraint content clearly defines behavioral action specifications, tone expression boundaries, tool usage restrictions, and adaptation conditions for random branch events. The output results include compliance judgment standards and violation correction suggestions. Subsequently, XML tags are used to standardize and encapsulate the rule entries, and a unique rule identifier is assigned to each rule. To improve query efficiency, a three-dimensional index structure of scene-role-behavior is established and optimized using an inverted index algorithm, ultimately obtaining a set of rule entries with a clear structure, standardized encapsulation, and support for efficient querying.
[0156] D114. Based on the preconditions and constraints of each rule in the rule entry set, a logical reasoning algorithm is used for consistency verification to identify logically contradictory rules. A review group composed of scenario domain experts is invited to conduct multiple rounds of review using the Delphi method to correct issues such as scenario adaptation deviation and fuzzy constraint standards in the rules. The initial priority of each rule is determined by a weighted average algorithm combined with expert scores, where scenario-specific rules have higher priority than general rules, and core behavioral constraint rules have higher priority than auxiliary behavioral constraint rules. A set of rules with logical consistency and initial priority is obtained.
[0157] D115. Based on user interaction feedback data and newly added scene data, the SGD incremental learning algorithm is used to iteratively update the rule set, add constraint rules for uncovered scenes, adjust the constraint thresholds and priorities of existing rules, set up a rule conflict detection engine, and use the Rete logical reasoning algorithm to detect conflicts between new rules and existing rules in real time. When conflicts exist, a priority sorting algorithm combined with scene adaptability evaluation results is used to resolve conflicts, ensuring the logical consistency of the rule base and obtaining a dynamically updated and logically rigorous rule base.
[0158] D116. Based on the input data such as role scene identifiers, behavioral goals, and tone adjustment strategies, a data normalization algorithm is used to unify the data format to ensure accurate matching with the rule base fields. Typical role interaction cases in multiple scenarios are selected as test sets, and a cross-validation algorithm is used to evaluate the constraint matching accuracy of the rule base. Based on the evaluation results, a gradient descent algorithm is used to optimize the scenario adaptation parameters of the rules, resulting in a multi-scenario behavior constraint rule base with significantly improved scenario adaptability and constraint effectiveness.
[0159] It should be further explained that the detailed logical steps of the scene behavior constraint module in this embodiment to obtain a continuous scene behavior constraint rule set include:
[0160] E101 receives role scene identifiers, behavioral goals, tone adjustment strategies, and optional tool call requests or random branch events. It uses a data normalization algorithm to unify the encoding format, expression standards, and field dimensions of various input data, extracts core matching elements, including the scene type corresponding to the role scene identifier, the type of the behavioral goal, the adaptation range of the tone adjustment strategy, the permission level of the tool call request, or the adaptation scene of the random branch event, and generates a standardized set of input elements to ensure that the input data accurately matches the fields of the multi-scene behavior constraint rule base.
[0161] E102. Based on the standardized input element set, the retrieval interface of the multi-scenario behavior constraint rule base is called. Combining the three-dimensional index structure of scenario-role-behavior established in the rule base, the inverted index algorithm is used to perform multi-condition joint retrieval and match rule entries containing the preconditions corresponding to the input elements. From the retrieval results, rules that are suitable for the current role scenario identifier, behavior target and tone adjustment strategy, and that meet the tool call permission or random branch event adaptation range are selected to form the initial rule candidate set.
[0162] E103. Based on the initial rule candidate set, the Apriori association rule mining algorithm is used to analyze the logical association between rules and the scene continuity adaptation pattern. The temporal association and conditional dependency of different rules in the continuous scene advancement process are extracted. Isolated rules that contradict or are unrelated to the current continuous scene advancement logic are eliminated, and a subset of association rules that can support the continuous evolution of the scene are retained.
[0163] E104. Combining the initial priority of each rule in the multi-scenario behavior constraint rule base, a priority sorting algorithm is used to sort the subset of associated rules. The sorting criteria include scenario-specific priority, core behavior constraint priority, and continuous scenario adaptation priority. Scenario-specific rules have higher priority than general rules, core behavior constraint rules have higher priority than auxiliary behavior constraint rules, and rules that adapt to the continuous scenario progression logic have higher priority than single-node rules, forming a rule sequence ordered by priority.
[0164] E105. Use logical reasoning algorithms to verify the logical consistency of the preconditions and constraints of each rule in the ordered rule sequence during the continuous scenario progression, and check for temporal conflicts or conditional contradictions between rules; combine the current behavioral goal and the possible subsequent scenario evolution direction, supplement the rule base with constraint rules that adapt to the connection of continuous scenarios, improve the scenario continuity of the rule sequence, and form a set of rules to be output that adapts to continuous scenarios.
[0165] E106. The production rule representation method is used to structurally integrate the validated and supplemented rule set to be output, clarifying the application order, constraint conditions and violation correction suggestions of each rule in continuous scenarios, and maintaining a unified structure in which each rule entry includes preconditions, constraint content and output results.
[0166] E107. The integrated rule set is standardized and encapsulated using XML tags. A unique rule set identifier is assigned to the continuous scene behavior constraint rule set. The final output is a continuous scene behavior constraint rule set containing ordered rule entries, scene adaptation instructions, and violation handling guidelines.
[0167] The tool invocation module is used to respond to the tool invocation request and, in conjunction with a preset external tool service interface, obtain response result parameters. It should be further noted that the process of obtaining response result parameters in this embodiment includes:
[0168] E111 receives structured tool call requests from the behavior decision instruction set, uses a data normalization algorithm to unify the encoding format, field descriptions, and parameter dimensions of the request data, extracts the core elements of the request, including the target tool type, interface call parameters, data return format requirements, and request priority; uses a JSON parsing algorithm to parse the nested parameters in the request, splits the hierarchical parameter structure, removes redundant and invalid parameters, and generates standardized tool call request data to ensure accurate adaptation with the parameter requirements of the preset external tool service interface.
[0169] E112. Call the preset external tool service interface configuration library, which stores information such as interface addresses, request protocols, authentication methods, parameter specifications, and timeout thresholds for various external tools; based on the target tool type in the standardized tool call request data, use an exact matching algorithm to match the corresponding external tool service interface information; if the interface requires authentication, use the OAuth2.0 authentication protocol to generate a temporary authentication token, and use the Base64 encoding algorithm to encrypt the authentication information to ensure the security and legitimacy of the interface call.
[0170] E113. Based on the external tool service interface parameter specifications obtained through matching, a data structuring algorithm is used to construct the preprocessed interface call parameters into a request message that meets the interface requirements, clearly defining the message header information, parameter arrangement order, and data type identifier; using the HTTP or HTTPS public transmission protocol, request messages are sent according to the preset request priority, and a request timeout monitoring mechanism is started at the same time. A cyclic retry algorithm is used to perform a limited number of retries when the request times out or the connection is abnormal. The retry interval is dynamically adjusted according to preset rules to avoid call failure due to a single network abnormality.
[0171] E114. Receive response data returned from external tool service interfaces, and parse the response data according to the preset data return format requirements using the corresponding parsing algorithm. If it is in JSON format, use the JSON parsing algorithm; if it is in XML format, use the XML parsing algorithm to extract the core response result parameters. Use the MD5 hash algorithm to perform integrity verification on the received response data, comparing the hash values of the data sender and receiver to ensure that the data has not been tampered with during data transmission. If the parsing finds that the response data is missing or has an incorrect format, use the error code matching algorithm to match the preset error handling rules and generate the corresponding error message.
[0172] E115. The core response result parameters are uniformly parsed using a data normalization algorithm, including field names, data types, and expression specifications. Invalid and redundant information is eliminated, and parameter descriptions and data source identifiers are added. The normalized response result parameters are structurally encapsulated using a production rule representation method to maintain the consistency and readability of the parameter set fields. The final output is a standardized response result parameter containing core data parameters, data integrity identifiers, interface call status, and error messages (if any). This is synchronously fed back to the decision generation unit and the plot evolution module to provide data support for subsequent character behavior adjustments and plot advancement.
[0173] The conversation generation module is used to obtain a set of character conversations in continuous scenes by combining a multimodal conversation model with a set of continuous scene behavior constraint rules and consistency indicators of behavior actions with speech rate, tone and micro-expressions at the same timestamp, based on behavioral goals, tone adjustment strategies, response result parameters, and initial plot progress. The specific motivation behind the constraint space setting in this embodiment is to address issues in traditional character dialogue generation, such as scene adaptation discrepancies, logical contradictions in multi-dimensional performance (e.g., inconsistencies between actions, speech rate, tone, and micro-expressions), and insufficient personalization and compliance due to a lack of continuous constraints on character performance. This ensures that character dialogue in continuous scenarios conforms to scene rules while maintaining inherent consistency in multi-dimensional performance, enhancing the immersiveness and credibility of the interaction. The principle is to use a set of continuous scene behavioral constraint rules (constructed based on core attributes and behavioral norms of multiple scenes) as the scene-based compliance boundary, clarifying the permissible range of character actions, the adaptation range of speech rate and tone, and the display norms of micro-expressions in different scenarios. Simultaneously, the consistency index of actions, speech rate, tone, and micro-expressions under the same timestamp serves as an internal logical constraint. Cosine similarity is used to verify the semantic association and logical fit of multi-dimensional features. Together, these constitute a multi-dimensional, dynamic constraint space, providing clear generation boundaries and logical basis for the multimodal dialogue model. This ensures that the generated character dialogue not only conforms to the behavioral norms of continuous scenarios but also achieves coordinated unity of actions, speech rate, tone, and micro-expressions, aligning with character settings and plot progression requirements.
[0174] It should be further explained that the conversation generation module in this embodiment includes an input unit, a constraint parsing unit, a conversation generation unit, and a conversation optimization unit; the input unit is used to extract the behavioral target and tone adjustment strategy from the behavioral decision instruction set, the initial character state, the initial user preference, and the response result parameters from the initial plot progress and the continuous scene behavioral constraint rule set, and construct a conversation generation input dataset;
[0175] The constraint parsing unit, based on the conversation-generated input dataset, parses the continuous scene behavior constraint rule set within it, extracts behavioral action specifications, and simultaneously calculates consistency indices between speech rate, tone, and behavioral actions and micro-expressions at the same timestamp, based on the tone parameter set and speech rate level and politeness level labels in the personality parameter set, generating a standardized constraint condition set including constraint thresholds and behavioral action boundaries. It should be further noted that, in this embodiment, the constraint parsing unit, based on the conversation-generated input dataset, uses a parsing algorithm to parse the continuous scene behavior constraint rule set to extract behavioral action specifications. The behavioral actions are extracted from the scene behavior adaptation clauses in the continuous scene behavior constraint rule set through the parsing algorithm. The micro-expressions are based on the tone identifier and speech rate level of the tone parameter set. The system combines politeness level labels from personality parameter sets with scene-adaptive micro-expression specifications from continuous scene behavior constraint rule sets, and uses a feature mapping algorithm to transform them into quantifiable micro-expression feature vectors. Simultaneously, based on the aforementioned tone parameter set and speech rate level and politeness level labels from the personality parameter set, a data normalization algorithm is first used to unify the format and dimensions of behavioral actions, micro-expression feature vectors, and speech rate and tone parameters. Then, a cosine similarity algorithm is used to calculate the consistency index of speech rate, tone, behavioral actions, and micro-expressions under the same timestamp. Finally, a standardized constraint condition set containing constraint thresholds, behavioral action boundaries, and consistency judgment rules is formed, providing a clear technical basis for compliance verification of subsequent conversation generation and ensuring the adaptability and internal logical consistency of the character's multi-dimensional performance with scene requirements and personality settings.
[0176] Please refer to Figure 2. In this embodiment, the conversation generation unit obtains the behavioral target, tone adjustment strategy, response result parameters and initial plot progress based on the conversation generation input dataset, as core driving parameters, and obtains the initial character state based on the initial plot progress.
[0177] Based on the standardized constraint set, quantitative constraint thresholds, behavioral action boundaries, and consistency judgment rules for speech rate and tone under the same timestamp are obtained to construct a dynamic constraint space.
[0178] It should be further explained that the dynamic constraint space in this embodiment is based on a standardized constraint set. An analytical algorithm is used to accurately extract the quantified constraint thresholds, behavioral action boundaries, and consistency judgment rules for speech rate-tone and action-expression at the same timestamp. Combined with spatial modeling methods, a multi-dimensional constraint model is constructed covering behavioral action dimensions, speech rate and tone dimensions, and expression display dimensions. This model can capture scene evolution nodes and character state change data in real time through rule matching algorithms, matching corresponding constraint parameter adjustment strategies to achieve dynamic adaptation of the constraint range as the scene progresses and the character's state updates. Its core purpose is to provide real-time and accurate dynamic constraint basis for the virtual character's behavior execution, tone expression, and expression display in continuous scenes, not only clearly defining the limits... It defines the compliance boundaries of character behavior and actions, quantifies the standards for tone and speed of speech, and specifies the consistency and adaptation requirements for actions, expressions, and tone. It can also dynamically optimize constraint parameters for different scene characteristics and character identity differences, ensuring that the character's performance is always highly consistent with the scene requirements and character settings. This space represents the dynamic compliance range of character behavior, actions, tone of speech, and facial expressions under different timestamps and scene nodes, as well as the degree of consistency and adaptation between various dimensions. During the implementation process, logical reasoning algorithms are used to comprehensively verify the logical correlation and scene adaptability between the consistency judgment rules of constraint thresholds and behavioral action boundaries and the dynamic adjustment parameters. Logical conflicts are identified and corrected in a timely manner to ensure the accuracy and logical rigor of the dynamic constraint space, providing core support for the consistent and compliant performance of virtual characters.
[0179] The preset multimodal conversation model is invoked, and the core driving parameters and the language-personality feature parameters in the initial character state are input into the input encoding layer of the multimodal conversation model to obtain a unified semantic representation that integrates plot, character, tool and constraint information;
[0180] It should be further explained that the input encoding layer in this embodiment is constructed and implemented as follows:
[0181] Based on the data normalization algorithm, the language-personality feature parameters in the core driving parameters and initial character state are standardized to accurately extract the plot logic information, tool call requirements, and constraint requirements from the core driving parameters, as well as the tone expression tendency and personality trait representation contained in the language-personality feature parameters in the initial character state, thus obtaining a structured parameter subset. Using a BERT pre-trained model, the textual information such as plot logic information, tool call requirements, and constraint requirements in the structured parameter subset are semantically encoded sentence by sentence to capture text context association features, obtaining a text semantic encoding vector containing context semantic associations. Using the Word2Vec algorithm, the language-personality feature parameters in the structured parameter subset are vectorized, transforming discrete tone expression tendencies and personality trait representations into low-dimensional dense vectors, preserving the inherent associations between features, and obtaining a low-dimensional dense personality feature vector. A multi-feature fusion module is constructed based on the self-attention algorithm to calculate the text semantic encoding vector and the personality feature vector. The system dynamically assigns weights to the features associated with the quantity based on the relevance of the current conversation scenario, highlighting the weights of core information features to obtain a weighted fusion feature vector. A fully connected layer is used to unify the dimensions of the weighted fusion feature vector, mapping feature vectors of different dimensions to the same feature space to obtain a unified dimensional feature vector. A layer normalization algorithm is used to optimize the distribution of the unified dimensional feature vector, standardizing and adjusting the mean and variance of the vector to reduce encoding bias caused by differences in data distribution, resulting in a balanced feature vector. The ReLU algorithm is used to perform nonlinear activation processing on the balanced feature vector, enhancing its ability to express complex semantic associations, filtering out invalid and redundant information, and obtaining a final encoding vector with strong semantic expressive power. Through the collaborative application of the above series of publicly available algorithms, a fully functional input encoding layer is constructed, ultimately obtaining a unified semantic representation that integrates plot logic information, character personality traits, tool call requirements, and constraint conditions.
[0182] Based on the scene context adaptation layer of the current scene identifier and behavior action boundary combined with the multimodal conversation model, scene semantic enhancement is performed on the unified semantic representation to obtain the intermediate representation of scene adaptation.
[0183] It should be further explained that the construction and implementation method of the scene context adaptation layer in this embodiment is as follows:
[0184] Based on the current scene identifier, the Word2Vec algorithm is used to deeply extract the core features of the scene, covering information such as scene type, scene environment attributes, identity positioning of interactive subjects, typical interaction flow, scene-specific behavioral norms, and scene emotional tone. The discrete scene identifier and scene attribute description are transformed into low-dimensional dense scene feature vectors with semantic association. Subsequently, the scene feature vectors are standardized by the L2 normalization algorithm to optimize the vector distribution range and ensure the consistency and comparability of feature vectors from different scenes.
[0185] Based on the behavioral action boundary, a label embedding algorithm combined with One-Hot encoding technology is used to transform information such as the scope of behavioral compliance, action execution steps, action intensity threshold, prohibited behavior list, action priority for the appropriate scenario, and the linkage specifications between actions and tone of voice and facial expressions into a structured constraint feature vector. Then, the constraint feature vector is adjusted in dimension through a fully connected layer to keep it consistent with the dimension of the scene feature vector, laying the foundation for subsequent feature fusion.
[0186] A scene-constraint-semantic mutual attention fusion module is constructed based on the self-attention algorithm. A multi-head self-attention mechanism is introduced to calculate the mutual attention weight matrix between the unified semantic representation and the scene feature vector and the constraint feature vector respectively. The weights are dynamically allocated according to the core needs of the current conversation scene, which accurately strengthens the semantic information that is highly matched with the current scene identifier, highlights the key features that conform to the boundaries of the behavior action, and effectively weakens the redundant information that is unrelated to the scene context and behavior constraints, so as to achieve deep coupling of the semantic information of the three.
[0187] Based on the GRU algorithm, a temporal context modeling unit is constructed. A gating mechanism is introduced to capture the semantic dependencies of different nodes in the continuous scene evolution process, explore the contextual association rules when scene switching, retain the key semantic information of historical scenes, avoid the semantic discontinuity problem caused by isolated scene adaptation, and ensure the coherence of semantic expression.
[0188] The feature vectors after temporal modeling are optimized by using a layer normalization algorithm to optimize the data distribution, and the mean and variance of the vectors are adjusted in real time to reduce the semantic distribution fluctuations caused by scene switching and improve the stability of the feature vectors in different scenes. The optimized feature vectors are non-linearly activated by the ReLU algorithm to enhance the ability of the feature vectors to express the complex relationships in the scene context. At the same time, the dropout algorithm is embedded to randomly block some feature nodes, suppress the overfitting phenomenon of the model, and ensure the generalization ability of the scene context adaptation layer.
[0189] Finally, a cosine similarity algorithm is used to verify the compatibility of the enhanced semantic representation with the standard feature vector of the current scene. If the verification result does not reach the preset adaptation threshold, it is fed back to the mutual attention fusion module to readjust the weight allocation and perform secondary optimization until the verification meets the standard. Through the collaborative application of the above series of publicly available algorithms, a fully functional and accurately adapted scene context adaptation layer is constructed, which performs comprehensive and in-depth scene semantic enhancement on the unified semantic representation, and finally obtains a scene-adapted intermediate representation that is highly consistent with the current scene identifiers and behavioral action boundaries, and includes temporal contextual associations and semantic coherence.
[0190] Meanwhile, through the role personality feature mapping layer of the multimodal conversation model, the intonation identifier, speech rate level and conversation vocabulary preference set in the language-personality feature parameters are used as style control vectors and injected into the attention mechanism of the multimodal conversation model to obtain the generation state of personality feature enhancement.
[0191] It should be further explained that the construction and implementation method of the role personality feature mapping layer of the multimodal conversation model in this embodiment is as follows:
[0192] Step 1: Based on the language-personality feature parameters in the initial role state, extract three types of core personality representation information from the language-personality feature parameters: intonation identifier, speech rate level, and conversational vocabulary preference set. For discrete intonation identifiers and ordered speech rate levels, a label embedding algorithm is used to transform them into low-dimensional dense numerical vectors. For the core words in the conversational vocabulary preference set, the Word2Vec algorithm is used for semantic encoding to generate vocabulary vectors with semantic association features between words. The intonation vector, speech rate vector, and vocabulary vector are standardized by the L2 normalization algorithm to ensure the consistency and comparability of various vectors under the same distribution dimension.
[0193] Step 2: Construct a feature fusion unit and introduce a fully connected layer to unify the dimensions of the standardized intonation vector, speech rate vector, and vocabulary vector; combine a weighted summation algorithm to dynamically allocate the fusion ratio of each vector according to the influence weight of different personality traits on the character's performance, and generate a style control vector that integrates intonation, speech rate, and vocabulary preferences.
[0194] Step 3: Based on the multi-head self-attention mechanism, a feature interaction module is built, and the style control vector is injected into the attention mechanism of the multimodal conversation model. By calculating the mutual attention weight matrix between the style control vector and the scene adaptation intermediate representation, the relationship between personality traits and scene semantics is accurately captured, and the semantic expression weight that conforms to the character's personality is dynamically strengthened, while the semantic information that contradicts the character's personality is weakened.
[0195] Step four involves introducing a layer normalization algorithm to optimize the data distribution of the fused feature vectors, adjusting the vector mean and variance to reduce feature bias; using the ReLU algorithm to perform nonlinear activation processing on the optimized feature vectors to enhance their ability to express complex lattice features; and embedding the dropout algorithm to randomly mask some feature nodes, effectively suppressing model overfitting.
[0196] Step 5: Verify the consistency between the enhanced features and the language-personality feature parameters in the initial role state using a logical reasoning algorithm to ensure accurate personality feature mapping. Through the above steps, construct a fully functional role personality feature mapping layer, output the generation state of personality feature enhancement, and provide accurate role personality guidance for the subsequent generation of conversation content in the multimodal conversation model.
[0197] During the generation process of each time step, the constraint verification layer based on the multimodal conversation model combines the quantized constraint threshold and the consistency judgment rule to perform real-time scoring and filtering of candidate outputs, and obtain the distribution of candidate tokens that meet the constraints. It should be further explained that the coherent token sequence of the initial character conversation set in this embodiment is used to represent semantically coherent content that meets the current scene adaptation requirements, fits the character's language-personality characteristics, meets the continuous scene behavior constraints and multi-dimensional consistency indicators. The tokens contained therein are arranged in chronological order, which not only reflects the expression style corresponding to the character's tone parameters and personality parameters, but also incorporates the tool call response results and plot advancement logic, accurately mapping the initial character state and plot development needs. This coherent token sequence is used to provide basic verification objects for the conversation optimization unit. After optimization, it serves as the core output content of character interaction in continuous scenes, supporting the multimodal conversation model to achieve personalized, compliant, and immersive character interaction. At the same time, it provides historical conversation context features for the state library module, ensuring the continuity and logic of subsequent plot evolution, behavior decisions and constraint verification. It should be further explained that the candidate output in this embodiment is constructed based on the core driving parameters, the language-personality feature parameters in the initial role state, and the generation logic of the multimodal conversation model. Specifically, the construction method is as follows: based on the unified semantic representation obtained by the input encoding layer of the multimodal conversation model through the core driving parameters and the language-personality feature parameters, combined with the scene adaptation intermediate representation output by the scene context adaptation layer and the generation state of personality feature enhancement output by the role personality feature mapping layer, the multimodal conversation model initially generates an initial output containing multiple potential semantic expressions through its decoder module based on the above-mentioned fusion information and its own preset generation probability distribution. This initial output is the candidate output, which contains multiple candidate token sets with different semantic tendencies, speech rate features, and action association features. This provides the basic object for the constraint condition verification layer to perform real-time scoring and filtering by combining the quantized constraint threshold and consistency judgment rules.
[0198] It should be further explained that the process of real-time scoring and filtering of candidate outputs in this embodiment includes:
[0199] Step 1: Based on the candidate outputs of the multimodal conversation model generated at each time step of the scene, extract the candidate token set contained therein. For each candidate token, extract its semantic feature vector based on the BERT pre-trained model, convert the speech rate information corresponding to the token into a numerical feature vector based on the label embedding algorithm, and convert the action description information associated with the token into an action feature vector based on the feature mapping algorithm. Obtain a multi-dimensional feature set for each candidate token, which includes semantic features, speech rate features, and action association features.
[0200] Step two: Based on preset quantitative constraint thresholds, a sub-item compliance scoring module is constructed to score the multi-dimensional features of each candidate token: First, the similarity between the semantic feature vector of the candidate token and the standard semantic feature vector of the current scene is calculated using the cosine similarity algorithm to obtain a semantic and scene adaptability score; Second, based on the upper and lower limits of speech rate in the quantitative constraint thresholds, an interval judgment algorithm is used to compare the speech rate numerical feature vector of the candidate token to determine whether the speech rate is within the compliance range, thus obtaining a speech rate compliance score; Third, based on the behavioral action boundary features corresponding to the quantitative constraint thresholds, a threshold filtering algorithm is used to match the action feature vector of the candidate token to determine whether the action association features are within the behavioral boundary, thus obtaining an action boundary compliance score; Each sub-item compliance score is mapped to a preset score range to ensure a consistent scoring scale.
[0201] Step 3: Based on the preset consistency judgment rules, a consistency scoring module is constructed. The similarity between the semantic feature vector of the candidate token and the language personality feature vector and behavior action feature vector of the current character is calculated based on the cosine similarity algorithm, as well as the similarity between the multi-dimensional feature set of the candidate token and the context feature vector of the current scene. The consistency sub-scores of the three dimensions are obtained. The three consistency sub-scores are fused according to the preset weights based on the weighted summation algorithm to obtain the comprehensive consistency score of each candidate token. The comprehensive consistency score is mapped to the preset score range mentioned above.
[0202] Step 4: Based on the semantic and scene adaptation score, speech rate compliance score, and action boundary compliance score obtained in Step 2, and the comprehensive consistency score obtained in Step 3, a weighted summation algorithm is used to perform weighted fusion according to the preset compliance weight and consistency weight to obtain the final total score of each candidate token. The final total score fully reflects the degree to which the token meets the quantitative constraint threshold and consistency judgment rules.
[0203] Step 5: Based on the preset qualified threshold, the threshold filtering algorithm is used to compare the final total score of each candidate token with the preset qualified threshold, filter out candidate tokens whose final total score is lower than the preset qualified threshold, retain valid candidate tokens that meet the constraints and whose final total score is higher than or equal to the preset qualified threshold, and remove invalid candidate tokens that do not meet the constraints.
[0204] Step 6: Based on the final total score of the valid candidate tokens retained in Step 5, the softmax normalization algorithm is used to perform probability normalization processing, converting the score of each valid candidate token into a corresponding probability value, ensuring that the sum of the probabilities of all valid candidate tokens is one, and finally obtaining a candidate token distribution that satisfies the constraints, has a reasonable probability distribution, meets the quantization constraint threshold and consistency judgment rules.
[0205] Based on the intermediate representation of the scene adaptation, the generation state of the personality feature enhancement, and the distribution of the candidate tokens that satisfy the constraints, the coherent token sequence that constitutes the initial character conversation set is iteratively output through autoregressive decoding.
[0206] It should be further explained that the process of iteratively outputting a coherent token sequence constituting the initial role session set through autoregressive decoding in this embodiment includes:
[0207] Step 1: Based on the intermediate representation adapted to the scene, the generated state enhanced by personality features, and the distribution of candidate tokens that meet the constraints, combined with the initial parameters of the decoding layer of the multimodal conversation model, initialize the initial decoding state of the autoregressive decoding. At the same time, based on the preset starting token identifier, initialize an empty historical token sequence and obtain the initial decoding state and the initial historical token sequence.
[0208] Step 2: In each iteration, based on the current decoding state and the historical token sequence, a multi-head self-attention mechanism is used to associate the intermediate representation of scene adaptation with the generation state of personality feature enhancement, capture the dynamic association information between the historical sequence and scene personality features, obtain the decoding context after feature fusion, and based on the decoding context, a weighted adjustment algorithm is used to dynamically calibrate the weights of the candidate token distribution that meets the constraints, highlighting the weights of tokens that are semantically coherent with the historical token sequence and meet the scene adaptation requirements and character personality features, and obtain the adjusted candidate token distribution.
[0209] Step 3: Based on the adjusted candidate token distribution, a greedy search algorithm or a bundle search algorithm is used to screen the optimal candidate tokens. The bundle search algorithm retains the K candidate tokens with the highest probability by setting a bundle width, and performs a secondary evaluation in combination with the historical sequence coherence to obtain the optimal candidate token for the current iteration step.
[0210] Step 4: Based on the optimal candidate token of the current iteration step, add it to the historical token sequence, update the length of the historical token sequence, and at the same time, based on the state propagation rules of autoregressive decoding, combine the feature information of the optimal candidate token with the current decoding state to update the decoding state parameters and obtain a new decoding state that is suitable for the next iteration.
[0211] Step 5: Based on the preset iteration termination conditions, the iteration termination conditions include the historical token sequence length reaching a preset threshold or the optimal candidate token being the preset termination token. The current iteration state is verified using a condition judgment algorithm. If the termination conditions are met, the iteration termination signal is obtained; otherwise, the process returns to Step 2 to continue iterating.
[0212] Step 6: Based on the complete historical token sequence obtained after the iteration terminates, a sequence integration algorithm is used to verify and regulate the token order to ensure that the sequence semantics are coherent and meet the requirements of scene adaptation and character personality traits, and finally obtain a coherent token sequence that constitutes the initial character conversation set.
[0213] The session optimization unit is used to traverse the initial role session set sentence by sentence, and for each session unit, to perform a verification step, specifically:
[0214] Based on the various judgment rules in the standardized constraint set, the speech rate characteristics, tone intensity, word preference and accompanying action description of each initial role conversation are analyzed and verified to obtain the consistency deviation score and constraint violation mark verification results relative to the preset behavior target and tone adjustment strategy.
[0215] All verification results are evaluated, and based on the preset fault tolerance threshold, the initial role session set to be optimized and its corresponding specific deviation type are obtained.
[0216] The optimization process is initiated. For each target session in the initial set of character sessions to be optimized, based on its deviation type and constraint violation flag, and combined with the language-personality characteristic parameters, an optimization prompt containing specific correction instructions and character style context is constructed. This prompt drives the multimodal session model or its dedicated optimization submodule to regenerate content or make local adjustments to obtain the optimized target session.
[0217] The optimized target session is used to replace the original target session to obtain a set of role sessions in a continuous scenario that satisfies the dynamic constraint space.
[0218] This embodiment employs algorithms such as jieba word segmentation, BERT+CRF entity recognition, and attention mechanism + bidirectional long short-term memory network in the role mapping module to accurately parse user-input role creation parameters and combine them with a role mapping parameter library to generate a full-dimensional language-personality feature set including tone and personality parameter sets. This solves the problem of insufficient personalized character expression in traditional systems and lays the foundation for personalized character interaction. The narrative evolution module loads standardized contextual input parameters and uses algorithms such as a narrative rule engine, Apriori association rule mining, and Bayesian neural networks to achieve narrative initialization and dynamic progression. Random branch events break the single narrative direction, and emotional state change markers capture character emotional dynamics, ensuring the logic, coherence, and immersion of the narrative evolution, overcoming the pain point of traditional systems' lack of randomness and dynamic adjustment in narrative. Finally, the scene behavior constraint module constructs a multi-scene behavior constraint rule library based on algorithms such as K-means clustering, BERT named entity recognition, and Rete logical reasoning. The system accurately matches character scene identifiers and behavioral goals to generate a set of continuous scene behavior constraint rules, achieving compliant adaptation of character behavior and tone across multiple scenarios and solving the problem of difficult multi-scenario adaptation. Through the tool invocation module, it employs technologies such as OAuth2.0 authentication, HTTP / HTTPS transmission, and MD5 hash verification to standardize the processing of tool invocation requests and integrate external tool response results, achieving seamless integration of tool invocation with plot and character interaction, thus overcoming the difficulty of integrating tool invocation with context. Utilizing the conversation generation module in conjunction with a multimodal conversation model, it generates a set of character conversations that conforms to a dynamic constraint space and possesses scene adaptability, personality consistency, and semantic coherence through the collaborative efforts of multiple algorithms, including input encoding layer, scene context adaptation layer, character personality feature mapping layer, constraint condition verification layer, and autoregressive decoding. These conversations are further verified and optimized by the conversation optimization unit to ensure compliance and accuracy, ultimately achieving personalized, immersive, and highly coherent large language model character interaction in continuous scenarios, significantly improving the user interaction experience.
[0219] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.
[0220] If the technical solution disclosed herein involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution disclosed herein involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
Claims
1. A large language model-based character interaction system based on plot-driven and tool-invoking approaches, characterized in that: include: The role mapping module is used to create parameters based on the user's input role and combine them with the role mapping parameter library to obtain the user's language-personality trait set. The state library module is used to initialize the plot based on the user's language-personality trait set and the character-plot state library to obtain the user's initial plot parameters; the initial plot parameters include the initial character state, initial user preferences, initial plot progress and historical conversation context features. The plot evolution module is used to initialize and advance the plot logic based on language-personality characteristic parameters and initial plot parameters, combined with a preset plot rule engine and a multi-scene behavior constraint rule library, and generate user character behavior goals, tone adjustment strategies and optional tool call requests or random branch events in real time. The scene behavior constraint module is used to obtain a continuous scene behavior constraint rule set based on the character scene identifier and behavior goal, tone adjustment strategy, and optional tool call requests or random branch events, combined with a multi-scene behavior constraint rule library; the tool call module is used to respond to the tool call request and obtain response result parameters by combining a preset external tool service interface; the conversation generation module is used to obtain a character conversation set in a continuous scene based on the behavior goal, tone adjustment strategy, response result parameters, initial plot progress, and using a multimodal conversation model as the constraint space, combining the continuous scene behavior constraint rule set and the consistency index of behavior actions with speech rate, tone, and micro-expressions at the same timestamp; the plot evolution module... It includes a plot deduction unit and a plot initialization unit. The plot deduction unit is used to load the standardized context input parameters obtained by the plot initialization unit, and input the latest plot progress status and the list of triggered key events at the current moment into the rule base of the preset plot rule engine for rule matching, to obtain the current event node that uniquely corresponds to the current narrative position, and the set of state transition conditions associated with the current event node. The set of state transition conditions includes at least the emotional trigger conditions constructed based on the character's emotional state change markers, the dialogue trigger conditions constructed based on the core keywords in the historical dialogue sequence, and the personalized trigger conditions constructed based on the feature dimensions of user preferences. Based on the semantic parsing results of the historical dialogue sequence and the quantitative features of the character's emotional state change markers, each condition in the state transition condition set is logically evaluated and satisfied according to a preset priority. Based on the judgment results, the next event node that satisfies all mandatory conditions or a preset number of optional conditions, as well as the narrative logic rule corresponding to the next event node, is obtained from the rule base of the plot rule engine. Based on the determined next event node and the corresponding narrative logic rule, a basic plot direction containing a unique event identifier, core plot text description, and expected emotional tone tag is generated. At the same time, based on the node attributes of the next event node, the timestamp information of the plot progress status, and the node completion status rule, the updated plot progress status is calculated and output. The updated plot progress status includes at least a new node identifier, a node completion status identifier, and updated timestamp information.
2. The large language model character interaction system based on plot-driven and tool-calling as described in claim 1, characterized in that, The role mapping module includes a parsing unit, a intonation mapping unit, and a personality mapping unit. The parsing unit is used to obtain a set of user role attribute keywords based on user input text information and a configured entity-relation extraction model. This set of user role attribute keywords includes at least name, age, occupation, hobbies, and tone style. The intonation mapping unit is used to obtain a set of tone parameters for the user role based on the user's age, occupation, and tone style keyword set, combined with a pre-defined tone mapping relation library. This set of tone parameters includes tone identifiers, speech rate levels, and language type. The personality mapping unit is used to obtain a set of personality parameters for the user role based on the user's age, occupation, and hobbies, combined with a pre-defined tone mapping relation library. This set of personality parameters includes a set of conversational vocabulary preferences and politeness level tags.
3. The large language model character interaction system based on plot-driven and tool-calling as described in claim 2, characterized in that, The state library module includes a state initialization unit and a storage unit; the state initialization unit is used to obtain initialization plot parameters based on the user character's tone parameter set and personality parameter set combined with a preset character-plot state library; The storage unit is used to store initial plot parameters and dynamic context data generated during system operation; the dynamic context data includes real-time updated character status, plot progress status, historical dialogue memory, current scene identifier, and response result parameters from the tool call module.
4. The large language model character interaction system based on plot-driven and tool-calling as described in claim 3, characterized in that, The state database module also includes a query and update unit; the plot initialization unit is used to send a query request to the query and update unit to obtain all the context data required for the current interaction round; the context data includes the character state, user preferences, latest plot progress state and complete historical conversation context features before the current round corresponding to the current round; The context data is parsed and extracted to obtain key historical dialogue sequences, a list of triggered key events, and markers of changes in character emotional states; The character's emotional state change markers include emotional type change markers and emotional intensity change markers under the corresponding emotional type; the parsed and extracted context data is reorganized and encapsulated according to the data structure template required by the plot rule engine to obtain standardized context input parameters.
5. The large language model character interaction system based on plot-driven and tool-calling as described in claim 4, characterized in that, The plot progression module further includes an event triggering unit; the event triggering unit is configured to: receive the basic plot direction, extract new node identifiers, node completion status identifiers, and updated timestamp information from the updated plot progress status as current plot progress status feature parameters; input the current plot progress status feature parameters and a preset random trigger probability threshold into a conditional probability model constructed by a Bayesian neural network to calculate the satisfaction determination result of the random trigger condition; when the satisfaction determination result is satisfied, perform feature matching based on the expected emotional tone tags, core plot text descriptions, and a preset random branch event library in the basic plot direction. The matching process involves selecting a unique random branch event from the preset random branch event library that meets the matching conditions, and then injecting the selected random branch event into the core plot text description of the basic plot direction according to the preset event injection rules. This generates a plot development framework that includes a unique event identifier, a core plot text description containing random branch event content, an expected emotional tone tag, and an uncertain branch identifier. When the satisfaction determination result is not satisfied, no random branch event is selected and the preset event injection rules are not executed. Instead, a plot development framework that includes a unique event identifier, the original core plot text description, an expected emotional tone tag, and does not contain an uncertain branch identifier is directly generated.
6. The large language model character interaction system based on plot-driven and tool-calling as described in claim 5, characterized in that, The plot evolution module also includes a decision generation unit; The decision generation unit is configured to: receive the plot development framework, the initial character state, and the initial user preferences, and perform information integration to obtain an integrated dataset; the integrated dataset includes the core plot text description, expected emotional tone label, uncertainty branch identifier, tone parameter set and personality parameter set in the initial character state, and feature dimensions of the initial user preferences in the plot development framework; based on the integrated dataset, combined with semantic parsing algorithm and conditional random field target extraction algorithm, analyze the correlation between the core plot text description, expected emotional tone label, uncertainty branch identifier, tone parameter set and personality parameter set in the initial character state, and feature dimensions of the initial user preferences in the plot development framework, and obtain the core behavioral target of the virtual character at the current plot node; Based on the core behavioral objective, and combined with the tone parameter set and personality parameter set in the initial character state, a tone adjustment strategy that achieves the core behavioral objective and is consistent with the character's personality is derived through a matching algorithm based on cosine similarity. Simultaneously, based on the plot logic contained in the core plot text description of the integrated dataset's plot development framework, it is determined whether the current plot advancement requires obtaining external information or services. When the determination result indicates that obtaining external information or services is required, a structured tool call request is generated according to the preset tool call request format. When the determination result indicates that obtaining external information or services is not required, no tool call request is generated. The final output is a set of behavioral decision instructions composed of the parsed core behavioral goals, the deduced tone adjustment strategies, the structured tool call request generated when the determination result indicates that it is required, and the random branch events existing in the plot development framework.
7. The large language model character interaction system based on plot-driven and tool-calling as described in claim 6, characterized in that, The conversation generation module includes an input unit and a constraint parsing unit. The input unit is used to extract the behavioral objectives and tone adjustment strategies from the behavioral decision instruction set, the initial character state, initial user preferences, and response result parameters from the initial plot progress, based on the behavioral decision instruction set, the response result parameters, the initial plot progress, and the continuous scene behavioral constraint rule set, to construct a conversation generation input dataset. The constraint parsing unit parses the continuous scene behavioral constraint rule set from the conversation generation input dataset, extracts behavioral action specifications, and calculates the consistency index of speech rate, tone, and behavioral actions with micro-expressions at the same timestamp based on the tone parameter set and the speech rate level and politeness level labels in the personality parameter set, generating a standardized constraint condition set containing constraint thresholds and behavioral action boundaries.
8. The large language model character interaction system based on plot-driven and tool-calling as described in claim 7, characterized in that, The conversation generation module further includes a conversation generation unit; the conversation generation unit, based on the conversation generation input dataset, obtains behavioral targets, tone adjustment strategies, response result parameters and initial plot progress as core driving parameters, and obtains the initial character state based on the initial plot progress; Based on the standardized constraint set, quantitative constraint thresholds, behavioral action boundaries, and rules for determining the consistency of speech rate and tone under the same timestamp are obtained to construct a dynamic constraint space. A preset multimodal conversation model is invoked, and the core driving parameters and language-personality feature parameters in the initial character state are input into the input encoding layer of the multimodal conversation model to obtain a unified semantic representation that integrates plot, character, tool, and constraint information. Based on the current scene identifier and behavioral action boundary combined with the scene context adaptation layer of the multimodal conversation model, scene semantic enhancement is performed on the unified semantic representation to obtain an intermediate representation for scene adaptation. At the same time, through the character personality feature mapping layer of the multimodal conversation model, the intonation identifier, speech rate level, and conversation vocabulary preference set in the language-personality feature parameters are used as style control vectors and injected into the attention mechanism of the multimodal conversation model to obtain the generation state of personality feature enhancement. During the generation process at each time step, the constraint verification layer based on the multimodal conversation model combines the quantization constraint threshold and the consistency judgment rule to perform real-time scoring and filtering of candidate outputs and obtain the candidate token distribution that satisfies the constraints. Based on the intermediate representation of the scene adaptation, the generation state of the personality feature enhancement, and the candidate token distribution that satisfies the constraints, the coherent token sequence that constitutes the initial role conversation set is iteratively output through autoregressive decoding.
9. The large language model character interaction system based on plot-driven and tool-calling as described in claim 8, characterized in that, The conversation generation module further includes a conversation optimization unit. This unit iterates through the initial character conversation set sentence by sentence. For each conversation unit, a verification step is performed, specifically: based on the judgment rules in the standardized constraint set, the speech rate characteristics, tone intensity, word preference, and accompanying action descriptions of each initial character conversation are analyzed and verified to obtain the consistency deviation score and constraint violation marker relative to the preset behavioral target and tone adjustment strategy; all verification results are evaluated, and based on a preset fault tolerance threshold, the initial character conversation set to be optimized and its corresponding specific deviation type are obtained; the optimization process is initiated, and for each target conversation in the initial character conversation set to be optimized, based on its deviation type and constraint violation marker, combined with the language-personality feature parameters, an optimization prompt containing specific correction instructions and character style context is constructed to drive the multimodal conversation model or its dedicated optimization submodule to regenerate content or make local adjustments to obtain the optimized target conversation; the optimized target conversation is used to replace the original target conversation to obtain a character conversation set satisfying the dynamic constraint space in a continuous scenario.
Citation Information
Patent Citations
Intelligent task-based dialogue method, system, device and program product fused with large language model
CN118569385A
Interaction system and chat robot for carrying out stylized dialogue based on large language model
CN118606441A
DeepSeek-based role large model fine tuning corpus automatic generation method
CN120849555A
Method and system for automatically generating 3D scene interaction script based on large language model
CN121303094A