Content generation methods, apparatus, electronic devices, and computer-readable storage media

By using multimodal data fusion and knowledge graph technology, the generative model can generate content that is highly consistent with the IP settings, solving the problem of inconsistent role generation in existing technologies and improving the accuracy and quality of content generation.

CN122286642APending Publication Date: 2026-06-26FIBOCOM WIRELESS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FIBOCOM WIRELESS
Filing Date
2026-03-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, character generation is difficult to align with IP settings and lacks consistency assessment, resulting in inconsistencies in the style, values, and knowledge background of the generated content.

Method used

By acquiring multimodal role setting data, extracting features and fusing them into a unified feature vector, converting it into a knowledge graph, using a generative model to generate content, and using the knowledge graph to calculate the confidence level of role update data and counterfactual reasoning to ensure consistency.

Benefits of technology

This achieves a high degree of consistency between generated content and character settings, improving the accuracy and quality of content generation and ensuring consistency in style and values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122286642A_ABST
    Figure CN122286642A_ABST
Patent Text Reader

Abstract

This invention proposes a content generation method, apparatus, electronic device, and computer-readable storage medium. The method includes the following steps: acquiring character setting data, which includes setting sub-data of different modalities; for each setting sub-data, extracting features based on the modality of the setting sub-data to obtain extracted features corresponding to the setting sub-data; fusing the extracted features corresponding to each setting sub-data to obtain a unified feature vector; converting the unified feature vector into a knowledge graph; and if a generation instruction is received, generating content corresponding to the generation instruction through the knowledge graph. By comprehensively using multimodal character setting data to generate a knowledge graph corresponding to the character, the knowledge graph can more comprehensively and accurately extract character characteristics. Content generation is then performed based on the knowledge graph, enabling the content to fully reproduce the character's characteristics and maintain consistency between the generated content and the character.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graphs, and more particularly to a content generation method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Existing IP (Intellectual Property) character reproduction technologies mainly rely on static rule systems or pre-trained large language models. These solutions generate outputs that conform to the IP setting by manually annotating character personality traits and worldview rules, combined with scripted dialogue trees or simple dialogue generation models. However, this approach lacks quantitative methods for consistent character evaluation and makes it difficult to ensure that the generated content is completely consistent with the IP setting in terms of style, values, and knowledge background. Summary of the Invention

[0003] The main objective of this invention is to provide a content generation method, apparatus, electronic device, and computer-readable storage medium, aiming to solve the problem in the prior art that character generation is difficult to match with IP settings.

[0004] To achieve the above objectives, the present invention provides a content generation method, the method comprising the following steps: Obtain character setting data, which includes setting sub-data for different modalities; For each set sub-data, feature extraction is performed on the set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data; The extracted features corresponding to each of the defined sub-data are fused to obtain a unified feature vector; The unified feature vector is converted into a knowledge graph; If a generation instruction is received, the content corresponding to the generation instruction is generated based on the knowledge graph using the generation model.

[0005] Optionally, after converting the unified feature vector into a knowledge graph, the method further includes: If character update data is received, the confidence level of the character update data is calculated based on the knowledge graph, wherein the confidence level indicates the consistency between the character update data and the character setting data; The knowledge graph is updated based on the confidence level using the role update data.

[0006] Optionally, calculating the confidence level of the role update data based on the knowledge graph includes: Calculate the context similarity of the character update data based on the knowledge graph; Obtain the credibility of the data source corresponding to the character update data; The confidence level of the role update data is obtained by combining the context similarity and the data source credibility.

[0007] Optionally, calculating the confidence level of the role update data based on the knowledge graph includes: Counterfactual reasoning is performed on the character update data based on the knowledge graph to determine whether the character update data is reasonable. If the character update data is unreasonable, the confidence level of the character update data is set to 0.

[0008] Optionally, fusing the extracted features corresponding to each of the defined sub-data to obtain a unified feature vector includes: Determine the modal weights corresponding to the modalities of the defined sub-data; For each set sub-data, feature masking is performed according to the corresponding modal weight to obtain the masked sub-data corresponding to the set sub-data, wherein the modal weight is positively correlated with the proportion of the masked sub-data that is masked; The unified feature vector is obtained by fusing the various masking sub-data.

[0009] Optionally, the step of converting the unified feature vector into a knowledge graph includes: Extract rule data from the character setting data; Determine the role logic constraints corresponding to the rule data; The role logic constraints are embedded into the knowledge graph.

[0010] Optionally, the step of generating the content corresponding to the generation instruction based on the knowledge graph using a generative model includes: Determine the generated content entropy of the content and obtain the user evaluation data corresponding to the content; A reward function is constructed based on the generated content entropy and the user evaluation data; The generative model is updated using the reward function.

