A knowledge graph construction method and system in a cultural tourism scene
Patent Information
- Application Number
- CN202611191504.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-08-07
AI Technical Summary
[0003]然而,现有的文旅知识图谱构建方法在处理上述多源用户生成文本时仍面临显著瓶颈
本申请通过构建无向加权共现图,其有益效果在于量化了候选实体在语料中的局部共现拓扑结构,能够有效过滤整篇文档范围内因话题杂糅而产生的虚假共现,使得图中边的权重准确反映候选实体对在语义表达层面的真实关联强度,为后续全局结构重要性评估提供了可靠的拓扑基础;得到各候选实体的语义核心值,其有益效果在于通过词频分布特征有效惩罚并降权了高频但无意义的泛化词语,同时突发检测从时间维度捕捉候选实体随文旅活动时效产生的热度波动,精准捕获了与真实文旅事件强相关的实体;二者结合得到的语义核心值,实现了对候选实体文旅语义承载强度与重要性评估的全面刻画;确定任意两个候选实体的语义关联度,其有益效果在于克服了单一局部共现频率易受随机噪声干扰的缺陷,结合候选实体在全图的全局枢纽地位进行综合考量,不仅滤除了偶然共现噪声,还精准挖掘出具有深层地域文化传递关系的高价值连边,使得语义关联度既受局部语义绑定驱动,又受全局结构地位调制,只有“局部共现显著且全局地位突出”的两个实体才能获得较高的关联度,显著提升了关系边置信度的判断准确性;自适应调整各候选实体的动态阈值,其有益效果在于摒弃了传统静态全局阈值“一刀切”的弊端,通过语义关联度自适应下调与核心实体强绑定的候选实体的筛选门槛,有效保护了自身曝光度低但文化价值高的实体免遭误删,同时,通过在语义关联度满足预设条件的核心实体对之间建立关系边,确保了图谱中节点的高置信度和关系边的高可靠性,显著提高了知识图谱的整体构建质量与知识承载能力,使得最终生成的文旅知识图谱可有效支撑智能问答、文化主题推理及个性化文旅推荐等下游服务。
Smart Images

