A three-axis constraint enhancement generation method for multi-dimensional tourism scenic spot safety risk evaluation

CN122819902APending Publication Date: 2026-09-25FUDAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610982144.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

第一,现有方面级情感分析数据集和方法大多面向餐饮、酒店、商品评价或一般旅游服务质量评价,缺少针对“旅游安全风险”的专门语义结构

Benefits of technology

第一,本发明提出结构化指令语义对齐机制,通过在输入端显式加入任务说明、字段定义、类别约束和输出格式约束,使模型能够更稳定地生成符合预设字段结构的结果,减少字段遗漏、顺序混乱和类别不规范等问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122819902A_ABST
    Figure CN122819902A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of multi-dimensional tourist attraction safety risk evaluation three-axis restraint enhancement generation method, comprising the following steps: obtaining the tourist comment text data to be evaluated;The tourist comment text data is converted into structured instruction based on structured instruction template;The structured instruction is used as the input of pre-training coding and decoding model, generates several candidate structured results;The structure consistency score of each candidate structured result is calculated, and the candidate structured result with the highest score is selected as the final output, to obtain the final tourist safety risk multi-element group result;Wherein, the coding and decoding model is trained by the total loss function of fusion generation loss and double affine dependence modeling loss.Compared with prior art, the present application can realize the automatic extraction, classification, scoring and interpretation of tourist safety risk information, with the advantages of high accuracy, stable model generation result, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for processing tourism safety risk information, and in particular to a three-axis constraint-enhanced generation method for multi-dimensional tourism scenic area safety risk assessment. Background Technology

[0002] With the widespread use of online travel platforms, social media, and destination review systems, tourists record their genuine experiences regarding scenic spots, transportation, dining, facilities, security, and emergency response through online reviews, travelogues, Q&A, and complaint texts during their trips. Among these, text content related to tourism safety risks directly reflects tourists' risk perception, hazard identification, and safety assessment during their visits to the destination, which is of significant value for destination risk management, scenic spot operation and maintenance optimization, tourist experience enhancement, and smart cultural tourism supervision.

[0003] Currently, text understanding methods for user reviews mainly focus on tasks such as sentiment analysis, aspect-level sentiment analysis, and opinion extraction. For example, existing aspect-level sentiment analysis methods typically extract aspect terms, opinion terms, and sentiment polarity from review text to determine whether tourists have a positive or negative evaluation of a certain service element. With the development of pre-trained language models, encoder-decoder structure models such as T5, BART, and Pegasus have been widely applied to text generation, information extraction, and structured semantic understanding tasks. By inputting raw review text and generating the target structured result, automatic understanding of review content can be achieved to a certain extent.

[0004] However, existing technologies still have the following shortcomings in the context of understanding tourism safety risks: First, existing aspect-level sentiment analysis datasets and methods are mostly geared towards reviews of restaurants, hotels, goods, or general tourism service quality, lacking a specific semantic structure for "tourism safety risks." Traditional tasks typically only focus on aspects, viewpoints, and sentiment polarity, making it difficult to express key information such as the risk subject, safety category, risk intensity, and justification in tourism safety scenarios.

[0005] Second, existing methods do not provide a detailed enough description of tourism safety risks, failing to cover multiple safety scenarios such as food and drinking water safety, facility and attraction safety, missing signage, personal safety and public security, crowd congestion and stampede risks, ticketing and consumer traps, natural environment and hazardous factors, public health and infectious disease risks, traffic safety, emergency rescue and medical care, and construction and temporary risks. Therefore, the model outputs are difficult to directly serve for scenic area risk management and destination safety supervision.

[0006] Third, existing generative models are prone to problems such as missing fields, disordered field order, non-standard category generation, and mismatch between aspect terms and viewpoint terms during the structured information extraction process. For example, the model may correctly identify the risk subject "path" but generate the wrong risk category; it may also identify the risk description "slippery" but fail to establish a stable association with the corresponding aspect term.

[0007] Fourth, existing methods typically rely on a single input order or a single prompt template for generation, lacking a dynamic selection mechanism for different structured input perspectives. When a single comment contains multiple risk subjects, multiple opinion phrases, or multiple safety categories, the model is easily affected by the input order, leading to unstable generation results.

[0008] Fifth, most existing methods treat structured text generation as a simple sequence-to-sequence generation task, lacking explicit modeling of the dependencies between key elements such as "aspect words - opinion words", "risk subjects - risk descriptions", and "risk categories - rating reasons". This results in inconsistent semantic structure in the generated results, especially in complex comments with multiple risks, multiple categories, and multiple groups, where the extraction accuracy and interpretability are insufficient.