[0011] Optionally, constructing the reward function based on the generated content entropy and the user rating data includes: Obtain multiple user sub-ratings from the user rating data; For each user sub-rating, obtain the evaluation frequency and evaluation consistency corresponding to the user sub-rating; Determine the user weights corresponding to the evaluation frequency and evaluation consistency; A reward function is constructed based on the generated content entropy, each user sub-rating, and the corresponding user weight.

[0012] To achieve the above objectives, the present invention also provides a content generation apparatus, the content generation apparatus comprising: The first acquisition module is used to acquire character setting data, which includes setting sub-data for different modalities; The first extraction module is used to extract features from each set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data. The first fusion module is used to fuse the extracted features corresponding to each of the set sub-data to obtain a unified feature vector; The first conversion module is used to convert the unified feature vector into a knowledge graph; The first generation module is used to generate the content corresponding to the generation instruction based on the knowledge graph through the generation model if a generation instruction is received.

[0013] To achieve the above objectives, the present invention also provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the content generation method as described above.

[0014] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the content generation method described above.

[0015] This invention proposes a content generation method, apparatus, electronic device, and computer-readable storage medium. The method involves acquiring character setting data, which includes sub-data of different modalities. For each sub-data, feature extraction is performed based on its modality to obtain extracted features. These extracted features are then fused to obtain a unified feature vector. This unified feature vector is converted into a knowledge graph. If a generation instruction is received, content corresponding to the instruction is generated based on the knowledge graph using a generation model. By integrating multimodal character setting data to generate a knowledge graph corresponding to a character, the character features extracted from the knowledge graph have broader and more diverse sources. This allows the knowledge graph to extract character characteristics more comprehensively and accurately. Content generation based on the knowledge graph then fully reflects the character's characteristics, maintaining consistency between the generated content and the character, and improving the accuracy of content generation. Attached Figure Description

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

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

[0018] Figure 1 This is a flowchart illustrating the first embodiment of the content generation method of the present invention; Figure 2 This is a detailed flowchart of the content generation method of the present invention; Figure 3 This is a schematic diagram of the module structure of the electronic device of the present invention. Detailed Implementation

[0019] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0020] This invention provides a content generation method, referring to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the content generation method of the present invention, the method comprising the following steps: Step S10: Obtain character setting data, which includes setting sub-data for different modalities; Character setting data describes the initial settings of a character; the specific type of character setting data can be set according to actual needs, such as text, images, audio and video sources of the character, such as novels, scripts, and setting frameworks from which the character originates, images such as character design drawings, and audio and video sources such as animations and voice-overs from which the character originates.

[0021] The sub-data is the data corresponding to a single modality in the character setting data; if the character setting data contains data of different modalities such as text, image, audio and video, then text, image, and audio each correspond to a sub-data.

[0022] Step S20: For each set sub-data, feature extraction is performed on the set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data; Different extraction methods should be used for data from different modalities; For example, for the setting sub-data of the text modality, a large language model can be used to analyze the text in order to extract features from the setting sub-data; the specific content extracted may include character personality traits, world view rules, related characters, locations, items, etc.

[0023] For the image modality's set subdata, the CLIP (Contrastive Language–Image Pretraining) model can be used to analyze character design drawings, scene illustrations, and videos to extract the character's appearance features, such as hair color and clothing, as well as the style of the environment in which the character is located, such as medieval or cyberpunk.

[0024] For the set sub-data of audio modalities, character audio, such as tone and emotional dynamics in dubbing, can be extracted through ASR (Automatic Speech Recognition) and sentiment analysis.

[0025] Step S30: The extracted features corresponding to each of the set sub-data are fused to obtain a unified feature vector; The unified feature vector includes features obtained from the character setting data. Therefore, the knowledge graph obtained by converting the unified feature vector can indicate the specific characteristics of the character in the character setting data.

[0026] Step S40: Convert the unified feature vector into a knowledge graph; The knowledge graph contains character-related features extracted from character setting data, and the knowledge graph can reflect the specific characteristics of a character within the setting.

[0027] The specific method for constructing a knowledge graph from character-defined data can be set based on actual needs.

[0028] The specific transformation method can be set according to actual needs. For example, entities such as roles, locations, and items can be extracted from a unified feature vector, and entity relationships can be constructed for specific entities to generate triples; such as (role A, role B, friend), (role A, location A, home), (role A, item A, like). By determining the relationships between different entities, the triples that constitute the knowledge graph are finally obtained, thus obtaining the final knowledge graph. The specific entity and relationship extraction methods can be set according to actual needs. For example, entities can be extracted by using NER (Named Entity Recognition), and relationships between entities can be extracted by using a relationship extraction model. The specific type of relationship extraction model can be set according to actual needs, such as BERT-based RE.

