Intelligent script generation and touring guide system based on city text travel characteristics

Through the intelligent script generation and tour guidance system, the knowledge graph and LLM technology are used to generate in-depth cultural scripts, and the NSGA-II algorithm is used to optimize the tour route, which solves the problem of the correlation between scenic spots and cultural factors being ignored in the existing system, and realizes Richer visitor experience and path optimization.

CN119311969AActive Publication Date: 2025-01-14NANJING UNIV OF INFORMATION SCI & TECH
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202411847520.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-01-14
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The existing tourism route planning system ignores the cultural background and historical relationships between attractions and cannot provide in-depth cultural interpretation and interactive script guidance, resulting in insufficient immersive experience for tourists.

Method used

Design an intelligent script generation and tour guidance system. By establishing a knowledge graph, using RAG retrieval enhanced generation technology and LLM large language model, the scenic spot script is generated, and the tour path is optimized through the NSGA-II algorithm to achieve script fluency evaluation and dynamic scripts. interpretation.

Benefits of technology

It improves tourists' cultural experience and immersion, optimizes tour routes, provides interactive script guidance, and enhances the personalization and interest of the tour process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311969A_ABST
    Figure CN119311969A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent script generation and touring guide system based on urban travel characteristics, and the system comprises a database building module which is used for building a database containing scenic spot data; the data generation module is used for generating world view and principal angle setting; the scenic spot script generation module is used for generating a scenic spot script; the fluency evaluation module is used for evaluating the fluency of the script; the path selection module is used for path selection based on an NSGA-II algorithm; and the script deduction module is used for performing LLM script deduction. The method is not only based on the geographic distance, but also combines the cultural background and tourist interests to realize multi-objective path optimization. The tourists can visit the most relevant scenic spots with the most cultural value in the shortest time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an intelligent script generation and tour guidance system based on the cultural and tourism characteristics of a city. Background Art

[0002] Existing travel route planning mostly focuses on the shortest path or the most convenient mode of transportation, ignoring the deep connection between attractions in terms of cultural background, historical connections, etc. Modern tourists not only pursue efficient tour experience, but also hope to enhance the tour experience through deeper cultural interpretation. However, current travel recommendation systems are mostly based on geographic location or user historical preferences, lacking in-depth consideration of the relevance and cultural factors between attractions. In addition, existing systems rarely provide interactive script guidance, which cannot effectively enhance tourists' immersive experience. Summary of the invention

[0003] Purpose of the invention: The technical problem to be solved by the present invention is to provide an intelligent script generation and tour guidance system based on the characteristics of urban cultural tourism, in view of the shortcomings of the prior art, including:

[0004] A database establishment module is used to establish a database containing scenic spot data;

[0005] Data generation module, used to generate world view and protagonist settings;

[0006] The scenic spot script generation module is used to generate scenic spot scripts;

[0007] Fluency Assessment Module, used to assess script fluency;

[0008] Path selection module, used for path selection based on NSGA-II algorithm;

[0009] The script interpretation module is used for LLM script interpretation.

[0010] The establishment of a database containing scenic spot data specifically includes: before planning a tour route, first construct a knowledge graph containing scenic spots, first collect the characteristics of each scenic spot, define the i-th scenic spot Features include historical background , Cultural Characteristics 、Scenic area facilities and geographic location ,in , represents the i-th scenic spot The longitude, represents the i-th scenic spot The latitude, represents the recommended visiting time for the i-th scenic spot, the i-th scenic spot Represented as a multidimensional vector:

[0011]

[0012] By building a knowledge graph, the background information of scenic spots and attractions is structured and stored in the database.

[0013] The database establishment module is also used to: set the knowledge graph to consist of a node set and edge set , where each edge Indicates the i-th scenic spot With the jth attraction The relationship between, n represents the total number of nodes; each node in the knowledge graph Indicates a scenic spot, side Indicates the connection between attractions.

[0014] The generation of the world view and the setting of the protagonist specifically includes: using the RAG retrieval enhancement generation technology, combining the information retrieved from the knowledge graph, using the prompt word prompt for the LLM large language model, generating a unified world view, and setting the generation of the world view to be generated by a global knowledge base It includes comprehensive background information on all cities and attractions:

[0015]

[0016] Identify the protagonist of the story ,main character The settings include identity ,character and background story , forming a vector containing the features:

[0017] .

[0018] The generating of the scenic spot script specifically includes: using RAG search enhancement generation technology to search for each scenic spot Based on the retrieved background information, for each scenic spot ,generate A collection of different scripts , Indicates the kth script; the script has a unified protagonist As the center, ensure the coherence of the plot and the consistency of the background. It is expressed as:

[0019]

[0020] in represents the kth script The plot; represents the kth script dialogue; represents the kth script The time is calculated as:

[0021]

[0022] Among them, the number of characters is the total number of characters in the kth script text, Indicates average reading speed.

[0023] The evaluation of script fluency specifically includes: randomly selecting attractions , list the attractions A collection of all the optional scripts , select ; Retrieve the current attractions through the knowledge graph All adjacent candidate attractions , set the i-th With the jth attraction Connect to get the jth attraction The set of all possible scripts ; According to the current script and the hth scenario selected from the candidate scenario , using LLM technology, generate connection scripts based on prompt words , that is, combining the possible scripts of the current attraction with the possible scripts of the next attraction to form a complete story chain;

[0024] To evaluate the connection script The cohesion effect needs to calculate the fluency score , Indicates the number of points from the i-th scenic spot The kth script to the jth attraction The coherence between the h-th scripts is given by:

[0025] ,

[0026] in Plot coherence score , Role Interaction Rating , spatiotemporal coherence score and immersion score The weight of .

[0027] The path selection based on the NSGA-II algorithm specifically includes:

[0028] Step 1, initialize the population: First initialize the population, set each path to contain scenic spots, and each individual path is composed of selected scenic spots. Given a path ,in is the mth scenic spot on the path, and the total length of the path is ;

[0029] Step 2, for each individual path, calculate the following objective function:

[0030] Fluency ,in It is the i-th attraction and the i+1th attraction Fluency scores between;

[0031] Time target ,in It is the i-th attraction Go to the i+1th attraction The travel time, is at the i-th attraction The duration of the script;

[0032] Script time ratio target ;

[0033] Step 3: Compare the non-dominated sorting and congestion degree: First, perform non-dominated sorting on all paths to obtain more than two dominance levels; set the initialized path and path , if the path Non-inferior to the path on all objectives , that is, the path Fluency Greater than , time target Less than , script time ratio target Greater than , and strictly outperforms the path in at least one objective , that is, the path Fluency Much greater than or time target Much smaller than Or script time ratio target Much greater than , then determine the path Non-dominated other paths ; For each individual path in the dominance level, calculate the congestion degree, for the i-th path and the jth path The mth target , the i-th path The congestion The calculation formula is:

[0034]

[0035] in and are the i-th path in the m-th target The maximum and minimum values ​​of and is the i+1th path after path sorting The target value and the i-1th path Target value of

[0036] Step 4, Crossover operation: Select two parent paths and Perform a crossover operation to generate two subpaths and ; Then in the path and In the random selection of cross-points , c takes the value of 1~m, and the scenic spot after the exchange intersection is:

[0037] ,

[0038] ,

[0039] Mutation operation: The mutation operation will randomly change the attractions or the script of the attractions in the path, select an attraction and mutate it;

[0040] For the path after mutation operation , the path will be recalculated The objective function of

[0041] Elite retention strategy: retain the best top paths and ensure the best forward The paths are not lost in the next generation; assuming that there are Optimal solution ,in represents the Nth optimal solution, Representing the elite population, The optimal solution will directly enter the next generation;

[0042] Update the population: When updating the population, merge the paths of the parent and child generations, perform non-dominated sorting, and select the top M optimal paths. The update rule is:

[0043]

[0044] in Representing the new generation population, represents the parent population, represents the offspring population, It is an elite retention strategy operation; It is a non-dominated sorting operation;

[0045] Final solution selection: Choose a path that meets user needs , the path And the final script script_final is saved.

[0046] The LLM script interpretation specifically includes: designing prompts for the LLM, setting director agents, actor agents and player agents;

[0047] The director agent generates a plot outline and script based on predefined plot goals, assigns the order in which the characters speak, instructs the actor agent to generate dialogue content that meets the plot goals, and checks whether the current plot has achieved the established goals;