[0009] Therefore, there is an urgent need for a fine-grained structured understanding method for tourism safety risk scenarios, which can automatically identify the subject of tourism safety risks, safety categories, emotional polarity, risk descriptions, risk scores, and reasons for explanations from tourists' online reviews, and improve the structural consistency, field completeness, and semantic accuracy of the generated results through constraint enhancement mechanisms. Summary of the Invention

[0010] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment.

[0011] The objective of this invention can be achieved through the following technical solutions: A three-axis constraint-enhanced generation method for multi-dimensional safety risk assessment of tourist attractions includes the following steps: Obtain the text data of the tourist reviews to be evaluated; The tourist comment text data is converted into structured instructions based on a structured instruction template; The structured instructions are used as input to a pre-trained encoding / decoding model to generate several candidate structured results; Calculate the structural consistency score for each candidate structured result, select the candidate structured result with the highest score as the final output, and obtain the final tourism safety risk plural result; The encoding / decoding model is trained using a total loss function that combines generation loss and dual affine dependency modeling loss.

[0012] Furthermore, the structured instructions include at least a task description, field definitions, category constraints, output format constraints, and original comment text.

[0013] Furthermore, the codec model employs a text-to-text pre-trained language model.

[0014] Furthermore, the construction of the training set for training the encoding / decoding model includes: Collect tourist review text data, perform preprocessing, and obtain a collection of tourist review texts; Each comment text is labeled, and the label is one or more tourism safety risk plural groups; Each comment text is converted into a structured instruction based on a structured instruction template. The structured instruction and its corresponding annotation are used as a training sample to construct a multi-dimensional understanding sample set of safety risks in tourist attractions, which serves as the training set.

[0015] Furthermore, the fields of the tourism safety risk plural group include at least an overall safety score, tourism safety risk subject terms, safety risk categories, sentiment tendencies, risk description phrases, dimensional safety scores or risk levels, and explanatory text.

[0016] Furthermore, several candidate structured results are generated based on different field structure arrangements.

[0017] Furthermore, the structural consistency score is determined based on a combination of multiple factors, including at least field completeness, category validity, polarity validity, score validity, aspect-viewpoint matching degree, reason consistency, and tuple boundary clarity.

[0018] Furthermore, the generation loss is expressed as: in, x Represents structured instructions. Indicates the first t Each target outputs a token. express t The tokens that have already been generated Represents the probability distribution of the generative model. This represents the loss in structured text generation.

[0019] Furthermore, the biaffine dependency modeling loss is expressed as: in, and For any two fields obtained in the encoder's hidden state, [the vector representation] This indicates whether there is a dependency relationship between the two fields. Represents the probability distribution of the generative model. This represents the loss in biaffine dependency modeling.

[0020] Furthermore, the total loss function is expressed as: in, Represents the loss in structured text generation. This represents the loss in biaffine dependency modeling. This represents the weighting coefficient.

[0021] This invention takes online tourist reviews as input and tourism safety risk tuples as output. Through structured instruction semantic alignment, multi-order representation selection based on structural consistency scoring, and triaxial constraints modeled by dual affine dependency relations, it achieves automatic extraction, classification, scoring, and interpretation of tourism safety risk information. Compared with existing technologies, this invention has at least the following improvements and beneficial effects: First, this invention proposes a structured instruction semantic alignment mechanism. By explicitly adding task descriptions, field definitions, category constraints, and output format constraints at the input end, the model can more stably generate results that conform to the preset field structure, reducing problems such as field omissions, disordered order, and non-standard categories.

[0022] Second, this invention proposes a multi-order representation selection mechanism based on structural consistency scoring. By constructing multiple field orders and candidate generation results, and using SMER structural consistency scoring for reordering, the impact of a single input order on the model generation results can be reduced, and the generation stability in multi-risk comment scenarios can be improved.

[0023] Third, this invention proposes a dual affine dependency modeling module, which explicitly models the dependency relationships between fields at the encoding end, enabling the model to more accurately identify the correspondence between fields and reduce mismatches of aspect terms and opinion terms.

[0024] Fourth, this invention proposes a fine-grained plural structure for tourism safety risk scenarios, which expands the aspect words, opinion words and sentiment polarity in traditional aspect-level sentiment analysis to overall score, risk subject, safety category, sentiment polarity, risk description phrase, dimension score and explanation reason, which can more completely express tourism safety risk information.

