A travel and culture conversation intelligent response method and system based on retrieval enhancement generation

By collecting and processing static knowledge base and real-time data in the intelligent customer service system of cultural and tourism scenic spots, and combining user location and dialogue history, the system effectively processes open domain queries, solves the shortcomings of the intelligent customer service system in spatial and temporal perception, reduces the rate of switching to human agents, and improves service quality.

CN123048722APending Publication Date: 2026-11-06GUANGXI BAIFA DATA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611269543.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing intelligent customer service systems for cultural and tourism scenic spots lack spatial and temporal awareness capabilities when handling open domain inquiries. They cannot effectively combine dynamic data such as the user's real-time location, the status of surrounding facilities, and the distribution of visitor flow, resulting in a high rate of referrals to human agents.

Method used

Collect static knowledge base of scenic area, real-time status data of points of interest and user location data, generate static knowledge vectors and real-time status dictionary through preprocessing, and combine user location and dialogue history to perform spatial trajectory perception, spatiotemporal fusion and modal gating fusion to generate natural and coherent responses.

Benefits of technology

It enables effective processing of open domain queries, reduces the rate of transferring queries to human agents, improves the real-time service experience for tourists within the scenic area, and ensures the accuracy and consistency of responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123048722A_ABST
    Figure CN123048722A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for intelligent response to cultural tourism dialogues based on retrieval enhancement generation, comprising: A1: collecting static knowledge base text corpus of scenic spots, real-time status data of scenic spot points of interest, user terminal fused positioning data, and user dialogue interaction logs, and preprocessing them respectively; A2: sequentially obtaining candidate knowledge fragment vector sets and semantically anchored fact representations; A3: calculating spatial trajectory perception latent states, spatiotemporal fusion latent states, and context spatiotemporal latent variables; A4: sequentially calculating collaborative perception interaction latent states, gated fusion intermediate representations, and joint semantic representations; A5: calculating candidate response latent states, verified response latent states, and final response output. This invention can solve the problem that the system is difficult to integrate real-time location and point of interest status when tourists inquire, resulting in a mismatch between the response content and the current scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent customer service technology, specifically to a dialogue-based intelligent response method and system for cultural and tourism scenarios. Background Technology

[0002] In the service chain of cultural and tourism scenic spots, the intelligent customer service system is deployed at the entry point of tourist services. It handles user inquiries from channels such as scenic spot mini-programs, official accounts, and self-service terminals. After automatic response processing, problems that cannot be resolved are transferred to human agents.

[0003] In engineering practice within cultural and tourism scenarios, dialogue response systems primarily involve matching the user's input query text with a pre-defined standard question library based on literal or semantic similarity. Upon a match, a fixed answer is returned. When the matching confidence level falls below a threshold, the system triggers clarification or direct transfer to a human agent. To improve matching coverage, some solutions introduce synonym expansion and rule templates. Questions are first reduced to the same intent slot, and then key information such as location names is extracted from the question using named entity recognition and filled into the response template. The core assumption underlying this process is that the tourist's query intent can be exhaustively enumerated by a finite set of standard questions. When a tourist asks an open-domain query that exceeds the constraints of the standard question library, the intent classification confidence drops sharply, and the system cannot find a match from the pre-defined intents, resulting in a fallback response being output and the system transferring the query to a human agent. At the semantic matching level, some systems have introduced a dual-tower semantic representation based on a pre-trained language model. The question and the candidate standard question are encoded into dense vectors and then cosine similarity is used for retrieval. This improves the recall rate between the fuzzy expression and the standard question to a certain extent with semantic generalization ability. However, the retrieval results can only return the corresponding preset static answer, and the preset answer itself does not contain any real-time state information.

[0004] The structural limitation of the aforementioned static knowledge base-based response mechanism lies in the fact that the generation of response content does not involve any perception of spatial context or time-varying states. When tourists ask questions such as "Are there any empty parking spaces nearby?" or "How long is the queue for this venue?"—questions that require a comprehensive judgment based on dynamic data such as the user's real-time location, the status of surrounding facilities, and visitor flow—the system lacks a mechanism to incorporate LBS coordinates, point-of-interest attributes, and real-time business data into the semantic computing pathway and project them into the response text. Even if the number of remaining parking spaces is found through a separate interface, the system cannot connect and combine it with the context of the human-computer dialogue to form a natural and coherent response, and can only regress to low-frequency information delivery methods such as "Please click the link to view."

[0005] In recent years, retrieval-enhanced dialogue frameworks have been widely used in open-domain question-answering tasks, as they can both expand knowledge coverage and ensure fluent and coherent responses. The approach involves first retrieving semantically relevant text fragments from an external knowledge base using the user's question, then concatenating these fragments with the dialogue history to form a context sequence, which is then fed into an autoregressive language model to generate the final response. However, directly applying this framework to the cultural tourism response scenario faces two challenges. First, the knowledge base in general retrieval enhancement schemes primarily consists of static document corpora. The granularity of information carried by the retrieved fragments differs from the real-time dynamic information required for the response. The generation model lacks a structured spatiotemporal data injection channel, resulting in a lack of factual anchors for reasoning about location-related queries. Second, the dialogue history does not explicitly encode the continuity of user spatial movement and intent drift. When tourists switch between asking about different attractions in multiple rounds of dialogue, the model lags in its perception of the context of the switched locations, leading to insufficient coherence in the generated multi-round responses in terms of referential resolution and spatial logical coherence. Summary of the Invention

[0006] In view of this, the present invention aims to provide a method and system for intelligent response to cultural and tourism dialogues based on retrieval enhancement generation, so as to solve the problem that traditional dialogue response schemes lack spatial temporal awareness and are difficult to handle the high rate of manual intervention caused by open domain queries.

[0007] A method for intelligent response to cultural and tourism dialogues based on retrieval enhancement includes:

[0008] A1: Collect static knowledge base text corpus of scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and preprocess them respectively to obtain static knowledge vector library, real-time status dictionary of points of interest, user location coordinate sequence, query semantic encoding vector, target point of interest identifier, and dialogue history sequence.

[0009] A2: Based on the target interest point identifier, the query semantic encoding vector, the static knowledge vector library, and the real-time status dictionary of interest points, the candidate knowledge fragment vector set and the semantic anchoring fact representation are obtained in sequence.

[0010] A3: Calculate the spatial trajectory perception latent state, spatiotemporal fusion latent state, and context spatiotemporal latent variables based on the user's location coordinate sequence, semantic anchoring fact representation, and dialogue history sequence.

[0011] A4: Based on semantically anchored fact representation and contextual spatiotemporal latent variables, calculate the collaborative perception interaction latent state, gated fusion intermediate representation, and joint semantic representation in sequence;

[0012] A5: Based on the joint semantic representation, the dialogue history sequence, and the semantically anchored fact representation, the candidate response hidden state, the verified response hidden state, and the final response output are calculated.

[0013] Furthermore, step A1 also includes:

[0014] A11: Collect static knowledge base text data of scenic spots. The data type is unstructured text data, including scenic spot explanation text, service facility description text, and frequently asked questions text.

[0015] For the static knowledge base text corpus of the scenic area, text segmentation based on syntax rules is used to divide each text into text segments; then, a text embedding method based on a pre-trained language model is used to map each text segment into a dense vector of fixed dimension, and the dense vector is used as the key vector and value vector of the corresponding text segment.

