A method and system for generating scenic spot tour plot based on question and answer

Through a question-and-answer method, combined with dialogue model, context management mechanism and emotional discrimination model, the problem of difficult to understand user intentions in traditional plot generation is solved, and a personalized and interesting plot generation of scenic spot tours is achieved.

CN118551008BActive Publication Date: 2025-02-07WUXI NIANHUAWAN CULTURAL TOURISM DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410619881.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-02-07
Estimated Expiration
2044-05-17

AI Technical Summary

Technical Problem

Traditional scenic spot tour plot generation methods are difficult to accurately understand user intentions, especially the implicit needs of users cannot be captured.

Method used

A question-and-answer method is adopted to collect scenic spot information and tourists' feedback, a dialogue model and context management mechanism are built, combined with the emotional discrimination model, and dynamically adjust the plot generation to ensure that the plot meets the user's personal preferences and needs.

Benefits of technology

It achieves a more accurate understanding of user needs and generates a personalized scenic spot tour plot, which enhances the personalization and fun of the tour experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551008B_ABST
    Figure CN118551008B_ABST
Patent Text Reader

Abstract

The present invention discloses a scenic spot tour plot generation method and system based on question and answer, including S1: collecting scenic spot information, providing preliminary plot style options for tourists, and storing plot style keywords selected by tourists; S2: constructing a dialogue model, generating a plot summary and collecting tourist feedback based on scenic spot information and keywords selected by tourists; S3: constructing a context management mechanism, and according to tourist feedback, asking tourists questions for keywords in multiple rounds of question and answer, tracking tourist preferences; S4: constructing an emotion discrimination model to determine whether tourists are satisfied with the plot summary; S5: if tourists are satisfied with the plot summary, enriching the details of the plot summary; if tourists are not satisfied with the plot summary, modifying the plot summary according to a new round of modification opinions from tourists; S6: repeating step S5 until it is determined that the tourists are satisfied or the preset number of dialogue rounds is reached. The present invention solves the problem that the traditional scenic spot tour plot generation method is difficult to accurately understand the user's intention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tourism services, and in particular to a method and system for generating a scenic spot tour plot based on question and answer. Background Art

[0002] Tour plot generation is a method that automatically generates storylines related to scenic spot tours based on user needs and settings. The storylines include tour routes, scenic spot introductions, character interactions, tasks, and achievements. Through tour plot generation, scenic spots can provide tourists with a more personalized and interesting tour experience.

[0003] Traditional plot generation methods mainly include manual writing, rule-based methods and traditional natural language processing methods. Manually writing plots is time-consuming and laborious, and it is difficult to cope with the needs of large-scale scenic spots and different users; rule-based systems can generate plots based on pre-defined rules and knowledge bases, but rule systems cannot flexibly adapt to the needs of different users; and traditional NLP methods can extract information such as scenic spot names and user preferences from the text provided by users, but usually cannot capture the user's implicit intentions. For example, a user may mention "I want to see beautiful scenery", but the specific name of the scenic spot is not clearly mentioned. Traditional methods find it difficult to understand this implicit demand. Summary of the invention

[0004] In view of this, the present invention aims to provide a method and system for generating scenic spot tour plots based on question and answer, aiming to solve the problem that traditional scenic spot tour plot generation methods are difficult to accurately understand user intentions.

[0005] A method for generating a scenic spot tour plot based on question and answer, comprising:

[0006] S1: Collect scenic spot information, provide preliminary plot style options for tourists, and store the plot style keywords selected by tourists;

[0007] S2: Build a dialogue model to generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists;

[0008] S3: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of Q&A to track tourists’ preferences;

[0009] S4: Construct an emotion discrimination model to determine whether tourists are satisfied with the plot summary;

[0010] S5: If the tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if the tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions;

[0011] S6: Repeat step S5 until the visitor is determined to be satisfied or the preset number of dialogue rounds is reached;

[0012] Furthermore, the step S1 collects scenic spot information, provides preliminary plot style options for tourists, and stores plot style keywords selected by tourists, including:

[0013] S11: Collect information about the scenic spot, including its history, culture, geography, attractions and activities;

[0014] S12: Setting a template for the information to be collected, including tourists' age group, gender, expected plot style, expected plot background, and expected role type;

[0015] S13: providing preliminary plot style options for tourists based on the template of the information to be collected and the scenic spot information, and storing the plot style keywords selected by the tourists.