[0025] Fifth, this invention constructs a tourism safety risk category system, classifying safety risks in tourist reviews into food and drinking water safety, facility and attraction safety, missing signage information, personal safety and public security, crowd congestion and stampede risk, ticketing and guide services and consumer traps, natural environment and risk factors, public health and infectious disease risks, traffic safety, emergency rescue and medical care, construction and temporary risks, etc., thereby improving the adaptability of the model output results to cultural and tourism governance scenarios.

[0026] Sixth, this invention employs a joint optimization of generation loss and dual affine dependency loss, enabling the model to simultaneously possess the ability to generate structured text and model the relationships between key risk elements, thereby improving the accuracy, completeness, and interpretability of tourism safety risk plural extraction.

[0027] Seventh, the structured results generated by this invention can be directly applied to destination risk profiling, scenic area safety hazard identification, tourist complaint analysis, risk level assessment, and smart cultural tourism supervision platforms, providing interpretable data support for tourism safety governance. Attached Figure Description

[0028] Figure 1 This is an overall flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the framework of the method of the present invention; Figure 3 This is a schematic diagram of the dual affine dependency modeling of the present invention; Figure 4 This is a schematic diagram of the candidate generation and structure reordering process in the reasoning stage of this invention. Detailed Implementation

[0029] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0030] Example 1 This embodiment proposes a tri-axis constraint-enhanced generator method (TRACE (Tri-Axis Constraint-Enhanced Generator Framework)) for multi-dimensional tourism scenic area safety risk assessment. This method takes online tourist reviews as input and tourism safety risk tuples as output. Through structured instruction semantic alignment, multi-order representation selection based on structural consistency scoring, and biaffine dependency modeling, it achieves automatic extraction, classification, scoring, and interpretation of tourism safety risk information.

[0031] like Figure 1As shown, the three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment includes the following steps: Step S1: Obtain the text data of the tourist reviews to be evaluated; Step S2: Convert the visitor comment text data into structured instructions based on the structured instruction template; Step S3: Use the structured instructions as input to the pre-trained encoder-decoder model (encoder-decoder model with shared backbone network) to generate several candidate structured results. The encoder-decoder model is trained by a total loss function that combines generation loss and dual affine dependency modeling loss. Step S4: Calculate the structure consistency score for each candidate structured result, select the candidate structured result with the highest score as the final output, and obtain the final tourism safety risk plural result. like Figure 2 As shown, the above method enhances the generation of multi-dimensional safety risk assessment for tourist attractions through three-axis constraints: Axis 1: Structured Instruction Semantic Alignment. This transforms the original comment text into structured instructions, which are then embedded as input to the model. This enables the model to generate results that conform to the predefined field structure more stably, reducing issues such as missing fields, disordered order, and non-standard categories. Axis 2: Score-Driven Multi-Order Representation (SMER) searches for multiple candidate structured results in different structural orders, reducing the impact of a single input order on the model's generated results and improving the generation stability in multi-risk comment scenarios; Axis 3: Biaffine Dependency Modeling. During the training of the encoding and decoding model, a biaffine dependency modeling module is introduced at the encoding end. The biaffine dependency modeling loss is considered to enable the model to more accurately identify the correspondence between fields and reduce mismatches of aspect terms and opinion terms.

[0032] The specific technical features of the above method are explained below.

[0033] 1. Construction of a sample set for multidimensional understanding of safety risks in tourist attractions Using online tourist reviews as raw data, a multi-dimensional sample set for safety risk assessment of tourist attractions was constructed.

[0034] First, tourist reviews are collected from travel review websites, online travel platforms, social media, and travelogues. The original texts are cleaned by removing duplicate reviews, advertising texts, texts without actual evaluation content, and garbled texts, while retaining reviews related to travel safety experiences, resulting in a collection of travel review texts.

[0035] In this embodiment, visitor reviews include, but are not limited to, English reviews, Chinese reviews, multilingual reviews, or mixed Chinese and English reviews.

[0036] Secondly, each comment text is labeled as one or more tourism safety risk tuples. Specifically, the fields of the tourism safety risk tuple include at least the overall safety score (overall_score), the tourism safety risk subject term (aspect_term), the safety risk category, the sentiment polarity (sentiment_polarity), the risk description phrase (opinion_phrase), the dimensional safety score or risk level (aspect_score), and the explanatory text (reason). This embodiment uses a seven-tuple tourism safety risk tuple.