[0016] All text fragments are traversed and processed to obtain a static knowledge vector library; the static knowledge vector library includes a key projection matrix and a value projection matrix composed of dense vectors of each text fragment;

[0017] A12: Collect real-time status data of scenic area points of interest. The data type is snapshot data of key-value pairs associated with timestamps. The key-value pairs use the point of interest identifier as the key and the real-time status value of the corresponding point of interest as the value. The real-time status value includes: the number of remaining parking spaces in each parking lot, the number of people queuing in each venue, and the number of people in each indoor venue. The value in the key-value pair is the numerical data of the corresponding key.

[0018] For the values ​​in the key-value pairs, outliers are detected using the interquartile range method, and the detected outliers are filled with the nearest valid value to obtain the cleaned real-time status values; then, using the point of interest identifier as the key and the cleaned real-time status values ​​as the values, a real-time status dictionary of the point of interest is obtained.

[0019] A13: The user terminal's fusion positioning module collects fusion positioning data, which is a multi-source spatial coordinate sequence data associated with timestamps, including GPS data and WiFi fingerprint data. For the user terminal's fusion positioning data, the WiFi fingerprint data is mapped to coordinates through a fingerprint matching algorithm, and then fused and smoothed with GPS data through Kalman filtering. Finally, a mean filtering method based on a sliding window is used for smoothing and noise reduction to obtain the user's location coordinate sequence.

[0020] A14: Collect user dialogue interaction logs. The data type is structured record data, including session identifier, dialogue round, user input text for each round, system response text for each round, and timestamp for each round.

[0021] The user input text of the current round in the user dialogue interaction log is semantically encoded using a text embedding method based on a pre-trained language model to obtain a query semantic encoding vector.

[0022] The similarity between the query semantic encoding vector and the key projection matrix of the static knowledge vector library is calculated, and the interest point identifier corresponding to the text segment with the highest similarity is determined as the target interest point identifier.

[0023] Based on the session identifier and session number in the user dialogue interaction log, the user input text and system response text of the historical sessions in the session are sorted in ascending order by session timestamp to obtain the dialogue history sequence.

[0024] Furthermore, step A2 also includes:

[0025] A21: Based on the target interest point identifier and the query semantic encoding vector, target-oriented semantic retrieval and filtering are performed on the static knowledge vector database to obtain a set of candidate knowledge fragment vectors. The calculation method is as follows:

[0026]

[0027]

[0028]

[0029]

[0030] in, To merge query vectors, For layer normalization operation, It is a multilayer perceptron. This is a vector concatenation operation. For embedding layer operations, Identify the target point of interest. For query semantic encoding vector, To integrate the query weight matrix, This is a similarity score vector. For the Softmax function, This is the key projection matrix of the static knowledge vector base. This is a transpose operation; The target interest point mask vector has a length equal to the number of text segments. In the target interest point mask vector, the segment position to which the target interest point belongs is set to 0, and the other positions are set to −∞. This is the set of indices corresponding to the maximum similarity score. This is an index filtering operation to retrieve the top K largest weight values. For the set of candidate knowledge fragment vectors, This is the operation of extracting the corresponding row from the value matrix based on the index. The projection matrix of the values ​​in the static knowledge vector base;

[0031] A22: Based on the candidate knowledge fragment vector set and the real-time state dictionary of interest points, cross-modal gating fusion encoding is performed to obtain a semantically anchored fact representation. The calculation method is as follows:

[0032]

[0033]

[0034]

[0035] in, For dynamic numerical semantic state, For flattening operation, For linear layers, The real-time status value is extracted from the real-time status dictionary of points of interest based on the target point of interest identifier. For modal gating weights, It is the Sigmoid activation function. For average pooling operation, To semantically anchor fact representation, For Hadama accumulation, This is a vector copying and tiling operation.

[0036] It should be further explained that the questions raised by tourists rely on real-time information—the number of parking spaces remaining, the number of people queuing at venues, and the number of people in indoor venues are subject to dynamic changes, while the explanations, facility descriptions, and answers to frequently asked questions in the static knowledge base only describe routine content. There is a timeliness gap between the two types of information. Tourists' open-domain questions are vaguely worded and do not clearly target attractions. The same question may refer to completely different things in different tour contexts. Traditional search methods are unable to converge vague inquiries to specific attractions or facilities, resulting in inaccurate information and causing inquiries to be handled by human customer service.

[0037] This invention starts with point of interest (POI) anchoring—the target POI identifier is processed by an embedding layer to obtain a semantic representation, which is then concatenated with the query semantic encoding vector and projected by a multilayer perceptron. After layer normalization, it is integrated into a fusion query vector, allowing the same open-ended question to obtain a stable interpretation direction under the guidance of the specific scenic spot's semantics. When tourists ask vague questions like "Can we still go in over there?", the retrieval will not deviate from the true intent due to literal ambiguity. The fusion query vector is multiplied by the transpose of the key projection matrix of the static knowledge vector base to obtain an initial similarity distribution. At this time, the target POI mask vector is superimposed—the mask vector takes a zero value at the segment position of the target POI and a negative infinity value at other positions. After normalization by the Softmax function, the similarity weight of non-target positions is suppressed to near zero. The system filters out irrelevant explanatory texts, facility descriptions, and frequently asked questions across attractions. Even if the tourist's question does not contain the attraction's name, the search scope can still be constrained to the correct topic based on the identifier. Then, the top few indices are truncated according to the similarity score from high to low. Based on this, the corresponding rows are extracted from the value projection matrix to obtain a set of candidate knowledge fragment vectors. This set has a limited length and a highly focused topic. The subsequent fusion process only needs to perform calculations on a small number of candidate fragments. At the same time, it avoids irrelevant fragments from diluting the features of the target entity at the semantic representation level, and reserves a clear anchoring space for the real-time state value. This ensures that the text basis of the final answer remains single and pure at the attraction dimension, and the same sentence-style questions asked by tourists for different attractions will not be retrieved by the same set of knowledge fragments.

[0038] After determining the candidate knowledge fragment vector set, the problem of how to bind static textual knowledge with real-time numerical states needs to be solved. Based on the target point of interest identifier, the latest state value is retrieved from the real-time state dictionary, and a dynamic numerical semantic state is obtained through linear transformation and semantic mapping. The remaining parking spaces in the parking lot are transformed from an integer scalar into a semantic representation with the same dimension as the text vector; the real-time value no longer exists in isolation but possesses a semantic identity to participate in vector operations. Subsequently, average pooling is performed on the candidate knowledge fragment vector set to obtain a textual semantic summary. The summary and the dynamic numerical semantic state are concatenated and processed through a linear layer before being fed into a Sigmoid activation function to generate modal gating weights. These weights are determined by the combined effect of the candidate textual semantics and the real-time state. When tourists inquire about queue length, the weights tilt towards the numerical side; when they inquire about the historical background of the attraction, the weights automatically regress towards the textual side. The fusion ratio does not require manual pre-calculation. In the fusion phase, candidate knowledge fragments are mapped by a multilayer perceptron and multiplied element-wise by gating weights. Dynamic numerical semantic states are copied by tiling and multiplied element-wise by complementary gating weights. The two branches are added element-wise and normalized to obtain a semantically anchored fact representation. Real-time values ​​are integrated into the text semantics in a continuous proportion rather than being awkwardly spliced ​​to the end of the sentence. The generated response can smoothly describe the overview of the attraction and naturally bring out the number of people in the queue or the number of parking spaces remaining in the same sentence. Tourists can obtain complete judgment basis from a single response and no longer need to compare between multiple information sources. When there are no parking spaces available, the original text vector in the fusion representation is compressed by gating weights to reduce the tone of the tour. Numerical semantics take the lead. The system's sensitivity to the state of no parking spaces is preserved at the expression level. When generating a response, the full state is not glossed over.