Figure CN122693798B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge graph construction technology, specifically to a method and system for constructing a knowledge graph in a cultural tourism scenario. Background Technology
[0002] With the digital transformation of the cultural and tourism industry, massive amounts of diverse and heterogeneous cultural and tourism data, such as travelogues, guides, and reviews, are constantly emerging. This textual data contains rich information about cultural and tourism entities and their inherent semantic relationships. By constructing knowledge graphs within cultural and tourism scenarios, this unstructured textual knowledge can be transformed into a structured semantic network, thereby providing high-quality knowledge support for downstream applications such as intelligent question answering, cultural theme reasoning, and personalized cultural and tourism recommendations.
[0003] However, existing methods for constructing cultural and tourism knowledge graphs still face significant bottlenecks when dealing with multi-source user-generated text. First, multi-source texts generally contain a large number of colloquial and semantically generalized words. Existing methods often rely on conventional word frequency statistics for entity screening, which makes it difficult to accurately distinguish and remove high-frequency generalized noise. Furthermore, they often ignore the sudden timeliness characteristics of entities fluctuating over time in cultural and tourism scenarios, resulting in extracted entities lacking high-value directional referentiality. Second, when establishing relationships between entities, existing technologies usually rely only on local text co-occurrence frequencies, ignoring the global centrality of entities in the overall network topology. This makes it difficult to effectively distinguish between genuine semantic relationships and random co-occurrence interference, leading to a large number of invalid edges being introduced into the knowledge graph. This results in a surge of noise information in the graph, sparse high-confidence semantic relationships, and seriously affects the construction quality of the graph and its subsequent application effects. Summary of the Invention
[0004] To address the aforementioned technical challenges, a method and system for constructing knowledge graphs in cultural and tourism scenarios are provided.
[0005] The solution to the technical problem in this application is to provide a method and system for constructing knowledge graphs in the cultural tourism scenario, including the following steps: Firstly, embodiments of this application provide a method for constructing a knowledge graph in a cultural and tourism scenario, the method comprising the following steps: Collect heterogeneous cultural and tourism texts from multiple sources and extract candidate entities related to cultural and tourism from them; count the co-occurrence relationships of different candidate entities in cultural and tourism texts and construct an undirected weighted co-occurrence graph; The distribution characteristics of the frequency of each candidate entity in the cultural and tourism text over time are evaluated, the timeliness popularity of each candidate entity is calculated, and the semantic core value of each candidate entity is obtained by combining the word frequency distribution characteristics of each candidate entity in the cultural and tourism text. The local co-occurrence dependency relationship between any two candidate entities in the cultural and tourism text and the global structural importance of the candidate entities in the undirected weighted co-occurrence graph are analyzed to determine the semantic correlation between any two candidate entities. Based on this, the dynamic threshold of each candidate entity is adaptively adjusted. The semantic core value and the dynamic threshold are compared to select core entities from the candidate entities. Relationship edges are established between two core entities whose semantic correlation meets the preset conditions, thereby generating a knowledge graph in the cultural and tourism scenario.
[0006] Preferably, the construction process of the undirected weighted co-occurrence graph is as follows: all cultural and tourism texts are segmented into sentences; for any two candidate entities, the number of sentences in all cultural and tourism texts that simultaneously contain these two candidate entities is counted, which is taken as the co-occurrence frequency of the two candidate entities; each candidate entity is abstracted into a node, and an undirected edge is established between the nodes corresponding to the two candidate entities whose co-occurrence frequency is not 0, and the co-occurrence frequency of the two candidate entities is taken as the edge weight of the edge, thereby constructing an undirected weighted co-occurrence graph.
[0007] Preferably, the calculation of the timeliness popularity of each candidate entity includes: The time range encompassed by the publication timestamps of all cultural and tourism texts is divided into consecutive time periods. For each candidate entity, the frequency of its occurrence in all cultural and tourism texts within each time period is counted as the target event count for that time period. The total frequency of all candidate entities in all cultural and tourism texts within that time period is counted as the total event count for that time period. The target event count and the total event count are input into the burst detection algorithm, which outputs the optimal state sequence of the candidate entity over the entire time range. Calculate the probability of occurrence of each state in the optimal state sequence of each candidate entity; use the probability of occurrence of each state as the weight, and perform a weighted sum of the element values corresponding to all states in the optimal state sequence to obtain the timeliness popularity of the candidate entity.
[0008] Preferably, obtaining the semantic core value of each candidate entity includes: calculating the TF-IDF value of each candidate entity based on all cultural and tourism texts; the semantic core value of each candidate entity is positively correlated with the timeliness popularity and the TF-IDF value.
[0009] Preferably, determining the semantic correlation between any two candidate entities includes: For any two candidate entities, the co-occurrence frequency and the occurrence frequency of each candidate entity are used to calculate the PMI value of the two candidate entities using the point mutual information algorithm; The PageRank algorithm is used to analyze the global centrality features of any two candidate entities in an undirected weighted co-occurrence graph and to calculate the collaborative importance of any two candidate entities. The semantic relevance, collaborative importance, and PMI value of any two candidate entities are all positively correlated.
[0010] Preferably, the calculation of the collaborative importance of any two candidate entities includes: based on the undirected weighted co-occurrence graph and the semantic core values of all nodes corresponding to candidate entities, using the PageRank algorithm to calculate the PR value of each node, and using it as the global centrality score of the corresponding candidate entity; calculating the product of the global centrality scores of any two candidate entities as the collaborative importance.
[0011] Preferably, adjusting the dynamic threshold of each candidate entity includes: In an undirected weighted co-occurrence graph, for each node's candidate entity, all candidate entities directly connected to it are selected and defined as neighboring entities. The maximum value among the semantic association degrees between each candidate entity and all its neighboring entities is selected as the local maximum value. No. Dynamic threshold for each candidate entity The calculation process is as follows: In the formula, The preset initial threshold, The preset adjustment range, For the first Local maximum values of candidate entities The maximum semantic association between any two candidate entities.
[0012] Preferably, the step of selecting core entities from candidate entities includes: if the semantic core value of each candidate entity is greater than or equal to the corresponding dynamic threshold, then the candidate entity is retained and defined as a core entity; otherwise, the candidate entity is removed.
[0013] Preferably, the step of establishing a relational edge between two core entities whose semantic relevance meets a preset condition to generate a knowledge graph in the cultural and tourism scenario includes: traversing all core entities; if the semantic relevance of any two core entities is greater than or equal to a preset value, then these two core entities are taken as nodes in the knowledge graph, and a relational edge is established between the two core entities. At the same time, the semantic relevance is taken as the weight of the relational edge, thereby generating a knowledge graph in the cultural and tourism scenario.
[0014] Secondly, embodiments of this application also provide a knowledge graph construction system for cultural and tourism scenarios, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described knowledge graph construction methods for cultural and tourism scenarios.
[0015] This application has at least the following beneficial effects: This application constructs an undirected weighted co-occurrence graph, which quantifies the local co-occurrence topology of candidate entities in the corpus. This effectively filters out false co-occurrences caused by topic mixing throughout the entire document, ensuring that the weights of the edges in the graph accurately reflect the true semantic relevance of candidate entities, providing a reliable topological foundation for subsequent global structural importance assessment. It also obtains semantic core values for each candidate entity, effectively penalizing and downweighting high-frequency but meaningless generalized words through word frequency distribution features. Simultaneously, burst detection captures the fluctuations in popularity of candidate entities as cultural and tourism activities become more timely, accurately identifying entities strongly related to real cultural and tourism events. The combined semantic core values provide a comprehensive characterization of the semantic carrying strength and importance assessment of candidate entities in the cultural and tourism context. Finally, it determines the semantic relevance between any two candidate entities, overcoming the vulnerability of single local co-occurrence frequencies to random noise interference and comprehensively considering the global pivotal position of the candidate entity within the entire graph. Not only does it filter out accidental co-occurrence noise, but it also accurately uncovers high-value connections with deep regional cultural transmission relationships. This ensures that semantic relevance is driven by both local semantic binding and global structural status modulation. Only two entities with "significant local co-occurrence and prominent global status" can achieve high relevance, significantly improving the accuracy of relation edge confidence judgment. The adaptive adjustment of the dynamic threshold of each candidate entity has the advantage of abandoning the drawback of the traditional static global threshold "one-size-fits-all". By adaptively lowering the screening threshold of candidate entities strongly bound to core entities through semantic relevance, it effectively protects entities with low exposure but high cultural value from being mistakenly deleted. At the same time, by establishing relation edges between core entity pairs that meet the preset conditions for semantic relevance, it ensures high confidence of nodes in the graph and high reliability of relation edges, significantly improving the overall construction quality and knowledge carrying capacity of the knowledge graph. This enables the final cultural tourism knowledge graph to effectively support downstream services such as intelligent question answering, cultural theme reasoning, and personalized cultural tourism recommendations. Attached Figure Description
[0016] The following section, in conjunction with the accompanying drawings, provides a more detailed explanation of a knowledge graph construction method for a cultural and tourism scenario based on this application.
[0017] Figure 1 A flowchart illustrating the steps of a knowledge graph construction method in a cultural tourism scenario, as provided in this application embodiment; Figure 2 A flowchart illustrating the steps of the method for obtaining semantic core values provided in this application embodiment. Detailed Implementation
[0018] The following, in conjunction with the accompanying drawings and embodiments, provides a more detailed description of the knowledge graph construction method and system for cultural and tourism scenarios proposed in this application.
[0019] Please see Figure 1 The diagram illustrates a flowchart of a knowledge graph construction method in a cultural tourism scenario according to an embodiment of this application. The method includes the following steps: Step 1: Collect multi-source heterogeneous cultural and tourism texts and extract candidate entities related to cultural and tourism from them; count the co-occurrence relationships of different candidate entities in cultural and tourism texts and construct an undirected weighted co-occurrence graph; Step 2: Evaluate the distribution characteristics of the frequency of each candidate entity in the cultural and tourism text over time, calculate the timeliness popularity of each candidate entity, and combine the word frequency distribution characteristics of each candidate entity in the cultural and tourism text to obtain the semantic core value of each candidate entity. Step 3: Analyze the local co-occurrence dependency relationship between any two candidate entities in the cultural and tourism text and the global structural importance of the candidate entities in the undirected weighted co-occurrence graph to determine the semantic relevance of any two candidate entities; Step 4: Adaptively adjust the dynamic threshold of each candidate entity based on semantic relevance, compare the semantic core value and the dynamic threshold, select core entities from the candidate entities, and establish relationship edges between two core entities whose semantic relevance meets the preset conditions, thereby generating a knowledge graph in the cultural tourism scenario.
[0020] In step 1, the specific process is as follows: Step 101: Collect multi-source heterogeneous cultural and tourism texts and extract candidate entities related to cultural and tourism from them; The multi-source heterogeneous cultural and tourism texts include travelogues, user reviews, travel guides, and scenic spot introductions. Regular expressions are used to clean the multi-source heterogeneous cultural and tourism texts, remove invalid characters and web page tags, process sentences according to punctuation marks, and extract the publication timestamp of each cultural and tourism text. A cultural and tourism dictionary is pre-built. Based on this dictionary, all cultural and tourism texts are traversed, and string matching is performed between them and the entities in the dictionary. The Conditional Random Field (CRF) model is used to perform named entity recognition on the cultural and tourism texts to extract cultural and tourism-related entities. After summarizing and deduplicating, these entities are used as candidate entities. String matching and the CRF model are well-known technologies and will not be described in detail here.
[0021] The process of constructing the cultural tourism dictionary is as follows: collect publicly released information sources such as the list of scenic spots, the list of national intangible cultural heritage, the list of national key cultural relics protection units, POI data from tourism websites, and the titles of entries related to culture and tourism in Baidu Encyclopedia. Extract all entities and remove duplicate information to construct a cultural tourism dictionary that includes categories such as scenic spots, intangible cultural heritage, festivals, food, and people.
[0022] Step 102: Segment all cultural and tourism texts. For any two candidate entities, count the number of sentences in all cultural and tourism texts that simultaneously contain both candidate entities, and use this count as the co-occurrence frequency of the two candidate entities. Abstract each candidate entity into a node, and establish an undirected edge between the nodes corresponding to two candidate entities whose co-occurrence frequency is not 0. Use the co-occurrence frequency of the two candidate entities as the edge weight of the edge, thereby constructing an undirected weighted co-occurrence graph. In cultural and tourism scenarios, user-generated comments, travelogues, and other texts often contain a large number of colloquial expressions. These expressions are semantically ambiguous, lack clear cultural and tourism referentiality, and cannot be specifically linked to scenic spots, intangible cultural heritage, or food entities. Directly using them as candidate entities in knowledge graph construction will introduce a large amount of semantic noise, reducing the accuracy and practical value of the graph. Therefore, step 2 calculates the semantic core value. The flowchart of the semantic core value acquisition method provided in this application embodiment is as follows: Figure 2 As shown, it specifically includes: Step 201: Calculate the TF-IDF value of each candidate entity based on all cultural and tourism texts; Among them, the TF-IDF algorithm is used to calculate the TF-IDF value to quantify the word frequency distribution characteristics of candidate entities. The TF-IDF algorithm is a well-known technology and will not be elaborated here. The larger the TF-IDF value, the more concentrated the document distribution of the candidate entity in the global cultural and tourism corpus, the stronger the semantic specificity, and the more likely it is to point to cultural and tourism proper nouns with clear referentiality.
[0023] In the context of cultural and tourism activities, the importance of candidate entities is not only reflected in their static statistical features in the global corpus, but also in their semantic popularity changes over specific time periods due to factors such as holidays, flowering seasons, flood seasons, or large-scale cultural and tourism events. TF-IDF alone cannot capture the dynamic semantic changes of candidate entities over time. Therefore, a burst detection algorithm is introduced to model the frequency fluctuations of each candidate entity over time, quantifying its temporal association strength with cultural and tourism activities.
[0024] Step 202: Divide the time range contained in the publication timestamps of all cultural and tourism texts into consecutive time periods. For each candidate entity, count its frequency of occurrence in all cultural and tourism texts within each time period, and use it as the target event number for that time period. Count the total frequency of occurrence of all candidate entities in all cultural and tourism texts within that time period, and use it as the total event number for that time period. Input the target event number and the total event number into the burst detection algorithm, and output the optimal state sequence of the candidate entity over the entire time range. Step 203: Calculate the probability of occurrence of each state in the optimal state sequence of each candidate entity; use the probability of occurrence of each state as the weight, and perform a weighted summation of the element values corresponding to all states in the optimal state sequence to obtain the timeliness popularity of the candidate entity. The burst detection algorithm is a well-known technology and will not be described in detail here. In this algorithm, the multiplication distance between states is set to 2 to control the transition cost between different activity levels. The upward transition difficulty parameter is set to 1.5, representing the additional penalty cost to overcome when jumping from a low-activity state to a higher-activity state. The width of the smoothing window is set to 3 to smooth the state probabilities over time to filter out daily text noise interference. The number of activity state levels is set to 3, namely low-activity, medium-activity, and high-activity states. As other implementation methods, implementers can set these levels according to their actual situations. Secondly, the probability of occurrence is calculated as follows: the number of elements belonging to low-activity, medium-activity, and high-activity states within the optimal state sequence is counted, and then divided by the total length of the optimal state sequence to obtain the probability of occurrence for each of these three states.
[0025] In addition, since the active states include low active state, medium active state and high active state, we can map them numerically. Let 0 represent low active state, 1 represent medium active state and 2 represent high active state. Then, we can multiply the value corresponding to each state by its corresponding probability of occurrence and sum them up to obtain the timeliness popularity.
[0026] It should be noted that the greater the timeliness of popularity, the more frequently the candidate entity appears within a specific time period, which means that the candidate entity has a higher degree of spatiotemporal correlation with the real cultural and tourism activities that occur within that specific time period.
[0027] Step 204: The semantic core value of each candidate entity is positively correlated with its timeliness popularity and TF-IDF value. It should be noted that a positive correlation means that the dependent variable increases as the independent variable increases and decreases as the independent variable decreases.
[0028] Specifically, based on a preset first weight and a preset second weight, the TF-IDF value and the timeliness popularity are weighted and summed, and the normalized result is used as the semantic core value of each candidate entity. The sum of the preset first weight and the preset second weight is 1. In this embodiment, the preset first weight is equal to the preset second weight, both of which are set to 0.5. In other implementations, the implementer can set them according to the actual situation. Further, based on the maximum and minimum value normalization processing formula, the above weighted sum is transformed and uniformly mapped and restricted to the data range of 0 to 1 to obtain the semantic core value.
[0029] It should be noted that the larger the semantic core value, the stronger the semantic specificity of the candidate entity in the global corpus, and the more it can respond to changes in the popularity of cultural and tourism activities in the time dimension. This reflects that the candidate entity is a truly high-value and highly certain regional core cultural and tourism entity, and should be given priority in the graph construction.
[0030] Furthermore, the aforementioned semantic core values can only assess the information carrying strength and importance of a single candidate entity, but cannot reflect the deep co-occurrence relationships between different candidate entities. In the knowledge graph construction process, if node selection relies solely on the semantic core values of the candidate entities themselves, while ignoring the co-occurrence dependency structure between candidate entities, it becomes impossible to distinguish whether the co-occurrence between two candidate entities is driven by genuine semantic associations or caused by random co-occurrence noise in the corpus, thus affecting the rationality of establishing relation edges in the knowledge graph. In step 3, the specific process is as follows: Step 301: For any two candidate entities, the PMI value of the two candidate entities is calculated using the point mutual information algorithm based on the co-occurrence frequency and the occurrence frequency of each candidate entity. The point mutual information algorithm is a well-known technology and will not be described in detail here. When calculating the PMI value, in order to avoid the denominator being 0, a parameter tuning factor is added to the denominator. This parameter tuning factor is set to 0.01. At the same time, for the case where the co-occurrence frequency of any two candidate entities is equal to 0, the PMI value between the two candidate entities is directly assigned to 0. As other implementation methods, implementers can set them according to the actual situation.
[0031] It should be noted that when the PMI value is positive, the larger the value, the greater the probability that the two entities co-occur in the sentence, which is far greater than the expected probability of their independent random occurrence. This reflects a strong non-random binding relationship between the two candidate entities, that is, they have a very strong real semantic relevance. When the PMI value is negative, it means that the actual co-occurrence probability of the two candidate entities is lower than the expected probability of their independent random occurrence. This reflects that the two candidate entities exhibit mutually exclusive characteristics in the corpus distribution, and are semantically unrelated or even semantically isolated.
[0032] Furthermore, in cultural and tourism texts, even if two candidate entities do not co-occur frequently locally, they may still have an implicit semantic transmission relationship if they are connected to a large number of highly central entities. Conversely, if two candidate entities co-occur frequently in individual sentences, but their local subgraphs are located at the edge of the entire network, the global influence of this co-occurrence relationship is low. Therefore, it is necessary to quantitatively evaluate the central structural position of candidate entities in the global co-occurrence network topology.
[0033] Step 302: Based on the undirected weighted co-occurrence graph and the semantic core values of all candidate entities corresponding to the nodes, the PageRank algorithm is used to calculate the PR value of each node and use it as the global centrality score of the corresponding candidate entity. The PageRank algorithm is a well-known technique and will not be described in detail here. Its specific process is as follows: Extract the edge weight of each undirected edge in the undirected weighted co-occurrence graph and construct a transition probability matrix that reflects the local transition probability between nodes; for each node, extract all nodes directly connected to it and define them as neighbor nodes. Calculate the sum of edge weights between each node and all its neighbors. Divide the weight of each undirected edge between each node and its neighbors by the sum to obtain the transition probability of each node moving to its neighbors. After traversing all nodes, construct the transition probability matrix. In this matrix, rows and columns represent nodes, and elements in the matrix represent nodes. Let represent the transition probability of node i moving to node j; where, if there is no edge between node i and node j, then The value is 0; and the elements on the diagonal of the matrix are assigned the value 0 to avoid node self-looping; in particular, if it is determined that a node is not connected to any node, the transition probability of that node to all other nodes is assigned the value 0. The sum of the semantic core values of all nodes is calculated. The semantic core value of each node is divided by this sum to generate a probability distribution vector with a probability sum of 1. This probability distribution vector is used as the random jump probability vector in the PageRank algorithm iteration process, i.e., a non-uniform prior distribution. This allows the PageRank algorithm to rely on the co-occurrence topology and be guided by the semantic core values of the nodes themselves, so that candidate entities with high semantic core values have a higher probability of random jump access when it iterates.
[0034] The damping coefficient is set to 0.85 to balance the weight ratio of forward edge transition and random jump. In each iteration calculation, the centrality score vector of the previous round is multiplied by the transition probability matrix and superimposed with the random jump probability vector after being converted by the damping coefficient to obtain the score vector of the current round. This iterative process continues until the absolute value of the difference between the L1 norms of two consecutive score vectors is less than the preset convergence precision, at which point the iteration stops. The preset convergence precision is set to... Finally, the converged score vector is output, and the PR value of each node is extracted from the score vector. It should be noted that the PageRank algorithm uses a random walk process to measure the importance of a node in the whole graph. That is, the higher the global centrality score, the more important nodes are linked to this node, the more prominent its pivotal position in the whole cultural and tourism knowledge system, and the more it carries the function of cross-type and cross-regional semantic connection.
[0035] Step 303: Calculate the product of the global centrality scores of any two candidate entities as the co-occurrence importance. The semantic relevance of any two candidate entities is positively correlated with both the co-occurrence importance and the PMI value. Specifically, the PMI value is positively mapped, and its product with the co-occurrence importance is used as the semantic relevance. The positive mapping process is as follows: the maximum value between 0 and the PMI value is selected as the result of the positive mapping.
[0036] It should be noted that the greater the semantic relevance, the more likely that the two candidate entities not only occupy a very core and dominant position in the global network topology, but also exhibit a strong co-occurrence dependency in the local text context that far exceeds random expectations, reflecting a real and valuable deep regional cultural connection between the two candidate entities.
[0037] Furthermore, in the process of knowledge graph construction, in order to eliminate low-value colloquial generalized words and retain effective candidate entities with implicit cultural connections, it is necessary to set a threshold for node screening. However, to avoid the incorrect elimination of entities with low word frequency but strong semantic dependence on entities with high semantic core values due to the use of a single rigid global threshold, a graph generation mechanism based on adaptive dynamic thresholds is designed. By feeding back the semantic correlation between entity pairs into the node screening threshold calculation, candidate entities with strong semantic correlation with nodes with high semantic core values can adaptively lower their screening threshold, thereby accurately achieving a dynamic balance between "filtering invalid generalized words" and "protecting core dependent entities". In step 4, the specific process is as follows: Step 401: In the undirected weighted co-occurrence graph, for each node's candidate entity, select all candidate entities directly connected to it and define them as neighboring entities. Select the maximum value from the semantic association degree between each candidate entity and all its neighboring entities as the local maximum value. In the formula, For the first Dynamic threshold for each candidate entity The preset initial threshold, The preset adjustment range, For the first Local maximum values of candidate entities The maximum semantic association between any two candidate entities; The preset initial threshold ranges from 0.3 to 0.9. In this embodiment, the value is set to 0.6. By taking the upper median quantile as the benchmark, the initial threshold can effectively filter out colloquial and generalized candidate entities with unclear referents and lack of semantic specificity while retaining most of the core cultural and tourism proper nouns. The preset adjustment range ranges from 0.2 to 0.5. In this embodiment, the value is set to 0.3 to control the magnitude of the threshold reduction. As for other implementation methods, the implementer can set it according to the actual situation. It should be noted that if a node in an undirected weighted co-occurrence graph is an isolated point, that is, not connected to any other node, then the local maximum value of that node is assigned to 0.
[0038] Step 402: If the semantic core value of each candidate entity is greater than or equal to the corresponding dynamic threshold, then the candidate entity is retained and defined as a core entity; otherwise, the candidate entity is removed. Step 403: Traverse all core entities. If the semantic correlation between any two core entities is greater than or equal to a preset value, then these two core entities are used as nodes in the knowledge graph, and a relationship edge is established between the two core entities. At the same time, the semantic correlation is used as the weight of the relationship edge, thereby generating a knowledge graph for the cultural tourism scenario.
[0039] The preset value is obtained by calculating the value corresponding to the preset quantile of the semantic correlation between any two core entities with a semantic correlation greater than 0. The preset quantile is set to the 30th quantile. As another implementation method, the implementer can set it according to the actual situation.
[0040] It should be noted that when a candidate entity has a high semantic co-occurrence dependency with a highly central candidate entity, meaning the two candidate entities have a high semantic correlation, it indicates that the candidate entity plays a significant connecting role in the cultural tourism semantic network. Even if the semantic core value of the candidate entity is low, retaining it still helps maintain the integrity and connectivity of the cultural tourism semantic network. If a candidate entity is directly removed due to its low semantic core value, the highly central entity connected to it will lack important semantic adjacency information in the knowledge graph, disrupting the structural integrity of the graph. Therefore, this application adaptively lowers the dynamic threshold through semantic correlation, allowing candidate entities with strong semantic co-occurrence dependencies with highly central entities to be retained, thereby maximizing the preservation of implicit semantic chains in the cultural tourism knowledge system while ensuring semantic accuracy.
[0041] Secondly, this knowledge graph significantly suppresses the noise of generalized candidate entities and random co-occurrence, effectively mining the implicit cultural semantic chains, which can be used to support subsequent services such as intelligent question answering, cultural theme reasoning, and personalized cultural tourism recommendations.
[0042] Based on the same inventive concept as the above methods, this application also provides a knowledge graph construction system in a cultural and tourism scenario, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described methods for constructing a knowledge graph in a cultural and tourism scenario.
Claims
1. A method for constructing a knowledge graph in a cultural tourism scenario, characterized in that, The method includes the following steps: Collect heterogeneous cultural and tourism texts from multiple sources and extract candidate entities related to cultural and tourism from them; count the co-occurrence relationships of different candidate entities in cultural and tourism texts and construct an undirected weighted co-occurrence graph. Specifically, all cultural and tourism texts are segmented into sentences. For any two candidate entities, count the number of sentences in all cultural and tourism texts that simultaneously contain both candidate entities, and use this count as the co-occurrence frequency of the two candidate entities; abstract each candidate entity into a node, and establish an undirected edge between the nodes corresponding to two candidate entities whose co-occurrence frequency is not 0, using the co-occurrence frequency of the two candidate entities as the edge weight, thereby constructing an undirected weighted co-occurrence graph. The distribution characteristics of the frequency of each candidate entity in the cultural and tourism text over time are evaluated, the timeliness popularity of each candidate entity is calculated, and the semantic core value of each candidate entity is obtained by combining the word frequency distribution characteristics of each candidate entity in the cultural and tourism text. The local co-occurrence dependency relationship between any two candidate entities in the cultural and tourism text and the global structural importance of the candidate entities in the undirected weighted co-occurrence graph are analyzed to determine the semantic correlation between any two candidate entities. Based on this, the dynamic threshold of each candidate entity is adaptively adjusted. The semantic core value and the dynamic threshold are compared to select core entities from the candidate entities. Relationship edges are established between two core entities whose semantic correlation meets the preset conditions, thereby generating a knowledge graph in the cultural and tourism scenario. The adjustment of the dynamic thresholds for each candidate entity includes: In an undirected weighted co-occurrence graph, for each node's candidate entity, all candidate entities directly connected to it are selected and defined as neighboring entities. The maximum value among the semantic association degrees between each candidate entity and all its neighboring entities is selected as the local maximum value. No. Dynamic threshold for each candidate entity The calculation process is as follows: In the formula, The preset initial threshold, The preset adjustment range, For the first Local maximum values of candidate entities The maximum semantic association between any two candidate entities.
2. The knowledge graph construction method in a cultural tourism scenario as described in claim 1, characterized in that, The calculation of the timeliness popularity of each candidate entity includes: The time range encompassed by the publication timestamps of all cultural and tourism texts is divided into consecutive time periods. For each candidate entity, the frequency of its occurrence in all cultural and tourism texts within each time period is counted as the target event count for that time period. The total frequency of all candidate entities in all cultural and tourism texts within that time period is counted as the total event count for that time period. The target event count and the total event count are input into the burst detection algorithm, which outputs the optimal state sequence of the candidate entity over the entire time range. Calculate the probability of occurrence of each state in the optimal state sequence of each candidate entity; use the probability of occurrence of each state as the weight, and perform a weighted sum of the element values corresponding to all states in the optimal state sequence to obtain the timeliness popularity of the candidate entity.
3. The knowledge graph construction method in a cultural tourism scenario as described in claim 1, characterized in that, The process of obtaining the semantic core value of each candidate entity includes: calculating the TF-IDF value of each candidate entity based on all cultural and tourism texts; the semantic core value of each candidate entity is positively correlated with the timeliness popularity and the TF-IDF value.
4. The knowledge graph construction method in a cultural tourism scenario as described in claim 2, characterized in that, Determining the semantic association between any two candidate entities includes: For any two candidate entities, the co-occurrence frequency and the occurrence frequency of each candidate entity are used to calculate the PMI value of the two candidate entities using the point mutual information algorithm; The PageRank algorithm is used to analyze the global centrality features of any two candidate entities in an undirected weighted co-occurrence graph and to calculate the collaborative importance of any two candidate entities. The semantic relevance, collaborative importance, and PMI value of any two candidate entities are all positively correlated.
5. The knowledge graph construction method in a cultural tourism scenario as described in claim 4, characterized in that, The calculation of the collaborative importance of any two candidate entities includes: based on the undirected weighted co-occurrence graph and the semantic core values of all nodes corresponding to candidate entities, using the PageRank algorithm to calculate the PR value of each node, and using it as the global centrality score of the corresponding candidate entity; calculating the product of the global centrality scores of any two candidate entities as the collaborative importance.
6. The knowledge graph construction method in a cultural tourism scenario as described in claim 1, characterized in that, The step of selecting core entities from candidate entities includes: if the semantic core value of each candidate entity is greater than or equal to the corresponding dynamic threshold, then the candidate entity is retained and defined as a core entity; otherwise, the candidate entity is removed.
7. The knowledge graph construction method in a cultural tourism scenario as described in claim 1, characterized in that, The step of establishing a relation edge between two core entities whose semantic relevance meets a preset condition to generate a knowledge graph in the cultural and tourism scenario includes: traversing all core entities; if the semantic relevance between any two core entities is greater than or equal to a preset value, then these two core entities are taken as nodes in the knowledge graph, and a relation edge is established between the two core entities. At the same time, the semantic relevance is taken as the weight of the relation edge, thereby generating a knowledge graph in the cultural and tourism scenario.
8. A knowledge graph construction system for a cultural tourism scenario, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the knowledge graph construction method in a cultural and tourism scenario as described in any one of claims 1-7.
Citation Information
Patent Citations
Interaction graph retrieval and credibility evaluation-based text travel model generation method
CN121958572A
File travel multi-source heterogeneous data fusion and knowledge graph construction method
CN122334452A