[0037] The overall safety score (overall_score) is a rating scaled at the review level. The overall_score ranges from 1 to 5, where 1 indicates strong negative, 2 indicates moderate negative, 3 indicates neutral or mixed, 4 indicates moderate positive, and 5 indicates strong positive.

[0038] aspect_term is an aspect-level annotation. For example, aspect_term can be "path", "vendors", "crowd", "signs", "bus", "water", "stairs", "construction area", etc.

[0039] In this embodiment, the preset tourism safety risk categories include: 1. Food and Drinking Water Safety; 2. Facilities & Attractions Safety; 3. Signage & Information Gaps: Missing signage and information. 4. Personal Security & Crime; 5. Crowd Density & Stampede: Risk of stampedes due to overcrowding; 6. Ticketing, Guides & Consumer Traps: Ticketing, Guides, and Consumer Traps; 7. Natural Environment & Hazards; 8. Public Health & Infectious Disease; Public health and infectious disease risks; 9. Transportation Safety; 10. Emergency, Rescue & Medical; 11. Construction & Temporary Risks.

[0040] Each aspect_term is mapped to one of 11 predefined security categories. For example, “slippery path” is mapped to Natural Environment & Hazards; “overcharging vendors” is mapped to Ticketing, Guides & Consumer Traps; “crowded entrance” is mapped to Crowd Density & Stampede; and “unclear warning signs” is mapped to Signage & Information Gaps.

[0041] The following parameters are used to annotate the risk assessment: sentiment_polarity, opinion_phrase, aspect_score, and reason. Sentiment_polarity can be positive, neutral, or negative; opinion_phrase is a phrase describing the nature of the risk; aspect_score ranges from 1 to 5; and reason is the explanatory text supporting the risk assessment.

[0042] Through the above steps, a sample set of seven-tuples representing tourism safety risks is constructed. One review can correspond to one or more seven-tuples.

[0043] Each comment text is converted into a structured instruction based on a structured instruction template. The structured instruction and its corresponding annotation are used as a training sample to construct a multi-dimensional understanding sample set of safety risks in tourist attractions, which serves as the training set.

[0044] For example, enter the comment as: “The path was uneven and slippery, and the vendors near the exit kept overcharging tourists.” The corresponding output is: [ { overall_score: 1.0, aspect_term: "path", category: "Natural Environment & Hazards", sentiment_polarity: "negative", opinion_phrase: "uneven and slippery", aspect_score: 1.0, reason: "the path was uneven and slippery" }, { overall_score: 1.0, aspect_term: "vendors", category: "Ticketing, Guides & Consumer Traps", sentiment_polarity: "negative", opinion_phrase: "kept overcharging tourists", aspect_score: 1.0, reason: "vendors near the exit kept overcharging tourists" } ] In other implementations, the number of tourism safety risk categories is not limited to the above 11 categories. They can be expanded or merged according to the destination management needs, such as adding categories like extreme weather risk, nighttime tourism risk, water-related project risk, and outdoor sports risk.

[0045] In other implementations, the tourism safety risk tuple can also adopt an octet, a nonad, or other structured risk expression forms, such as adding fields such as location, time, risk_level, and suggestion.

[0046] 2. Structured instruction semantic alignment To mitigate the risks of field confusion and semantic drift during model generation, this embodiment introduces a structured instruction semantic alignment mechanism at the input end. This mechanism breaks down the tourism safety risk understanding task into field-level subtasks, including overall score identification, risk subject extraction, safety category determination, sentiment polarity identification, risk description phrase extraction, dimensional score determination, and explanation reason generation. By explicitly defining the meaning, order, and category range of fields in the instruction template, the model's encoded representation simultaneously incorporates the semantics of the original comment and the target structural constraints.

[0047] Regarding the original comment: "The stairs were too steep and there were no warning signs." The following structured instructions are constructed using a structured instruction template as input. These structured instructions include at least a task description, field definitions, category constraints, output format constraints, and the original comment text. For example: "Extract tourism safety risk tuples from the following review. Each tuple must include overall_score, aspect_term, category, sentiment_polarity, opinion_phrase, aspect_score and reason. The category must be selected from Food & Drinking Water Safety, Facilities & Attractions Safety, Signage & Information Gaps, Personal Security & Crime, Crowd Density & Stampede, Ticketing, Guides & Consumer Traps, Natural Environment & Hazards, Public Health & Infectious Disease, Transportation Safety, Emergency, Rescue & Medical, Construction & Temporary Risks. Review: The stairs were too steep and there were no warning signs." The model target output is: { overall_score: 1.0, aspect_term: "stairs", category: "Facilities & Attractions Safety", sentiment_polarity: "negative", opinion_phrase: "too steep", aspect_score: 1.0, reason: "the stairs were too steep" }, { ​overall_score: 1.0, aspect_term: "warning signs", category: "Signage & Information Gaps", sentiment_polarity: "negative", opinion_phrase: "no warning signs", aspect_score: 1.0, reason: "there were no warning signs" } ] By explicitly qualifying fields and categories in the instructions, the model is able to learn the mapping from natural language reviews to structured seven-tuples of travel safety risks, thus achieving explicit alignment from semantics to the field level.