[0039] In existing technologies, scenic area inquiry systems typically rely on two processing methods: one is based solely on keyword matching or vector similarity retrieval using a static knowledge base. The search results are entirely derived from pre-stored explanatory texts and frequently asked questions, lacking any awareness of real-time values ​​that change every minute. When tourists inquire about their current wait time, they only receive a generalized response based on historical averages, and this error is further amplified during peak hours when queues increase rapidly. The other method attempts to incorporate real-time values ​​as supplementary text into the search results. However, numerical and textual knowledge have semantic differences in vector space, and simple concatenation can easily dilute numerical information within long paragraphs. The system lacks a mechanism to determine the appropriate weight of the numerical value in answer generation, and sometimes the numerical value is misaligned with the target point of interest. In this invention, during the retrieval phase, queries are anchored to specific entities using target interest point masks, limiting the semantic range to which real-time values ​​can be attached. During the fusion phase, modal gating weights adaptively adjust the ratio based on the semantic relevance between candidate text and dynamic values, allowing static knowledge and real-time states to complement each other while retaining their respective expressive power. The introduction of real-time values ​​does not disrupt the semantic integrity of the text. Compared to forcibly attaching real-time states to text vectors, this invention provides answers that are more closely aligned with the current situation in the high-frequency, changing scenario of scenic area inquiries. This reduces the probability of tourists repeatedly asking follow-up questions due to outdated or misaligned information, effectively controlling the number of inquiries requiring human intervention. Customer service resources can then be allocated more to complex requests that genuinely require human intervention.

[0040] Furthermore, step A3 also includes:

[0041] A31: Based on the user's location coordinate sequence and semantically anchored fact representation, the spatial-semantic association strength between trajectory points and knowledge fragments is calculated to obtain the spatial trajectory perception latent state. The calculation method is as follows:

[0042]

[0043]

[0044]

[0045] in, The hidden state is encoded for the trajectory. It is a bidirectional long short-term memory network. For the user's location coordinate sequence, This is the spatial semantic association attention weight matrix. To perceive the hidden state of spatial trajectory;

[0046] A32: Based on the dialogue history sequence and spatial trajectory perception of the latent state, the dialogue context temporal encoding and gating fusion are performed to obtain the spatiotemporal fused latent state. The calculation method is as follows:

[0047]

[0048]

[0049]

[0050] in, Encode the hidden state for the dialogue. As a historical sequence of dialogues, For spatiotemporal fusion gating weights, This is a hidden state of spatiotemporal fusion;

[0051] A33: Based on the spatiotemporal fusion latent state and semantically anchored fact representation, temporal self-reinforcement and residual memory distillation are performed to obtain the contextual spatiotemporal latent variables. The calculation method is as follows:

[0052]

[0053]

[0054] in, To enhance the hidden state in the time series, For multi-head attention operation, These are context-space-time latent variables.

[0055] It should be further explained that in the multi-round inquiry scenario in the park, the visitor's location is constantly moving, and the coordinates are continuously updated in a trajectory sequence. The correct answer to the same question is completely different in different locations in the park—asking about opening hours at the exhibition hall entrance and asking about opening hours in the catering area require answers with different spatial orientations. At the same time, the visitor's dialogue is multi-round and progressive. Information that has been answered in the previous round should not be repeated in the next round. The information that has not been covered is the key point that needs to be supplemented. Ignoring the progress of the dialogue will cause repetition or contradictions.

[0056] In the spatial semantic association calculation stage, the input consists of a sequence of tourist location coordinates and a semantically anchored fact representation. First, a bidirectional long short-term memory network extracts the tourist's movement trend from continuous coordinate changes. Then, the trajectory features and knowledge fragment representations are used to calculate spatial semantic association weights, resulting in a spatial trajectory perception latent state. This allows for a dynamic correspondence between the response content and the tourist's current location. When a tourist gradually moves towards a certain exhibition hall along the main road, the association weight of the relevant knowledge fragments for that hall increases, and the response prioritizes information about the hall's opening hours and exhibits. When the trajectory features indicate that the tourist has already passed the exhibition hall and continues forward, the association weight automatically decreases, and the response no longer focuses on the missed hall but instead provides guidance on facilities ahead. The bidirectional long short-term memory network simultaneously references information from both directions of the location sequence, helping to distinguish whether the tourist is approaching or has already left. When approaching, the response emphasizes guiding the arrival route; when leaving, the response emphasizes providing alternative options for the next stop, avoiding the spatial misalignment problem of tourists being recommended attractions behind them even after they have passed by.

[0057] In the dialogue context-based temporal encoding and gating fusion stage, the input consists of a dialogue history sequence and a spatial trajectory perception latent state. The dialogue history is encoded into a dialogue representation, and a gating weight is calculated to adjust the relative proportion of spatial information and dialogue information, ultimately yielding a spatiotemporally fused latent state. This allows the system to dynamically adjust the focus of responses based on the visitor's actual situation. When the visitor is in an unfamiliar area and has not yet revealed a clear preference in the dialogue, spatial information occupies a larger weight, and the response focuses on introducing the facilities around the current location. When the visitor continuously inquires about a particular exhibit in multiple rounds of dialogue, the weight of dialogue information gradually increases, and the response shifts to supplementing the exhibits already mentioned in previous rounds, without repeating content already answered. Simultaneously, gating fusion also aligns the two information streams—when changes in the visitor's location cause updates to the spatial trajectory perception latent state, the gating weight adjusts the level of intervention of dialogue information in real time, ensuring that subsequent responses in the same dialogue remain synchronized with the visitor's spatial movement.

[0058] In the temporal self-reinforcement and residual memory distillation stages, the input consists of spatiotemporal fusion latent states and semantically anchored fact representations. Multi-head attention operations are used to perform temporal self-reinforcement on the spatiotemporal fusion latent states, establishing interdependencies between spatial cues from different rounds within the same dialogue. Residual connections are then superimposed, and the mean of the semantically anchored fact representations is distilled in to obtain contextual spatiotemporal latent variables. The effect of multi-head attention is that location information from earlier dialogue rounds can continuously influence subsequent responses—for example, when a visitor asks about the location of a certain exhibition hall in the first round and then inquires about its opening hours in the second round, the temporal reinforcement mechanism makes the second round… The system can directly inherit the location information obtained in the first round, providing a coherent answer pointing to the distance from the current location to the exhibition hall, rather than treating the two rounds of questions separately. The residual connection ensures that the initial trajectory features are not diluted in subsequent layered calculations. When tourists mention the same target again after traveling a certain distance, the system can still trace back to earlier trajectory clues, and the spatiotemporal coherence of the answer is relatively stable. The mean of the semantic anchoring fact representation is distilled into the final hidden state, so that dynamic trajectory information and static knowledge are always in the same semantic space. The generated answer is constrained by spatial location, but does not deviate from the objective facts of the park.