[0029] Step S20: If character update data is received, calculate the confidence level of the character update data based on the knowledge graph, wherein the confidence level indicates the consistency between the character update data and the character setting data; Step S30: Update the knowledge graph based on the confidence level using the role update data; Step S50: If a generation instruction is received, the content corresponding to the generation instruction is generated based on the knowledge graph using the generation model.

[0030] The generation command instructs the generation of new content; the generation command is sent by the user or triggered by specific conditions.

[0031] The specific type of content can be set based on actual needs, such as text, dialogue, behavior, voice, video, and images.

[0032] The specific content generation method can be set based on actual needs. For example, a corresponding model can be set to generate content based on a knowledge graph. Understandably, to improve the accuracy of specific modality generation, different generation methods can be set for different types of content. For example, for text content such as text and dialogue, a Transformer model can be set; for behavioral content, a behavior tree can be set to simulate the character's behavioral decisions, such as choosing to fight or flee in a dangerous scenario; for image content such as video and pictures, an image generation model can be set; for audio content, text-to-speech can be set, and an image generation model can be combined to output images and audio simultaneously.

[0033] In this embodiment, a knowledge graph corresponding to a role is generated by integrating multimodal role setting data. This allows the role features extracted from the knowledge graph to have a wider and more diverse source, enabling the knowledge graph to extract role characteristics more comprehensively and accurately. Content generation is then performed based on the knowledge graph, ensuring that the content fully reflects the role's characteristics, maintaining consistency between the generated content and the role, and improving the accuracy of content generation. Furthermore, in the second embodiment of the content generation method of the present invention based on the first embodiment, step S40 is followed by: Step S60: If character update data is received, calculate the confidence level of the character update data based on the knowledge graph, wherein the confidence level indicates the consistency between the character update data and the character setting data; Step S70: Update the knowledge graph based on the confidence level using the role update data.

[0034] Character update data is supplementary data added after the character's initial settings, supplementing the character's information, such as update information, sequels, and fan-created content. The specific type of character update data can be set based on actual needs, such as text, images, audio, and video. Character update data can be provided by users or generated using GANs (Generative Adversarial Networks) to produce diverse content that conforms to the established settings.

[0035] The confidence level indicates the consistency between the character update data and the character setting data. It can be understood that the knowledge graph is built on the character setting data. Therefore, the knowledge graph reflects the character's setting characteristics. Thus, based on the knowledge graph, it is possible to determine whether the character update data conforms to the character's setting, and to give the confidence level of the character update data based on the degree to which the character update data conforms to the setting.

[0036] After determining the confidence level of the character update data, the knowledge graph can be updated based on the confidence level. Specifically, the higher the confidence level, the greater the degree to which the character update data is applied to update the knowledge graph. That is, the more relevant the character update data is to the character setting data, the greater the degree to which the character update data updates the knowledge graph. This ensures that the character settings remain consistent after the new data updates the knowledge graph, avoiding deviations from the initial settings.

[0037] The specific update method can be set based on actual needs. For example, update feature vectors can be extracted from role update data, and the unified feature vectors and knowledge graph can be updated through these update feature vectors. Alternatively, an online variational autoencoder (Online VAE) can be used to dynamically adjust the feature representation.

[0038] Where F' is the updated feature vector; Fnew is the role update data; F is the original unified feature vector of the knowledge graph; and δ is the learning rate, which is set to 0.01 by default.

[0039] Since knowledge graphs are built on role setting data and updated based on confidence levels using role update data, they ensure the consistency of role settings. Therefore, content generated based on knowledge graphs can be consistent with role settings, thus ensuring that the generated content meets the role settings and improving the quality of content generation.

[0040] This embodiment calculates the confidence level of the updated role data based on the knowledge graph when adding new data, thereby determining whether the updated role data conforms to the role setting. The knowledge graph is then updated based on the confidence level, ensuring that the knowledge graph updates always meet the role setting, thus improving the consistency between the content generated based on the knowledge graph and the role setting data. Further, step S60 includes the following steps: Step S61: Calculate the contextual similarity of the role update data based on the knowledge graph; Step S62: Obtain the data source credibility corresponding to the character update data; Step S63: Combine the context similarity and the data source credibility to obtain the confidence level of the role update data.

[0041] Context similarity indicates the degree of similarity between the updated role data and the knowledge graph. The specific type of context similarity can be set based on actual needs, such as cosine similarity. Specifically, feature extraction is first performed on the updated role data to obtain the updated feature vector, and the updated feature vector and the corresponding feature vector in the knowledge graph are pre-similar to calculate the context similarity.