[0048] The director's agent will be based on the current attractions The script _ Set story goals ,in Indicates the nth target and sets the script _ Converted to multi-round dialogue script format , where the kth round of dialogue , t, including roles and the role Expected content of speech ; When generating a dialogue script, the director agent will obtain the basic information of all the characters in the scene to ensure that the generated plot conforms to the character's personalized information; the script generated by the director agent , only as a plot summary, the actual speech content The generation of is completed by the actor agent; to ensure that the generated content meets the plot objectives , the Director Agent provides instructions to the Actor Agent , including scripts _ , Overview of the roles that will be speaking and keywords :

[0049]

[0050] After each round of dialogue, the director agent queries the actual dialogue history To determine the current plot goal Is it completed? Indicates the content of the pth dialogue; if completed, move on to the next plot goal ; If not completed, continue generating the current plot goal;

[0051] The actor agent is used to generate the actual dialogue content. Each actor agent has an independent role profile, memory database and role relationship database; the role profile contains the basic information of the role; the memory database records the past events and perceptions of the role; the role relationship database records the relationship between the roles; the dialogue log The format of narrative dialogue is adopted; when the content of the dialogue log reaches a threshold, the early dialogue will be summarized as key points and re-added to the top of the log L; when generating the role response content a, the actor agent retrieves relevant documents from the role archive, memory database and role relationship database, and combines the instructions of the director agent, the script background and the dialogue history to generate the response content.

[0052] The present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor runs the system.

[0053] The present invention also provides a storage medium storing a computer program or instruction. When the computer program or instruction is executed on a computer, the system is executed.

[0054] The present invention has the following beneficial effects: 1. Improving the tourist experience: By constructing a knowledge graph and LLM technology, the cultural relevance between scenic spots is identified, so that tourists can feel a more coherent historical and cultural context during the tour, rather than just a simple visit to the scenic spot.

[0055] 2. Path optimization: This invention not only combines geographical distance, but also cultural background and tourists’ interests to achieve multi-objective path optimization. Tourists can visit the most relevant and culturally valuable attractions in the shortest time.

[0056] 3. Interactive Guidance: Automatically generated scripts provide in-depth cultural interpretations of each attraction, enhancing visitors’ sense of immersion. The scripts can be dynamically adjusted based on visitors’ real-time behavior, increasing interactivity and fun during the tour.

[0057] 4. Dynamic script interpretation: Through the collaborative work of director agents, actor agents and player agents, the script content is dynamically generated and adjusted to adapt to the real-time behavior and choices of tourists, further enhancing the interactivity and personalized experience of the tour. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.

[0060] like Figure 1 As shown, the embodiment of the present invention provides an intelligent script generation and tour guidance system based on the characteristics of urban culture and tourism, including:

[0061] A database establishment module is used to establish a database containing scenic spot data;

[0062] Before planning a tour route, we need to build a knowledge graph containing attractions. First, we collect the characteristics of each attraction and define the i-th attraction. characteristics, including historical background , Cultural Characteristics 、Scenic area facilities and geographic location ,in , represents the i-th scenic spot The longitude, represents the i-th scenic spot The latitude, represents the recommended visiting time for the i-th scenic spot, the i-th scenic spot Represented as a multidimensional vector:

[0063]

[0064] By building a knowledge graph, the background information of scenic spots and attractions is structured and stored in the database.

[0065] Set the knowledge graph to consist of a set of nodes and edge set , where each edge Indicates the i-th scenic spot With the jth attraction The relationship between nodes (such as adjacent, historical association, etc.), n represents the total number of nodes. Each node in the knowledge graph Indicates a scenic spot, side Indicates the connection between attractions.

[0066] Data generation module, used to generate world view and protagonist settings;

[0067] Using RAG (Retrieval-Augmented Generation) technology, combined with the information retrieved from the knowledge graph, the LLM (Large Language Model) uses the prompt word prompt to generate a unified world view. The generation of the world view is assumed to be based on a global knowledge base. It includes comprehensive background information on all cities and attractions:

[0068]

[0069] Identify the protagonist of the story ,main character The settings include identity ,character and background story , forming a vector containing multiple features:

[0070]

[0071] main character The setting will affect the direction of subsequent plot generation and the selection of attractions.

[0072] The scenic spot script generation module is used to generate scenic spot scripts;