[0016] Furthermore, the step S2 constructs a dialogue model, generates a plot summary and collects tourist feedback based on the scenic spot information and the keywords selected by tourists, including:

[0017] S21: Construct a dialogue model based on UniLM. The dialogue model is pre-trained using scenic spot information and incorporates contextual probability decoding and context management mechanisms. UniLM (Unified Language Model) is a unified language model.

[0018] S22: Construct contextual probability decoding, calculated as follows:

[0019] Let P(w) be the probability distribution of the word when decoding, and sort all decoded words in descending order according to P(w);

[0020] Find the smallest n so that the cumulative probability satisfy

[0021] Among them, p is the pre-set probability threshold, w is the decoded word vector, and w i is the word vector of the i-th decoded word, i is the word vector index, and n is the minimum number of decoded words;

[0022] By setting the probability threshold p and selecting decoding words in a cumulative probability manner, the appearance of irrelevant or inappropriate words can be reduced. Compared with traditional plot generation methods, which rely on fixed templates or simple keyword matching and are prone to produce stereotyped or repetitive content, contextual probabilistic decoding can dynamically adjust the plot according to tourists' feedback and preferences, so that every tourist can get a customized tour plot that meets their personal preferences and needs.

[0023] S23: The standard decoding method in UniLM is replaced by contextual probability decoding, and the keywords selected by tourists and the template of information to be collected are used as the input of the dialogue model, and the plot summary and plot adjustment direction are used as the output of the dialogue model.

[0024] Furthermore, the S3 step constructs a context management mechanism, and based on tourist feedback, asks tourists questions based on keywords in multiple rounds of questions and answers, and tracks tourist preferences, including:

[0025] S31: Build a context management mechanism, the calculation method is:

[0026]

[0027] e t =exp(-λt)

[0028]

[0029]

[0030] Among them, α t is the attention weight of the t-th round of dialogue, t is the dialogue round index, e t is the attenuation factor, λ is the first attenuation parameter, exp() is the exponential operation of taking the natural constant, τ is the second attenuation parameter, and Z is the normalization constant; β t,i is the attention weight of the ith keyword in the tth round of dialogue, sim() is the similarity calculation, N t is the total number of keywords in the tth round of dialogue, k i is the word vector of the i-th keyword, k j is the word vector of the jth keyword, j is another keyword index, q t is the query vector of the t-th round of dialogue; · is the vector dot product, |||| is the Euclidean norm;

[0031] The present invention uses the principle of attention mechanism, combined with attenuation factor and similarity calculation, so that the model can more accurately capture the key information in the historical conversation and dynamically adjust the focus of the conversation based on this information; compared with the traditional method, the context management mechanism assigns corresponding weights to each round of conversation and each keyword to indicate its importance in the conversation, which has obvious advantages in information selection and filtering. In particular, when the amount of information is huge, the traditional method may forget the key information mentioned in the early conversation, while the present invention continuously tracks this key information through weights, ensuring the integrity of the information and the coherence of the conversation;

[0032] S32: Generate keywords for tourist feedback based on attention weights, calculated as follows:

[0033]

[0034] w t,i =α t β t,i

[0035] k feedback is the keyword vector of the generated tourist feedback, T is the total number of conversation rounds, and w t,i is the word vector of the i-th keyword in the t-th round of dialogue, v t,i is the generation weight of the i-th keyword in the t-th round of dialogue;

[0036] The keyword generation method can comprehensively consider the tourists' attention to each keyword during the entire conversation process. Therefore, it not only extracts the keywords clearly expressed by tourists, but also generates keyword word vectors that reflect tourists' intentions through the accumulation of attention weights. Traditional keyword extraction methods only focus on tourists' direct expressions and ignore the deep understanding of tourists' intentions. In the present invention, even if tourists do not mention words or the descriptions are not clear enough, the system can understand their potential needs and intentions, generate corresponding keyword descriptions, and more flexibly adapt to the needs of various tourists.

[0037] S33: Input tourist feedback, keywords of tourist feedback and plot summary into the dialogue model, and generate questions to ask tourists for a new round of modification opinions.

[0038] Furthermore, the step S4 constructs an emotion discrimination model to judge whether the tourists are satisfied with the plot summary, including:

[0039] S41: Sort the keywords in descending order of weight, and extract the top 5 keywords except for the weight ranking. The calculation method is:

[0040] K sorted =sort(K,by=v t,i )