[0042] Data source credibility is used to indicate the authority of the source of character update data. For example, the data source can be the official character creator, partners, fan creations, etc. The official character creator has the highest data source credibility because they are the creators of the character. Partners have official authorization and a high degree of consistency with the character, so their data source credibility is also relatively high. Fan creations have a more diverse source and are influenced by the understanding and creative direction of specific fans, so their data source credibility is relatively low. By verifying the data source credibility, we can determine the reliability of the data from the source of the character update data, thereby helping to determine the confidence level.

[0043] The confidence level of the role update data is obtained by combining contextual similarity and data source credibility; specifically:

[0044] Where G is the updated knowledge graph; Update() indicates an update; G prev The knowledge graph before the update; E new For new entities extracted from character update data; R new C represents the new relation extracted from the role update data; C is the confidence level; Confidence(·) indicates the confidence level calculation; D new Update data for the character; S context For context similarity; M source This relates to the credibility of the data source.

[0045] In practical applications, a confidence threshold can be set. The knowledge graph will only be updated using the role update data if the confidence of the role update data is greater than the confidence threshold; otherwise, the knowledge graph will not be updated using the role update data if the confidence of the role update data is less than or equal to the confidence threshold.

[0046] It should be noted that when obtaining character update data, there may be multiple character update data. Confidence is calculated for each character update data, and an update operation is performed on the corresponding character update data based on the confidence score.

[0047] Further, step S60 includes the following steps: Step S64: Perform counterfactual reasoning on the character update data based on the knowledge graph to determine whether the character update data is reasonable; Step S65: If the character update data is unreasonable, then set the confidence level of the character update data to 0.

[0048] Counterfactual reasoning is used to verify whether character update data violates the character's established characteristics.

[0049] Specifically, counterfactual reasoning can use simulation to combine character update data into the knowledge graph and determine whether, after combination, the character will behave in ways that are inconsistent with its established settings or worldview rules under different environments. If so, the character update data is considered unreasonable, and therefore, the confidence level of the character update data is set to 0, and the knowledge graph is not updated using the character update data. Otherwise, the character update data is considered reasonable, and the knowledge graph is updated using the character update data.

[0050] This embodiment introduces counterfactual reasoning, which enables verification of whether the character remains consistent with the settings in a specific scenario, thereby ensuring the consistency between the generated content and the settings.

[0051] Furthermore, in the third embodiment of the method for generating the content of this invention based on the first embodiment of this invention, step S30 includes the following steps: Step S31: Determine the modal weights corresponding to the modalities of the set sub-data; Step S32: For each set sub-data, feature masking is performed according to the corresponding modal weight to obtain the masked sub-data corresponding to the set sub-data, wherein the modal weight is positively correlated with the proportion of the masked sub-data that is masked; Step S33: The various masking sub-data are fused to obtain the unified feature vector.

[0052] To avoid information redundancy in text data, CAMAE (Complementary-Aware Masked Autoencoder) can be used to randomly mask some text tokens, forcing large language models to focus on cross-modal complementary information and generate compressed semantic feature vectors.

[0053] For image modality setting subdata, image patches can be masked using CAMAE to enhance cross-modal alignment and map to the text feature space.

[0054] For the setting sub-data of audio modalities, audio frames can be masked using CAMAE to capture temporal emotional features.

[0055] After obtaining the extracted features of the set sub-data for different modalities, the extracted features corresponding to each modality are fused. The specific fusion method can be set according to actual needs. For example, using CAMAE to achieve cross-modal complementary learning through selective occlusion can outperform traditional feature stitching.