[0073] To ensure the accuracy of the script for each attraction in terms of history, culture, geography and plot, we first used RAG technology to search for each attraction. Based on the retrieved background information, for each scenic spot ,generate A collection of different scripts , represents the kth script; these scripts have a unified protagonist As the center, ensure the coherence of the plot and the consistency of the background. It is expressed as:

[0074]

[0075] in represents the kth script Plot: Describes the main storyline, including the protagonist's actions in the attraction, the conflicts encountered and the solutions. The plot will be designed based on the historical background, cultural elements and geographical features of the attraction, and ensure that it conforms to the atmosphere and historical authenticity of the attraction.

[0076] represents the kth script Dialogue: The dialogue between the protagonist and other virtual characters or attraction elements further promotes the plot. The dialogue content will be generated based on historical figures, local dialects, cultural characteristics and other factors, making tourists feel more real and immersive.

[0077] represents the kth script Time: The duration of each script, that is, the time required to perform the script, in minutes, calculated using the formula:

[0078]

[0079] Among them, the number of characters is the total number of characters in the kth script text, Indicates the average reading speed, which is usually 300 to 400 characters per minute.

[0080] Fluency Assessment Module, used to assess script fluency;

[0081] Randomly select attractions , list the attractions A collection of all the optional scripts , select ; Retrieve the current attractions through the knowledge graph All adjacent candidate attractions , set the i-th With the jth attraction Connect to get the jth attraction The set of all possible scripts According to the current script and the hth scenario selected from the candidate scenario , using LLM technology to generate connection scripts based on prompt words , that is, combining the possible scripts of the current attraction with the possible scripts of the next attraction to form a complete story chain. In this way, there will be a logical transition between the two scripts, allowing tourists to have a seamless experience when moving from one attraction to another.

[0082] To evaluate the connection script The cohesion effect needs to calculate the fluency score , Indicates the number of points from the i-th scenic spot The kth script to the jth attraction The coherence between the hth scripts of the story is measured. The fluency score reflects whether the transition between the two scripts is natural and whether the plot, characters and interactions are connected smoothly. The calculation is completed using LLM technology, which uses LLM to complete the questionnaire scoring, involving the plot coherence score , Role Interaction Rating , spatiotemporal coherence score , immersion score The four dimensions have a full score of 5 points, and the average value of the corresponding dimension questions is taken. The formula is:

[0083] ,

[0084] in Plot coherence score , Role Interaction Rating , spatiotemporal coherence score and immersion score The weight can be adjusted according to actual needs to meet .

[0085] Path selection module, used for path selection based on NSGA-II (Non-dominated Sorting Genetic Algorithm-II) algorithm;

[0086] The path selection based on the NSGA-II algorithm specifically includes:

[0087] Initialize the population: First initialize the population, set each path to contain a number of scenic spots, each individual (path) is composed of selected scenic spots, given a path ,in is the mth scenic spot on the path, and the total length of the path is ,in ;

[0088] For each individual path, the following objective function needs to be calculated:

[0089] Fluency ,in It is the i-th attraction and the i+1th attraction Fluency score between attractions; Evaluate the connectivity and coherence between all attractions in the path, based on the script fluency score of each attraction;

[0090] Time target ,in It is the i-th attraction Go to the i+1th attraction The travel time, is at the i-th attraction The duration of the script;

[0091] Script time ratio target .

[0092] Then, non-dominated sorting and crowding comparison are performed: First, non-dominated sorting is performed on all paths to obtain multiple "Pareto Fronts". Set the path obtained by initialization Dominant Path , if the path Non-inferior to the path on all objectives , that is, the path Fluency Greater than , time target Less than , script time ratio target Greater than , and strictly outperforms the path in at least one objective , that is, the path Fluency Much greater than or time target Much smaller than Or script time ratio target Much greater than (In this example, if it is more than 2 times, it is considered to be much greater than). For each individual path in the dominance level, the crowding degree is calculated. The crowding degree refers to the degree to which the path is "squeezed" by other individuals in the target space, which is used to guide diversity maintenance. For the i-th path and the jth path The mth target , the i-th path The congestion The calculation formula is:

[0093]

[0094] in and are the i-th path in the m-th target The maximum and minimum values ​​of and is the i+1th path after path sorting The target value and the i-1th path Target value of

[0095] Intersection operation: Select two parent paths and Perform a crossover operation to generate two subpaths and ; Then in the path and In the random selection of cross-points , c takes the value of 1~m, and the scenic spot after the exchange intersection is:

[0096]

[0097]

[0098] Mutation operation: The mutation operation will randomly change the attractions in the path. Select an attraction and mutate it, for example: select two attractions and , swap their positions and randomly select a scenic spot to delete, or insert a new one in the path;

[0099] For the path after mutation operation , the path will be recalculated The objective function of .

[0100] Elite retention strategy: retain the best top paths and ensure the best forward The paths are not lost in the next generation; assuming that there are Optimal solution ,in represents the Nth optimal solution, Represents the Elite Population. The optimal solution will directly enter the next generation.

[0101] Update the population: When updating the population, merge the paths of the parent and child generations, perform non-dominated sorting, and select the top M optimal paths. The update rule is:

[0102]

[0103] in Represents the Next Generation Population, represents the parent population, represents the offspring population, It is an elite retention strategy operation, which ensures that in each generation, the best individuals (i.e., elite solutions) will be retained and directly enter the next generation; It is a non-dominated sorting operation.

[0104] Final solution selection: Finally, a path that meets user needs is selected, usually the path with the best fluency in the objective function and the closest time to the target. This path can be selected from the final Pareto front solution set. And the final script script_final is saved.

[0105] The script interpretation module is used for LLM script interpretation;

[0106] Artificially design prompts for LLM, and set director agents (Director Agent), actor agents (ActorAgent) and player agents (Player Agent).

[0107] The main responsibilities of the Director Agent are to generate plot outlines and scripts based on predefined plot objectives, assign roles to speak in order, instruct the Actor Agent to generate dialogue content that meets the plot objectives, and check whether the current plot has achieved the established objectives. The script _ Set story goals ,in Indicates the nth target and sets the script _ Converted to multi-round dialogue script format , where the kth round of dialogue , t, including roles and the role Expected content of speech When generating a dialogue script, the director agent will obtain the basic information of all the characters in the scene (including character descriptions, character relationships, impressions, memories related to the current plot goals, etc.) to ensure that the generated plot conforms to the character's personalized information. , only as a plot summary, the actual speech content The generation of is done by the actor agent. To ensure that the generated content meets the plot objectives , the Director Agent provides instructions to the Actor Agent , including scripts _ , Overview of the roles that will be speaking and several keywords :

[0108]

[0109] After each round of dialogue, the director agent queries the actual dialogue history To determine the current plot goal Is it completed? Indicates the content of the pth dialogue. If completed, move to the next plot goal ; If not completed, continue generating the current plot goal.

[0110] Actor agents are used to generate actual dialogue content. Each actor agent has an independent character profile, memory database, and character relationship database. The character profile contains basic information about the character (such as name, description); the memory database records the character's past events and perceptions; and the character relationship database records the relationships between characters. In order to enhance the character's performance, the actor agent interprets this information from the character's perspective in a first-person "monologue", and updates the character impressions and relationships in the memory database as the plot develops. Dialogue log The format of narrative dialogue is adopted. The actor agent obtains environmental events, character speeches and other descriptive information from the log. When the content of the dialogue log reaches p=50, the early dialogue Will be summarized into key points , and rejoin the first position of log L, where Indicates point 5; when generating role response content a, the actor agent retrieves relevant documents from the role archive, memory database, and role relationship database, and generates response content in combination with the director agent's instructions, script background, and dialogue history.

[0111] The player agent allows human users to freely insert dialogue into the plot, while the director agent dynamically adjusts the plot based on the player's behavior to keep the story moving forward.

[0112] In a specific embodiment of the present invention, a smart script generation and tour guidance system based on the city's cultural and tourism characteristics is provided, comprising the following steps:

[0113] Step 1: The historical background, cultural characteristics, geographical location and other information of Nanjing’s Sun Yat-sen Mausoleum, Confucius Temple, Presidential Palace and other scenic spots are stored in a structured manner in the database to form a knowledge graph;

[0114] Step 2, get the script world view and character settings that are easy to connect the entire Nanjing attractions, such as "At the intersection of modern technology and ancient wisdom, there is a secret organization - "Time Guardians". This organization is composed of a group of guardians who can travel through different historical periods and protect historical and cultural heritage. They have a special ability to enter a parallel world called "Historical Fantasy", where the most glorious cultural heritage and the most moving stories in history are preserved...";