[0059] In existing technologies, question-answering methods relying on static knowledge bases often only retrieve facts from the knowledge graph without considering the visitor's location coordinates. For questions like "What's here?", they can only output all locations with the same name within the park for the visitor to compare, lacking specificity when the visitor is moving. While generation methods based on dialogue history can remember previous context, they lack spatial constraints and cannot anchor the answer to the actual scenery at the visitor's current location, resulting in almost no difference in the content of the same topic's answers at different locations. This invention superimposes the location trajectory and dialogue history temporal signals onto the semantically anchored fact representation, establishes a dynamic location correspondence through spatial semantic association calculation, and then forms a contextual spatiotemporal latent variable that simultaneously contains spatial dynamics and dialogue progress through gated fusion and residual memory distillation. This compensates for the lack of spatial perception capability in existing methods—the answer can be adjusted synchronously with the visitor's movement and the progress of the dialogue, and has a more complete spatiotemporal adaptation capability than static retrieval or pure dialogue generation methods in both the dimensions of location perception and dialogue coherence.

[0060] Furthermore, step A4 also includes:

[0061] A41: Based on semantically anchored fact representations and contextual spatiotemporal latent variables, feature projection and cross-modal interaction encoding are performed to obtain the collaborative perceptual interaction latent state. The calculation method is as follows:

[0062]

[0063]

[0064]

[0065]

[0066] in, To anchor the query vector semantically. For the spatiotemporal context key vector, For the spatiotemporal context value vector, To collaboratively perceive the hidden state of interaction;

[0067] A42: Based on the collaborative perception interaction latent state and contextual spatiotemporal latent variables, perform dual-path deep gating fusion to obtain the gating fusion intermediate representation. The calculation method is as follows:

[0068]

[0069]

[0070] in, To complement the gating weights, This serves as an intermediate representation for gating fusion.

[0071] A43: Based on the gated fusion intermediate representation and the semantically anchored fact representation, residual and multi-level semantic enhancement are performed to obtain the joint semantic representation. The calculation method is as follows:

[0072]

[0073]

[0074] in, This is the hidden state for semantic distillation. This is a joint semantic representation.

[0075] It should be further explained that in the dialogue scenario of a scenic spot tour, the tourist's location trajectory is constantly changing, while the real-time scenic spot status anchored by facts—such as temporary maintenance and session adjustments—has strong timeliness. When the two types of information exist independently in the representation space, there is a lack of fine-grained mutual correction between the most relevant knowledge facts and the most relevant trajectory segments. In a long interaction sequence, the attention mechanism tends to distribute the weight to multiple candidate information, causing the key real-time status and the topic related to the current location to dilute each other. As multiple rounds of question and answer continue, the time difference between location, topic, and knowledge status accumulates round by round, eventually manifesting as irrelevant answers, omission of key status, or contextual breaks.

[0076] Semantic anchoring facts represent key knowledge such as the real-time status of attractions, while contextual spatiotemporal latent variables encode the location trajectory and dialogue history of tourists. During the frequent movement of tourists, this invention projects semantic anchoring facts into query vectors and spatiotemporal latent variables into key-value vectors, completing cross-modal interaction encoding through multi-head attention. The resulting collaborative perception interaction latent state allows each knowledge fact to reposition its relevance in the context space: when a tourist moves to the vicinity of an attraction, status information such as whether the attraction is under temporary maintenance or whether the session has been adjusted is given a higher relevance weight, while knowledge items unrelated to the current location are correspondingly weakened. Topics mentioned earlier in the dialogue can also be reactivated or corrected by the latest location information. Subsequent fusion no longer faces two sets of mutually isolated features, but rather information carriers that have already undergone a round of cross-modal alignment—the information misalignment caused by location migration in multi-round dialogues is alleviated in the first layer here.

[0077] The collaborative perception interaction latent state and contextual spatiotemporal latent variables are then subjected to dual-path deep gating fusion. Given the constantly changing focus of tourists' questions, this invention extracts global features from both representations and concatenates them, then processes them using a Sigmoid function to generate complementary gating weights, controlling the proportion of information from each path in the fused output element by element. When a tourist's question focuses on the immediate situation, the dynamic information of the spatiotemporal context dominates the output; when the question leans towards the historical or cultural background of the attraction, the anchored knowledge content is preserved. The gating fusion intermediate representation retains its respective semantic focus while avoiding the suppression of one path's features by the other. Compared to fixed-weight concatenation, this invention adaptively differentiates the effectiveness of information from both paths under different question-and-answer states, and also reduces mutual dilution caused by differences in feature distribution.

[0078] As the multi-round dialogue progresses, the gated fusion intermediate representation already contains context-selected information, but the fusion process itself compresses some of the original semantics. This invention introduces the mean information of semantically anchored fact representation as a reference, and forms a semantically distilled hidden state through splicing projection and residual connection. Then, it undergoes a multi-head attention self-enhancement to obtain a joint semantic representation. The joint semantic representation organizes the three clues of knowledge, location, and dialogue into the same representation base. The location trajectory update, dialogue topic shift, and knowledge point state change remain connected in the final representation. When information is retrieved in the generation stage, it faces already consistent content, without having to rely on a certain feature occupying a longer space in the sequence to maintain contextual consistency. The loss of information when it is passed layer by layer in multi-round question answering is compensated at each level, and the semantic association across rounds is therefore more stable.

[0079] In existing technologies, the processing of scenic area question-and-answer tasks typically involves concatenating knowledge text with the dialogue history sequence and then letting the generative model distinguish the information source itself, or simply adding the location trajectory with attention weights to the text representation. These approaches preserve the original distribution differences of each modality on the input side—the generative model needs to simultaneously complete multiple tasks such as information deduplication, timeliness judgment, and location alignment during decoding. When tourists walk and ask questions, and switch topics rapidly in multiple rounds, the attention weights are prone to shift, resulting in outdated knowledge being accepted or key states corresponding to the current location being ignored. This invention completes multi-level processing of cross-modal interactive encoding, dual-channel gating fusion, and residual enhancement before entering the generation stage, moving the correlation verification between modalities to the representation construction stage. This mechanism avoids the separation of knowledge from context—the generation stage no longer deals with independent information fragments, but with a joint semantic representation that has been corrected for spatiotemporal context and semantically enhanced. This allows the response content to remain relatively consistent with the tourist's scene, reducing the reliance on the generative model to automatically align cross-modal information.

[0080] Furthermore, step A5 also includes:

[0081] A51: Based on the joint semantic representation and dialogue history sequence, a generative space is constructed and autoregressive decoding is performed to obtain the hidden states of candidate responses. The calculation method is as follows:

[0082]

[0083]

[0084] in, This is the initial input conditional context vector for the decoder. This represents the hidden state of candidate responses. for Decoder operation;

[0085] A52: Based on the candidate response hidden state sequence and semantically anchored fact representation, perform knowledge consistency verification and credibility scoring to obtain the verified response hidden state. The calculation method is as follows:

[0086]

[0087]

[0088]

[0089] in, Align the hidden state with the fact perception. For cross-attention operations, For consistency gating coefficient, The response is in a hidden state after verification;

[0090] A53: Based on the verified response hidden state, probability mapping and decoding are performed to obtain the final response output. The calculation method is as follows:

[0091]

[0092]

[0093] in, This represents the final vocabulary probability distribution. For the final vocabulary projection weights, This is the projection bias vector after verification. For the final response output, This is an operation to retrieve the index of the word with the highest probability.