[0041] Among them, K is the set of original keyword vectors, K sorted is a set of keyword vectors sorted in descending order of weight;

[0042] S42: Establish a recurrent neural network, combine the tourists' new round of modification opinions and keyword weight rankings, and input them into the recurrent neural network for sentiment discrimination. The calculation method is:

[0043] x g =concat(h sentence ,K top5 )

[0044] h g =LSTM(x g ,hg-1 )

[0045] y g =softmax(W·h g +b)

[0046] Among them, h sentence is the sentence vector of the entire conversation, K top5 is the set of the top 5 keyword vectors by weight, concat() is the vector concatenation operation, LSTM() is the recurrent neural network operation, x g is the input of time step g, g is the time step index, h g is the hidden state at time step g, h g-1 is the hidden state at time step g-1; y g is the probability distribution of emotion discrimination at time step g; W is the weight parameter of the recurrent neural network, and b is the bias vector of the recurrent neural network;

[0047] Combining keyword weights and sentence vectors as the input of the sentiment discrimination model not only takes into account the overall semantics of the sentence, but also emphasizes the importance of keywords, which can more comprehensively capture the emotional tendencies of tourists. In addition, the use of recurrent neural networks enables the model to capture the time dependency in the conversation, thereby better understanding the dynamic changes of tourists' emotions.

[0048] Furthermore, in step S5, if the tourists are satisfied with the plot summary, the plot summary is enriched with details; if the tourists are not satisfied with the plot summary, the plot summary is modified according to the tourists' new round of modification suggestions, including:

[0049] S51: If the tourist is satisfied with the plot summary, the plot summary, the keywords fed back by the tourist, and the content of each discussion dialogue are used as inputs of the dialogue model to generate details of the plot summary for each part of the plot summary;

[0050] S52: If the tourist is not satisfied with the plot summary, the keywords indicating the tourist's dissatisfaction and the previous round of dialogue are used as inputs of the dialogue model to generate a new plot summary, and the previous round of dialogue is replaced and output to the tourist.

[0051] Further, step S6 repeats step S5 until it is determined that the visitor is satisfied or a preset number of dialogue rounds is reached, including:

[0052] S61: Set the upper threshold and the dynamic threshold. The calculation method is:

[0053]

[0054] Where D is the dynamic threshold, min() is the minimum value, max() is the maximum value, M is the upper limit of the threshold, S is the total number of words in the visitor's reply, and R is the average number of words in each round of dialogue in the historical data;

[0055] The upper limit of the number of conversation rounds is adjusted through dynamic thresholds and historical conversation data. The calculation of the dynamic threshold takes into account the participation of tourists, reflecting the level of activity of tourists in the conversation, while the average number of words in each round of conversation in the historical data reflects the level of activeness of tourists in previous situations.

[0056] Traditional dialogue systems may use a fixed number of dialogue turns as a standard, which may result in dialogues that are too brief or too lengthy, making it difficult to meet the needs of all tourists. The introduction of dynamic thresholds can prevent dialogues from ending prematurely without achieving effective communication, or from being unnecessarily prolonged when tourists are already satisfied. This not only improves the tourists’ experience, but also improves the efficiency and quality of plot generation.

[0057] S62: After each interaction with the visitor, the current number of dialogue rounds is updated and compared with the dynamic threshold. If the current number of dialogue rounds reaches the dynamic threshold D, the dialogue is stopped.

[0058] The present invention also provides a scenic spot tour plot generation system based on question and answer, comprising:

[0059] Plot style preliminary selection module: collects scenic spot information, provides tourists with preliminary plot style options, and stores the plot style keywords selected by tourists;

[0060] Dialogue model building module: Build a dialogue model, generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists;

[0061] Context management mechanism module: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of questions and answers based on tourists’ feedback to track tourists’ preferences;

[0062] Emotion discrimination module: build an emotion discrimination model to determine whether tourists are satisfied with the plot summary;

[0063] Plot modification module: if tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions;

[0064] Dialogue round limit module: repeatedly modify the plot until the tourist is determined to be satisfied or the preset number of dialogue rounds is reached; so as to realize the above-mentioned question-and-answer-based scenic spot tour plot generation method.

[0065] Compared with the prior art, the advantages of the present invention are:

[0066] (1) In terms of the overall solution, the present invention incorporates a context management mechanism based on UniLM, so that the dialogue model can better understand the needs and intentions of tourists. By extracting key information based on tourists' feedback and asking more detailed questions about this information, the system can more accurately generate personalized scenic spot tour plots.