[0056] Where F is the unified feature vector; F t Extracted features corresponding to text modalities; w t For F t Modal weights; F i Extracted features corresponding to image modalities; w i For F i Modal weights; F a Extracted features corresponding to audio modalities; w a For F a Modal weights; The specific values ​​of the aforementioned weights can be set based on the importance of the specific modality. For example, the sub-data of the text modality usually contains more information, therefore, a larger modality weight needs to be set, such as (w t w i w aThe weights of the modal data are set to (0.4, 0.3, 0.3). Therefore, in this embodiment, the modal weights are set to be positively correlated with the proportion of the masked sub-data that is masked. This enables the masking of multimodal data based on the actual data situation, learning cross-modal complementary information, generating robust feature representations, and solving the noise problem of traditional feature splicing. In practical applications, dynamic weights can be set to determine the specific values ​​of each modal weight based on the amount of data contained in the text, image, and audio.

[0057] Furthermore, in the fourth embodiment of the method for generating the content of this invention based on the first embodiment of this invention, step S10 includes the following steps: Step S11: Extract rule data from the character setting data; Step S12: Determine the role logic constraints corresponding to the rule data; Step S13: Embed the role logic constraints into the knowledge graph.

[0058] The rule data is the data used in the character setting data to describe the rules of the world view; the rules of the world view can be set based on actual needs, such as magic can only be used during a full moon.

[0059] It is understandable that character settings involve not only relationship settings but also rule settings. However, when new data is added for updates, the new data may contain content related to character behavior or environmental settings. This content may not conflict with entity relationships but may violate worldview rules, which is difficult to determine directly through entity relationships. Therefore, to ensure that subsequent updates conform to the set worldview rules, this embodiment embeds rule data into the knowledge graph. When the knowledge graph is updated, it can call the embedded rule data and determine whether the updated character data conforms to the worldview rules. Then, it combines the degree of conformity with the worldview rules to determine the confidence level of the updated character data. It is understood that the higher the degree of conformity with the worldview rules, the higher the corresponding confidence level.

[0060] Furthermore, in the fifth embodiment of the invention content generation method based on the first embodiment of the present invention, step S40 is followed by the following step: Step S80: Determine the generated content entropy of the content and obtain the user evaluation data corresponding to the content; Step S90: Construct a reward function based on the generated content entropy and the user evaluation data; Step S100: Update the generative model using the reward function.

[0061] Content entropy is used to indicate the diversity of generated content. The specific calculation method of content entropy can be set according to actual needs, such as performing semantic recognition on the generated content to determine the generation frequency of different words in the content, and combining the differences and frequencies between different words to calculate content entropy. It can be understood that the higher the content entropy, the better the diversity of the generated content. Therefore, updating the knowledge graph based on content entropy can avoid generating single and repetitive content.

[0062] User rating data is data obtained by users evaluating content; after content is output, users can rate it; user rating data directly indicates the user's satisfaction with the generated content. Therefore, updating the knowledge graph using user rating data can make the knowledge graph more in line with user needs.

[0063] The reward function indicates the reward design in the generative model; in this embodiment, the reward function is dynamically constructed by generating content entropy and user evaluation data, so that the reward function can improve the diversity and user needs of the generated content, thereby improving the quality of the generated content.

[0064] Further, step S90 includes the following steps: Step S91: Obtain multiple user sub-ratings from the user rating data; Step S92: For each user sub-rating, obtain the evaluation frequency and evaluation consistency corresponding to the user sub-rating; Step S93: Determine the user weights corresponding to the evaluation frequency and evaluation consistency; Step S94: Construct a reward function based on the generated content entropy, each user sub-rating, and the corresponding user weight.

[0065] Understandably, in practical applications, the generated content may be targeted at different users; and in order to achieve a comprehensive consideration of the evaluations of different users, it is necessary to combine the evaluations of multiple users to construct the reward function; user sub-ratings are the evaluation data corresponding to a single user.

[0066] Different users have varying degrees of importance or influence on the generated content. For example, some users may provide perfunctory reviews, resulting in low-quality evaluations that need to be filtered out; while others provide professional reviews, requiring an increase in their weight in the reward function construction. Therefore, this embodiment determines the evaluation frequency and consistency of user sub-ratings to assess user influence. Comment frequency refers to the frequency with which users perform comment operations, and comment frequency is positively correlated with user weight. Evaluation consistency refers to the consistency of users' opinions in their evaluations, and evaluation consistency is also positively correlated with user weight.

[0067] Users with consistent evaluation criteria and high engagement in evaluations can be selected based on evaluation frequency and consistency. Therefore, user weights can be reasonably determined by evaluating frequency and consistency.

[0068] After determining the user weights, a reward function can be constructed by combining the generated content entropy and each user's sub-rating; specifically:

[0069] Where R is the reward function; W user User weight; R user Sub-rating for users; H(P) gen ) represents the entropy of the generated content; η represents the weight of the entropy of the generated content. The specific value of η can be set based on actual needs, such as 0.1.

[0070] The following is based on Figure 2 The overall process of this application is explained as follows: 1. Multimodal semantic distillation: Extract core features from text (such as novels and scripts), images (such as character design drawings), and audio and video (such as dubbing and animation) of IP (Intellectual Property) to generate a unified feature representation for subsequent generation and reasoning.

[0071] process: Text processing: A pre-trained large language model is used to analyze IP-related texts, extracting character traits (such as bravery and resourcefulness) and worldview rules (such as "magic requires specific incantations"). To avoid information redundancy, a complementary perceptual masking autoencoder is used. By randomly masking some text tokens, the model is forced to focus on cross-modal complementary information, generating compressed semantic feature vectors.