[0115] Step 3, obtaining several story scripts centered around the protagonist in various scenic spots;

[0116] Step 4: Get the connection script generated by matching the scripts between different scenic spots and the fluency between the two scripts, which provides a quantitative indicator for the subsequent path selection;

[0117] Step 5, get a set of optional travel routes, for example, if you want a 5-hour tour route, the route of "Sun Yat-sen Mausoleum - Presidential Palace" will be recommended, and the script of visiting these two attractions will be saved;

[0118] Step 6. Follow the guidance of the plot, have conversations with the characters, and immerse yourself in the historical and cultural characteristics of the scenic spot.

[0119] The present invention provides an intelligent script generation and tour guidance system based on the characteristics of urban cultural tourism. There are many methods and ways to implement the technical solution. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention. All components not specified in this embodiment can be implemented by existing technologies.

Claims

1. An intelligent script generation and tour guidance system based on the characteristics of urban culture and tourism, characterized in that: include: A database establishment module is used to establish a database containing scenic spot data; Data generation module, used to generate world view and protagonist settings; The scenic spot script generation module is used to generate scenic spot scripts; Fluency Assessment Module, used to assess script fluency; Path selection module, used for path selection based on NSGA-II algorithm; The script interpretation module is used for LLM script interpretation.

2. The system according to claim 1, characterized in that The establishment of a database containing scenic spot data specifically includes: before planning a tour route, first construct a knowledge graph containing scenic spots, first collect the characteristics of each scenic spot, define the i-th scenic spot Features include historical background , Cultural Characteristics 、Scenic area facilities and geographic location ,in , represents the i-th scenic spot The longitude, represents the i-th scenic spot The latitude, represents the recommended visiting time for the i-th scenic spot, the i-th scenic spot Represented as a multidimensional vector: , By building a knowledge graph, the background information of scenic spots and attractions is structured and stored in the database.

3. The system according to claim 2, characterized in that The database establishment module is also used to: set the knowledge graph to consist of a node set and edge set , where each edge Indicates the i-th scenic spot With the jth attraction The relationship between, n represents the total number of nodes; each node in the knowledge graph Indicates a scenic spot, side Indicates the connection between attractions.

4. The system according to claim 3, characterized in that The generation of the world view and the setting of the protagonist specifically includes: using the RAG retrieval enhancement generation technology, combining the information retrieved from the knowledge graph, using the prompt word prompt for the LLM large language model, generating a unified world view, and setting the generation of the world view to be generated by a global knowledge base It includes comprehensive background information on all cities and attractions: , Identify the protagonist of the story ,main character The settings include identity ,character and background story , forming a vector containing the features: 。 5. The system according to claim 4, characterized in that The generating of the scenic spot script specifically includes: using RAG search enhancement generation technology to search for each scenic spot Based on the retrieved background information, for each scenic spot ,generate A collection of different scripts , Indicates the kth script; the script has a unified protagonist As the center, ensure the coherence of the plot and the consistency of the background. It is expressed as: , in represents the kth script The plot; represents the kth script dialogue; represents the kth script The time is calculated as: , Among them, the number of characters is the total number of characters in the kth script text, Indicates average reading speed.

6. The system according to claim 5, characterized in that The evaluation of script fluency specifically includes: randomly selecting attractions , list the attractions A collection of all the optional scripts , select ; Retrieve the current attractions through the knowledge graph All adjacent candidate attractions , set the i-th With the jth attraction Connect to get the jth attraction The set of all possible scripts ; According to the current script and the hth scenario selected from the candidate scenario , using LLM technology, generate connection scripts based on prompt words , that is, combining the possible scripts of the current attraction with the possible scripts of the next attraction to form a complete story chain; To evaluate the connection script The cohesion effect needs to calculate the fluency score , Indicates the number of points from the i-th scenic spot The k-th script to the j-th attraction The coherence between the h-th scripts is given by: , in Plot coherence score , Role Interaction Rating , spatiotemporal coherence score and immersion score The weight of .