[0067] (2) In terms of algorithm improvement, the context management mechanism proposed in this invention can not only extract the importance of different rounds, but also extract the importance of keywords in each round of questions and answers, while understanding tourists' needs and generating new keywords, so that the system can understand tourists' needs more comprehensively, rather than just being limited to tourists' direct expressions;

[0068] (3) In terms of conversation round control, the present invention adjusts the upper limit of conversation rounds through dynamic thresholds and historical conversation data, so that the conversation length can be adjusted according to actual conditions, avoiding premature termination of the conversation or unnecessary extension.

[0069] (4) In the decoding process from word vectors to specific words, the present invention combines the scene of tour plot generation and proposes contextual probability decoding, which selects decoding words in a cumulative probability manner. Compared with the traditional decoding method, it can dynamically adjust according to the context and preferences of tourists' feedback, generating richer and more interesting tour plots. 。 BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A schematic flow chart of the method for generating scenic spot tour plots based on question and answer provided by the present invention.

[0071] Figure 2 A schematic diagram of the context management mechanism provided by the present invention. DETAILED DESCRIPTION

[0072] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0073] Embodiment 1: A method for generating a scenic spot tour plot based on question and answer, such as Figure 1 As shown, including:

[0074] S1: Collect scenic spot information, provide preliminary plot style options for tourists, and store the plot style keywords selected by tourists;

[0075] S11: Collect information about the scenic spot, including its history, culture, geography, attractions and activities;

[0076] S12: Setting a template for the information to be collected, including tourists' age group, gender, expected plot style, expected plot background, and expected role type;

[0077] S13: providing preliminary plot style options for tourists based on the template of the information to be collected and the scenic spot information, and storing the plot style keywords selected by the tourists.

[0078] S2: Build a dialogue model to generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists;

[0079] S21: Construct a dialogue model based on UniLM. The dialogue model is pre-trained using scenic spot information and incorporates contextual probability decoding and context management mechanisms. UniLM (Unified Language Model) is a unified language model.

[0080] S22: Construct contextual probability decoding, calculated as follows:

[0081] Let P(w) be the probability distribution of the word when decoding, and sort all decoded words in descending order according to P(w);

[0082] Find the smallest n so that the cumulative probability satisfy

[0083] Among them, p is the pre-set probability threshold, w is the decoded word vector, and w i is the word vector of the i-th decoded word, i is the word vector index, and n is the minimum number of decoded words;

[0084] By setting the probability threshold p and selecting decoding words in a cumulative probability manner, the appearance of irrelevant or inappropriate words can be reduced. Compared with traditional plot generation methods, which rely on fixed templates or simple keyword matching and are prone to produce stereotyped or repetitive content, contextual probabilistic decoding can dynamically adjust the plot according to tourists' feedback and preferences, so that every tourist can get a customized tour plot that meets their personal preferences and needs.

[0085] S23: Using contextual probabilistic decoding instead of the standard decoding method in UniLM, the keywords selected by tourists and the template of information to be collected are used as the input of the dialogue model, and the plot summary and plot adjustment direction are used as the output of the dialogue model;

[0086] For example, in the context of historical sites, the candidate words are:

[0087] “Palace” (0.3), “Museum” (0.2), “Ruins” (0.15), “Monument” (0.15), “Temple” (0.1), “Castle” (0.08), “Watchtower” (0.05), …;

[0088] The cumulative probability of the top 6 words in generation probability is 0.98<1, while the cumulative probability of the top 7 words in generation probability is 1.03>1, so the first 6 words are used as the decoding range;

[0089] For example, in another context, the candidate words are:

[0090] “Rock climbing” (0.5), “rafting” (0.3), “skydiving” (0.25), …;

[0091] The cumulative probability of the top two words in generation probability is 0.8 < 1, while the cumulative probability of the top three words in generation probability is 1.05 > 1, so the first two words are used as the decoding range;

[0092] It can be seen that in different situations, contextual probability decoding can dynamically adjust the number of candidate words according to the preset probability threshold and the actual word probability distribution, so as to better adapt to different plot generation needs.

[0093] S3: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of questions and answers based on tourists’ feedback, and track tourists’ preferences, e.g. Figure 2 As shown;

[0094] S31: Build a context management mechanism, the calculation method is:

[0095]

[0096] e t =exp(-λt)