[0048] 3. Encoding / Decoding Model This embodiment uses a shared encoder-decoder model to generate candidate structured results.

[0049] The structured instructions are input into the pre-trained encoder-decoder model to obtain the hidden state at the encoder end, and the decoder generates the tourism safety risk seven-tuple result.

[0050] In this embodiment, the encoder-decoder model can employ T5, BART, Pegasus, or other pre-trained language models with text-to-text generation capabilities. During model training, structured instructions are used as input, and manually annotated seven-tuple sequences of tourism safety risks are used as the target output. The generation loss is optimized through maximum likelihood estimation.

[0051] Specifically, the generation loss is expressed as: in, x This represents structured instructions (i.e., instructional input text). Indicates the first t Each target outputs a token. express t The token that was generated earlier.

[0052] To enhance the model's ability to identify structural dependencies between aspect_term and opinion_phrase, this embodiment introduces a dual affine dependency modeling module at the encoding end, such as... Figure 3 As shown.

[0053] First, aspect term representations are obtained from the encoder's hidden state based on the positions of aspect_term (AT) and opinion_phrase (OT) in the training samples. and opinion words Then, the dependency scores between aspect terms and opinion terms are calculated using a biaffine scoring function: in, The vector representation of aspect_term. The vector representation of opinion_phrase W This represents the biaffine weight matrix. U Represents the parameters of the linear transformation. b This indicates the bias term.

[0054] The above formula scores the match / dependency between the aspect term and the opinion phrase. Its purpose is to assign a dependency score to each candidate AT-OT combination; a higher score indicates that the model more strongly believes the opinion phrase describes the aspect term. During training, this score, along with manually labeled correct pairings, is used to calculate the biaffine dependency loss, forcing the model to learn correct binding relationships such as "path to uneven and slippery" and "vendors to overcharging," thereby reducing mismatches between aspect and opinion terms in multi-risk comments. It can also be used as one of the criteria for structural consistency during inference or reordering.

[0055] The above dependency score This score represents the dependency relationship between the aspect term and the opinion phrase, calculated by the model using a biaffine function. It indicates the strength of the model's assessment of the match between the two. True dependency labels are constructed based on manually labeled aspect term-opinion phrase pairs. This is used to indicate whether a correspondence actually exists between aspect_term and opinion_phrase. Typically... =1 indicates that a dependency relationship exists. =0 indicates that there is no dependency relationship. The model is calculated first. Then, use sigmoid or softmax to... Convert to predicted probabilities, and then use these predicted probabilities and human labels. Calculate cross-entropy loss That is, using cross-entropy loss to train the dual affine dependency module: in, This indicates whether there is a dependency relationship between aspect_term and opinion_phrase.

[0056] In the above cross-entropy loss function, Indicates a true dependency label. Indicates by The predicted probabilities are obtained after sigmoid or softmax transformation, therefore this loss directly uses the true labels. And indirectly use double affine scoring by predicting probabilities. .

[0057] Through this module, the model can explicitly learn the correspondence between risk subjects and risk descriptions, reducing the probability of mismatch between aspect terms and opinion terms in multi-risk scenarios.

[0058] For example, regarding comments: “The wooden bridge was shaky, and the emergency phone did not work.” The manually labeled results include two dependencies: "wooden bridge" corresponds to "shaky"; "emergency phone" corresponds to "did not work".

[0059] The model extracts representation vectors for “wooden bridge”, “emergency phone”, “shaky”, and “didnot work” from the encoder’s hidden state and calculates the biaffine dependency score between each aspect term and each opinion phrase.

[0060] Correctly depend on the tags "wooden bridge-shaky" and "emergency phone-did not work". The error code is 1; the labels for the incorrect combination "wooden bridge - did not work" and "emergency phone - shaky" are incorrect. It is 0.