[0072] Image processing: The CLIP model is used to analyze character design drawings and scene illustrations to extract appearance features (such as hair color and clothing) and environmental styles (such as medieval and cyberpunk). Image patches are masked using CAMAE to enhance cross-modal alignment and map them to the text feature space.

[0073] Audio and video processing: Extract tone and emotional dynamics (such as optimism and anger) from dubbing through automatic speech recognition and sentiment analysis. CAMAE masks audio frames to capture temporal emotional features.

[0074] Feature fusion: Weighted fusion of text, image and audio / video features to generate a unified feature vector, ensuring that information from each modality is complementary and reducing noise interference.

[0075] CAMAE is used to achieve cross-modal complementary learning through selective occlusion, which is superior to traditional feature splicing.

[0076] 2. Dynamic knowledge graph construction: Transform feature vectors into structured IP knowledge graphs, supporting dynamic updates and ensuring consistency.

[0077] process: Entity and Relationship Extraction: Extract entities such as roles, locations, and items from text features, as well as relationships between entities (e.g., "role A is a friend of role B"), using named entity recognition and relationship extraction models.

[0078] Rule embedding: Transform worldview rules (such as "magic can only be used during a full moon") into logical constraints and embed them into the knowledge graph.

[0079] Dynamic updates: When new data (such as sequels, fan content) or user feedback arrives, a comprehensive confidence score is calculated to assess the credibility of the new information. Only knowledge with a confidence score higher than a threshold triggers an update. During updates, a GNN (Graph Neural Network) is used to fuse new and old knowledge and resolve potential conflicts.

[0080] Counterfactual reasoning: To ensure that new knowledge does not deviate from the IP's established settings, counterfactual reasoning is used to verify its rationality. For example, check "If character A possesses new knowledge X, will they behave in a way consistent with their personality Y?" If it is unreasonable, the update or weight adjustment is rejected.

[0081] Storage and Query: Neo4j is used to store the knowledge graph, supporting efficient querying and reasoning.

[0082] Combining confidence level and counterfactual reasoning ensures the consistency of knowledge graph updates.

[0083] 3. Adaptive Generative Model: Based on knowledge graphs and feature vectors, it generates dialogues and behaviors that conform to the IP settings.

[0084] process: Dialogue generation: Using the Transformer model, combined with knowledge graphs and feature vectors, dialogues are generated that align with the character's personality and worldview. Design prompts embed personality traits (e.g., "Brave characters prioritize combat").

[0085] Behavior generation: Simulate character decisions (such as choosing to fight or flee in a dangerous scenario) through behavior trees to ensure that the behavior conforms to the rules of the worldview.

[0086] Consistency Optimization: An improved role consistency assessment mechanism is introduced, combining expert rules (such as IP setting documents) and reference output generated by manual evaluation to quantify the fit between generated content and IP settings. The differences in attention distribution between the generated model and IP settings when processing the same input are analyzed to ensure consistency in style and values.

[0087] Multimodal output: Combining text-to-speech and image generation models, outputting content that matches the character's tone and visual style (such as passionate knight voice-over and armor animation).

[0088] By combining semantic distribution (KL divergence), feature similarity, and attention distribution difference (AttnDiff), the consistency between generated content and IP settings in terms of semantics, features, and concerns is comprehensively evaluated. The improved role consistency loss function is as follows:

[0089] Among them, (P) gen ||P IP The probability distribution set for generated content and IP; (F) gen , F) represents the generated content and target feature vectors. (A) gen A IP ): Attention distribution for generated content and IP settings. (λ1, λ2, λ3) are weights (default 0.5, 0.3, 0.2).

[0090] 4. Information-based reinforcement learning: Optimize generated content through high-quality user feedback, balancing consistency and diversity.

[0091] process: Reward Design: The reward function is designed based on user ratings (such as "fits the character's personality") and the diversity of generated content. Diversity is evaluated using information entropy to avoid generating repetitive, identical content.

[0092] Feedback quality assessment: Assign weights to user feedback, filter low-quality or malicious feedback based on user history (such as feedback frequency and consistency) and consistency scores of multi-user feedback.

[0093] Optimization process: The PPO (Proximal Policy Optimization) algorithm is used to optimize and generate model parameters based on weighted feedback. User preferences are collected through A / B testing to dynamically adjust the reward function.

[0094] Establish a feedback quality assessment mechanism and an information entropy reward system.

[0095] 5. Self-evolution module: Achieves dynamic optimization of the agent through incremental learning and adversarial training.