[0097]

[0098]

[0099] Among them, α t is the attention weight of the t-th round of dialogue, t is the dialogue round index, e t is the attenuation factor, λ is the first attenuation parameter, exp() is the exponential operation of taking the natural constant, τ is the second attenuation parameter, and Z is the normalization constant; β t,i is the attention weight of the ith keyword in the tth round of dialogue, sim() is the similarity calculation, N t is the total number of keywords in the tth round of dialogue, k i is the word vector of the i-th keyword, k jis the word vector of the jth keyword, j is another keyword index, q t is the query vector of the t-th round of dialogue; · is the vector dot product, |||| is the Euclidean norm;

[0100] The present invention uses the principle of attention mechanism, combined with attenuation factor and similarity calculation, so that the model can more accurately capture the key information in the historical conversation and dynamically adjust the focus of the conversation based on this information; compared with the traditional method, the context management mechanism assigns corresponding weights to each round of conversation and each keyword to indicate its importance in the conversation, which has obvious advantages in information selection and filtering. In particular, when the amount of information is huge, the traditional method may forget the key information mentioned in the early conversation, while the present invention continuously tracks this key information through weights, ensuring the integrity of the information and the coherence of the conversation;

[0101] S32: Generate keywords for tourist feedback based on attention weights, calculated as follows:

[0102]

[0103] w t,i =α t β t,i

[0104] k feedback is the keyword vector of the generated tourist feedback, T is the total number of conversation rounds, and w t,i is the word vector of the i-th keyword in the t-th round of dialogue, v t,i is the generation weight of the i-th keyword in the t-th round of dialogue;

[0105] The keyword generation method can comprehensively consider the tourists' attention to each keyword during the entire conversation process. Therefore, it not only extracts the keywords clearly expressed by tourists, but also generates keyword word vectors that reflect tourists' intentions through the accumulation of attention weights. Traditional keyword extraction methods only focus on tourists' direct expressions and ignore the deep understanding of tourists' intentions. In the present invention, even if tourists do not mention words or the descriptions are not clear enough, the system can understand their potential needs and intentions, generate corresponding keyword descriptions, and more flexibly adapt to the needs of various tourists.

[0106] For example, the numbers in brackets in the following dialogue are the sequence numbers of the dialogue turns:

[0107] **System (0): **Welcome to our historical monuments adventure! In this journey, you will play the role of an explorer looking for ancient secrets. First, let me know what kind of story you have in mind? Is it an exciting adventure, or an exploration immersed in romantic legends?

[0108] **Visitor (1):** I want a romantic and mysterious story, like searching for a treasure from an ancient legend.

[0109] **System (1):** Understand your expectations! Now, you are standing in front of a forgotten ruin, and a moss-covered stone tablet catches your attention. It seems to be the key to the past. Are you going to follow the vague clues on the map and move forward, or decipher the mysterious symbols on the stone tablet first?

[0110] **Visitor (2):** I'd like to study these symbols first, they look very unusual.

[0111] **System (2):** These symbols seem to be related to an ancient legend. This legend tells of a brave warrior who gave his life to protect this monument. At this point, do you want to continue to explore the warrior's story, or just wander around?

[0112] **Tourist (3): **I am very interested in that battle. By the way, when does the specialty cafe here open?

[0113] **System (3):** This battle took place two hundred years ago and was a decisive conflict that had a profound impact on the history of this region. As for the café, it usually opens at nine in the morning. Would you like to rest there after visiting the monument?

[0114] During the conversation, the system automatically calculates the weight of each round of visitors' replies to indicate their importance:

[0115] The response weight of visitor (1): α1 = 0.4

[0116] This is the key response that tourists express their preference for plot style, and the system generates a romantic and mysterious story background based on it;

[0117] The response weight of visitor (2): α2 = 0.3

[0118] Visitors choose to study symbols, which is a decision that has a direct impact on the development of the plot, according to which the system introduces elements about ancient legends and brave warriors.

[0119] The response weight of visitor (3): α3 = 0.2

[0120] Although the visitor asked about the café’s opening hours, which is secondary information, the system still provided an answer and cleverly tied it to the main plot by asking if the visitor wanted to rest after exploring.

