Agent-based interactive content generation method and device, electronic equipment and storage medium

Through the interactive content generation method of Agent, the problems of low efficiency of interactive content generation and insufficient accuracy of material matching are solved, and efficient, logically coherent multimodal content generation is achieved, which is suitable for cultural entertainment, education and training, and digital marketing.

CN120372001APending Publication Date: 2025-07-25CHENGDU POTENTIAL ARTIFICIAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510441313.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing interactive content generation technology has problems such as low productivity and insufficient matching accuracy of multimodal material, especially in ultra-long text scenarios, which can easily cause semantic faults and materials to be mismatched, resulting in the semantic deviation of the generated content from the original text.

Method used

An interactive content generation method based on Agent is adopted, text parsing, structured preprocessing, sliding window division of text fragments, multimodal element extraction and semantic bias correction optimization are generated, and interactive content is generated using a multimodal matching algorithm.

Benefits of technology

It improves the efficiency and accuracy of interactive content generation, avoids context loss and material matching errors in long text processing, and the generated content is logically coherent and multimodal material matching is accurate, and is suitable for interactive content generation in diverse scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372001A_ABST
    Figure CN120372001A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to an Agent-based interactive content generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an original text, and carrying out text analysis and structured preprocessing on the original text; dividing the preprocessed original text into a plurality of text fragments based on a sliding window and a fragment assembly strategy; extracting a multi-modal element from the text fragment, and performing material matching by using a multi-modal matching algorithm; optimizing a material matching result based on semantic correction; and generating interactive content based on the optimized multi-modal elements and a material matching result. The objective of the invention is to realize interactive content automatic generation based on the input text and improve the efficiency and accuracy of automatically generating the interactive content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and particularly to an Agent-based interactive content generation method, device, electronic device and storage medium. Background Art

[0002] With the iterative upgrade of digital media technology and the significant improvement of information processing capabilities, interactive multimodal content generation technology has become the core development direction of the cultural and entertainment industry. Such content is characterized by multimodal fusion, and by integrating text, images, audio, video and user interaction behaviors, immersive experience scenarios are constructed. Typical applications cover emerging fields such as interactive games, short dramas, adaptive short videos, non-linear narrative interactive novels, etc.

[0003] The implementation of interactive content generation technology highly depends on the collaborative effect of interdisciplinary technologies such as natural language processing (NLP), computer vision (CV), generative artificial intelligence (AIGC) and real-time rendering engines. Driven by market demand, the content creation paradigm is gradually transforming from labor-intensive to intelligent and automated to meet the exponentially growing demands of users for content quality, personalization and update efficiency. Currently, interactive content generation still faces significant bottlenecks: firstly, the traditional production process relies on the in-depth collaboration of cross-domain teams. Due to high communication costs and long iteration cycles, the production efficiency is low and resource consumption is huge; secondly, the existing automated generation technology is limited by the insufficient accuracy of multimodal material matching algorithms. Especially in the scenario of ultra-long texts, semantic breaks and material mis-matching problems are likely to occur, further leading to semantic deviation between the output content and the original text, restricting the quality of the generated content and the consistency of the user experience. Summary of the Invention

[0004] In order to realize the automatic generation of text-based interactive content and improve the efficiency and accuracy of the interactive content generation results, the present invention provides an Agent-based interactive content generation method, device, electronic device and storage medium. The specific technical solutions adopted are as follows:

[0005] The technical solution of the first aspect of the present invention provides an Agent-based interactive content generation method, and the method includes:

[0006] Obtain the original text and perform text parsing and structured preprocessing on the original text;

[0007] Based on the sliding window and fragment assembly strategy, divide the preprocessed original text into multiple text fragments;

[0008] Extract multimodal elements from the text fragments and perform material matching using a multimodal matching algorithm;

[0009] Optimize the material matching result based on semantic correction;

[0010] Generate interactive content based on the optimized multi-modal elements and material matching results.

[0011] Further, obtain the original text and perform text parsing and structured preprocessing on the original text, including:

[0012] Perform summarization processing on the original text to extract a text summary containing the core plot;

[0013] Extract character information from the original text, perform deduplication, anaphora resolution, and attribute analysis on the character information through natural language processing technology, and output structured character data.

[0014] Further, based on the sliding window and segment assembly strategy, divide the preprocessed original text into multiple text segments, and each text segment can be expressed as:

[0015] [S+R]+[C i-1 ,C i+1 +[C i

[0016] In the formula, S represents the text summary; R represents the set of characters; C i represents the i-th text segment; C i-1 represents the (i-1)-th text segment; C i+1 represents the (i+1)-th text segment.

[0017] Further, extract multi-modal elements from the text segments, including:

[0018] Perform scene segmentation processing on the text segment to generate a scene description without characters;

[0019] Cut each scene into multiple plots, and each plot includes a character name, dialogue content, emotion label, sound effect label, and background music label.

[0020] Further, use the multi-modal matching algorithm for material matching, including:

[0021] Use the multi-modal recall algorithm to perform image-to-text processing on the image materials in the preset material library, generate a text description and convert it into a text vector, and convert the text labels of the audio and special effect materials into text vectors;

[0022] Calculate the similarity between the text vectors and the multi-modal elements, and extract candidate materials.

[0023] Further, using the multi-modal matching algorithm for material matching also includes:

[0024] ​Construct a prompt template that includes candidate material descriptions and original text fragments, and use a large language model to select the best-matching material from the candidate materials.

[0025] Further, optimize the material matching result based on semantic correction, including:

[0026] Limit the output option range through a preset prompt template to generate a preliminary matching result;

[0027] Perform format detection and semantic correction on the preliminary matching result, and eliminate the output that does not conform to the preset rules.

[0028] The technical solution of the second aspect of the present invention provides an Agent-based interactive content generation device, which adopts the Agent-based interactive content generation method described in the technical solution of the first aspect of the present invention. The device includes:

[0029] A text summary module configured to extract a text summary containing the core plot of the original text;

[0030] A character processing module configured to extract character information from the original text and output structured character data;

[0031] A long text slicing module configured to divide the original text into multiple text fragments;

[0032] A multi-stage processing module configured to extract multi-modal elements from the text fragments;

[0033] A material library indexing module configured to perform material matching using a multi-modal matching algorithm;

[0034] An interactive presentation terminal configured to display the generated interactive content.

[0035] The technical solution of the third aspect of the present invention provides an electronic device, which includes: a processor and a memory communicatively connected to the processor; wherein, the memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor can execute the steps of the Agent-based interactive content generation method described in the technical solution of the first aspect of the present invention.

[0036] The technical solution of the fourth aspect of the present invention provides a computer-readable storage medium, on which a program for implementing the Agent-based interactive content generation method is stored, and the implementation of the Agent-based interactive content generation method is executed by a processor to implement the steps of the Agent-based interactive content generation method described in the technical solution of the first aspect of the present invention.

[0037] The present invention has the following beneficial effects:

[0038] The interactive content generation method based on Agent provided by the present invention can quickly generate high-quality interactive multimodal content from the input text content. On the one hand, through the sliding window strategy, the preprocessed original text is divided into multiple text segments to effectively support the input of ultra-long original text and avoid the problem of context loss in long text processing. On the other hand, by extracting multimodal elements from the text segments and using multimodal matching algorithms for material matching, and then optimizing the material matching results based on semantic correction, the accuracy of material matching is improved, the problem of unstable output caused by large model hallucinations is avoided, and the quality of interactive content is improved. This method simplifies the overall generation process of interactive content, improves the generation efficiency, and can be applied to the generation of interactive content in diverse scenarios in different fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0040] Figure 1 It is a flowchart of the method for the interactive content generation method based on Agent provided by an embodiment of the present invention;

[0041] Figure 2 It is a schematic diagram of material matching provided by an embodiment of the present invention;

[0042] Figure 3 It is a schematic diagram of the overall architecture of the interactive content generation device based on Agent provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0043] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following, in combination with the drawings and preferred embodiments, details the specific implementation manners, structures, features and effects of an interactive content generation method, device, electronic device and storage medium based on Agent proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.

[0045] This technical solution is applicable to fields such as culture and entertainment, education and training, digital marketing, etc., and is particularly applicable to the following scenarios:

[0046] Game development: Support the rapid prototyping of game types such as text adventure, role-playing, and strategy games;

[0047] Short video and short drama production: Accelerate the production process of animations and short dramas by automatically generating character animations and scene layouts;

[0048] Educational content creation: Provide interactive learning resources for the education industry, such as interactive courseware, situational teaching animations, etc.;