[0096] process: Incremental learning: Extract features from new data (such as sequels and fan content) and update the unified feature vector and knowledge graph. Use an online variational autoencoder to dynamically adjust the feature representation.

[0097] Adversarial training: Generative adversarial networks generate diverse content that conforms to IP settings, and a discriminator evaluates the consistency between the generated content and the IP settings.

[0098] Consistency constraints: Counterfactual reasoning is used to verify the rationality of updated features and knowledge, ensuring that they do not deviate from the IP setting. KL divergence constraint models are used for updates to prevent catastrophic forgetting.

[0099] Building online VAEs and counterfactual reasoning to support dynamic evolution:

[0100] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0102] This application also provides a content generation apparatus for implementing the above-described content generation method, the content generation apparatus comprising: The first acquisition module is used to acquire character setting data, which includes setting sub-data for different modalities; The first extraction module is used to extract features from each set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data. The first fusion module is used to fuse the extracted features corresponding to each of the set sub-data to obtain a unified feature vector; The first conversion module is used to convert the unified feature vector into a knowledge graph; The first generation module is used to generate the content corresponding to the generation instruction based on the knowledge graph through the generation model if a generation instruction is received.

[0103] This content generation device generates a knowledge graph corresponding to a character by integrating multimodal character setting data. This allows the character features extracted from the knowledge graph to have a wider and more diverse source, enabling the knowledge graph to extract character characteristics more comprehensively and accurately. Content is then generated based on the knowledge graph, ensuring that the content fully reproduces the character's characteristics, maintaining consistency between the generated content and the character, and improving the accuracy of content generation.

[0104] It should be noted that the first acquisition module in this embodiment can be used to execute step S10 in this application embodiment, the first extraction module in this embodiment can be used to execute step S20 in this application embodiment, the first fusion module in this embodiment can be used to execute step S30 in this application embodiment, the first conversion module in this embodiment can be used to execute step S40 in this application embodiment, and the first generation module in this embodiment can be used to execute step S50 in this application embodiment.

[0105] Furthermore, the device also includes: The first receiving module is configured to convert the unified feature vector into a knowledge graph, and if it receives role update data, calculate the confidence level of the role update data based on the knowledge graph, wherein the confidence level indicates the consistency between the role update data and the role setting data. The first update module is used to update the knowledge graph based on the confidence level using the role update data.

[0106] Furthermore, the first update module includes: The first computing unit is used to calculate the context similarity of the role update data based on the knowledge graph; The first acquisition unit is used to acquire the credibility of the data source corresponding to the character update data; The first integration unit is used to integrate the context similarity and the data source credibility to obtain the confidence level of the role update data.

[0107] Further, the first receiving module includes: The first reasoning unit is used to perform counterfactual reasoning on the role update data based on the knowledge graph to determine whether the role update data is reasonable. The first setting unit is used to set the confidence level of the character update data to 0 if the character update data is unreasonable.

[0108] Furthermore, the first fusion module includes: The first determining unit is used to determine the modal weights corresponding to the modalities of the set sub-data. The first execution unit is configured to perform feature masking on each set sub-data according to the corresponding modal weight to obtain masked sub-data corresponding to the set sub-data, wherein the modal weight is positively correlated with the proportion of the masked sub-data being masked; The first fusion unit is used to fuse the various masking sub-data to obtain the unified feature vector.

[0109] Furthermore, the device also includes: The second extraction module is used to extract rule data from the role setting data after converting the unified feature vector into a knowledge graph. The first determining module is used to determine the role logic constraints corresponding to the rule data; The first embedding module is used to embed the role logic constraints into the knowledge graph.

[0110] Further, the device includes: The second determining module is used to determine the generated content entropy of the content after generating the content corresponding to the generation instruction based on the knowledge graph through the generation model, and to obtain the user evaluation data corresponding to the content. The first construction module is used to construct a reward function based on the generated content entropy and the user evaluation data; The second update module is used to update the generated model through the reward function.

[0111] Furthermore, the first building module includes: The second acquisition unit is used to acquire multiple user sub-ratings from the user rating data; The third acquisition unit is used to acquire the evaluation frequency and evaluation consistency corresponding to each user sub-rating. The second determining unit is used to determine the user weights corresponding to the evaluation frequency and evaluation consistency. The first construction unit is used to construct a reward function based on the generated content entropy, each user sub-rating, and the corresponding user weight.

[0112] Reference Figure 3 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to both the memory 20 and the communication module 10. The memory 20 stores a computer program, which is executed by the processor 30. When the computer program is executed, it implements the steps of the above-described method embodiments.