[0094] This invention also discloses a cultural tourism dialogue intelligent response system based on retrieval enhancement generation, comprising:

[0095] Dialogue data preprocessing module: Collects static knowledge base text corpus of scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and performs preprocessing on each to obtain static knowledge vector library, real-time status dictionary of points of interest, user location coordinate sequence, query semantic encoding vector, target point of interest identifier, and dialogue history sequence;

[0096] The retrieval enhancement module calculates the candidate knowledge fragment vector set and semantic anchoring fact representation sequentially based on the target interest point identifier, query semantic encoding vector, static knowledge vector library, and interest point real-time status dictionary.

[0097] Context feature fusion module: Calculates spatial trajectory perception latent state, spatiotemporal fusion latent state, and context spatiotemporal latent variables based on user location coordinate sequence, semantic anchored fact representation, and dialogue history sequence;

[0098] Joint semantic feature extraction module: Based on semantic anchored fact representation and contextual spatiotemporal latent variables, it sequentially calculates collaborative perception interaction latent state, gated fusion intermediate representation, and joint semantic representation;

[0099] Output module: Based on the joint semantic representation, dialogue history sequence, and semantic anchoring fact representation, calculate the candidate response hidden state, the verified response hidden state, and the final response output.

[0100] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0101] (1) This invention incorporates the real-time location of tourists, the status of points of interest, and the dialogue history into the semantic computing pathway. First, it constructs a semantic anchoring fact representation based on the real-time status, so that the generated response can directly refer to dynamic data such as the number of parking spaces remaining and the queuing time of the venue, rather than returning a preset answer that is detached from the information on the scene. Then, it tracks the location movement and intention drift of tourists in multi-round dialogues through spatial trajectory perception latent state and contextual spatiotemporal latent variables. When tourists switch from the parking scene to the venue inquiry, they can also correctly refer to the current target, avoiding irrelevant answers due to spatial logic breaks. The collaborative perception interaction latent state and gating fusion mechanism then integrate static knowledge, real-time facts, and dialogue context into a joint semantic representation. The final discourse is output by the verified response latent state, so that the answer is both fluent and natural and does not deviate from the retrieved factual basis. This enables the system to handle open domain real-time inquiries that could not be handled before, reduces the rate of manual intervention, and improves the real-time service experience of tourists in the scenic area.

[0102] (2) To address the issue of timeliness gaps caused by tourists' questions relying on real-time information while static knowledge bases only describe routine content, this invention starts with interest point anchoring. By fusing query vectors and interest point masks, it stably constrains ambiguous expressions to the correct topic, preventing them from deviating from the true intent due to literal ambiguity. The same sentence structure query will not retrieve the same set of knowledge fragments for different attractions. At the same time, the real-time state value is mapped to a semantic representation of the same dimension as the text. The fusion ratio of text and numerical values ​​is adaptively adjusted by modal gating weights, so that the real-time values ​​are integrated into the semantics of the text in a continuous proportion. Thus, a single answer can naturally bring out the number of people in the queue or the remaining parking spaces without having to compare multiple information sources. When there are no empty spaces in the parking lot, numerical semantics take the lead, and the system will not gloss over the full status.

[0103] (3) In response to the continuous movement of tourists' locations and different answers to the same question in different locations in the multi-round inquiry scenario in the park, this invention extracts the movement trend from the location coordinate sequence and performs spatial semantic association with knowledge fragments through a bidirectional long short-term memory network, so that the answer content corresponds dynamically with the tourist's location. When tourists approach the exhibition hall, the information of the hall is displayed first, and after leaving, the system turns to the facilities in front of them for guidance, avoiding spatial misalignment where tourists are still recommended to attractions behind them even after they have gone too far. Combined with dialogue history gating fusion, the system can dynamically adjust the focus according to the actual situation. In unfamiliar areas, the system focuses on the surrounding facilities, and when asking follow-up questions, it turns to supplementary explanations without repeating the answers already given. Furthermore, through temporal self-reinforcement and residual memory distillation, the location information of earlier rounds continues to influence subsequent answers. Even after tourists go around, they can still trace earlier trajectory clues, and the spatiotemporal continuity of the answers is stable. The dynamic trajectory and static knowledge are always in the same semantic space.

[0104] (4) In response to the problem that attention in scenic area dialogues can easily dilute key states and current topics, and that time differences accumulate in rounds leading to irrelevant answers, this invention encodes semantically anchored factual representations and contextual spatiotemporal latent variables through cross-modal interaction. This allows each knowledge fact to reposition its relevance in the contextual space. States such as whether a scenic spot is under temporary maintenance or whether a session has been adjusted are given higher weights, while irrelevant knowledge is correspondingly weakened. Earlier topics can also be reactivated or corrected by the latest location information. Then, through dual-path deep gating fusion, the effectiveness of the two paths of information under different question-and-answer states is adaptively distinguished, reducing mutual dilution. Furthermore, through semantic distillation and self-reinforcement, the three clues of knowledge, location, and dialogue are organized into the same representation base, so that the loss of information in the multi-round question-and-answer process is compensated at each level, and the cross-round semantic association is more stable. Attached Figure Description

[0105] Figure 1 A flowchart illustrating a method for intelligent response to cultural tourism dialogues based on retrieval enhancement provided by the present invention;

[0106] Figure 2 The training and validation loss curve variation diagram provided by this invention;

[0107] Figure 3 This invention provides a background monitoring interface diagram for a cultural tourism dialogue intelligent response system based on retrieval enhancement generation. Detailed Implementation

[0108] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.

[0109] Example 1: A method for intelligent response to cultural tourism dialogues based on retrieval enhancement, such as... Figure 1 As shown, it includes the following steps:

[0110] A1: Collect static knowledge base text corpus of the scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and preprocess them respectively to obtain a static knowledge vector library, a real-time status dictionary of points of interest, a user location coordinate sequence, a query semantic encoding vector, a target point of interest identifier, and a dialogue history sequence, including:

[0111] A11: Collect static knowledge base text data of scenic spots. The data type is unstructured text data, including scenic spot explanation text, service facility description text, and frequently asked questions text.

[0112] For the static knowledge base text corpus of the scenic area, text segmentation based on syntax rules is used to divide each text into text segments; then, a text embedding method based on a pre-trained language model is used to map each text segment into a dense vector of fixed dimension, and the dense vector is used as the key vector and value vector of the corresponding text segment.

[0113] All text fragments are traversed and processed to obtain a static knowledge vector library; the static knowledge vector library includes a key projection matrix and a value projection matrix composed of dense vectors of each text fragment;

[0114] A12: Collect real-time status data of scenic area points of interest. The data type is snapshot data of key-value pairs associated with timestamps. The key-value pairs use the point of interest identifier as the key and the real-time status value of the corresponding point of interest as the value. The real-time status value includes: the number of remaining parking spaces in each parking lot, the number of people queuing in each venue, and the number of people in each indoor venue. The value in the key-value pair is the numerical data of the corresponding key.

[0115] For the values ​​in the key-value pairs, outliers are detected using the interquartile range method, and the detected outliers are filled with the nearest valid value to obtain the cleaned real-time status values; then, using the point of interest identifier as the key and the cleaned real-time status values ​​as the values, a real-time status dictionary of the point of interest is obtained.