[0121] Among them, for the tourist's third round of replies, "I am very interested in that battle. By the way, when does the specialty cafe here open?", the tourist took the initiative to ask questions without the guidance of the system, indicating that this is information that the tourist cares about. Therefore, when the system calculates, the weight of the keyword "cafe" in this round of conversation will be higher. Then the system will conduct targeted in-depth research on the tourist's replies, dynamically adjust the attention weight according to the tourist's replies, pay attention to the information that the tourist cares about, and finally generate a reply "It usually opens at nine in the morning. Do you want to go there to rest after visiting the monument?"

[0122] S33: Input tourist feedback, keywords of tourist feedback and plot summary into the dialogue model, and generate questions to ask tourists for a new round of modification opinions.

[0123] If the tourist does not cooperate with multiple rounds of questions and answers, the system uses a pre-set guidance template to help the tourist quickly get through this stage, for example:

[0124] **System:** I am very sorry for wasting your time. In order to let you experience the fun of the scenic spot as soon as possible, I will create a simple and enjoyable plot for you.

[0125] You have arrived in a mysterious forest and felt the beauty of nature. You will follow the guide and walk along the trails, enjoying the beauty of the trees and the singing of the birds.

[0126] I hope this simple plot can relax you a little. Please enjoy your time in the scenic area and have a pleasant visit!

[0127] S4: Construct an emotion discrimination model to determine whether tourists are satisfied with the plot summary;

[0128] S41: Sort the keywords in descending order of weight, and extract the top 5 keywords except for the weight ranking. The calculation method is:

[0129] K sorted =sort(K,by=v t,i )

[0130] Among them, K is the set of original keyword vectors, K sorted is a set of keyword vectors sorted in descending order of weight;

[0131] S42: Establish a recurrent neural network, combine the tourists' new round of modification opinions and keyword weight rankings, and input them into the recurrent neural network for sentiment discrimination. The calculation method is:

[0132] x g =concat(h sentence ,K top5 )

[0133] h g =LSTM(x g ,h g-1 )

[0134] y g =softmax(W·h g +b)

[0135] Among them, h sentence is the sentence vector of the entire conversation, K top5 is the set of the top 5 keyword vectors by weight, concat() is the vector concatenation operation, LSTM() is the recurrent neural network operation, x g is the input of time step g, g is the time step index, h g is the hidden state at time step g, h g-1 is the hidden state at time step g-1; y g is the probability distribution of emotion discrimination at time step g; W is the weight parameter of the recurrent neural network, and b is the bias vector of the recurrent neural network;

[0136] Combining keyword weights and sentence vectors as the input of the sentiment discrimination model not only takes into account the overall semantics of the sentence, but also emphasizes the importance of keywords, which can more comprehensively capture the emotional tendencies of tourists. In addition, the use of recurrent neural networks enables the model to capture the time dependency in the conversation, thereby better understanding the dynamic changes of tourists' emotions.

[0137] For example,

[0138] **System:** This is a legendary adventure about an ancient warrior. In this story, you will find an ancient sword, which is a relic of the warrior and is said to have the power to guide to treasure. What do you think of this plot?

[0139] **Tourist:** Well, the story is OK, but I wish there were more clues and challenges about the treasure.

[0140] **Emotional discrimination model analysis:**

[0141] -Keywords: story, treasure, clues, challenge

[0142] -Emotional discrimination: The satisfaction calculation result is **0.6**, which means that tourists are generally satisfied with the plot, but expect more details.

[0143] **System:** Thanks for your feedback! Well, let's add some suspense. During your exploration, you encounter a series of puzzles, each of which will reveal part of the map to the treasure. These puzzles require you to use your wisdom and courage to solve them. What do you think of this improvement?

[0144] **Tourist:** Great! I love solving puzzles and this makes the whole adventure more exciting and fun.

[0145] **Emotional discrimination model analysis:**

[0146] -Keywords: puzzle, wisdom, courage, excitement, fun

[0147] -Emotional discrimination: The satisfaction calculation result is **0.9**, which means that tourists are very satisfied with the plot adjustment.

[0148] **SYSTEM:** We're glad you like this improvement! Now, let's continue your adventure and see if you can solve all the puzzles and find the legendary treasure.

[0149] S5: If the tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if the tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions;

[0150] S51: If the tourist is satisfied with the plot summary, the plot summary, the keywords fed back by the tourist, and the content of each discussion dialogue are used as inputs of the dialogue model to generate details of the plot summary for each part of the plot summary;

[0151] S52: If the tourist is not satisfied with the plot summary, the keywords indicating the tourist's dissatisfaction and the previous round of dialogue are used as inputs of the dialogue model to generate a new plot summary, and the previous round of dialogue is replaced and output to the tourist.