[0113] The communication module 10 can connect to external communication devices via a network. The communication module 10 can receive requests from the external communication devices and can also send requests, instructions, and information to the external communication devices. The external communication devices can be other electronic devices, servers, or IoT devices, such as televisions, etc.

[0114] The memory 20 can be used to store software programs and various data. The memory 20 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as retrieving character setting data), etc.; the data storage area may include a database, and may store data or information created based on system usage. Furthermore, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0115] The processor 30 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 20, and by calling data stored in the memory 20, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 30.

[0116] although Figure 3 Not shown, but the above-described electronic device may further include a circuit control module for connecting to a power supply to ensure the normal operation of other components. Those skilled in the art will understand that... Figure 3 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0117] The present invention also proposes a computer-readable storage medium having a computer program stored thereon. The computer-readable storage medium may be... Figure 3The memory 20 in the electronic device may also be at least one of ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc. The computer-readable storage medium includes a number of instructions to cause a terminal device with a processor (which may be a television, automobile, mobile phone, computer, server, terminal, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0118] In this invention, the terms "first," "second," "third," "fourth," and "fifth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0119] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0120] Although embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, and substitutions to the above embodiments within the scope of the present invention, and such changes, modifications, and substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A content generation method, characterized in that, The content generation method includes: Obtain character setting data, which includes setting sub-data for different modalities; For each set sub-data, feature extraction is performed on the set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data; The extracted features corresponding to each of the defined sub-data are fused to obtain a unified feature vector; The unified feature vector is converted into a knowledge graph; If a generation instruction is received, the content corresponding to the generation instruction is generated based on the knowledge graph using the generation model.

2. The content generation method as described in claim 1, characterized in that, The process of converting the unified feature vector into a knowledge graph also includes: If character update data is received, the confidence level of the character update data is calculated based on the knowledge graph, wherein the confidence level indicates the consistency between the character update data and the character setting data; The knowledge graph is updated based on the confidence level using the role update data.

3. The content generation method as described in claim 2, characterized in that, The calculation of the confidence level of the role update data based on the knowledge graph includes: Calculate the context similarity of the character update data based on the knowledge graph; Obtain the credibility of the data source corresponding to the character update data; The confidence level of the role update data is obtained by combining the context similarity and the data source credibility.

4. The content generation method as described in claim 2, characterized in that, The calculation of the confidence level of the role update data based on the knowledge graph includes: Counterfactual reasoning is performed on the character update data based on the knowledge graph to determine whether the character update data is reasonable. If the character update data is unreasonable, the confidence level of the character update data is set to 0.

5. The content generation method as described in claim 1, characterized in that, The step of fusing the extracted features corresponding to each of the defined sub-data to obtain a unified feature vector includes: Determine the modal weights corresponding to the modalities of the defined sub-data; For each set sub-data, feature masking is performed according to the corresponding modal weight to obtain the masked sub-data corresponding to the set sub-data, wherein the modal weight is positively correlated with the proportion of the masked sub-data that is masked; The unified feature vector is obtained by fusing the various masking sub-data.

6. The content generation method as described in claim 1, characterized in that, The process of converting the unified feature vector into a knowledge graph includes: Extract rule data from the character setting data; Determine the role logic constraints corresponding to the rule data; The role logic constraints are embedded into the knowledge graph.

7. The content generation method as described in claim 1, characterized in that, After generating the content corresponding to the generation instruction based on the knowledge graph using a generative model, the following steps are included: Determine the generated content entropy of the content and obtain the user evaluation data corresponding to the content; A reward function is constructed based on the generated content entropy and the user evaluation data; The generative model is updated using the reward function.

8. The content generation method as described in claim 7, characterized in that, The step of constructing a reward function based on the generated content entropy and the user evaluation data includes: Obtain multiple user sub-ratings from the user rating data; For each user sub-rating, obtain the evaluation frequency and evaluation consistency corresponding to the user sub-rating; Determine the user weights corresponding to the evaluation frequency and evaluation consistency; A reward function is constructed based on the generated content entropy, each user sub-rating, and the corresponding user weight.

9. A content generation device, characterized in that, The content generation device includes: The first acquisition module is used to acquire character setting data, which includes setting sub-data for different modalities; The first extraction module is used to extract features from each set sub-data based on the modality of the set sub-data to obtain the extracted features corresponding to the set sub-data. The first fusion module is used to fuse the extracted features corresponding to each of the set sub-data to obtain a unified feature vector; The first conversion module is used to convert the unified feature vector into a knowledge graph; The first generation module is used to generate the content corresponding to the generation instruction based on the knowledge graph through the generation model if a generation instruction is received.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the content generation method as described in any one of claims 1 to 7.