[0116] A13: The user terminal's fusion positioning module collects fusion positioning data, which is a multi-source spatial coordinate sequence data associated with timestamps, including GPS data and WiFi fingerprint data. For the user terminal's fusion positioning data, the WiFi fingerprint data is mapped to coordinates through a fingerprint matching algorithm, and then fused and smoothed with GPS data through Kalman filtering. Finally, a mean filtering method based on a sliding window is used for smoothing and noise reduction to obtain the user's location coordinate sequence.

[0117] A14: Collect user dialogue interaction logs. The data type is structured record data, including session identifier, dialogue round, user input text for each round, system response text for each round, and timestamp for each round.

[0118] The user input text of the current round in the user dialogue interaction log is semantically encoded using a text embedding method based on a pre-trained language model to obtain a query semantic encoding vector.

[0119] The similarity between the query semantic encoding vector and the key projection matrix of the static knowledge vector library is calculated, and the interest point identifier corresponding to the text segment with the highest similarity is determined as the target interest point identifier.

[0120] Based on the session identifier and session number in the user dialogue interaction log, the user input text and system response text of the historical sessions in the session are sorted in ascending order by session timestamp to obtain the dialogue history sequence.

[0121] A2: Based on the target interest point identifier, query semantic encoding vector, static knowledge vector library, and real-time interest point status dictionary, the candidate knowledge fragment vector set and semantic anchoring fact representation are obtained sequentially, including:

[0122] A21: Based on the target interest point identifier and the query semantic encoding vector, target-oriented semantic retrieval and filtering are performed on the static knowledge vector database to obtain a set of candidate knowledge fragment vectors. The calculation method is as follows:

[0123]

[0124]

[0125]

[0126]

[0127] in, To merge query vectors, For layer normalization operation, It is a multilayer perceptron. This is a vector concatenation operation. For embedding layer operations, Identify the target point of interest. For query semantic encoding vector, To integrate the query weight matrix, This is a similarity score vector. For the Softmax function, This is the key projection matrix of the static knowledge vector base. This is a transpose operation; The target interest point mask vector has a length equal to the number of text segments. In the target interest point mask vector, the segment position to which the target interest point belongs is set to 0, and the other positions are set to −∞. This is the set of indices corresponding to the maximum similarity score. This is an index filtering operation to retrieve the top K largest weight values. For the set of candidate knowledge fragment vectors, This is the operation of extracting the corresponding row from the value matrix based on the index. The projection matrix of the values ​​in the static knowledge vector base;

[0128] A22: Based on the candidate knowledge fragment vector set and the real-time state dictionary of interest points, cross-modal gating fusion encoding is performed to obtain a semantically anchored fact representation. The calculation method is as follows:

[0129]

[0130]

[0131]

[0132] in, For dynamic numerical semantic state, For flattening operation, For linear layers, The real-time status value is extracted from the real-time status dictionary of points of interest based on the target point of interest identifier. For modal gating weights, It is the Sigmoid activation function. For average pooling operation, To semantically anchor fact representation, For Hadama accumulation, This is a vector copying and tiling operation.

[0133] A3: Based on the user's location coordinate sequence, semantically anchored fact representation, and dialogue history sequence, calculate the spatial trajectory-aware latent state, spatiotemporal fusion latent state, and contextual spatiotemporal latent variables, including:

[0134] A31: Based on the user's location coordinate sequence and semantically anchored fact representation, the spatial-semantic association strength between trajectory points and knowledge fragments is calculated to obtain the spatial trajectory perception latent state. The calculation method is as follows:

[0135]

[0136]

[0137]

[0138] in, The hidden state is encoded for the trajectory. It is a bidirectional long short-term memory network. For the user's location coordinate sequence, This is the spatial semantic association attention weight matrix. To perceive the hidden state of spatial trajectory;

[0139] A32: Based on the dialogue history sequence and spatial trajectory perception of the latent state, the dialogue context temporal encoding and gating fusion are performed to obtain the spatiotemporal fused latent state. The calculation method is as follows:

[0140]

[0141]

[0142]

[0143] in, Encode the hidden state for the dialogue. As a historical sequence of dialogues, For spatiotemporal fusion gating weights, This is a hidden state of spatiotemporal fusion;

[0144] A33: Based on the spatiotemporal fusion latent state and semantically anchored fact representation, temporal self-reinforcement and residual memory distillation are performed to obtain the contextual spatiotemporal latent variables. The calculation method is as follows:

[0145]

[0146]

[0147] in, To enhance the hidden state in the time series, For multi-head attention operation, These are context-space-time latent variables.

[0148] Specifically, for scenarios involving the calculation of spatial-semantic association strength between trajectory points and knowledge fragments, this invention also provides a simplified calculation method to replace step A31. The calculation method is as follows:

[0149]

[0150]

[0151]

[0152]

[0153] in, To simplify trajectory projection, For semantic anchor mean vector, For associated gating weights.

[0154] A4: Based on the semantically anchored fact representation and the contextual spatiotemporal latent variables, the collaborative perception interaction latent state, the gated fusion intermediate representation, and the joint semantic representation are calculated sequentially, including:

[0155] A41: Based on semantically anchored fact representations and contextual spatiotemporal latent variables, feature projection and cross-modal interaction encoding are performed to obtain the collaborative perceptual interaction latent state. The calculation method is as follows:

[0156]

[0157]

[0158]

[0159]

[0160] in, To anchor the query vector semantically. For the spatiotemporal context key vector, For the spatiotemporal context value vector, To collaboratively perceive the hidden state of interaction;

[0161] A42: Based on the collaborative perception interaction latent state and contextual spatiotemporal latent variables, perform dual-path deep gating fusion to obtain the gating fusion intermediate representation. The calculation method is as follows:

[0162]

[0163]

[0164] in, To complement the gating weights, This serves as an intermediate representation for gating fusion.

[0165] A43: Based on the gated fusion intermediate representation and the semantically anchored fact representation, residual and multi-level semantic enhancement are performed to obtain the joint semantic representation. The calculation method is as follows:

[0166]

[0167]

[0168] in, This is the hidden state for semantic distillation. This is a joint semantic representation.

[0169] A5: Based on the joint semantic representation, dialogue history sequence, and semantically anchored fact representation, the candidate response hidden state, the verified response hidden state, and the final response output are calculated, including:

[0170] A51: Based on the joint semantic representation and dialogue history sequence, a generative space is constructed and autoregressive decoding is performed to obtain the hidden states of candidate responses. The calculation method is as follows:

[0171]

[0172]

[0173] in, This is the initial input conditional context vector for the decoder. This represents the hidden state of candidate responses. for Decoder operation;

[0174] A52: Based on the candidate response hidden state sequence and semantically anchored fact representation, perform knowledge consistency verification and credibility scoring to obtain the verified response hidden state. The calculation method is as follows:

[0175]

[0176]

[0177]

[0178] in, Align the hidden state with the fact perception. For cross-attention operations, For consistency gating coefficient, The response is in a hidden state after verification;

[0179] A53: Based on the verified response hidden state, probability mapping and decoding are performed to obtain the final response output. The calculation method is as follows:

[0180]

[0181]

[0182] in, This represents the final vocabulary probability distribution. For the final vocabulary projection weights, This is the projection bias vector after verification. For the final response output, This is an operation to retrieve the index of the word with the highest probability.

[0183] In this embodiment, the neural network adopts an end-to-end joint training overall structure, which includes the following processing stages in the order of data flow;