[0152] S6: Repeat step S5 until the visitor is determined to be satisfied or the preset number of dialogue rounds is reached;

[0153] S61: Set the upper threshold and the dynamic threshold. The calculation method is:

[0154]

[0155] Where D is the dynamic threshold, min() is the minimum value, max() is the maximum value, M is the upper limit of the threshold, S is the total number of words in the visitor's reply, and R is the average number of words in each round of dialogue in the historical data;

[0156] The upper limit of the number of conversation rounds is adjusted through dynamic thresholds and historical conversation data. The calculation of the dynamic threshold takes into account the participation of tourists, reflecting the level of activity of tourists in the conversation, while the average number of words in each round of conversation in the historical data reflects the level of activeness of tourists in previous situations.

[0157] Traditional dialogue systems may use a fixed number of dialogue turns as a standard, which may result in dialogues that are too brief or too lengthy, making it difficult to meet the needs of all tourists. The introduction of dynamic thresholds can prevent dialogues from ending prematurely without achieving effective communication, or from being unnecessarily prolonged when tourists are already satisfied. This not only improves the tourists’ experience, but also improves the efficiency and quality of plot generation.

[0158] S62: After each interaction with the visitor, the current number of dialogue rounds is updated and compared with the dynamic threshold. If the current number of dialogue rounds reaches the dynamic threshold D, the dialogue is stopped.

[0159] Embodiment 2: The present invention also discloses a scenic spot tour plot generation system based on question and answer, which is used to implement the above-mentioned scenic spot tour plot generation method based on question and answer, including:

[0160] Plot style preliminary selection module: collects scenic spot information, provides tourists with preliminary plot style options, and stores the plot style keywords selected by tourists;

[0161] Dialogue model building module: Build a dialogue model, generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists;

[0162] Context management mechanism module: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of questions and answers based on tourists’ feedback to track tourists’ preferences;

[0163] Emotion discrimination module: build an emotion discrimination model to determine whether tourists are satisfied with the plot summary;

[0164] Plot modification module: if tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions;

[0165] Dialogue round limit module: repeatedly modify the plot until the tourists are satisfied or the preset number of dialogue rounds is reached.

[0166] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0167] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0168] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for generating scenic spot tour plots based on question and answer, characterized in that: include: S1: Collect scenic spot information, provide tourists with preliminary plot style options, and store the plot style keywords selected by tourists; including: S11: Collect information about the scenic spot, including its history, culture, geography, attractions and activities; S12: Setting a template for the information to be collected, including tourists' age group, gender, expected plot style, expected plot background, and expected role type; S13: providing preliminary plot style options for tourists based on the template of the information to be collected and the scenic spot information, and storing the plot style keywords selected by the tourists; S2: Build a dialogue model to generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists; The dialogue model is based on UniLM, which is pre-trained using scenic spot information. The standard decoding method in UniLM is replaced by contextual probability decoding to output the plot summary and plot adjustment direction. include: S21: Construct a dialogue model based on UniLM. The dialogue model is pre-trained using scenic spot information and incorporates contextual probability decoding and context management mechanisms. S22: Construct contextual probability decoding. The specific calculation method is: Let P(w) be the probability distribution of the word when decoding, and sort all decoded words in descending order according to P(w); Find the smallest n so that the cumulative probability satisfy Among them, p is the pre-set probability threshold, w is the decoded word vector, and w i is the word vector of the i-th decoded word, i is the word vector index, and n is the minimum number of decoded words; S23: Using contextual probabilistic decoding instead of the standard decoding method in UniLM, the keywords selected by tourists and the template of information to be collected are used as the input of the dialogue model, and the plot summary and plot adjustment direction are used as the output of the dialogue model; S3: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of Q&A to track tourists’ preferences; include: S31: Build a context management mechanism, the calculation method is: e t =exp(-λt) Among them, α t is the attention weight of the t-th round of dialogue, t is the dialogue round index, e t is the attenuation factor, λ is the first attenuation parameter, exp() is the exponential operation of taking the natural constant, τ is the second attenuation parameter, and Z is the normalization constant; β t,i is the attention weight of the ith keyword in the tth round of dialogue, sim() is the similarity calculation, N t is the total number of keywords in the tth round of dialogue, k i is the word vector of the i-th keyword, k j is the word vector of the jth keyword, j is another keyword index, q t is the query vector of the t-th round of dialogue; · is the vector dot product, || || is the Euclidean norm; S32: Generate keywords for tourist feedback based on attention weights, calculated as follows: w t,i =α t ·β t,i k feedback is the keyword vector of the generated tourist feedback, T is the total number of conversation rounds, and w t,i is the word vector of the i-th keyword in the t-th round of dialogue, v t,i is the generation weight of the i-th keyword in the t-th round of dialogue; S33: Input tourist feedback, keywords of tourist feedback and plot summary into the dialogue model, and generate questions to ask tourists for a new round of modification opinions; S4: Construct an emotion discrimination model to determine whether tourists are satisfied with the plot summary; S5: If the tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if the tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions; S6: Repeat step S5 until the visitor is determined to be satisfied or the preset number of dialogue rounds is reached.