[0061] The model will calculate these combinations separately. Ideally, the correct combination The probability should be high, and a higher probability is obtained after applying the sigmoid function; incorrect combinations. The probability should be low, resulting in a lower probability after passing through the sigmoid function. During training, the cross-entropy loss is adjusted based on the predicted probability and the manually assigned label. The model is penalized for any discrepancies, which helps it gradually learn to correctly match the risk subject and the risk description.

[0062] The structured generation loss and the dual affine dependency loss are jointly optimized, and the total loss function is: in, Represents the loss in structured text generation. This represents the loss in biaffine dependency modeling. This represents the weighting coefficient.

[0063] Through joint training, the model learns both the ability to generate text into seven-tuples and the ability to understand the structural constraints between risk subjects and risk descriptions.

[0064] This embodiment uses T5-base as the encoder-decoder backbone model. Alternatively, T5-large, BART-base, BART-large, Pegasus-xsum, or Pegasus-large can also be used as the backbone model. The training steps are as follows: First, each comment in the training set is converted into a structured instruction input; Second, the manually annotated seven-tuple sequence is used as the target output text; Third, the instruction input is sent to the encoder to obtain the hidden state of the encoder end; Fourth, the decoder generates the output text according to the target seven-tuple format; Fifth, calculate the generation loss. ; Sixth, extract vector representations of aspect_term and opinion_phrase from the encoder's hidden state; Seventh, calculate the dependency score between aspect_term and opinion_phrase using the dual affine dependency module; Eighth, calculate the biaffine dependency loss based on the manually annotated aspect_term-opinion_phrase. ; Ninth, according to Calculate the total loss and update the model parameters.

[0065] In one specific implementation, The value can be set to 0.1, 0.3, 0.5, or 1.0, and the optimal value should be selected based on the validation set results. The number of training rounds can be set to 10 to 30 rounds, the batch size can be set to 4, 8, or 16, and the learning rate can be set to 1e-5 to 5e-5.

[0066] During training, the model learns the mapping relationship from the semantic space of the comment text to the seven-tuple structure space, making the generated results more consistent with the preset field structure.

[0067] In other implementations, the backbone model can be replaced with other encoder-decoder models or large language models, such as mT5, FLAN-T5, BART-large, Pegasus-large, Qwen, LLaMA, or other models with text generation capabilities.

[0068] In other implementations, the dual affine dependency modeling module can also be extended to model structural relationships between aspect_term and category, opinion_phrase and reason, and category and aspect_score.

[0069] 4. Selection of multiple order representations To address the issue of unstable generation order when multiple risk subjects, opinion phrases, and safety categories exist in the same comment, this embodiment employs a Score-Driven Multi-Order Representation (SMER) mechanism based on structural consistency scoring.

[0070] First, construct multiple candidate input representations or candidate output sequences based on different structural arrangements, for example: The first order is: overall_score→aspect_term→category→sentiment_polarity→opinion_phrase→aspect_score→reason; The second order is: aspect_term→opinion_phrase→category→sentiment_polarity→aspect_score→reason→overall_score; The third order is: category → aspect_term → opinion_phrase → sentiment_polarity → aspect_score → reason → overall_score.

[0071] The model then generates multiple candidate structured results based on different orders. For each candidate structured result, its Structure Consistency Score (SMER) is calculated. (Reference) Figure 4 As shown, this rating takes into account the following factors: 1. Field completeness, i.e., whether the candidate results contain the seven required fields; 2. Category validity, i.e., whether the category belongs to one of the 11 predefined tourism safety risk categories; 3. Polarity legitimacy, i.e., whether sentiment_polarity is positive, neutral, or negative; 4. Scoring validity, i.e., whether overall_score and aspect_score are within the scoring range of 1 to 5; 5. Aspect-view matching degree, that is, whether aspect_term and opinion_phrase correspond semantically; 6. Consistency of reasoning, i.e., whether the reason can support the corresponding risk category and score; 7. The clarity of tuple boundaries, i.e. whether there is crosstalk between multiple risk 7-tuples.

[0072] Finally, the candidate result with the highest SMER structural consistency score is selected as the final output.

[0073] For example, for entering comments: “The shuttle bus was overcrowded and the driver drove too fast on the mountain road.” The model generates K candidate results using Beamsearch. For example, K is set to 5.

[0074] Candidate result 1 identified "shuttle bus" and "driver", but missed the aspect_score field; Candidate result 2 identified "shuttle bus" and "driver", but incorrectly generated the category as Food & Drinking Water Safety; Candidate result 3 identified “shuttle bus” and “driver”, and correctly generated the Transportation Safety category, negative polarity, risk score of 1.0 and corresponding reason.