[0184] First, the target interest point identifier and the query semantic encoding vector are input into the target-oriented semantic retrieval and filtering module. This module consists of two fully connected layers, with the hidden layer containing 128 units. It uses a linear rectified activation function and filters out the set of candidate knowledge fragment vectors with the highest similarity by calculating the cosine similarity with each vector in the static knowledge vector base. This set is then combined with the real-time state dictionary of interest points and enters the cross-modal gated fusion encoding module. This module contains an S-shaped growth curve function gating unit with a state size of 256, and outputs a semantic anchoring fact representation. Based on this... The user's location coordinate sequence and semantic anchoring fact representation are input into the spatial-semantic association strength calculation module. This module employs a 4-head attention mechanism, with each attention head having an internal mapping size of 64, to calculate the association strength between trajectory points and knowledge fragments, obtaining the spatial trajectory perception latent state. Simultaneously, the dialogue history sequence and this latent state are input into the dialogue context temporal encoding and gating fusion module. This module uses a two-layer bidirectional long short-term memory network with 256 units in the hidden layer, and, in conjunction with gating fusion operations, outputs a spatiotemporal fusion latent state. Subsequently, this latent state is combined with the semantic anchoring facts... The input is fed to the temporal self-reinforcement and residual memory distillation module, which contains a self-attention sublayer and a feedforward sublayer, both with an output size of 128, ultimately yielding the contextual spatiotemporal latent variables. Next, the semantic anchoring fact representation and the contextual spatiotemporal latent variables are input to the feature projection and cross-modal interaction encoding module. The feature projection uses a linear projection layer to adjust the representation size to 256, and the cross-modal interaction uses an 8-head attention mechanism, with each attention head having an internal mapping size of 64, outputting the collaborative perceptual interaction latent state. This latent state and the contextual spatiotemporal latent variables are then input to the dual-path depth... The gated fusion module contains two parallel gated branches, each with a fully connected layer and an output size of 128. It uses an S-shaped growth curve function to generate the gated signal, resulting in a gated fusion intermediate representation. This intermediate representation, along with the semantic anchoring fact representation, is residually concatenated in the residual and multi-level semantic enhancement module and then fed into a multilayer perceptron with two hidden layers, each containing 256 units, to obtain a joint semantic representation. The joint semantic representation, the dialogue history sequence, and the semantic anchoring fact representation are then combined to generate candidate response hidden states, which are verified to obtain the final response output.

[0185] In terms of training, this invention adopts an end-to-end joint optimization approach. The training data is constructed from the static knowledge base text corpus of the scenic area, the real-time status data of the scenic area's points of interest, the user terminal fusion positioning data, and the user dialogue interaction logs. Each training sample includes the target point of interest identifier, the query semantic encoding vector, the user location coordinate sequence, the dialogue history sequence, and the corresponding real response text. During the forward propagation process, the above multi-source inputs sequentially pass through all modules such as semantic retrieval, gated fusion encoding, spatial association, temporal encoding, interaction encoding, and response generation, generating the final response output in one go.

[0186] The total loss function consists of a weighted sum of three parts: the cross-entropy loss between the final response output and the true response text accounts for 0.5 of the total loss; the mean squared error loss between the validated response hidden state and the candidate response hidden state accounts for 0.3; and the contrast loss between the semantically anchored fact representation and the contextual spatiotemporal latent variables accounts for 0.2. Training optimization uses an adaptive moment estimation optimizer, with an initial learning rate of 0.0005, a batch size of 32, and 200 training epochs. The learning rate gradually decays using a cosine annealing strategy. The training process is as follows: Figure 2 As shown.

[0187] Example 2: This invention also discloses a cultural tourism dialogue intelligent response system based on retrieval enhancement generation, comprising:

[0188] Dialogue data preprocessing module: Collects static knowledge base text corpus of scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and performs preprocessing on each to obtain static knowledge vector library, real-time status dictionary of points of interest, user location coordinate sequence, query semantic encoding vector, target point of interest identifier, and dialogue history sequence;

[0189] The retrieval enhancement module calculates the candidate knowledge fragment vector set and semantic anchoring fact representation sequentially based on the target interest point identifier, query semantic encoding vector, static knowledge vector library, and interest point real-time status dictionary.

[0190] Context feature fusion module: Calculates spatial trajectory perception latent state, spatiotemporal fusion latent state, and context spatiotemporal latent variables based on user location coordinate sequence, semantic anchored fact representation, and dialogue history sequence;

[0191] Joint semantic feature extraction module: Based on semantic anchored fact representation and contextual spatiotemporal latent variables, it sequentially calculates collaborative perception interaction latent state, gated fusion intermediate representation, and joint semantic representation;

[0192] Output module: Based on the joint semantic representation, dialogue history sequence, and semantically anchored fact representation, calculate the candidate response hidden state, the verified response hidden state, and the final response output;

[0193] A screenshot of the backend monitoring interface of the intelligent response system for cultural and tourism dialogue based on enhanced retrieval is shown below. Figure 3 As shown.

[0194] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

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

[0196] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for intelligent response in cultural tourism dialogue based on retrieval enhancement, characterized in that, Includes the following steps: A1: Collect static knowledge base text corpus of scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and preprocess them respectively to obtain static knowledge vector library, real-time status dictionary of points of interest, user location coordinate sequence, query semantic encoding vector, target point of interest identifier, and dialogue history sequence. A2: Based on the target interest point identifier, the query semantic encoding vector, the static knowledge vector library, and the real-time status dictionary of interest points, the candidate knowledge fragment vector set and the semantic anchoring fact representation are obtained in sequence. A3: Calculate the spatial trajectory perception latent state, spatiotemporal fusion latent state, and context spatiotemporal latent variables based on the user's location coordinate sequence, semantic anchoring fact representation, and dialogue history sequence. A4: Based on semantically anchored fact representation and contextual spatiotemporal latent variables, calculate the collaborative perception interaction latent state, gated fusion intermediate representation, and joint semantic representation in sequence; A5: Based on the joint semantic representation, the dialogue history sequence, and the semantically anchored fact representation, the candidate response hidden state, the verified response hidden state, and the final response output are calculated.

2. The intelligent response method for cultural tourism dialogue based on retrieval enhancement generation according to claim 1, characterized in that, Step A1 includes: A11: Collect static knowledge base text data of scenic spots. The data type is unstructured text data, including scenic spot explanation text, service facility description text, and frequently asked questions text. For the static knowledge base text corpus of the scenic area, text segmentation based on syntax rules is used to divide each text into text segments; then, a text embedding method based on a pre-trained language model is used to map each text segment into a dense vector of fixed dimension, and the dense vector is used as the key vector and value vector of the corresponding text segment. All text fragments are traversed and processed to obtain a static knowledge vector library; the static knowledge vector library includes a key projection matrix and a value projection matrix composed of dense vectors of each text fragment; A12: Collect real-time status data of scenic area points of interest. The data type is snapshot data of key-value pairs associated with timestamps. The key-value pairs use the point of interest identifier as the key and the real-time status value of the corresponding point of interest as the value. The real-time status value includes: the number of remaining parking spaces in each parking lot, the number of people queuing in each venue, and the number of people in each indoor venue. The value in the key-value pair is the numerical data of the corresponding key. For the values ​​in the key-value pairs, outliers are detected using the interquartile range method, and the detected outliers are filled with the nearest valid value to obtain the cleaned real-time status values; then, using the point of interest identifier as the key and the cleaned real-time status values ​​as the values, a real-time status dictionary of the point of interest is obtained. A13: The user terminal's fusion positioning module collects fusion positioning data, which is a multi-source spatial coordinate sequence data associated with timestamps, including GPS data and WiFi fingerprint data. For the user terminal's fusion positioning data, the WiFi fingerprint data is mapped to coordinates through a fingerprint matching algorithm, and then fused and smoothed with GPS data through Kalman filtering. Finally, a mean filtering method based on a sliding window is used for smoothing and noise reduction to obtain the user's location coordinate sequence. A14: Collect user dialogue interaction logs. The data type is structured record data, including session identifier, dialogue round, user input text for each round, system response text for each round, and timestamp for each round. The user input text of the current round in the user dialogue interaction log is semantically encoded using a text embedding method based on a pre-trained language model to obtain a query semantic encoding vector. The similarity between the query semantic encoding vector and the key projection matrix of the static knowledge vector library is calculated, and the interest point identifier corresponding to the text segment with the highest similarity is determined as the target interest point identifier. Based on the session identifier and session number in the user dialogue interaction log, the user input text and system response text of the historical sessions in the session are sorted in ascending order by session timestamp to obtain the dialogue history sequence.