2. The method for generating scenic spot tour plot based on question and answer according to claim 1, characterized in that: The step S4 comprises: S41: Sort the keywords in descending order of weight, and extract the top 5 keywords except for the weight ranking. The calculation method is: K sorted =sort(K,by=v t,i ) Among them, K is the set of original keyword vectors, K sorted is a set of keyword vectors sorted in descending order of weight; S42: Establish a recurrent neural network, combine the tourists' new round of modification opinions and keyword weight rankings, and input them into the recurrent neural network for sentiment discrimination. The calculation method is: x g =concat(h sentence ,K top5 ) h g =LSTM(x g ,h g-1 ) y g =softmax(W·h g +b) Among them, h sentence is the sentence vector of the entire conversation, K top5 is the set of the top 5 keyword vectors by weight, concat() is the vector concatenation operation, LSTM() is the recurrent neural network operation, x g is the input of time step g, g is the time step index, h g is the hidden state at time step g, h g-1 is the hidden state at time step g-1; y g is the probability distribution of emotion discrimination at time step g; W is the weight parameter of the recurrent neural network, and b is the bias vector of the recurrent neural network.

3. The method for generating scenic spot tour plot based on question and answer according to claim 2 is characterized in that: The step S5 comprises: S51: If the tourist is satisfied with the plot summary, the plot summary, the keywords fed back by the tourist, and the content of each discussion dialogue are used as inputs of the dialogue model to generate details of the plot summary for each part of the plot summary; S52: If the tourist is not satisfied with the plot summary, the keywords indicating the tourist's dissatisfaction and the previous round of dialogue are used as inputs of the dialogue model to generate a new plot summary, and the previous round of dialogue is replaced and output to the tourist.

4. The method for generating scenic spot tour plot based on question and answer according to claim 3 is characterized in that: The step S6 comprises: S61: Set the upper threshold and the dynamic threshold. The calculation method is: Where D is the dynamic threshold, min() is the minimum value, max() is the maximum value, M is the upper limit of the threshold, S is the total number of words in the visitor's reply, and R is the average number of words in each round of dialogue in the historical data; S62: After each interaction with the visitor, the current number of dialogue rounds is updated and compared with the dynamic threshold. If the current number of dialogue rounds reaches the dynamic threshold D, the dialogue is stopped.

5. A scenic spot tour plot generation system based on question and answer, characterized in that: include: Plot style preliminary selection module: collects scenic spot information, provides preliminary plot style options for tourists, and stores the plot style keywords selected by tourists; Dialogue model building module: Build a dialogue model, generate a plot summary and collect tourist feedback based on scenic spot information and keywords selected by tourists; Context management mechanism module: Build a context management mechanism and ask tourists questions based on the keywords in multiple rounds of questions and answers based on tourists’ feedback to track tourists’ preferences; Emotion discrimination module: build an emotion discrimination model to determine whether tourists are satisfied with the plot summary; Plot modification module: if tourists are satisfied with the plot summary, the details of the plot summary will be enriched; if tourists are not satisfied with the plot summary, the plot summary will be modified according to the tourists' new round of modification suggestions; Dialogue round limit module: repeatedly modify the plot until the visitor is satisfied or the preset number of dialogue rounds is reached; To realize the scenic spot tour plot generation method based on question and answer as described in any of claims 1-4.

Citation Information

Patent Citations

  • Multi-NPC dialogue text generation method and device, multi-NPC dialogue text display method and device and medium

    CN115146048A

  • System and method for intelligent initiation of a man-machine dialogue based on multi-modal sensory inputs

    US20220254343A1