Personalized travel route planning method, system and terminal based on large language model
By constructing a tourism knowledge graph and using instructional fine-tuning of a large language model, and combining genetic algorithms and simulated annealing algorithms to optimize paths, the efficiency and accuracy problems of personalized tourism route planning in existing technologies have been solved, and the efficient generation of personalized tourism routes has been achieved.
Patent Information
- Application Number
- CN202511035240.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies cannot quickly and accurately provide users with personalized travel route planning, resulting in limited user travel efficiency and experience.
By collecting multi-source data to construct a tourism knowledge graph, using a large language model for imperative fine-tuning and knowledge distillation enhancement, a personalized tourism route planning model is generated. The path is then optimized by combining genetic algorithms and simulated annealing algorithms, and a personalized tourism route is output.
It enables the efficient and accurate generation of personalized travel route planning, improving the user travel experience and the level of intelligence in route planning.
Smart Images

Figure CN120930898A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and route planning, and in particular to a personalized tourism route planning method, system and terminal based on a large language model. Background Technology
[0002] With the acceleration of global digitalization and breakthroughs in artificial intelligence, smart tourism has become a core direction for the transformation and upgrading of the tourism industry. However, traditional tourism planning tools, due to technological limitations, lead to problems such as homogenized routes and mismatched needs for users. Against this backdrop, intelligent planning technology that integrates large language models, with its ability to understand complex semantics and its advantages in integrating multi-source data, has become a key path to overcome industry bottlenecks.
[0003] While existing intelligent route planning technologies that integrate large language models can ensure the rationality of basic logic, they cannot parse the complex needs of users. The data layer relies on a single information source, and the algorithm layer is limited to shallow feature matching, resulting in a significant deviation between route planning and actual experience. This makes it impossible to provide users with personalized route planning solutions quickly and accurately, thus limiting the efficiency and experience of user travel.
[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0005] The main objective of this invention is to provide a personalized travel route planning method, system, terminal, and computer-readable storage medium based on a large language model. This invention aims to address the problems in existing route planning technologies, such as the inability to parse complex user needs, reliance on a single information source at the data layer, and limitations at the algorithm layer to shallow feature matching. These limitations prevent the invention from quickly and accurately providing personalized route planning solutions to users, thereby restricting the efficiency and experience of user travel.
[0006] To achieve the above objectives, this invention provides a personalized travel route planning method based on a large language model, which includes the following steps:
[0007] Collect tourism-related multi-source data, perform information extraction and standardization on the multi-source data to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set;
[0008] A large language model is constructed, and the large language model is fine-tuned in an imperative manner based on the tourism knowledge graph and the preset fine-tuning task. The large language model after imperative fine-tuning is then enhanced by knowledge distillation technology to obtain a tourism route planning model.
[0009] The system obtains the user's pending natural language request, inputs the natural language request into the travel route planning model for calculation, outputs a user preference vector and a set of candidate attractions, and generates a personalized travel route plan based on the user preference vector and the set of candidate attractions.
[0010] Optionally, the personalized tourism route planning method based on a large language model includes the following steps: collecting tourism-related information to construct a multi-source dataset; performing information extraction and standardization on the multi-source dataset to obtain a target multi-source dataset; and constructing a tourism knowledge graph based on the target multi-source dataset.
[0011] Collect structured field information, raw text information, geographic location information, and metadata information from multiple trusted data sources;
[0012] Using natural language processing technology, entity recognition, attribute extraction, and sentiment analysis are performed on the unstructured content in the original text information to obtain a set of triples, which includes head entity, relation, and tail entity.
[0013] The structured field information and the metadata information are uniformly mapped to a standard attribute set and normalized to obtain normalized data. Missing values are then processed for the geographic location information to obtain the target geographic location information.
[0014] The normalized data and the target geographic location information are used as an entity set, and the triple set is used as a semantic relation set. A tourism knowledge graph is constructed based on the entity set and the semantic relation set.
[0015] Optionally, the personalized tourism route planning method based on a large language model, wherein constructing the large language model and performing imperative fine-tuning of the large language model according to the tourism knowledge graph and preset fine-tuning tasks specifically includes:
[0016] A large language model is built using a basic open-source model to obtain user natural language requests and real structured response instructions, and the user natural language requests and real structured response instructions are used as training data.
[0017] Based on the tourism knowledge graph and the training data, an imperative fine-tuning task is performed on the large language model, wherein the imperative fine-tuning task includes: preference intent parsing, candidate attraction screening, and time feasibility verification.
[0018] Optionally, the personalized tourism route planning method based on a large language model, wherein the step of performing an imperative fine-tuning task on the large language model according to the tourism knowledge graph and the training data specifically includes:
[0019] Retrieve tourism scenario-related knowledge fragments from the tourism knowledge graph, input the user's natural language request and the tourism scenario-related knowledge fragments into the big language model for preference intent parsing, and obtain the user preference vector;
[0020] An initial set of attractions is obtained based on the user preference vector and the entity set in the tourism knowledge graph. The initial set of attractions is then evaluated for semantic matching and filtered for special constraints to select a set of candidate attractions that meet the user's needs. The time feasibility of the candidate set of attractions is then verified to obtain the target set of attractions.
[0021] The Cross-Entropy loss is calculated based on the user preference vector, the target attraction set, and the real structured response instructions. The parameters of the large language model are then updated based on the Cross-Entropy loss to obtain a fine-tuned large language model.
[0022] Optionally, the personalized travel route planning method based on a large language model, wherein the step of evaluating the semantic matching degree and filtering for special constraints on the initial set of attractions to select a set of candidate attractions that meet the user's needs, and verifying the time feasibility of the candidate set of attractions to obtain the target set of attractions, specifically includes:
[0023] The initial set of attractions is semantically matched based on the user preference vector and the entity set in the tourism knowledge graph, resulting in multiple semantic similarities:
[0024] sim(P j E i )=α·cos(Embed(P j ),Embed(E i ))+(1-α)·TF-IDF(P j E i );
[0025] Among them, P j E represents the user preference vector. i sim(P) represents the set of entities in the tourism knowledge graph. j E i ) represents P j With E i The semantic similarity between them, where α represents the weight parameter, Embed(P) j ) represents P j Semantic embedding vectors generated based on large language models, Embed(E i ) represents E i Semantic embedding vectors generated based on large language models, TF-IDF(P)j E i ) represents P j With E i Explicit keyword matching between them.
[0026] Among the multiple semantic similarities, a target semantic similarity lower than a preset similarity threshold is selected, and the attraction corresponding to the target semantic similarity is deleted from the initial attraction set to obtain an intermediate attraction set;
[0027] Obtain avoidance items or special constraints from the user's natural language request, and remove attractions from the intermediate attraction set that do not meet the avoidance items or special constraints to obtain a candidate attraction set that meets the user's needs.
[0028] The candidate attraction set is filtered based on time constraints to obtain the target attraction set:
[0029] C j ={E i ∈E filtered |t visit (E i )+t transit (E i )≤T user};
[0030] Among them, t transit (E i ) represents the estimated travel time from the user's current location to the attraction, t visit (E i () indicates the suggested visit duration for the attraction. user This indicates the user-defined daily total visit duration limit, C j E represents the collection of target attractions. filtered This represents the set of candidate attractions.
[0031] Optionally, the personalized travel route planning method based on a large language model, wherein generating a personalized travel route plan based on the user preference vector and the candidate attraction set specifically includes:
[0032] The objective function value of the overall preference and transportation cost is calculated based on the candidate attraction set:
[0033]
[0034] Where F represents the objective function value, T represents the number of travel days, t represents the current day, and s i Let S_t represent the i-th attraction in the candidate attraction set, and S_t represent the daily visit sequence. i ) represents the score of the degree of matching of preferences, x iThe value is either 0 or 1, where 0 indicates not visiting the current attraction and 1 indicates visiting the current attraction. λ represents the time cost weighting coefficient. Indicates daily travel time. t represents the daily idle time penalty item. i-start When will the scenic area reopen? i-end Indicates the closing time of the scenic area, d i This represents the recommended visit duration for the i-th attraction. Indicates arrival at attraction s i Time, Indicates the time to reach the next attraction, time(s) i ,s i+1 ) indicates the attraction s i To the scenic spot i+1 Traffic time Indicates arrival at attraction s n Time, d n This represents the recommended visit duration for the nth attraction. Indicates daily time limit;
[0035] Based on the user preference vector, the candidate attraction set, and the objective function value, a personalized travel route plan including the order of attraction visits is obtained through a hybrid strategy, wherein the hybrid strategy is obtained by combining a genetic algorithm and a simulated annealing algorithm.
[0036] Optionally, the personalized travel route planning method based on a large language model, wherein the personalized travel route plan is generated using a traditional route optimization algorithm, further includes:
[0037] The personalized travel route plan is converted into a target text format that is understandable to the user through a large language model.
[0038] The target text format is output to the user, and the route map of the personalized travel route plan is visualized.
[0039] Furthermore, to achieve the above objectives, the present invention also provides a personalized travel route planning system based on a large language model, wherein the personalized travel route planning system based on a large language model includes:
[0040] The knowledge graph construction module is used to collect multi-source data information related to tourism, perform information extraction and standardization processing on the multi-source data information to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set.
[0041] The route planning model training module is used to construct a large language model. Based on the tourism knowledge graph and the preset fine-tuning task, the large language model is fine-tuned in an imperative manner. The fine-tuned large language model is then enhanced by knowledge distillation technology to obtain a tourism route planning model.
[0042] The route planning generation module is used to obtain the user's natural language request to be processed, input the natural language request into the tourism route planning model for calculation, output the user preference vector and the candidate attraction set, and generate a personalized tourism route plan based on the user preference vector and the candidate attraction set.
[0043] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a personalized travel route planning program based on a large language model stored in the memory and executable on the processor, wherein when the personalized travel route planning program based on a large language model is executed by the processor, it implements the steps of the personalized travel route planning method based on a large language model as described above.
[0044] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a personalized travel route planning program based on a large language model, and the personalized travel route planning program based on a large language model, when executed by a processor, implements the steps of the personalized travel route planning method based on a large language model as described above.
[0045] In this invention, multi-source data information is collected, extracted, and standardized to obtain a target multi-source data set. A tourism knowledge graph is constructed based on this target multi-source data set. A large language model is built, and the large language model is fine-tuned in an imperative manner based on the tourism knowledge graph and preset fine-tuning tasks. The fine-tuned large language model is then enhanced using knowledge distillation technology to obtain a tourism route planning model. The tourism route planning model outputs a user preference vector and a set of candidate attractions. Based on the user preference vector and the set of candidate attractions, a personalized tourism route plan is generated using a traditional route optimization algorithm. This invention performs entity extraction and dynamic knowledge graph modeling on multi-source heterogeneous tourism data, combined with deep semantic understanding and preference parsing using a large language model, enabling the provision of personalized tourism routes and improving user travel efficiency. Attached Figure Description
[0046] Figure 1 This is a flowchart of a preferred embodiment of the personalized tourism route planning method based on a large language model of the present invention;
[0047] Figure 2 This is a schematic diagram illustrating the principle of the personalized tourism route planning method based on a large language model of the present invention.
[0048] Figure 3 This is a flowchart of the imperative fine-tuning task performed on the large language model in the personalized tourism route planning method based on the large language model of the present invention;
[0049] Figure 4 This is a structural diagram of a preferred embodiment of the personalized tourism route planning system based on a large language model of the present invention;
[0050] Figure 5 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0051] This application provides a personalized travel route planning method, system, and terminal based on a large language model. To make the purpose, technical solution, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0052] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0053] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0054] The personalized travel route planning method based on a large language model described in the preferred embodiment of the present invention, such as... Figure 1 As shown, the personalized travel route planning method based on a large language model includes the following steps:
[0055] Step S10: Collect tourism-related multi-source data information, perform information extraction and standardization processing on the multi-source data information to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set.
[0056] This step of the invention aims to construct a tourism knowledge representation system suitable for understanding and reasoning in large language models. By collecting and processing multi-source heterogeneous data, and integrating structured and unstructured information, a knowledge representation under a unified semantic space is generated, providing a high-quality data foundation for subsequent model fine-tuning and route planning.
[0057] Specifically, it collects structured field information, raw text information, geographic location information, and metadata information from multiple trusted data sources.
[0058] Understandably, this application collects tourism-related information from multiple trusted data sources to form a dataset, which includes: basic information about attractions from third-party tourism platforms, such as name, address, rating, opening hours, ticket price, category, and recommendation level; spatial location information and accessibility information provided by geographic information platforms, such as bus, subway, walking routes, and estimated travel time; unstructured text such as user travelogues, reviews, and tags from social media platforms; and dynamic information such as urban population density and holiday traffic published on public open data platforms.
[0059] It should be noted that, in addition to the multi-source data mentioned above, this application can further incorporate multi-source dynamic information such as weather, holiday events, and historical big data to enrich the knowledge graph structure and expand knowledge modeling for specific tourism scenarios (such as medical and health care, study tours, etc.).
[0060] Let the collected data set be: Each data unit d i It includes the following four types of information: in, This represents structured field information, such as attraction ratings and opening hours. This represents raw text information, such as user comments or tags. Represents geographical location information (latitude and longitude coordinates), It represents metadata information, such as data source and publication time.
[0061] Furthermore, through natural language processing technology, entity recognition, attribute extraction, and sentiment analysis are performed on the unstructured content in the original text information to obtain a set of triples, which includes head entity, relation, and tail entity.
[0062] In this embodiment, for For unstructured content, natural language processing techniques are used for entity recognition, attribute extraction, and sentiment analysis to extract triple sets.
[0063] Among them, h j Represents a head entity, such as "Summer Palace"; r j Indicates a relationship, such as "suitable"; t j This indicates the tail entity or attribute value, such as "family outing".
[0064] Furthermore, the structured field information and the metadata information are uniformly mapped to a standard attribute set and normalized to obtain normalized data. Missing values are then processed for the geographic location information to obtain the target geographic location information.
[0065] In this embodiment, structured fields and metadata are uniformly mapped to a standard attribute set, which includes type (such as "historical site", "city park"), time (such as "opening hours", "recommended visit duration"), target audience (such as "family travel", "couples"), mode of transportation (such as "accessible by subway", "walking distance"), and congestion indicators (such as "tourist traffic", "peak hours").
[0066] Understandably, in order to maintain semantic consistency, this application sets up a standardization function, which is used to normalize the standard attribute set and normalize the expressions from different sources into unified semantic labels for subsequent modeling.
[0067] Furthermore, the normalized data and the target geographic location information are used as an entity set, and the set of triples is used as a semantic relation set. A tourism knowledge graph is constructed based on the entity set and the semantic relation set.
[0068] Specifically, a tourism knowledge graph is constructed based on the entity set and the semantic relationship set: Where: ε represents the set of entities (scenic spots, tags, transportation nodes, etc.); It represents a set of semantic relationships, such as "belongs to type", "reachable", "recommended for", etc.
[0069] Each entity e∈ε in the entity set corresponds to a semantic vector. semantic vector v e It is composed of its structured features and text representation:
[0070]
[0071] Where φ(·) represents the structured feature encoder (such as the embedding layer), ψ(·) represents the text embedding generated by the pre-trained language model, and Concat(·) represents the concatenation operation.
[0072] It is understood that this embodiment can further construct a time-series version of the dynamic graph. Dynamic graph It can adapt to seasonal and time-varying data changes, supporting dynamic travel recommendations.
[0073] Step S20: Construct a large language model, perform imperative fine-tuning on the large language model based on the tourism knowledge graph and preset fine-tuning tasks, and enhance the large language model after imperative fine-tuning through knowledge distillation technology to obtain a tourism route planning model.
[0074] Understandably, this step aims to construct a Large Language Model (LLM) with tourism semantic understanding and preference parsing capabilities. This enables structured parsing of users' natural language needs, preliminary screening of candidate attractions, and personalized expression of travel intentions guided by preferences. This model serves as the core interaction interface between the user and the system, and provides a candidate space and constraints for subsequent route planning.
[0075] The construction of the large language model, based on the tourism knowledge graph and preset fine-tuning tasks, specifically includes:
[0076] A large language model is built using a basic open-source model to obtain user natural language requests and real structured response instructions, and the user natural language requests and real structured response instructions are used as training data.
[0077] Based on the tourism knowledge graph and the training data, an imperative fine-tuning task is performed on the large language model, wherein the imperative fine-tuning task includes: preference intent parsing, candidate attraction screening, and time feasibility verification.
[0078] In this embodiment, to achieve the tourism preference understanding and candidate attraction evaluation task proposed in this application, this application selects high-performance, mainstream, and suitable open-source large language models (such as DeepSeek and Qwen series models) as the base model, including the DeepSeek LLM model (67B): which has powerful semantic understanding capabilities and is suitable for parsing complex natural language instructions; or the Qwen model (14B or 72B): which has excellent Chinese understanding capabilities, is particularly suitable for localized scenarios, and can efficiently complete the understanding of detailed needs in the tourism field.
[0079] It should be noted that the large language model described in this application can be replaced with any open-source / commercial model with instruction fine-tuning capabilities (such as Llama, GPT-4, ERNIE, etc.), or adapted to local multilingual scenarios to achieve intelligent planning of cross-language and cross-regional travel routes.
[0080] Furthermore, to ensure that the basic large language model is accurately adapted to tourism scenarios, this invention adopts an instruction-based fine-tuning method to establish a mechanism for parsing user natural language needs and initially screening candidate attractions, thus preparing for subsequent path optimization.
[0081] First, obtain the user's natural language request and the actual structured response instructions, and use these as training data. The training data is constructed as a training dataset D in the form of instruction-response pairs of user natural language requests and structured responses. train :
[0082] D train ={(q1,a1),(q2,a2),…,(q n ,a n )};
[0083] Where, q i Let a represent the i-th natural language travel request input by the user. i For the corresponding structured output, a i Specifically, it includes two core components: the user preference vector P j And candidate attraction collection C j User preference vector P j This represents the user's explicit or implicit multi-dimensional structured tourism needs; candidate attraction set C j This represents the set of attractions that meet the user's needs, initially selected based on preference vectors.
[0084] like Figure 3 As shown, further, the imperative fine-tuning task is performed on the large language model, including:
[0085] Step S201: Retrieve tourism scene-related knowledge fragments from the tourism knowledge graph, input the user's natural language request and the tourism scene-related knowledge fragments into the large language model for preference intent parsing, and obtain the user preference vector.
[0086] Understandably, this task transforms the user's input natural language command q into a structured user preference vector P. j Specifically, the user preference vector is defined as:
[0087] P j ={T,B,M,L,N}=fθ (q∣K);
[0088] In this context, T, B, and M are explicit constraints: T represents the number of travel days (e.g., "3-day trip"), B represents the budget range (e.g., "under 3000 yuan"), and M represents the mode of transportation (e.g., "mainly walking"). L is an implicit interest preference constraint, representing a set of interest tags (e.g., "cultural history, natural scenery, photography spots"). N is an avoidance constraint, representing a set of negative characteristics (e.g., "avoid popular and crowded attractions, avoid long-distance travel"). θ The function represents the large language model function, and K represents the tourism scene-related knowledge fragments retrieved from the constructed dynamic knowledge graph KG, which is used to enhance the model's contextual reasoning ability and ensure the accuracy of preference parsing.
[0089] Step S202: Obtain an initial set of attractions based on the user preference vector and the entity set in the tourism knowledge graph. Perform semantic matching degree evaluation and special constraint filtering on the initial set of attractions to select a set of candidate attractions that meet the user's needs. Perform time feasibility verification on the set of candidate attractions to obtain a set of target attractions.
[0090] Specifically, the initial set of attractions is semantically matched based on the user preference vector and the entity set in the tourism knowledge graph, resulting in multiple semantic similarities:
[0091] sim(P j E i )=α·cos(Embed(P j ),Embed(E i ))+(1-α)·TF-IDF(P j E i );
[0092] Among them, P j E represents the user preference vector. i sim(P) represents the set of entities in the tourism knowledge graph. j E i ) represents P j With E i The semantic similarity between them, where α represents the weight parameter, Embed(P) j ) represents P j Semantic embedding vectors generated based on large language models, Embed(E i ) represents E i Semantic embedding vectors generated based on large language models, TF-IDF(P) j E i ) represents P j With E iExplicit keyword matching between them (such as matching "history and culture" in user preferences with attraction tags).
[0093] Among the multiple semantic similarities, a target semantic similarity lower than a preset similarity threshold is selected, and the attraction corresponding to the target semantic similarity is deleted from the initial attraction set to obtain an intermediate attraction set;
[0094] Obtain avoidance items or special constraints from the user's natural language request, and remove attractions from the intermediate attraction set that do not meet the avoidance items or special constraints to obtain a candidate attraction set that meets the user's needs.
[0095] The candidate attraction set is filtered based on time constraints to obtain the target attraction set:
[0096] C j ={E i ∈E filtered |t visit (E i )+t transit (E i )≤T user};
[0097] Among them, t transit (E i ) represents the estimated travel time from the user's current location to the attraction, t visit (E i () indicates the suggested visit duration for the attraction. user This indicates the user-defined daily total visit duration limit, C j E represents the collection of target attractions. filtered This represents the set of candidate attractions.
[0098] Step S203: Calculate the Cross-Entropy loss based on the user preference vector, the target attraction set, and the real structured response instructions; update the parameters of the large language model based on the Cross-Entropy loss to obtain the fine-tuned large language model.
[0099] Furthermore, the large language model after imperative fine-tuning is enhanced using knowledge distillation techniques to obtain a tourism route planning model.
[0100] Understandably, in order to improve the reasoning efficiency and real-time performance of the model, this invention employs knowledge distillation to enhance the large language model.
[0101] Teacher Model: Two to three large-scale base models with different architectures (such as DeepSeek, Qwen, and Baichuan) are selected. After fine-tuning the instructions for each model, the response results to the same input request are weighted and ensembled to obtain robust and high-quality supervision data. The teacher model output is smoothed using Softmax to provide richer supervision signals.
[0102] Student model: Uses relatively small, faster open-source model architectures, such as lightweight versions of Qwen-7B or DeepSeek-7B; the distillation process is completed by minimizing the KL divergence between the student model's prediction distribution and the teacher model's output distribution.
[0103] Step S30: Obtain the user's natural language request to be processed, input the natural language request into the travel route planning model for calculation, output the user preference vector and the candidate attraction set, and generate a personalized travel route plan based on the user preference vector and the candidate attraction set.
[0104] In this embodiment, the user's unprocessed natural language request is obtained and input into the travel route planning model for calculation. The travel route planning model outputs two core structures for subsequent travel route optimization: a user preference vector P. i : Structured multidimensional constraints representing user needs; Candidate attraction set C j It provides a candidate solution space for path calculation and optimization.
[0105] Furthermore, the step of generating a personalized travel route plan based on the user preference vector and the candidate attraction set specifically includes:
[0106] The objective function value of the overall preference and transportation cost is calculated based on the candidate attraction set:
[0107]
[0108] The constraints are as follows:
[0109]
[0110] Where F represents the objective function value, T represents the number of travel days, t represents the current day, and s i Let S_t represent the i-th attraction in the candidate attraction set, and S_t represent the daily visit sequence. i ) represents the score of the degree of matching of preferences, x iThe value is either 0 or 1, where 0 indicates not visiting the current attraction and 1 indicates visiting the current attraction. λ represents the time cost weighting coefficient. Indicates daily travel time. t represents the daily idle time penalty item. i-start When will the scenic area reopen? i-end Indicates the closing time of the scenic area, d i This represents the recommended visit duration for the i-th attraction. Indicates arrival at attraction s i Time, Indicates the time to reach the next attraction, time(s) i ,s i+1 ) indicates the attraction s i To the scenic spot i+1 Traffic time Indicates arrival at attraction s n Time, d n This represents the recommended visit duration for the nth attraction. Indicates daily time limit;
[0111] Understandably, the three constraints of the above objective function are: (1) Time window constraint: the arrival time at the attraction must be within the attraction's opening hours, and the recommended visit time must also be before the attraction's closing time, ensuring that users have sufficient time to play; (2) Itinerary continuity constraint: the arrival time at the next attraction should be as close as the closing time of the previous attraction plus travel time, ensuring itinerary continuity; (3) Daily duration limit: the total play time must not exceed the threshold, ensuring reasonable play time, improving user comfort, and avoiding excessive user fatigue.
[0112] Furthermore, daily travel time is expressed as follows:
[0113]
[0114] The penalty for daily free time is represented as follows:
[0115]
[0116] In this embodiment, the matching degree score with the preference is taken as Score(s). i The system calculates the total travel time between attractions by taking the maximum value and summing the results. Idle time is calculated as follows: if a day's itinerary ends too early (e.g., the planned attractions close at 5 PM, but the user can play until 8 PM), the system will penalize the unused 3 hours, encouraging reasonable time management. The importance of time cost is adjusted through a coefficient λ. A larger λ indicates a preference for short, compact routes; a smaller λ indicates a greater willingness to tolerate longer travel times for high-scoring attractions. This avoids blindly piling on high-scoring attractions, leading to fatigue, and also prevents sacrificing the experience entirely to save time.
[0117] Based on the user preference vector, the candidate attraction set, and the objective function value, a personalized travel route plan including the order of attraction visits is obtained through a hybrid strategy, wherein the hybrid strategy is obtained by combining a genetic algorithm and a simulated annealing algorithm.
[0118] In this embodiment, a hybrid strategy of genetic algorithm (GA) and simulated annealing (SA) is used to obtain a personalized travel route plan that includes the order of attraction visits.
[0119] Specifically, a path search is first performed, and the path search process uses the input set C. j and user preference vector P i Construct a graph structure G_path = (V, E), where: V represents candidate attractions; E is the traffic connection edge e of the candidate path. ij , border rights w ij For the required time or transportation costs.
[0120] Furthermore, the path S_total is encoded as a gene sequence. For example, the 3-day tour path is encoded as DNA = [s1,s3,s4|s2,s6|s5], where s i For candidate attractions, the daily attraction sequence S_t is separated by "|". When generating the initial population, a probability distribution is constructed based on attraction preference scores and edge weights:
[0121]
[0122] Understandably, this probability distribution ensures that attractions with high preference scores are prioritized for inclusion in the route, while random separators are inserted to generate multi-day itineraries. Therefore, this application, based on the candidate attraction set, generates a practically feasible and optimally designed time-series route by solving spatiotemporal constraints.
[0123] Furthermore, fitness calculation and constraint processing are enabled. The fitness is calculated by inheriting the objective function value and introducing hard constraint penalty terms:
[0124] fitness=F-μ∑times 违反约束 ;
[0125] Where fitness is the fitness level, μ is the penalty coefficient, and times 违反约束 To constrain the number of violations, for each edge e... ij Constraint verification is performed, and if a violation occurs, a dynamic repair mechanism is triggered: for attractions s that do not meet the opening time window requirements. iPerform the following operations: (1) Time shift: Adjust the attraction to the feasible time period of the day; (2) Cross-day migration: If there is no free time on the day, move it to a later date; (3) Forced removal: If it cannot be satisfied, remove it from the path and search for adjacent attractions along G_path. k Replace it.
[0126] Furthermore, a genetic algorithm (GA) is executed, employing a hybrid strategy of elite retention and roulette wheel selection, retaining the top 10% of optimal individuals and selecting the remaining 90% based on fitness. A segmented sequential crossover (S-OX) is designed, a dedicated crossover operator for multi-day travel scenarios. Its core idea is to exchange gene segments according to the number of days, preserving high-quality segments from the parent generation while avoiding time window conflicts caused by traditional crossover.
[0127] The specific steps are as follows: (1) Randomly select consecutive daily travel segments from the parent chromosome, and only allow the selection of well-connected sub-paths (edge weights w) in G_path. ij <threshold); (2) swap corresponding paragraphs; (3) repair duplicate attractions.
[0128] Furthermore, simulated annealing (SA) algorithm is executed to perform a local fine search on the top 20% of individuals generated by the genetic algorithm GA: (1) Neighborhood operation: if and only if e ij When ∈E, two scenic spots s are randomly swapped within a single day. i s j Location; Cross-day adjustment: Move a scenic spot to a feasible location on an adjacent day, ensuring that the sequence after the move is connected. (2) Annealing acceptance criterion: If the fitness difference ΔE of the new solution is greater than 0, then the new solution is accepted; otherwise, it is accepted by probability. The formula for calculating the probability Paccept is as follows:
[0129]
[0130] Wherein, temperature T' cools exponentially: T'(t') = T0·0.95 t' T0 is the initial temperature, and t' is the number of iterations.
[0131] It should be noted that in this embodiment, the latest traffic data is retrieved from the map API every preset time interval (e.g., 30 minutes) to update the G_path edge weights w. ij To achieve dynamic edge weight updates:
[0132] w ij =TravelTime(s) i ,s j )×(1+Cr);
[0133] Cr is the congestion index, which includes factors such as the average speed of the road segment.
[0134] The final termination condition is when the change in optimal fitness is less than 1% over 10 consecutive generations or when the maximum number of iterations (e.g., 200) is reached. A non-dominated solution set (Pareto front) is selected from the final population. If the user has no explicit preference, the solution P_optimal with the highest overall score is returned by default. This solution P_optimal represents the optimal path (i.e., personalized travel route planning).
[0135] It should be noted that in other implementations, the above-mentioned hybrid GA-SA framework can be replaced with ant colony optimization, deep reinforcement learning, or multi-objective evolutionary algorithms to support more objective constraints and dynamic scenarios, such as green and low-carbon routes, optimal cost budgets, and risk avoidance, thereby improving personalized intelligent optimization capabilities.
[0136] Furthermore, the process of generating personalized travel route plans using traditional route optimization algorithms further includes:
[0137] The personalized travel route plan is converted into a target text format that is understandable to the user through a large language model.
[0138] The target text format is output to the user, and the route map of the personalized travel route plan is visualized.
[0139] In this embodiment, after the personalized travel route planning calculation is completed, the large language model is called to convert the structured personalized travel route planning into text output that users can understand, such as: "On the morning of day 1, it is recommended to visit the Summer Palace (a royal garden, recommended to spend 2 hours there), have lunch near Nanluoguxiang, and visit the National Art Museum of China in the afternoon (artistic style, not crowded). The total walking time for the day is estimated to be about 1.5 hours."
[0140] Understandably, in addition to transforming structured, personalized travel route planning into user-understandable text output, this application also supports the following multi-turn interactive functions: users add or delete attractions, and the model updates C. j The system recalculates the route; users adjust their pace preferences (e.g., "play at a slower pace"), and the system adjusts the cost coefficients to recalculate the route; and the route map is visualized.
[0141] Compared with the prior art, the beneficial effects of the technical method provided by the present invention are:
[0142] (1) This invention innovatively combines multi-source heterogeneous tourism data with entity extraction, attribute standardization, and dynamic modeling using knowledge graphs, along with a large language model, for deep semantic understanding and preference parsing. This significantly improves the automated parsing and reasoning capabilities for complex semantics, breaks through the limitations of static matching in traditional rule engines and collaborative filtering, and achieves intelligent generation of personalized tourism routes that are "one for each person".
[0143] (2) This invention proposes a candidate selection algorithm that integrates semantic embedding of a large language model, structured features, and weighted matching of explicit keywords (TF-IDF). It also introduces special constraints (such as accessibility, barrier-free access, and popular site avoidance) and a spatiotemporal feasibility verification mechanism to construct a refined and dynamically expandable set of candidate attractions. This comprehensive scoring and filtering mechanism effectively addresses the shortcomings of traditional recommendation models in adapting to real-time constraints and multidimensional preferences.
[0144] (3) This invention innovatively applies LLM fine-tuning to the structured expression of tourism demand, outputting a highly semantic intermediate layer consisting of "user preference vector + candidate set," providing a powerful and scalable input interface for subsequent route optimization and interactive decision-making. This intermediate layer supports contextual reasoning to complete missing or implicit demands, significantly improving the user experience and the intelligence level of route decision-making.
[0145] (4) For complex scenarios involving multiple days and multiple attractions, a hybrid solution framework integrating genetic algorithm (GA) and simulated annealing (SA) is proposed. The path is dynamically adjusted according to tourism spatiotemporal constraints, attraction opening time windows, and user rhythm, supporting real-time traffic updates and idle time penalties. A customized segmented sequential crossover operator and dynamic edge weight mechanism are used to effectively improve the global optimality and robustness of the solution in large-scale scenarios.
[0146] Furthermore, such as Figure 4 As shown, based on the above-mentioned personalized travel route planning method based on a large language model, this invention also provides a personalized travel route planning system based on a large language model, wherein the personalized travel route planning system based on a large language model includes:
[0147] The knowledge graph construction module 51 is used to collect multi-source data information related to tourism, perform information extraction and standardization processing on the multi-source data information to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set.
[0148] The route planning model training module 52 is used to construct a large language model, perform imperative fine-tuning on the large language model based on the tourism knowledge graph and the preset fine-tuning task, and enhance the imperatively fine-tuned large language model through knowledge distillation technology to obtain a tourism route planning model.
[0149] The route planning generation module 53 is used to obtain the user's natural language request to be processed, input the natural language request into the tourism route planning model for calculation, output the user preference vector and the candidate attraction set, and generate a personalized tourism route plan based on the user preference vector and the candidate attraction set.
[0150] Furthermore, such as Figure 5 As shown, based on the above-mentioned personalized tourism route planning method and system based on a large language model, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 5 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0151] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a personalized travel route planning program 40 based on a large language model, which can be executed by the processor 10 to implement the personalized travel route planning method based on a large language model in this application.
[0152] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the personalized travel route planning method based on a large language model.
[0153] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.
[0154] In one embodiment, when processor 10 executes the personalized travel route planning program 40 based on a large language model stored in memory 20, the following steps are performed:
[0155] Collect tourism-related multi-source data, perform information extraction and standardization on the multi-source data to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set;
[0156] A large language model is constructed, and the large language model is fine-tuned in an imperative manner based on the tourism knowledge graph and the preset fine-tuning task. The large language model after imperative fine-tuning is then enhanced by knowledge distillation technology to obtain a tourism route planning model.
[0157] The system obtains the user's pending natural language request, inputs the natural language request into the travel route planning model for calculation, outputs a user preference vector and a set of candidate attractions, and generates a personalized travel route plan based on the user preference vector and the set of candidate attractions.
[0158] The process of collecting tourism-related information to construct a multi-source dataset, extracting and standardizing information from the multi-source dataset to obtain a target multi-source dataset, and constructing a tourism knowledge graph based on the target multi-source dataset specifically includes:
[0159] Collect structured field information, raw text information, geographic location information, and metadata information from multiple trusted data sources;
[0160] Using natural language processing technology, entity recognition, attribute extraction, and sentiment analysis are performed on the unstructured content in the original text information to obtain a set of triples, which includes head entity, relation, and tail entity.
[0161] The structured field information and the metadata information are uniformly mapped to a standard attribute set and normalized to obtain normalized data. Missing values are then processed for the geographic location information to obtain the target geographic location information.
[0162] The normalized data and the target geographic location information are used as an entity set, and the triple set is used as a semantic relation set. A tourism knowledge graph is constructed based on the entity set and the semantic relation set.
[0163] The construction of the large language model, specifically including the imperative fine-tuning of the large language model based on the tourism knowledge graph and preset fine-tuning tasks, includes:
[0164] A large language model is built using a basic open-source model to obtain user natural language requests and real structured response instructions, and the user natural language requests and real structured response instructions are used as training data.
[0165] Based on the tourism knowledge graph and the training data, an imperative fine-tuning task is performed on the large language model, wherein the imperative fine-tuning task includes: preference intent parsing, candidate attraction screening, and time feasibility verification.
[0166] Specifically, the step of performing imperative fine-tuning on the large language model based on the tourism knowledge graph and the training data includes:
[0167] Retrieve tourism scenario-related knowledge fragments from the tourism knowledge graph, input the user's natural language request and the tourism scenario-related knowledge fragments into the big language model for preference intent parsing, and obtain the user preference vector;
[0168] An initial set of attractions is obtained based on the user preference vector and the entity set in the tourism knowledge graph. The initial set of attractions is then evaluated for semantic matching and filtered for special constraints to select a set of candidate attractions that meet the user's needs. The time feasibility of the candidate set of attractions is then verified to obtain the target set of attractions.
[0169] The Cross-Entropy loss is calculated based on the user preference vector, the target attraction set, and the real structured response instructions. The parameters of the large language model are then updated based on the Cross-Entropy loss to obtain a fine-tuned large language model.
[0170] Specifically, the process of evaluating semantic matching degree and filtering under special constraints on the initial set of attractions to select a set of candidate attractions that meet user needs, and verifying the time feasibility of the candidate set of attractions to obtain the target set of attractions, includes:
[0171] The initial set of attractions is semantically matched based on the user preference vector and the entity set in the tourism knowledge graph, resulting in multiple semantic similarities:
[0172] sim(P j E i )=α·cos(Embed(P j ),Embed(E i ))+(1-α)·TF-IDF(P j E i );
[0173] Among them, P j E represents the user preference vector.i sim(P) represents the set of entities in the tourism knowledge graph. j E i ) represents P j With E i The semantic similarity between them, where α represents the weight parameter, Embed(P) j ) represents P j Semantic embedding vectors generated based on large language models, Embed(E i ) represents E i Semantic embedding vectors generated based on large language models, TF-IDF(P) j E i ) represents P j With E i Explicit keyword matching between them.
[0174] Among the multiple semantic similarities, a target semantic similarity lower than a preset similarity threshold is selected, and the attraction corresponding to the target semantic similarity is deleted from the initial attraction set to obtain an intermediate attraction set;
[0175] Obtain avoidance items or special constraints from the user's natural language request, and remove attractions from the intermediate attraction set that do not meet the avoidance items or special constraints to obtain a candidate attraction set that meets the user's needs.
[0176] The candidate attraction set is filtered based on time constraints to obtain the target attraction set:
[0177] C j ={E i ∈E filtered |t visit (E i )+t transit (E i )≤T user};
[0178] Among them, t transit (E i ) represents the estimated travel time from the user's current location to the attraction, t visit (E i () indicates the suggested visit duration for the attraction. user This indicates the user-defined daily total visit duration limit, C j E represents the collection of target attractions. filtered This represents the set of candidate attractions.
[0179] Specifically, generating a personalized travel route plan based on the user preference vector and the candidate attraction set includes:
[0180] The objective function value of the overall preference and transportation cost is calculated based on the candidate attraction set:
[0181]
[0182] Where F represents the objective function value, T represents the number of travel days, t represents the current day, and s i Let S_t represent the i-th attraction in the candidate attraction set, and S_t represent the daily visit sequence. i ) represents the score of the degree of matching of preferences, x i The value is either 0 or 1, where 0 indicates not visiting the current attraction and 1 indicates visiting the current attraction. λ represents the time cost weighting coefficient. Indicates daily travel time. t represents the daily idle time penalty item. i-start When will the scenic area reopen? i-end Indicates the closing time of the scenic area, d i This represents the recommended visit duration for the i-th attraction. Indicates arrival at attraction s i Time, Indicates the time to reach the next attraction, time(s) i ,s i+1 ) indicates the attraction s i To the scenic spot i+1 Traffic time Indicates arrival at attraction s n Time, d n This represents the recommended visit duration for the nth attraction. Indicates daily time limit;
[0183] Based on the user preference vector, the candidate attraction set, and the objective function value, a personalized travel route plan including the order of attraction visits is obtained through a hybrid strategy, wherein the hybrid strategy is obtained by combining a genetic algorithm and a simulated annealing algorithm.
[0184] The process of generating personalized travel route plans using traditional route optimization algorithms further includes:
[0185] The personalized travel route plan is converted into a target text format that is understandable to the user through a large language model.
[0186] The target text format is output to the user, and the route map of the personalized travel route plan is visualized.
[0187] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a personalized travel route planning program based on a large language model, and the personalized travel route planning program based on a large language model implements the steps of the personalized travel route planning method based on a large language model as described above when executed by a processor.
[0188] In summary, this invention proposes a personalized tourism route planning method, system, and terminal based on a large language model. The method includes: collecting multi-source data information; extracting and standardizing the multi-source data information to obtain a target multi-source data set; constructing a tourism knowledge graph based on the target multi-source data set; constructing a large language model; performing imperative fine-tuning of the large language model based on the tourism knowledge graph and preset fine-tuning tasks; enhancing the imperatively fine-tuned large language model using knowledge distillation technology to obtain a tourism route planning model; outputting a user preference vector and a candidate attraction set based on the tourism route planning model; and generating personalized tourism route plans using traditional route optimization algorithms based on the user preference vector and the candidate attraction set. This invention performs entity extraction and dynamic knowledge graph modeling on multi-source heterogeneous tourism data, combined with deep semantic understanding and preference parsing using a large language model, enabling the provision of personalized tourism routes and improving user travel efficiency.
[0189] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal 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, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0190] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0191] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A personalized tourism route planning method based on a large language model, characterized in that, The personalized travel route planning method based on a large language model includes: Collect tourism-related multi-source data, perform information extraction and standardization on the multi-source data to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set; A large language model is constructed, and the large language model is fine-tuned in an imperative manner based on the tourism knowledge graph and the preset fine-tuning task. The large language model after imperative fine-tuning is then enhanced by knowledge distillation technology to obtain a tourism route planning model. The system obtains the user's pending natural language request, inputs the natural language request into the travel route planning model for calculation, outputs a user preference vector and a set of candidate attractions, and generates a personalized travel route plan based on the user preference vector and the set of candidate attractions.
2. The personalized tourism route planning method based on a large language model according to claim 1, characterized in that, The process of collecting tourism-related information to construct a multi-source dataset, extracting and standardizing information from the multi-source dataset to obtain a target multi-source dataset, and constructing a tourism knowledge graph based on the target multi-source dataset specifically includes: Collect structured field information, raw text information, geographic location information, and metadata information from multiple trusted data sources; Using natural language processing technology, entity recognition, attribute extraction, and sentiment analysis are performed on the unstructured content in the original text information to obtain a set of triples, which includes head entity, relation, and tail entity. The structured field information and the metadata information are uniformly mapped to a standard attribute set and normalized to obtain normalized data. Missing values are then processed for the geographic location information to obtain the target geographic location information. The normalized data and the target geographic location information are used as an entity set, and the triple set is used as a semantic relation set. A tourism knowledge graph is constructed based on the entity set and the semantic relation set.
3. The personalized tourism route planning method based on a large language model according to claim 1, characterized in that, The construction of the large language model, based on the tourism knowledge graph and preset fine-tuning tasks, specifically includes: A large language model is built using a basic open-source model to obtain user natural language requests and real structured response instructions, and the user natural language requests and real structured response instructions are used as training data. Based on the tourism knowledge graph and the training data, an imperative fine-tuning task is performed on the large language model, wherein the imperative fine-tuning task includes: preference intent parsing, candidate attraction screening, and time feasibility verification.
4. The personalized tourism route planning method based on a large language model according to claim 3, characterized in that, The step of performing imperative fine-tuning on the large language model based on the tourism knowledge graph and the training data specifically includes: Retrieve tourism scenario-related knowledge fragments from the tourism knowledge graph, input the user's natural language request and the tourism scenario-related knowledge fragments into the big language model for preference intent parsing, and obtain the user preference vector; An initial set of attractions is obtained based on the user preference vector and the entity set in the tourism knowledge graph. The initial set of attractions is then evaluated for semantic matching and filtered for special constraints to select a set of candidate attractions that meet the user's needs. The time feasibility of the candidate set of attractions is then verified to obtain the target set of attractions. The Cross-Entropy loss is calculated based on the user preference vector, the target attraction set, and the real structured response instructions. The parameters of the large language model are then updated based on the Cross-Entropy loss to obtain a fine-tuned large language model.
5. The personalized tourism route planning method based on a large language model according to claim 4, characterized in that, The process of evaluating semantic matching and filtering under special constraints on the initial set of attractions to select a set of candidate attractions that meet the user's needs, and verifying the time feasibility of the candidate set of attractions to obtain the target set of attractions, specifically includes: The initial set of attractions is semantically matched based on the user preference vector and the entity set in the tourism knowledge graph, resulting in multiple semantic similarities: sim ( P j ,E i )sα·cos(Embed(P j ),Embed(E i ))+(1-α)·TF-IDF(P). j ,E i )4 Among them, P j E represents the user preference vector. i sim(P) represents the set of entities in the tourism knowledge graph. j E i ) represents P j With E i The semantic similarity between them, where α represents the weight parameter, Embed(P) j ) represents P j Semantic embedding vectors generated based on large language models, Embed(E i ) represents E i Semantic embedding vectors generated based on large language models, TF-IDF(P) j E i ) represents P j With E i Explicit keyword matching between them. Among the multiple semantic similarities, a target semantic similarity lower than a preset similarity threshold is selected, and the attraction corresponding to the target semantic similarity is deleted from the initial attraction set to obtain an intermediate attraction set; Obtain avoidance items or special constraints from the user's natural language request, and remove attractions from the intermediate attraction set that do not meet the avoidance items or special constraints to obtain a candidate attraction set that meets the user's needs. The candidate attraction set is filtered based on time constraints to obtain the target attraction set: C j ={E i ∈E filtered ∣t visit (E i )+t transit (E i )≤T user }; Among them, t transit (E i ) represents the estimated travel time from the user's current location to the attraction, t visit (E i () indicates the suggested visit duration for the attraction. user This indicates the user-defined daily total visit duration limit, C j E represents the collection of target attractions. filtered This represents the set of candidate attractions.
6. The personalized tourism route planning method based on a large language model according to claim 1, characterized in that, The process of generating a personalized travel route plan based on the user preference vector and the candidate attraction set specifically includes: The objective function value of the overall preference and transportation cost is calculated based on the candidate attraction set: Where F represents the objective function value, T represents the number of travel days, t represents the current day, and s i Let S_t represent the i-th attraction in the candidate attraction set, and S_t represent the daily visit sequence. i ) represents the score of the degree of matching of preferences, x i The value is either 0 or 1, where 0 indicates not visiting the current attraction and 1 indicates visiting the current attraction. λ represents the time cost weighting coefficient. Indicates daily travel time. t represents the daily idle time penalty item. i-start When will the scenic area reopen? i-end Indicates the closing time of the scenic area, d i This represents the recommended visit duration for the i-th attraction. Indicates arrival at attraction s i Time, Indicates the time to reach the next attraction, time(s) i ,s i+1 ) indicates the attraction s i To the scenic spot i+1 Traffic time Indicates arrival at attraction s n Time, d n This represents the recommended visit duration for the nth attraction. Indicates daily time limit; Based on the user preference vector, the candidate attraction set, and the objective function value, a personalized travel route plan including the order of attraction visits is obtained through a hybrid strategy, wherein the hybrid strategy is obtained by combining a genetic algorithm and a simulated annealing algorithm.
7. The personalized tourism route planning method based on a large language model according to claim 1, characterized in that, The process of generating personalized travel route plans using traditional route optimization algorithms also includes: The personalized travel route plan is converted into a target text format that is understandable to the user through a large language model. The target text format is output to the user, and the route map of the personalized travel route plan is visualized.
8. A personalized tourism route planning system based on a large language model, characterized in that, The personalized travel route planning system based on a large language model includes: The knowledge graph construction module is used to collect multi-source data information related to tourism, perform information extraction and standardization processing on the multi-source data information to obtain a target multi-source data set, and construct a tourism knowledge graph based on the target multi-source data set. The route planning model training module is used to construct a large language model. Based on the tourism knowledge graph and the preset fine-tuning task, the large language model is fine-tuned in an imperative manner. The fine-tuned large language model is then enhanced by knowledge distillation technology to obtain a tourism route planning model. The route planning generation module is used to obtain the user's natural language request to be processed, input the natural language request into the tourism route planning model for calculation, output the user preference vector and the candidate attraction set, and generate a personalized tourism route plan based on the user preference vector and the candidate attraction set.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a personalized travel route planning program based on a large language model stored in the memory and executable on the processor. When the personalized travel route planning program based on a large language model is executed by the processor, it implements the steps of the personalized travel route planning method based on a large language model as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a personalized travel route planning program based on a large language model, which, when executed by a processor, implements the steps of the personalized travel route planning method based on a large language model as described in any one of claims 1-7.
Citation Information
Cited By
Intelligent auditing method based on knowledge graph constraint
CN121437188A
Dynamic tourism script task logic judgment method based on vertical large model and user feedback
CN121743608A
Vertical large model and user feedback dynamic travel script task logic judgment method
CN121743608B