[0075] In this embodiment, the SMER structural consistency scores of the three candidate results are calculated respectively. Candidate result 3 outperforms candidate result 1 and candidate result 2 in terms of field completeness, category validity, score validity, aspect-viewpoint matching degree, and reason consistency, and is therefore selected as the final output.

[0076] The final output is: [ { overall_score: 1.0, aspect_term: "shuttle bus", category: "Transportation Safety", sentiment_polarity: "negative", opinion_phrase: "overcrowded", aspect_score: 1.0, reason: "the shuttle bus was overcrowded" }, { overall_score: 1.0, aspect_term: "driver", category: "Transportation Safety", sentiment_polarity: "negative", opinion_phrase: "drove too fast", aspect_score: 1.0, reason: "the driver drove too fast on the mountain road" } ] By using SMER reordering, this invention can select the result with the most complete structure and the most consistent semantics from multiple candidate generated results.

[0077] The SMER structural consistency score can be adjusted in weight according to actual application needs. For example, in regulatory scenarios, the weight of category legality and risk score can be increased, and in complaint analysis scenarios, the weight of reason consistency and opinion_phrase accuracy can be increased.

[0078] refer to Figure 2 As shown, during the inference phase, the text of the tourist review to be identified is input into the structured instruction template to obtain the structured instruction; the model generates K candidate structured results through beamsearch; then, the SMER structure consistency score is calculated for each candidate structured result; finally, the result with the highest score is selected as the final output.

[0079] Furthermore, the final output can be used for destination risk identification, scenic area safety hazard discovery, tourist complaint attribution, smart cultural tourism governance, tourism safety early warning, and scenic area operation and maintenance optimization.

[0080] To verify the effectiveness of the above method, this embodiment conducts experiments on a multidimensional tourist attraction safety risk assessment dataset. The dataset includes approximately 25,634 tourist reviews and approximately 57,707 aspect annotations. The task objective is to generate structured 7-tuples containing overall_score, aspect_term, category, sentiment_polarity, opinion_phrase, aspect_score, and reason from the review text.

[0081] This embodiment selects several encoder-decoder pre-trained language models as comparison methods, including T5, T5-large, BART, BART-large, Pegasus-xsum, and Pegasus-large. Experiments compare the performance of ordinary generative methods with the TRACE triaxial constraint-enhanced generative method of this invention on the tourism safety seven-tuple extraction task.

[0082] Evaluation metrics include field-level accuracy, category recognition accuracy, sentiment polarity recognition accuracy, aspect word extraction F1, opinion phrase extraction F1, seven-tuple exact matching F1, structural integrity rate, and illegal format rate. Experimental results are shown in Table 1, with the best results highlighted in bold.

[0083] Table 1 In Table 1, "Method" represents the comparison method or model; "7-tuple" represents the F1 score of the complete seven-tuple prediction, including overall_score, aspect_term, category, sentiment_polarity, opinion_phrase, aspect_score, and reason; "6-tuple" represents the F1 score of the six-tuple structure prediction after removing one of the fields, usually used to observe the extraction effect of the main structure field; "ACOSQE" represents the joint extraction F1 score of combined structures such as aspect words, categories, opinion phrases, sentiment polarity, rating, and explanation; "ACSTE" represents the F1 score of aspect-category-sentiment triple extraction; "AOSTE" represents the F1 score of aspect-opinion-sentiment triple extraction; "ASPE" represents the F1 score of aspect-sentiment pair extraction; and "CSPE" represents the category-sentiment... Paired sampling F1; AOPE represents aspect-opinion paired sampling F1; Asp_MAE represents the mean absolute error of the aspect_score, lower is better; Overall_MAE represents the mean absolute error of the overall_score, lower is better; Reason_BLEU represents the BLEU score between the generated explanation text reason and the reference explanation, higher is better. Except for MAE, for F1 and BLEU, higher is better.

[0084] Experimental results show that, compared with the ordinary encoder-decoder generation method, this invention improves the structural integrity and semantic accuracy of the generated tourism safety 7-tuples through structured instruction semantic alignment, SMER structure reordering, and dual affine dependency modeling. In particular, regarding the tuple-level exact matching metric, this invention reduces field omissions, category errors, and aspect-viewpoint mismatches, making the generated results more suitable for tourism safety risk identification and smart cultural tourism governance applications.