3. The intelligent response method for cultural tourism dialogue based on retrieval enhancement generation according to claim 1, characterized in that, Step A2 includes: A21: Based on the target interest point identifier and the query semantic encoding vector, target-oriented semantic retrieval and filtering are performed on the static knowledge vector database to obtain a set of candidate knowledge fragment vectors. The calculation method is as follows: in, To merge query vectors, For layer normalization operation, It is a multilayer perceptron. This is a vector concatenation operation. For embedding layer operations, Identify the target point of interest. For query semantic encoding vector, To integrate the query weight matrix, This is a similarity score vector. For the Softmax function, This is the key projection matrix of the static knowledge vector base. This is a transpose operation; The target interest point mask vector has a length equal to the number of text segments. In the target interest point mask vector, the segment position to which the target interest point belongs is set to 0, and the other positions are set to −∞. This is the set of indices corresponding to the maximum similarity score. This is an index filtering operation to retrieve the top K largest weight values. For the set of candidate knowledge fragment vectors, This is the operation of extracting the corresponding row from the value matrix based on the index. The projection matrix of the values ​​in the static knowledge vector base; A22: Based on the candidate knowledge fragment vector set and the real-time state dictionary of interest points, cross-modal gating fusion encoding is performed to obtain a semantically anchored fact representation. The calculation method is as follows: in, For dynamic numerical semantic state, For flattening operation, For linear layers, The real-time status value is extracted from the real-time status dictionary of points of interest based on the target point of interest identifier. For modal gating weights, It is the Sigmoid activation function. For average pooling operation, To semantically anchor fact representation, For Hadama accumulation, This is a vector copying and tiling operation.

4. The intelligent response method for cultural tourism dialogue based on retrieval enhancement generation according to claim 3, characterized in that, Step A3 includes: A31: Based on the user's location coordinate sequence and semantically anchored fact representation, the spatial-semantic association strength between trajectory points and knowledge fragments is calculated to obtain the spatial trajectory perception latent state. The calculation method is as follows: in, The hidden state is encoded for the trajectory. It is a bidirectional long short-term memory network. For the user's location coordinate sequence, This is the spatial semantic association attention weight matrix. To perceive the hidden state of spatial trajectory; A32: Based on the dialogue history sequence and spatial trajectory perception of the latent state, the dialogue context temporal encoding and gating fusion are performed to obtain the spatiotemporal fused latent state. The calculation method is as follows: in, Encode the hidden state for the dialogue. As a historical sequence of dialogues, For spatiotemporal fusion gating weights, This is a hidden state of spatiotemporal fusion; A33: Based on the spatiotemporal fusion latent state and semantically anchored fact representation, temporal self-reinforcement and residual memory distillation are performed to obtain the contextual spatiotemporal latent variables. The calculation method is as follows: in, To enhance the hidden state in the time series, For multi-head attention operation, These are context-space-time latent variables.

5. The intelligent response method for cultural tourism dialogue based on retrieval enhancement generation according to claim 4, characterized in that, The A4 step includes: A41: Based on semantically anchored fact representations and contextual spatiotemporal latent variables, feature projection and cross-modal interaction encoding are performed to obtain the collaborative perceptual interaction latent state. The calculation method is as follows: in, To anchor the query vector semantically. For the spatiotemporal context key vector, For the spatiotemporal context value vector, To collaboratively perceive the hidden state of interaction; A42: Based on the collaborative perception interaction latent state and contextual spatiotemporal latent variables, perform dual-path deep gating fusion to obtain the gating fusion intermediate representation. The calculation method is as follows: in, To complement the gating weights, This serves as an intermediate representation for gating fusion. A43: Based on the gated fusion intermediate representation and the semantically anchored fact representation, residual and multi-level semantic enhancement are performed to obtain the joint semantic representation. The calculation method is as follows: in, This is the hidden state for semantic distillation. This is a joint semantic representation.

6. The intelligent response method for cultural tourism dialogue based on retrieval enhancement generation according to claim 5, characterized in that, Step A5 includes: A51: Based on the joint semantic representation and dialogue history sequence, a generative space is constructed and autoregressive decoding is performed to obtain the hidden states of candidate responses. The calculation method is as follows: in, This is the initial input conditional context vector for the decoder. This represents the hidden state of candidate responses. for Decoder operation; A52: Based on the candidate response hidden state sequence and semantically anchored fact representation, perform knowledge consistency verification and credibility scoring to obtain the verified response hidden state. The calculation method is as follows: in, Align the hidden state with the fact perception. For cross-attention operations, For consistency gating coefficient, The response is in a hidden state after verification; A53: Based on the verified hidden state of the response, probability mapping and decoding are performed to obtain the final response output. The calculation method is as follows: in, This represents the final vocabulary probability distribution. For the final vocabulary projection weights, This is the projection bias vector after verification. For the final response output, This is an operation to retrieve the index of the word with the highest probability.

7. A cultural tourism dialogue intelligent response system based on retrieval enhancement generation, characterized in that, include: Dialogue data preprocessing module: Collects static knowledge base text corpus of scenic area, real-time status data of scenic area points of interest, user terminal fusion positioning data, and user dialogue interaction logs, and performs preprocessing on each to obtain static knowledge vector library, real-time status dictionary of points of interest, user location coordinate sequence, query semantic encoding vector, target point of interest identifier, and dialogue history sequence; The retrieval enhancement module calculates the candidate knowledge fragment vector set and semantic anchoring fact representation sequentially based on the target interest point identifier, query semantic encoding vector, static knowledge vector library, and interest point real-time status dictionary. Context feature fusion module: Calculates spatial trajectory perception latent state, spatiotemporal fusion latent state, and context spatiotemporal latent variables based on user location coordinate sequence, semantic anchored fact representation, and dialogue history sequence; Joint semantic feature extraction module: Based on semantic anchored fact representation and contextual spatiotemporal latent variables, it sequentially calculates collaborative perception interaction latent state, gated fusion intermediate representation, and joint semantic representation; Output module: Based on the joint semantic representation, dialogue history sequence, and semantic anchoring fact representation, calculate the candidate response hidden state, the verified response hidden state, and the final response output; to realize the intelligent response method for cultural tourism dialogue based on retrieval enhancement generation as described in any one of claims 1-6.