[0049] Digital advertising and marketing: Generate personalized interactive advertisements to enhance user engagement and brand communication effects.

[0050] The following specifically describes the specific solutions of an Agent-based interactive content generation method, device, electronic device, and storage medium provided by the present invention in conjunction with the accompanying drawings.

[0051] Please refer to Figure 1 , which shows the method flow chart of the Agent-based interactive content generation method provided by an embodiment of the present invention. The method includes:

[0052] Step S100: Obtain the original text and perform text parsing and structured preprocessing on the original text;

[0053] Step S100 specifically includes:

[0054] Step S110: Perform summarization processing on the original text to extract a text summary containing the core plot; specifically, in this embodiment, a pre-trained language model is used for word segmentation and semantic analysis, and then the core text summary of the original text content such as novels and scripts is extracted. The text summary is used as a fixed context input to solve the problem of context loss caused by long texts; for example, the pre-trained language model performs semantic analysis on the word-segmented original text to understand the semantic relationships between words, sentence structures, and discourse logics in the text. Using the attention mechanism technology, focus on the key information parts in the text and identify the sentences or paragraphs that can represent the core plot. Taking a novel as an example, the core plot includes the key decisions of the main characters, the outbreak points of conflicts, etc.; taking a script as an example, the core plot is the key scene description that promotes the development of the plot. Finally, the extracted core plot content is organized into a coherent text summary to ensure that the summary can accurately reflect the main content and plot context of the original text.

[0055] Step S120: Extract role information from the original text, and perform deduplication, anaphora resolution, and attribute analysis on the role information through natural language processing technology to output structured role data. Specifically, for the roles in the original text, the BERT-NER model can be used to label the role names in the text and identify the entity type as "person". Example: In the sentence "Wang Wu said to Li Si: 'We need to take action.'", the model identifies "Wang Wu" and "Li Si" as role entities. Then, perform deduplication and context association analysis. First, perform deduplication processing on the identified role names to remove duplicate role identifiers. At the same time, for the anaphoric relationships in the text, such as "he", "she", "that person", etc., use context information and anaphora resolution algorithms to restore them. For example, in a text, it is mentioned earlier that "Zhang San bought a book and he was very happy". Through the anaphora resolution algorithm, it can be determined that "he" refers to "Zhang San". By establishing a mapping relationship between the role names and the anaphoric words, and then analyzing the context of the words in the text, accurate restoration can be achieved. Secondly, for the determined main roles, in this embodiment, further in-depth analysis of their attribute information is carried out. By performing semantic analysis on the sentences containing role descriptions, information such as the age, gender, personality, and appearance characteristics of the roles is extracted, and finally a structured role list is output. For example:

[0056] Role 1: {"Name": "Zhang San", "Age": "25", "Gender": "Male", "Personality": "Steady"}

[0057] Role 2: {"Name": "Li Si", "Age": "30", "Gender": "Female", "Personality": "Lively"}

[0058] By performing summary processing on the original text in Step S100 and extracting the text summary of the core plot as the fixed context input, the problem of context loss during the processing of long texts is effectively solved, enabling subsequent text processing to focus on the core content. At the same time, by extracting role information from the original text and outputting structured role data after deduplication, anaphora resolution, and attribute analysis, the role information in the text can be clearly and accurately sorted out, providing rich and accurate basic data for subsequent role-based interactive content generation. For example, in generating an interactive game, the structured role data can directly drive the appearance and behavior design of virtual characters; in short drama production, the summary and role information can quickly match the scene storyboards and audio materials. This step significantly improves the accuracy and efficiency of automated content generation.