7. The system according to claim 6, characterized in that The path selection based on the NSGA-II algorithm specifically includes: Step 1, initialize the population: First initialize the population, set each path to contain scenic spots, and each individual path is composed of selected scenic spots. Given a path ,in is the mth scenic spot on the path, and the total length of the path is ; Step 2, for each individual path, calculate the following objective function: Fluency ,in It is the i-th attraction and the i+1th attraction Fluency scores between; Time target ,in It is the i-th attraction Go to the i+1th attraction The travel time, is at the i-th attraction The duration of the script; Script time ratio target ; Step 3: Compare non-dominated sorting and congestion degree: First, perform non-dominated sorting on all paths to obtain more than two dominance levels; set the initialized path and path , if the path Non-inferior to the path on all objectives , that is, the path Fluency Greater than , time target Less than , script time ratio target Greater than , and strictly outperforms the path in at least one objective , that is, the path Fluency Greater than or time target Less than Or script time ratio target Greater than , then determine the path Non-dominated other paths ; For each individual path in the dominance level, calculate the congestion degree, for the i-th path and the jth path The mth target , the i-th path The congestion The calculation formula is: , in and are the i-th path in the m-th target The maximum and minimum values ​​of and is the i+1th path after path sorting The target value and the i-1th path Target value of Step 4, Crossover operation: Select two parent paths and Perform a crossover operation to generate two subpaths and ; Then in the path and In the random selection of crossover attractions , c takes the value of 1~m, and the scenic spot after the exchange intersection is: , , Mutation operation: The mutation operation randomly changes the attractions in the path, selects an attraction and mutates it; For the path after mutation operation , the path will be recalculated The objective function of Elite retention strategy: retain the best top paths and ensure the best forward The paths are not lost in the next generation; assuming that there are Optimal solution ,in represents the Nth optimal solution, Representing the elite population, The optimal solution will directly enter the next generation; Update the population: When updating the population, merge the paths of the parent and child generations, perform non-dominated sorting, and select the top M optimal paths. The update rule is: , in Representing the new generation population, represents the parent population, represents the offspring population, It is an elite retention strategy operation; It is a non-dominated sorting operation; Final solution selection: Choose a path that meets user needs , the path And the final script script_final is saved.

8. The system according to claim 7, characterized in that The LLM script interpretation specifically includes: designing prompts for the LLM, setting director agents, actor agents and player agents; The director agent generates a plot outline and script based on predefined plot goals, assigns the order in which the characters speak, instructs the actor agent to generate dialogue content that meets the plot goals, and checks whether the current plot has achieved the established goals; The director's agent will be based on the current attractions The script _ Set story goals ,in Indicates the nth target and sets the script _ Converted to multi-round dialogue script format , where the kth round of dialogue , t, including roles and the role Expected content of speech ; When generating a dialogue script, the director agent will obtain the basic information of all the characters in the scene to ensure that the generated plot conforms to the character's personalized information; the script generated by the director agent , only as a plot summary, the actual speech content The generation of is completed by the actor agent; to ensure that the generated content meets the plot objectives , the Director Agent provides instructions to the Actor Agent , including scripts _ , Overview of the roles that will be speaking and keywords : , After each round of dialogue, the director agent queries the actual dialogue history To determine the current plot goal Is it completed? Indicates the content of the pth dialogue; if completed, move on to the next plot goal ; If not completed, continue generating the current plot goal; The actor agent is used to generate the actual dialogue content. Each actor agent has an independent role profile, memory database and role relationship database; the role profile contains the basic information of the role; the memory database records the past events and perceptions of the role; the role relationship database records the relationship between the roles; the dialogue log The format of narrative dialogue is adopted; when the content of the dialogue log reaches a threshold, the early dialogue will be summarized as key points and re-added to the top of the log L; when generating the role response content a, the actor agent retrieves relevant documents from the role archive, memory database and role relationship database, and combines the instructions of the director agent, the script background and the dialogue history to generate the response content.

9. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor runs the system according to any one of claims 1 to 8.

10. A storage medium, characterized in that: A computer program or instruction is stored, and when the computer program or instruction is executed on a computer, the system according to any one of claims 1 to 8 is executed.

Citation Information

Patent Citations

  • System for realizing role play

    CN106880946A

  • Interactive cartoon generation system and method based on generative AI technology and storage medium

    CN117391923A

  • Tourist route recommendation method based on large language model and knowledge graph

    CN117407606A

  • Scenario generation method and device based on affair graph, equipment and storage medium

    CN117993493A

  • Language model role playing-based long script automatic generation method

    CN118394926A