[0085] The aforementioned three-axis constraint-enhanced generation method for multidimensional tourism scenic area safety risk assessment can automatically extract tourism safety risk pluripotents from online tourist reviews, including overall rating, risk subject, safety category, sentiment polarity, risk description phrases, dimensional ratings, and explanatory reasons. This method achieves accurate, stable, and interpretable extraction of tourism safety risk information through structured instruction semantic alignment, multi-order representation and SMER structure reordering, and dual affine dependency modeling. Compared with existing ordinary generative information extraction methods, this invention can effectively reduce field missing, category errors, and aspect-viewpoint mismatch problems in the structured generation process, and can be widely applied to scenarios such as destination risk governance, scenic area operation and maintenance optimization, tourist complaint analysis, tourism safety early warning, and smart cultural tourism supervision.

[0086] If the above methods are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0087] Example 2 This embodiment provides an application of the three-axis constraint enhancement generation method for multi-dimensional tourist attraction safety risk assessment as described in Embodiment 1 in a smart cultural tourism governance platform.

[0088] After receiving online comments from tourists, the platform first uses the method of this invention to automatically extract a seven-tuple of tourism safety risks. Then, the risks are categorized according to the category field, sorted by aspect_score and overall_score to determine their severity, and an interpretable risk summary is generated based on the reason field.

[0089] For example, when a large number of reviews mention risky entities such as "crowded entrance," "no warning signs," "slipperystairs," and "overcharging vendors," the platform can automatically identify high risks in the scenic area regarding overcrowding, lack of signage, facility safety, and consumer traps, and generate a risk analysis report for management departments.

[0090] For scenic area operators, the output of this embodiment can be used to discover high-frequency safety hazards, identify key risk areas, track the reasons for tourist complaints, assist in the allocation of emergency resources, and optimize scenic area service processes.

[0091] For cultural and tourism regulatory departments, the output results of this invention can be used for destination safety risk monitoring, tourism safety incident early warning, scenic spot quality assessment, and regional cultural and tourism governance decision-making.

[0092] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A three-axis constraint-enhanced generation method for multi-dimensional safety risk assessment of tourist attractions, characterized in that, Includes the following steps: Obtain the text data of the tourist reviews to be evaluated; The tourist comment text data is converted into structured instructions based on a structured instruction template; The structured instructions are used as input to a pre-trained encoding / decoding model to generate several candidate structured results; Calculate the structural consistency score for each candidate structured result, select the candidate structured result with the highest score as the final output, and obtain the final tourism safety risk plural result; The encoding / decoding model is trained using a total loss function that combines generation loss and dual affine dependency modeling loss.

2. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The structured instructions include at least a task description, field definitions, category constraints, output format constraints, and original comment text.

3. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The codec model uses a pre-trained text-to-text language model.

4. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The construction of the training set for training the encoding / decoding model includes: Collect tourist review text data, perform preprocessing, and obtain a collection of tourist review texts; Each comment text is labeled, and the label is one or more tourism safety risk plural groups; Each comment text is converted into a structured instruction based on a structured instruction template. The structured instruction and its corresponding annotation are used as a training sample to construct a multi-dimensional understanding sample set of safety risks in tourist attractions, which serves as the training set.

5. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 4, characterized in that, The fields of the tourism safety risk plural group include at least the overall safety score, tourism safety risk subject terms, safety risk category, sentiment tendency, risk description phrase, dimensional safety score or risk level, and explanatory text.

6. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The candidate structured results are generated based on different field structure arrangements.

7. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 5, characterized in that, The structural consistency score is determined based on a combination of factors, including at least field completeness, category validity, polarity validity, score validity, aspect-viewpoint matching, reasoning consistency, and tuple boundary clarity.

8. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The generation loss is expressed as: in, x Represents structured instructions. Indicates the first t Each target outputs a token. express t The tokens that have already been generated Represents the probability distribution of the generative model. This represents the loss in structured text generation.

9. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 4, characterized in that, The loss for biaffine dependency modeling is expressed as: in, and For any two fields obtained in the encoder's hidden state, [the vector representation] This indicates whether there is a dependency relationship between the two fields. This represents the probability distribution predicted by the dependency relationship. This represents the loss in biaffine dependency modeling.

10. The three-axis constraint-enhanced generation method for multi-dimensional tourist attraction safety risk assessment according to claim 1, characterized in that, The total loss function is expressed as: in, Represents the loss in structured text generation. This represents the loss in biaffine dependency modeling. This represents the weighting coefficient.