[0059] Step S200: Based on the sliding window and fragment assembly strategy, divide the preprocessed original text into multiple text fragments; specifically, for texts with clear chapter identifiers, such as novels and textbooks, the start and end positions of chapters can be accurately identified through regular expressions or specific text format parsing tools; for texts without obvious chapter identifiers but with paragraph logical structures, they can be divided into different chapters according to characteristics such as logical coherence and theme transition between paragraphs; then divide the preprocessed text into sequences C1, C2, …, C N , where N represents the total number of chapters; the text summary containing the core plot extracted in step S110 is used as part of the fixed context at this time. The text summary can summarize the core content of the original text, ensuring that the model can always grasp the overall theme of the text when processing each chapter text fragment. The structured character data extracted in step S120, that is, the character list, is also used as the fixed context; the character list contains detailed information about the main characters in the text. When processing the chapter text fragments, this character information helps the model understand the actions and relationships of the characters in the text; for each chapter C i , extract the content of its adjacent chapters, [C i-1 , C i+1 , and the adjacent chapter content is used to provide local context to avoid plot breaks; taking a novel as an example, the previous chapter describes the actions of the protagonist in a certain scene, and the next chapter immediately describes the results of the protagonist's actions. If the text fragments in the middle chapter are processed alone, it will be difficult to understand due to the lack of connection between the front and back plots. Therefore, by introducing the content of adjacent chapters, the model can better grasp the coherence of the plot.

[0060] Finally, assemble the text summary and character list fixed context, adjacent chapter content, and the original text of the current chapter to obtain the text fragment corresponding to each chapter, which can be expressed as:

[0061]

[0062] In the formula, represents the text fragment corresponding to the i-th chapter; S represents the text summary, which is used to summarize the core plot of the full text to ensure that the model can perceive the overall narrative framework when processing any chapter; R represents the character list, which provides character attribute and relationship mappings to avoid character reference ambiguity; [C i-1 , C i+1 represents the content of adjacent chapters, which is used to provide local context to avoid plot breaks; C iThe original text representing the i-th chapter; where the text summary and character list are used as fixed contexts to ensure that the core information of the original text is retained during model processing; in this implementation, by extracting text fragments, it facilitates the large model to process each text fragment paragraph by paragraph, avoiding the impact of overly long texts on the model; it should be noted that if the chapter content exceeds the input limit of the model, it is further split into sub-fragments, and 50% overlapping content is retained between the sub-fragments to ensure the coherence of the plot;

[0063] In this embodiment, the preprocessed text is segmented by chapter, and a sliding window strategy is adopted for context assembly to generate text fragments containing rich context information. On the one hand, the text summary and character list extracted in step S100 are fully utilized as fixed contexts to ensure that the model can retain the core information of the original text when processing each text fragment. At the same time, by introducing adjacent chapter content, the problem of plot breaks is effectively avoided. This step enables the large model to process overly long texts paragraph by paragraph, reducing the impact of text length on the model's processing ability, and improving the efficiency and accuracy of the model in processing texts. Furthermore, during the interactive content generation process, based on the text fragments, more coherent, accurate, and logically consistent content that conforms to the original text can be generated, especially suitable for processing long texts with complex plots and numerous characters. For example, when generating an interactive game, this step can accurately restore the logical sequence of character actions; in short drama production, it can avoid narrative disconnection caused by scene changes. In addition, through the dynamic adjustment mechanism of the sliding window, it adapts to chapter inputs of different lengths, ensuring the dual optimization of model processing efficiency and generation quality, providing a text input basis with high consistency for subsequent multi-modal content generation.

[0064] Please refer to Figure 2 as shown, step S300: Extract multi-modal elements from the text fragments and perform material matching using a multi-modal matching algorithm;

[0065] Step S300 specifically includes:

[0066] Step S310: Perform scene segmentation on the text fragments to generate scene descriptions without characters; specifically, for the input text fragment scene segmentation is performed, and the LLM is used to parse the text fragment to output a scene description without characters, such as "The city streets in the heavy rain, the neon lights are blurred and flashing in the rain", and then the chapter is segmented into scenes P1, P2,..., P M , M represents the total number of scenes, and each scene corresponds to an independent space or time unit.

[0067] Step S320: Segment each scene into multiple plots, and each plot includes a character name, dialogue content, emotion label, sound effect label, and background music label; specifically, for each scene Pj , where \(j = 1, 2, \ldots, M\), the scene is segmented into plots \(Q_1, Q_2, \ldots, Q\) according to the format of "Role: Dialogue Content". N′ , \(N'\) represents the total number of plots, and the LLM is called to perform sentiment analysis on the dialogue content in the plots, outputting sentiment labels; matching sound effect labels according to the plot descriptions; selecting music types according to the scene sentiment labels; specifically, the LLM judges the emotional tendency expressed by the dialogue through the comprehensive understanding of vocabulary, sentence patterns, and context. For example, for the dialogue "Great! We finally made it", the model can recognize the positive emotion in it and output corresponding sentiment labels such as "Joy" and "Excitement"; then establish a sound effect label library containing sound effects corresponding to various common scenes and plots, such as footsteps, door closing sounds, laughter, rain sounds, etc., and can match the keywords in the plot descriptions with the sound effect label library. At the same time, further refine the sound effect selection in combination with the sentiment labels. For example, under the tense sentiment label, select more oppressive sound effects. Select music types according to the scene sentiment labels. Establish the corresponding relationship between music types and sentiment labels, such as positive emotions corresponding to lively music, and negative emotions corresponding to sad or tense music. Finally, each plot can be represented as:

[0068] Q k = {Character Name, Dialogue Content, Sentiment Label, Sound Effect Label, Background Music Label}; for example: {"Character Name": "Zhang San", "Dialogue Content": "We must act immediately!", "Sentiment Label": "Tense", "Sound Effect Label": "Hasty Footsteps", "Background Music Label": "Suspenseful Atmosphere Music"}.

[0069] In this embodiment, by performing scene storyboarding on the text fragments, generating scene descriptions without characters, and segmenting the scenes according to time or space changes, a clear scene framework is provided for subsequent plot analysis and multi-modal element extraction. Furthermore, the scenes are refined into plots, and the character names, dialogue content, sentiment labels, sound effect labels, and background music labels are marked, comprehensively enriching the multi-modal information of the text. It enables the text to go from the overall chapter structure to specific plot and scene details, providing a more accurate and detailed input for the multi-modal matching algorithm. Based on these processing results, in the process of interactive content generation, it is possible to more accurately match and generate multi-modal materials that highly fit the text content.

[0070] Step S330: Use the multi-modal retrieval algorithm to perform image-to-text processing on the image materials in the preset material library, generate text descriptions and convert them into text vectors, and convert the text tags of audio and special effect materials into text vectors. Specifically, for various types of picture resources such as character illustrations and backgrounds in the picture material library, each picture is input into the selected image-to-text model in turn. The model extracts and analyzes the features of the picture, and uses the visual and semantic association knowledge it has learned to generate corresponding text descriptions. For audio materials, if audio-to-text conversion is involved, speech recognition technology can be used, such as an automatic speech recognition (ASR) model based on the Transformer architecture, to convert the audio content into text. Then, a text embedding model is used to convert the generated text description into a vector representation. The converted vectors are stored together with the corresponding picture indexes for convenient subsequent retrieval and matching.

[0071] Step S340: Calculate the similarity between the text vectors and the multi-modal elements, and extract candidate materials. Specifically, according to the multi-modal elements obtained in Step S320, such as the plot description containing the character name, dialogue content, emotion label, etc., convert them into text vectors, and the conversion method is the same as that of converting the text description into a vector in Step S330. Then, calculate the similarity between these multi-modal element text vectors and the picture and audio text vectors in Step S330. The similarity can be measured by calculating the cosine distance of the vectors. The smaller the cosine distance, the more similar the text semantics represented by the two vectors. According to the calculated cosine distance, select the TOP K pictures corresponding to the similar vectors with the smallest distance as candidates. These pictures are the closest in semantics to the multi-modal elements. Then, input the text descriptions of the K pictures into the large model, and the large model further screens according to these descriptions to determine the pictures that better meet the requirements.

[0072] Step S350: Construct a prompt template that includes the candidate material description and the original text fragment, and use the large language model to select the optimal matching material from the candidate materials; specifically, design a prompt template that includes the candidate material description and the original text fragment. Among them, the <task description> part clearly describes the task objective, such as "select the picture that best matches the plot of the original novel text from the candidate pictures"; the <task example> provides an example of completing a similar task to help the large language model better understand the task requirements. [Input: <original novel text, Top K image descriptions>] Clearly define the input content, and provide the original novel text fragment and the Top K image descriptions obtained in step S340 to the large language model. Input the constructed prompt into the large language model; the large language model conducts a comprehensive analysis of the Top K candidate materials based on the information in the prompt; then, considering factors such as the semantics, plot, and emotion of the original text fragment, as well as the degree of fit between the candidate material description and the original text, finally outputs the index of the most matching picture. This index corresponds to the optimal material selected from the preset material library.

[0073] Step S300 parses the text fragment into multimodal elements (scenes, emotions, sound effects, music) through scene storyboarding and plot segmentation, providing accurate semantic input for material matching; the two-stage matching algorithm (recall + optimization) significantly improves the efficiency and accuracy of material matching: In the recall stage: Use multimodal vector similarity to quickly screen candidate materials, covering more than 90% of relevant resources; In the optimization stage: Solve the fuzzy matching problem in complex scenarios (such as "dark rainy day" vs "night street") through LLM semantic analysis, and the matching precision rate can be increased to more than 95%; Combine emotion tags with sound effect mapping to avoid conflicts between materials and plot emotions; This embodiment not only solves the problem of low efficiency of traditional manual annotation, but also shortens the material matching cycle from several hours to minutes through an automated process, especially suitable for scenarios such as game development and film and television production that require high-frequency matching of multimodal materials, ensuring that the generated interactive content is highly consistent in terms of vision, hearing, and narrative logic.

[0074] Step S400: Optimize the material matching result based on semantic correction;

[0075] Step S400 specifically includes:

[0076] Step S410: Generate a preliminary matching result by restricting the output option range through a preset prompt template; Design the prompt template: For different material matching tasks such as character matching, background image matching, and sound effect matching, design a prompt template. The task description part in the template needs to precisely elaborate the task objective. For example, in character matching, it can be described as "Select the character from the given character list that is most consistent with the actions and personality in the current novel plot." The output selection list clearly restricts the final output content. Taking character matching as an example, it can list the names and brief characteristics of all the main characters in the novel, such as "Character 1: Zhang San, 25 years old, calm personality, good at martial arts; Character 2: Li Si, 30 years old, lively personality, quick thinking", etc., similar to providing multiple-choice options for the large language model (LLM). The example part provides a past successful matching case, including the original text plot, the provided selection list, and the final correct selection result, to help the LLM better understand the task requirements and the expected output form.

[0077] Apply the LLM for preliminary matching: Input the constructed prompt template into the LLM. The LLM, based on the information in the template and its own learned language knowledge and semantic understanding ability, filters and judges within the given output selection list range to generate a preliminary matching result. For example, in the background image matching task, the LLM will select the most suitable image description according to the description of the scene in the prompt and the provided image description selection list, and output the preliminary matching result in a preset formatting method, such as in JSON format. The output form is, for example: {"Matched Image": "A picture of a peaceful forest scene with lush trees and sunlight shining through the gaps in the leaves"}.

[0078] Step S420: Perform format detection and semantic deviation correction on the preliminary matching result, and eliminate the output that does not conform to the preset rules; Specifically, in this embodiment, format detection is performed on the preliminary matching result generated by the Agent output to check whether it conforms to the preset output format requirements, such as whether it is in the correct JSON format. If the output format does not meet the requirements, it is directly determined as an invalid result and eliminated. For example, if the output is not a standard JSON object but an unordered text string, it does not meet the format requirements and directly triggers the regeneration process.

[0079] Content compliance detection: Input the preliminary matching results into the LLM again, and utilize the semantic understanding ability of the LLM to determine whether the results are within the output selection list in the prompt template. For example, in the role matching task, if the role name output by the LLM is not in the provided selection list, then the result does not meet the requirements and is excluded. At the same time, further check whether the results semantically match the original text plot. For example, for a text plot describing a fierce battle scene, if the matched background image description is "peaceful garden", it does not meet the requirements semantically and also needs to be excluded.

[0080] Benefit summary of step S400

[0081] By generating a two-layer collaborative mechanism of the generation Agent and the detection Agent in step S400, the accuracy of material matching can be improved, and errors caused by large model hallucinations (such as role mismatches and scene conflicts) can be significantly reduced. The generation Agent forcibly restricts the output range through a preset template to avoid interference from invalid options; the detection Agent ensures that the results are highly consistent with the original text in terms of logic, emotion, and scene elements through format verification and semantic rectification. For example, in film and television production, this step can avoid "mismatching comical segments with suspenseful music", and in game development, ensure that "the sound effects of the battle scene are synchronized with the character actions". This mechanism greatly reduces the cost of manual review and provides a reliable guarantee for the automated generation of high-quality interactive content.

[0082] Step S500: Generate interactive content based on the optimized multi-modal elements and material matching results; specifically, obtain the optimized multi-modal elements from step S400, including character pictures (such as "Zhang San_calm.jpg"), background music (such as "suspense_background music.mp3"), sound effects (such as "hasty footsteps.wav"), and material matching results (such as scene ID, emotion label); then construct the basic data structure of the plot: according to the composition structure of the plot, organize the collected elements in the format of [character name, character picture: dialogue text, dialogue audio, dialogue emotion, background picture, background music, sound effects, special effect animations, branch options]. For example, for a specific plot, the character is "Zhang San", the link to his character picture has been determined, the dialogue text is "I will definitely find the truth", the dialogue audio has also been matched, the analyzed dialogue emotion is "determined", the background picture is "dim investigation room", the background music is tense suspenseful music, the sound effect is the slight sound of paper flipping, the special effect animation may be the clue light flashing on the screen, and the branch options are "continue the investigation" or "seek help". Integrate this information into a basic data unit of a plot.

[0083] Then, according to the logical structure and chapter division of the original text (the chapter segmentation has been performed in step S200), arrange each plot in the corresponding chapter in the correct order. For example, the plots in the first chapter of a novel are arranged in sequence according to the chronological order of the story development, and each plot is interrelated through time, space or logical relationships. Combine the arranged plots into chapter content, and each chapter contains a series of closely related plots. During this process, it is necessary to ensure that the transition between the plots within the chapter is natural and smooth. For example, when switching plots, elements such as background images and background music can be reasonably transitioned to avoid a sudden feeling. Finally, select a suitable rendering engine. Specifically, according to the actual needs and project characteristics, a professional rendering engine can be selected, such as rendering engines like Unity and Unreal Engine. These engines have powerful functions in processing the integration of graphics, text, and sound. Set corresponding rendering parameters for different elements. For picture elements, adjust parameters such as the resolution, color saturation, and contrast of the pictures to ensure that the display effect of the pictures in the video is clear and beautiful. For audio elements, set the volume size, channel balance, and audio effects so that the dialogue audio, background music, and sound effects can create a suitable atmosphere in the video. For example, in tense plots, appropriately increase the volume of the background music to enhance the sense of tension; in dialogue scenes, ensure that the dialogue audio is clearly audible and at a moderate volume. For text elements, select a suitable font, font size, color, and layout method to make it coordinated with the overall picture style. Finally, input the assembled chapter and plot content into the rendering engine and perform rendering according to the set parameters. During the rendering process, the rendering engine will integrate elements such as graphics, text, and sound to generate the final video with integrated graphics, text, and sound.

[0084] In this embodiment, through structured data integration, logically coherent plot assembly, and high-fidelity rendering, the optimized multi-modal elements are transformed into immersive interactive content. This generation method makes full use of the results of text parsing, structured processing, as well as the extraction, matching, and optimization of multi-modal elements in the previous steps. The generated interactive content has high logic and coherence, and the reasonable assembly of plots and chapters enables the story to be presented to users clearly and smoothly. The integration of rich multi-modal elements, such as graphics, text, sound, special effects animations, etc., enhances the attractiveness and immersion of the content. In the field of film and television production, it can quickly generate high-quality plot segments, providing intuitive creative demonstrations for directors and screenwriters; in game development, it can efficiently build fascinating game levels and plot scenes, improving the gaming experience of players. This step greatly improves the efficiency and quality of content creation in the practical application of interactive content generation, bringing users a richer and more vivid interactive experience.

[0085] In summary, the Agent-based interactive content generation method provided by the present invention can quickly generate high-quality interactive multimodal content from the input text content. On the one hand, through the sliding window strategy, the preprocessed original text is divided into multiple text segments to effectively support the input of ultra-long original text and avoid the problem of context loss in long text processing. On the other hand, by extracting multimodal elements from the text segments and using the multimodal matching algorithm for material matching, and then optimizing the material matching result based on semantic correction, the accuracy of material matching is improved, the problem of unstable output caused by large model hallucinations is avoided, and the quality of interactive content is improved. This method simplifies the overall process of generating interactive content, improves the generation efficiency, and can be applied to the generation of interactive content in diverse scenarios in different fields.

[0086] Please refer to Figure 3 , which shows a schematic diagram of the overall architecture of an Agent-based interactive content generation device provided by an embodiment of the present invention. The device includes:

[0087] A text summary module configured to extract a text summary containing the core plot of the original text;

[0088] A character processing module configured to extract character information from the original text and output structured character data;

[0089] A long text slicing module configured to divide the original text into multiple text segments;

[0090] A multi-stage processing module configured to extract multimodal elements from the text segments;

[0091] A material library indexing module configured to perform material matching using a multimodal matching algorithm;

[0092] An interactive presentation terminal configured to display the generated interactive content.

[0093] The technical solution of the third aspect of the present invention provides an electronic device, which includes: a processor and a memory communicatively connected to the processor; wherein, the memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the steps of the Agent-based interactive content generation method described in the technical solution of the first aspect of the present invention.

[0094] The technical solution of the fourth aspect of the present invention provides a computer-readable storage medium, on which a program for implementing the Agent-based interactive content generation method is stored, and the implementation of the Agent-based interactive content generation method is executed by a processor to implement the steps of the Agent-based interactive content generation method described in the technical solution of the first aspect of the present invention.

[0095] It should be noted that the above sequence of embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0096] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments.

Claims

1. Agent-based interactive content generation method, characterized in that The method includes: Obtain the original text and perform text parsing and structured preprocessing on the original text; Based on the sliding window and segment assembly strategy, divide the preprocessed original text into multiple text segments; Extract multimodal elements from the text segments and perform material matching using a multimodal matching algorithm; Optimize the material matching result based on semantic correction; Generate interactive content based on the optimized multimodal elements and material matching result.

2. The Agent-based interactive content generation method according to claim 1, wherein Obtain the original text and perform text parsing and structured preprocessing on the original text, including: Perform abstract processing on the original text to extract a text abstract containing the core plot; Extract character information from the original text, perform deduplication, anaphora resolution, and attribute analysis on the character information through natural language processing technology, and output structured character data.

3. The Agent-based interactive content generation method according to claim 1, characterized in that Based on the sliding window and segment assembly strategy, divide the preprocessed original text into multiple text segments, and each text segment can be expressed as: [S+r]+[C i-1 ,C i+1 +[C i ​ Where S represents the text summary; r represents the set of roles; C i represents the i-th text segment; C i-1 represents the (i - 1)-th text segment; C i+1 represents the (i + 1)-th text segment.

4. The Agent-based interactive content generation method according to claim 1, characterized in that, Extract multimodal elements from the text segments, including: Perform scene segmentation processing on the text segment to generate a scene description without characters; Cut each scene into multiple plots, and each plot includes a character name, dialogue content, emotion label, sound effect label, and background music label.

5. The Agent-based interactive content generation method according to claim 4, wherein Perform material matching using a multimodal matching algorithm, including: Use a multimodal recall algorithm to perform text generation from images on the image materials in the preset material library, generate a text description and convert it into a text vector, and convert the text labels of audio and special effect materials into text vectors; Calculate the similarity between the text vectors and the multimodal elements, and extract candidate materials.

6. The Agent-based interactive content generation method according to claim 5, wherein, Performing material matching using a multimodal matching algorithm further includes: Construct a prompt template containing candidate material descriptions and the original text segments, and use a large language model to select the optimal matching material from the candidate materials.

7. The Agent-based interactive content generation method according to any one of claims 1 to 6, characterized in that, Optimize the material matching result based on semantic correction, including: Generate a preliminary matching result by restricting the output option range through a preset prompt template; Perform format detection and semantic correction on the preliminary matching result, and eliminate the output that does not conform to the preset rules.

8. Agent-based interactive content generation device, characterized in that Adopt the Agent-based interactive content generation method according to any one of claims 1 to 7. The device includes: A text summary module configured to extract a text summary containing the core plot of the original text; A character processing module configured to extract character information from the original text and output structured character data; A long text slicing module configured to divide the original text into multiple text segments; A multi-stage processing module configured to extract multimodal elements from the text segments; A material library indexing module configured to perform material matching using a multimodal matching algorithm; An interactive presentation terminal configured to display the generated interactive content.

9. An electronic device, characterized in that, The electronic device includes: a processor and a memory communicatively connected to the processor; wherein, the memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the steps of the Agent-based interactive content generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A program for implementing the Agent-based interactive content generation method is stored on the computer-readable storage medium, and the implementation of the Agent-based interactive content generation method is executed by a processor to implement the steps of the Agent-based interactive content generation method according to any one of claims 1 to 7.

Citation Information

Cited By

  • AIGC content generation method and system based on multi-source feature fusion

    CN121435142A