A method and device for constructing a knowledge association graph of culture and travel, a storage medium and an equipment
Patent Information
- Application Number
- CN202511380854.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-09-25
AI Technical Summary
[0004]本申请实施例的主要目的在于提供一种文旅知识关联图谱构建方法、装置、存储介质及设备,通过挖掘各地文旅知识实体间的统计规律与语义关联,实现“历史故事→非遗技艺→衍生商品”的链式智能化关联图谱的构建,从而不仅解决了现有文旅知识关联方式中存在的成本高、效率低、及关联的实时性和准确率也较低的问题,达到了理想的关联效果
[0027]本申请实施例提供的一种文旅知识关联图谱构建方法、装置、存储介质及设备,首先获取目标地区的文旅知识文本;并提取文旅知识文本中的目标实体,以及生成目标实体与关键词的矩阵;其中,目标实体包括历史故事实体、非遗技艺实体和衍生商品实体;然后根据目标实体与关键词的矩阵,计算文旅知识文本中的目标实体对中两个目标实体之间的关联置信度;再根据目标实体对中两个目标实体之间的关联置信度和语义相似度,计算目标实体对中两个目标实体之间的语义置信度;并利用目标实体对中两个目标实体之间的语义置信度,生成实体关联规则库;接着利用实体关联规则库,生成由历史故事实体、非遗技艺实体和衍生商品实体组成的候选三元组;并计算各个候选三元组对应的关联关系得分;进而可以从所有候选三元组中筛选出关联关系得分高于预设得分阈值的三元组,作为目标三元组,用以构建目标地区对应的文旅知识关联图谱。
Smart Images

Figure CN121279402B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a method, apparatus, storage medium and device for constructing a knowledge association graph of cultural tourism. Background Technology
[0002] With the rapid development of the tourism industry, in order to create unique, communicable, and meaningful cultural and tourism products and services, local cultural and tourism organizations usually need to deeply explore and utilize their local regional cultural characteristics.
[0003] However, the vast amount of fragmented cultural assets still suffers from scattered distribution, slow collection and updating, and difficulty in value transformation. This is because existing cultural tourism knowledge association schemes typically employ a keyword matching method dominated by manual rules. First, cultural tourism experts formulate keyword matching association rules based on experience, such as "a certain legend is associated with a certain craft." Then, Natural Language Processing (NLP) tools are used to extract entities from texts with regional characteristics, triggering associations using the keyword matching rules, such as associating "bamboo weaving craft" based on the keyword "weaving" in the story text. However, existing association methods have several problems. First, expert annotation is inefficient (approximately 20 rules per person per day based on statistics) and costly (each rule takes about 30 minutes to annotate). When dealing with a large number of entities (e.g., millions), rule coverage is low, and it struggles to cover long-tail entities (such as associations between niche regional stories and skills). Second, keyword matching methods cannot distinguish semantic ambiguity or capture deep cultural connections, potentially leading to association results lacking cultural rationality and a high error rate. Third, manually formulated rules lack dynamic adaptability and cannot respond promptly to emerging association needs, resulting in delays in associations for popular products. Therefore, existing methods for linking cultural and tourism knowledge across regions are not only costly and inefficient, but also have low real-time performance and accuracy, making it difficult to achieve the desired association results. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, storage medium, and device for constructing a cultural tourism knowledge association graph. By mining the statistical patterns and semantic relationships between cultural tourism knowledge entities in various regions, it achieves the construction of a chain-like intelligent association graph of "historical stories → intangible cultural heritage skills → derivative products." This not only solves the problems of high cost, low efficiency, and low real-time performance and accuracy in existing cultural tourism knowledge association methods, achieving an ideal association effect, but also facilitates local businesses to quickly search for skills and products highly related to their local cultural characteristics from this association graph, thereby developing distinctive products with market competitiveness.
[0005] This application provides a method for constructing a cultural tourism knowledge association graph, including: Acquire cultural and tourism knowledge texts of the target region; extract target entities from the cultural and tourism knowledge texts, and generate a matrix of target entities and keywords; the target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities; Based on the matrix of target entities and keywords, calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text; Based on the association confidence and semantic similarity between the two target entities in the target entity pair, the semantic confidence between the two target entities in the target entity pair is calculated; and an entity association rule base is generated using the semantic confidence between the two target entities in the target entity pair. Using the entity association rule base, candidate triples are generated, consisting of the historical story entity, the intangible cultural heritage skill entity, and the derivative product entity; and the association score corresponding to each candidate triple is calculated. From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples to construct the cultural and tourism knowledge association graph corresponding to the target region.
[0006] In one possible implementation, generating the matrix of target entities and keywords includes: The target entity is located in the cultural and tourism knowledge text. TF-IDF feature extraction is performed to obtain a feature vector. A matrix of the target entity and keywords is generated based on the feature vector.
[0007] In one possible implementation, calculating the association confidence between two target entities in the target entity pair of the cultural and tourism knowledge text based on the matrix of target entities and keywords includes: Based on the matrix of target entities and keywords, the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text are mined, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence rules of target entity pairs.
[0008] In one possible implementation, the step of mining the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text based on the matrix of target entities and keywords, and calculating the association confidence between two target entities in the target entity pair based on the obtained co-occurrence rules, includes: Based on the matrix of target entities and keywords, the Apriori algorithm is used to mine the co-occurrence frequency of target entity pairs in the cultural and tourism knowledge text, and the association confidence between the two target entities in the target entity pair is calculated based on the obtained co-occurrence frequency of target entity pairs.
[0009] In one possible implementation, before calculating the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair, the method further includes: Generate semantic vectors corresponding to each of the two target entities in the target entity pair; and calculate the cosine similarity between the two target entities based on the semantic vectors corresponding to each of the two target entities, which is used as the semantic similarity between the two target entities. The step of calculating the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair includes: The semantic confidence between the two target entities in the target entity pair is obtained by multiplying the association confidence between the two target entities in the target entity pair by the cosine similarity.
[0010] In one possible implementation, generating an entity association rule base using the semantic confidence between two target entities in the target entity pair includes: Target entity pairs with semantic confidence scores higher than a preset confidence threshold are selected; and an entity association rule base is generated using two target entities from the selected target entities and the semantic confidence score between the two target entities.
[0011] In one possible implementation, the entity association rule base includes historical story entities and intangible cultural heritage skill entities, as well as the semantic confidence between them; the entity association rule base also includes intangible cultural heritage skill entities and derivative product entities, as well as the semantic confidence between them; the step of using the entity association rule base to generate candidate triples composed of the historical story entities, intangible cultural heritage skill entities, and derivative product entities includes: For the i-th historical story entity, select K intangible cultural heritage skill entities with the highest semantic confidence among the i-th historical story entity from the entity association rule base; where i is a positive integer greater than 0; and K is a positive integer greater than 0. Filter out the derivative product entities corresponding to each of the K intangible cultural heritage skill entities from the entity association rule base; Using various historical story entities, K intangible cultural heritage skill entities selected from the entity association rule base, and derivative product entities corresponding to each of the K intangible cultural heritage skill entities selected from the entity association rule base, M candidate triples are constructed; M is a positive integer greater than 0; wherein each candidate triple includes a historical story entity, an intangible cultural heritage skill entity, and a derivative product entity.
[0012] In one possible implementation, calculating the association score corresponding to each of the candidate triples includes: For the j-th candidate triple, the semantic confidence between the historical story entity and the intangible cultural heritage skill entity contained in it is multiplied by the semantic confidence between the intangible cultural heritage skill entity and the derivative product entity contained in it to obtain the multiplication result; where j is a positive integer greater than 0 and not greater than M; Calculate the similarity between the matrix of historical story entities and keywords corresponding to the historical story entities contained in the j-th candidate triplet and the matrix of derivative product entities and keywords corresponding to the derivative product entities contained in the j-th candidate triplet, and obtain the similarity calculation result; The multiplication result and the similarity result are weighted and summed to obtain a weighted sum result, which is then used as the association score corresponding to the j-th candidate triple; this process is repeated until the association score corresponding to each candidate triple is calculated.
[0013] In one possible implementation, the step of selecting triples with association scores higher than a preset score threshold from all candidate triples as target triples is used to construct a cultural tourism knowledge association graph corresponding to the target region.
[0014] From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples. The historical story entities, intangible cultural heritage skill entities, and derivative product entities contained in the selected target triples are used as node attributes, and the correlation score of the corresponding target triples is used as edge attributes to construct the cultural tourism knowledge association graph corresponding to the target region.
[0015] This application also provides a device for constructing a cultural tourism knowledge association graph, including: The acquisition unit is used to acquire cultural and tourism knowledge text of the target region; extract target entities from the cultural and tourism knowledge text; and generate a matrix of target entities and keywords; the target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities; The first calculation unit is used to calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text based on the matrix of the target entities and keywords. The second calculation unit is used to calculate the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair; and to generate an entity association rule base using the semantic confidence between the two target entities in the target entity pair. The third calculation unit is used to generate candidate triples composed of the historical story entity, the intangible cultural heritage skill entity, and the derivative product entity using the entity association rule base; and to calculate the association score corresponding to each candidate triple. The construction unit is used to select triples with a correlation score higher than a preset score threshold from all the candidate triples as target triples, in order to construct the cultural and tourism knowledge association graph corresponding to the target region.
[0016] In one possible implementation, the acquisition unit is specifically used for: The target entity is located in the cultural and tourism knowledge text. TF-IDF feature extraction is performed to obtain a feature vector. A matrix of the target entity and keywords is generated based on the feature vector.
[0017] In one possible implementation, the first computing unit is specifically used for: Based on the matrix of target entities and keywords, the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text are mined, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence rules of target entity pairs.
[0018] In one possible implementation, the first computing unit is specifically used for: Based on the matrix of target entities and keywords, the Apriori algorithm is used to mine the co-occurrence frequency of target entity pairs in the cultural and tourism knowledge text, and the association confidence between the two target entities in the target entity pair is calculated based on the obtained co-occurrence frequency of target entity pairs.
[0019] In one possible implementation, the device further includes: The fourth calculation unit is used to generate semantic vectors corresponding to the two target entities in the target entity pair; and to calculate the cosine similarity between the two target entities based on the semantic vectors corresponding to the two target entities, as the semantic similarity between the two target entities. The second calculation unit is specifically used for: The semantic confidence between the two target entities in the target entity pair is obtained by multiplying the association confidence between the two target entities in the target entity pair by the cosine similarity.
[0020] In one possible implementation, the second computing unit is specifically used for: Target entity pairs with semantic confidence scores higher than a preset confidence threshold are selected; and an entity association rule base is generated using two target entities from the selected target entities and the semantic confidence score between the two target entities.
[0021] In one possible implementation, the entity association rule base includes historical story entities and intangible cultural heritage skill entities, as well as the semantic confidence between them; the entity association rule base also includes intangible cultural heritage skill entities and derivative product entities, as well as the semantic confidence between them; the third calculation unit includes: The first filtering subunit is used to filter out K intangible cultural heritage skill entities with the highest semantic confidence between the i-th historical story entity and the i-th historical story entity from the entity association rule base; where i is a positive integer greater than 0; and K is a positive integer greater than 0. The second filtering subunit is used to filter out the derivative product entities corresponding to each of the K intangible cultural heritage skill entities from the entity association rule base; A subunit is constructed to utilize each historical story entity, K intangible cultural heritage skill entities selected from the entity association rule base, and derivative product entities corresponding to each of the K intangible cultural heritage skill entities selected from the entity association rule base to construct M candidate triples; where M is a positive integer greater than 0; wherein each candidate triple includes a historical story entity, an intangible cultural heritage skill entity, and a derivative product entity.
[0022] In one possible implementation, the third computing unit includes: The multiplication calculation subunit is used to multiply the semantic confidence between the historical story entity and the intangible cultural heritage skill entity contained in the j-th candidate triplet by the semantic confidence between the intangible cultural heritage skill entity and the derivative product entity contained in it, and obtain the multiplication calculation result; where j is a positive integer greater than 0 and not greater than M. The similarity calculation subunit is used to calculate the similarity between the matrix of historical story entities and keywords corresponding to the historical story entities contained in the j-th candidate triplet and the matrix of derivative product entities and keywords corresponding to the derivative product entities contained in the j-th candidate triplet, and to obtain the similarity calculation result. The weighted summation calculation subunit is used to perform a weighted summation calculation on the multiplication calculation result and the similarity calculation result to obtain a weighted summation calculation result, and use the weighted summation calculation result as the association score corresponding to the j-th candidate triple; and so on, until the association score corresponding to each candidate triple is calculated.
[0023] In one possible implementation, the building unit is specifically used for: From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples. The historical story entities, intangible cultural heritage skill entities, and derivative product entities contained in the selected target triples are used as node attributes, and the correlation score of the corresponding target triples is used as edge attributes to construct the cultural tourism knowledge association graph corresponding to the target region.
[0024] This application embodiment also provides a cultural tourism knowledge association graph construction device, including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to perform any of the above-described methods for constructing a cultural and tourism knowledge association graph.
[0025] This application also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described methods for constructing a cultural tourism knowledge association graph.
[0026] This application also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-described methods for constructing a cultural tourism knowledge association graph.
[0027] This application provides a method, apparatus, storage medium, and device for constructing a cultural tourism knowledge association graph. First, it acquires cultural tourism knowledge text of a target region; then, it extracts target entities from the text and generates a matrix of target entities and keywords. The target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities. Next, based on the matrix of target entities and keywords, it calculates the association confidence between two target entities in a target entity pair within the text. Then, based on the association confidence and semantic similarity between the two target entities in the target entity pair, it calculates the semantic confidence between them. Using the semantic confidence between the two target entities in the target entity pair, it generates an entity association rule base. Next, using the entity association rule base, it generates candidate triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities. It calculates the association score corresponding to each candidate triple. Finally, it selects triples from all candidate triples whose association scores are higher than a preset score threshold as target triples to construct a cultural tourism knowledge association graph corresponding to the target region.
[0028] As can be seen, this application achieves the construction of a chain-like intelligent association graph of "historical stories → intangible cultural heritage skills → derivative products" by mining the statistical patterns (which can be understood as association confidence) and semantic associations (which can be understood as semantic confidence) between target entities (i.e., historical story entities, intangible cultural heritage skill entities, and derivative product entities) contained in the cultural and tourism knowledge text of the target region. Specifically, it uses target triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities with association scores higher than a preset score threshold to construct the cultural and tourism knowledge association graph corresponding to the target region. This not only solves the problems of high cost, low efficiency, and low real-time and accuracy of existing cultural and tourism knowledge association methods, achieving an ideal association effect, but also facilitates merchants in the target region to quickly find skills and products highly related to their local cultural characteristics from this cultural and tourism knowledge association graph, thereby developing distinctive products with market competitiveness and improving the product buying and selling experience between merchants and buyers. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 A flowchart illustrating a method for constructing a cultural tourism knowledge association graph, provided as an embodiment of this application; Figure 2 Example diagram of the cultural tourism knowledge association graph provided in the embodiments of this application; Figure 3 A schematic diagram of the composition of a cultural tourism knowledge association graph construction device provided in this application embodiment; Figure 4 This is a schematic diagram of a cultural tourism knowledge association graph construction device provided in an embodiment of this application. Detailed Implementation
[0031] Currently, to improve the utilization efficiency of cultural heritage knowledge in various regions and to create unique, communicable, and meaningful cultural tourism products and services for tourists, existing cultural tourism knowledge association solutions typically employ a keyword matching method dominated by manual rules, mainly including the following three steps: (1) Construction of a manual rule base: Cultural tourism experts develop keyword matching association rules based on their experience, for example: Rule 1: If the historical story text contains the keyword "origin of the craft", then associate it with the corresponding intangible cultural heritage craft; Rule 2: If the name of an intangible cultural heritage technique contains the keyword "making", it is associated with craft-related derivative products.
[0032] (2) Entity extraction and keyword matching: Use NLP tools (such as spaCy) to extract entities from texts with regional characteristics (such as "Miao folk songs" and "silver jewelry forging"). Then, use keyword matching association rules to trigger associations (such as associating "Miao silver jewelry forging technique" when the keyword "silver jewelry" appears in the story text).
[0033] (3) Generation of associations: Following the hierarchy of "story → craftsmanship → product", the relationships are deduced in a chain-like manner based on artificial rules, for example: "Miao ancient songs" (story) → "Miao silver jewelry forging techniques" (craftsmanship) → "Miao silver jewelry pendants" (product).
[0034] However, the existing keyword matching association methods that rely on manual rules have the following problems: (1) The non-scalability of manual rules.
[0035] Relying on domain experts to manually define rules (such as "XX legend is associated with XX skill") results in low annotation efficiency (based on statistics, an average of about 20 rules can be processed per person per day), high cost (annotating a single rule takes about 30 minutes), low rule coverage (less than 10%) when dealing with a large number of entities (such as millions), and difficulty in covering long-tail entities (such as the association between niche regional stories and skills).
[0036] For example, if a cultural tourism company collects 200 local stories from a local intangible cultural heritage database, manually labeling the associated techniques would take 10 person-days, which is costly.
[0037] (2) The uncertainty of semantic association.
[0038] The keyword matching method (such as matching "weaving" with "bamboo weaving technique" in the story text) not only fails to distinguish semantic ambiguity (such as "paper cutting" may be associated with "Spring Festival paper cutting" or "opera paper cutting"), resulting in a high false association rate (such as as high as 35%), but also fails to capture the deep connections of cultural logic (such as the influence of "Tujia brocade story" on the origin of "Xilankapu technique"), resulting in the association results lacking cultural rationality.
[0039] For example, the story text "Qingming Customs" contains the keyword "paper". Based on keyword matching, it may be incorrectly associated with "wedding paper-cutting skills" instead of "Qingming paper-making skills", resulting in a false association.
[0040] (3) The dynamic adaptability of manually formulated rules is insufficient.
[0041] The demand in the cultural and tourism market changes in real time (such as intangible cultural heritage projects becoming popular through short videos, or a certain skill becoming a hit due to exposure in variety shows). However, the update cycle of the manual rule base is long (usually 1-3 months), which makes it impossible to respond to emerging related needs in a timely manner. Consequently, it is impossible to adjust the priority of association in real time, resulting in the lag in association of popular products. For example, after a certain skill suddenly becomes popular, it is necessary to quickly associate it with its derivative products, but the existing manual rule base cannot respond in time and cannot provide tourists and buyers with suitable derivative products in a timely manner.
[0042] Therefore, existing methods for linking cultural and tourism knowledge are not only costly and inefficient, but also have low real-time performance and accuracy, making it difficult to achieve the desired linking effect.
[0043] To address the aforementioned shortcomings, this application provides a method for constructing a cultural tourism knowledge association graph. First, it acquires cultural tourism knowledge text of the target region; then, it extracts target entities from the text and generates a matrix of target entities and keywords. The target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities. Next, based on the matrix of target entities and keywords, it calculates the association confidence between two target entities in a target entity pair within the text. Then, based on the association confidence and semantic similarity between the two target entities in the target entity pair, it calculates the semantic confidence between them. Using the semantic confidence between the two target entities in the target entity pair, it generates an entity association rule base. Next, using the entity association rule base, it generates candidate triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities. It calculates the association score corresponding to each candidate triple. Finally, it selects triples from all candidate triples whose association scores are higher than a preset score threshold as target triples to construct the cultural tourism knowledge association graph corresponding to the target region.
[0044] As can be seen, this application achieves the construction of a chain-like intelligent association graph of "historical stories → intangible cultural heritage skills → derivative products" by mining the statistical patterns (which can be understood as association confidence) and semantic associations (which can be understood as semantic confidence) between target entities (i.e., historical story entities, intangible cultural heritage skill entities, and derivative product entities) contained in the cultural and tourism knowledge text of the target region. Specifically, it uses target triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities with association scores higher than a preset score threshold to construct the cultural and tourism knowledge association graph corresponding to the target region. This not only solves the problems of high cost, low efficiency, and low real-time and accuracy of existing cultural and tourism knowledge association methods, achieving an ideal association effect, but also facilitates merchants in the target region to quickly find skills and products highly related to their local cultural characteristics from this cultural and tourism knowledge association graph, thereby developing distinctive products with market competitiveness and improving the product buying and selling experience between merchants and buyers.
[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] First Embodiment
[0047] See Figure 1 This is a flowchart illustrating a method for constructing a cultural tourism knowledge association graph provided in this embodiment. The method includes the following steps: S101: Obtain cultural and tourism knowledge texts of the target region; extract target entities from the cultural and tourism knowledge texts, and generate a matrix of target entities and keywords; among which, target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities.
[0048] In this embodiment, any region (such as provincial, municipal, or county-level regions) that needs to be associated with cultural and tourism knowledge is selected as the target region. Multimodal cultural and tourism knowledge data, including text, images, audio, and video, is purchased from third-party platforms such as organizations in the target region, online media monitoring, and e-commerce transactions. All of this data is converted into text form and then associated through subsequent steps.
[0049] It should be noted that this embodiment does not limit the language type of these cultural and tourism knowledge texts of the target region after conversion. For example, these cultural and tourism knowledge texts can be Chinese texts or English texts, etc. This embodiment also does not limit the length of these cultural and tourism knowledge texts, that is, these cultural and tourism knowledge texts can be sentence texts (i.e., a collection of individual words) or chapter texts (i.e., a collection of individual sentences), etc.
[0050] Based on this, after acquiring the cultural and tourism knowledge texts of the target region, these text data can be divided into three types of texts: but not limited to historical story texts (such as "Miao ancient songs 'Maple Tree Song' and 'Wading Through Mountains and Rivers'"), intangible cultural heritage texts (such as "Miao silver jewelry forging techniques (national intangible cultural heritage)"), and derivative product texts (such as "Miao silver necklaces, silver tea sets, etc."). These three types of texts are defined as follows: , , .
[0051] Furthermore, existing or future entity extraction methods (such as using the spaCy tool) can be utilized to extract these cultural and tourism knowledge texts of the target region. , , The entities in ) (defined here as target entities). It is understandable that, to facilitate subsequent knowledge graph construction, this can be approached from the three types corresponding to these cultural and tourism knowledge texts of the target region (i.e., historical story texts). Intangible cultural heritage techniques texts and derivative product text The text extracts three types of entities: historical story entities, intangible cultural heritage skills entities, and derivative product entities. These three types of entities can be categorized as follows:
[0052] in, This refers to the set of historical story entities extracted from cultural and tourism knowledge texts of the target region, which includes... Represents n specific historical story entities; This refers to the set of intangible cultural heritage skills entities extracted from cultural and tourism knowledge texts of the target region, which includes... Represents m specific entities of intangible cultural heritage skills; This represents the set of derivative product entities extracted from cultural and tourism knowledge texts of the target region, which includes... Represents k specific .
[0053] For example: Suppose a text fragment from a historical and cultural story database is: "In the Miao folk song 'Maple Tree Song,' the Butterfly Mother is born from the heart of a maple tree. After falling in love with a water bubble, she lays twelve divine eggs, which hatch into Jiang Yang, the ancestor of the Miao people, and all living beings. This creation myth symbolizes the origin of life and the propagation of the ethnic group, becoming a core image of Miao culture." The historical story entities extracted from this text would be: It can be "Miao ethnic folk songs".
[0054] Furthermore, this involves extracting the target entities (specifically, sets of historical story entities) contained within the cultural and tourism knowledge texts of the target region. Intangible cultural heritage skills physical collection and derivative product physical sets After identifying the various entities included, one optional implementation is to first perform Term Frequency–Inverse Document Frequency (TF-IDF) feature extraction on the various cultural and tourism knowledge texts containing these target entities, obtaining feature vectors, and then representing them as... ,in, This represents the number of keywords. Then, based on the obtained feature vector, a matrix of target entities and keywords is generated for subsequent step S102.
[0055] TF (Term Frequency) refers to the frequency of a keyword in the corresponding descriptive text corpus (after normalization).
[0056] IDF (Inverse Document Frequency) refers to the calculation based on a larger text corpus (such as descriptions of other entities including "Han silver ornaments" and "Yi silver ornaments") to measure the uniqueness of keywords to "Miao silver ornaments".
[0057] For example, suppose we extract 5 core keywords (p=5) from the entity description text corpus of "Miao silver ornaments" to form a dictionary: ["silver ornaments", "forging", "butterfly pattern", "Miao ancient songs", "engraving"]. The final generated feature vector (X) for "Miao silver ornaments" is: [0.32, 0.28, 0.35, 0.22, 0.29]. We can understand that the vector dimension of this feature vector (X) corresponds to the dictionary order, and each value represents the TF-IDF weight of that keyword. "Butterfly pattern" has a relatively high weight (0.35) because this pattern is a typical feature that distinguishes Miao silver ornaments from those of other ethnic groups (high IDF value); "silver ornaments," as a core word, has a high word frequency (high TF value) and therefore a relatively high weight (0.32).
[0058] Based on this, after processing three target entities (such as Miao silver ornaments, Yi silver ornaments, and Dong silver ornaments) simultaneously using a similar method, the generated (TF-IDF) matrix of target entities and keywords can be shown in Table 1 below, where rows represent target entities and columns represent keywords:
[0059] Table 1
[0060] S102: Based on the matrix of target entities and keywords, calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text.
[0061] In this embodiment, in order to improve the association effect of cultural and tourism knowledge, after generating the (TF-IDF) matrix of target entities and keywords in step S101, the co-occurrence rules of target entity pairs in cultural and tourism knowledge text can be further mined based on the (TF-IDF) matrix of target entities and keywords (which can be understood as statistical regularities). Based on the obtained co-occurrence rules of target entity pairs, the association confidence between two target entities in the target entity pair is calculated, and the subsequent step S103 is executed.
[0062] Specifically, one possible implementation is to use the Apriori algorithm to mine the co-occurrence frequency of target entity pairs in cultural and tourism knowledge texts, and then calculate the association confidence between the two target entities in the target entity pair based on the obtained co-occurrence frequency. The specific calculation formula is as follows: (1) Here, support refers to the frequency with which a particular itemset (or rule) appears in the entire dataset; that is, the proportion of transactions containing all items of that rule out of the total transactions. For rule A→B (where A and B are itemsets), the support is: Support is used to filter "rare rules" to ensure that the rules have general significance.
[0063] Confidence, on the other hand, refers to the probability that a transaction containing itemset A also contains itemset B; that is, the degree of credibility of the rule A→B. The confidence level reflects the generality of the rule. A rule with low support may only occur occasionally and has no practical significance; high support indicates that the rule occurs frequently in the data. It also reflects the reliability of the rule. High confidence means that when A occurs, B is likely to occur as well, indicating strong predictive power. Confidence is used to filter out "unreliable rules" and ensure the predictive effectiveness of the rules.
[0064] For example: Suppose we collected 1000 pieces of transaction data related to Miao culture (such as tourists' spending at intangible cultural heritage workshops, participation records in cultural experience projects, etc.), among which: There are 200 transactions involving "Miao folk songs" (such as purchasing folk song CDs and participating in folk song singing experiences). There are 300 transactions involving "Miao silver ornaments" (such as purchasing silver ornaments and experiencing silver ornament forging). There are 150 transactions involving both "Miao folk songs" and "Miao silver jewelry" (such as buying silver jewelry and participating in the folk song experience).
[0065] Therefore, support(Miao ancient songs → Miao silver ornaments) = 150 / 1000 = 15%, which means that transactions involving both Miao ancient songs and Miao silver ornaments account for 15% of all transactions, indicating that the two appear frequently in the data and have a certain correlation.
[0066] Furthermore, Confidence (Miao folk songs → Miao silver ornaments) = 150 / 200 = 75%, indicating that "75% of transactions involving Miao folk songs also involve Miao silver ornaments," suggesting that when tourists are interested in Miao folk songs, they are very likely to be interested in Miao silver ornaments as well, and the connection between the two is highly reliable.
[0067] Based on these two indicators, the correlation strength between "Miao ancient songs" and "Miao silver ornaments" can be determined as follows: The 15% support rate indicates that the co-occurrence of both phenomena is quite common and not a coincidence. A 75% confidence level indicates that the association between the two is reliable and can be used in practical business (such as recommending silver jewelry products to tourists participating in the ancient song experience, or designing a combination experience project of "ancient song + silver jewelry").
[0068] S103: Calculate the semantic confidence between two target entities in a target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair; and generate an entity association rule base using the semantic confidence between the two target entities in the target entity pair.
[0069] In this embodiment, after calculating the association confidence between two target entities in a target entity pair in the cultural and tourism knowledge text through step S102 (e.g., using the Apriori algorithm to mine the co-occurrence frequency of target entity pairs in the cultural and tourism knowledge text, and calculating the association confidence between two target entities in the target entity pair based on the obtained co-occurrence frequency), in order to achieve the upgrade from "keyword matching" to "cultural logical association" and ensure that the subsequently automatically constructed rule base meets the knowledge integration needs of the cultural and tourism industry, further, existing or future vector generation methods (e.g., using the BERT model) can be used to generate the semantic vectors corresponding to the two target entities in each target entity pair (represented as follows). and And based on the semantic vectors corresponding to these two target entities (). and ), calculate the cosine similarity between the two target entities (i.e. The cosine similarity is used as the semantic similarity between the two target entities. Then, the association confidence between the two target entities is multiplied by the cosine similarity to obtain the semantic confidence between the two target entities in the corresponding target entity pair. The specific calculation formula is as follows: (2) in, Represents the target entity and Semantic confidence between them; Represents the target entity and The confidence level of the association between them is calculated using the formula (1) above. Represents the target entity and Cosine similarity between them.
[0070] For example, regarding the target entities "Miao silver ornaments" and "Maple Tree God," their co-occurrence frequency in daily transaction data, product descriptions, or tourist feedback is usually low. However, they have a strong semantic connection due to the inherent logic of Miao culture. The "maple wood pattern" and "tree branch pattern" commonly found in Miao silver ornaments are based on the Maple Tree God from ancient songs. Silversmiths transform the image of the sacred tree into decorative symbols through engraving, symbolizing the origin of life and the foundation of the ethnic group. Even though the co-occurrence frequency of "Miao silver ornaments" and "Maple Tree God" is low (low support), their deep semantic connection can be clearly identified through cultural tracing and symbol interpretation (high semantic confidence). This connection reflects the inevitable link between "explicit cultural symbols (silver ornaments)" and "implicit cultural roots (mythological imagery)," representing the relationship between the "surface" and the "essence" in the inheritance of ethnic culture.
[0071] Based on this, further, target entity pairs with semantic confidence higher than the preset confidence threshold (the specific value is not limited and can be set according to the actual situation and experience, such as 0.6) can be selected, and the semantic confidence between two target entities and the two target entities can be used to generate an entity association rule base, which can be represented as R. It can be understood that the content of the entity association rule base R can include not only historical story entities and intangible cultural heritage skill entities and the semantic confidence between them, but also intangible cultural heritage skill entities and derivative product entities and the semantic confidence between them. For example, the entity association rule base R can contain: (Miao ancient songs, Miao silver ornaments, 0.75), which is used to indicate that the semantic confidence between Miao ancient songs and Miao silver ornaments is 0.75. It can be understood that the semantic confidence between intangible cultural heritage skill entities and derivative product entities can still be calculated using the above formulas (1) and (2), only the historical story entities and intangible cultural heritage skill entities (i.e. and The corresponding entities are replaced with intangible cultural heritage skills entities and derivative product entities (i.e., and That's all; I won't go into details here.
[0072] In this way, the co-occurrence rules of target entity pairs in cultural and tourism knowledge texts are first mined using the Apriori algorithm, and the association confidence is calculated (i.e., formula (1)). Then, the semantic vectors of the two target entities in the target entity pair are generated (using BERT). Cosine similarity is introduced to enhance the credibility of the rules, and the semantic confidence is calculated (i.e., formula (2)). Then, using a pre-set confidence threshold (e.g., 0.6), the rule content that meets the confidence threshold (e.g., higher than 0.6) is retained (e.g., (Miao ancient songs, Miao silver ornaments, 0.75)), forming the entity association rule library R set. This realizes the combination of traditional association rules and pre-trained model semantic vectors, thereby avoiding the need for manually defining association logic rules and constructing a dynamically changeable entity association rule library R (which can be automatically optimized according to real-time data (e.g., scenic spot traffic, e-commerce sales, media opinion)). This enhances the practical value of the cultural and tourism knowledge association graph constructed using this entity association rule library R.
[0073] S104: Using the entity association rule base, generate candidate triples consisting of historical story entities, intangible cultural heritage skill entities, and derivative product entities; and calculate the association score corresponding to each candidate triple.
[0074] In this embodiment, after generating the entity association rule base R in step S103, the content contained in the entity association rule base R (i.e., historical story entities) can be further utilized. With intangible cultural heritage skills and the semantic confidence between the two, and the intangible cultural heritage skills entities With derivative products (and the semantic confidence between the two), generating historical story entities. Intangible cultural heritage skills and derivative products Candidate triples formed The association score corresponding to each candidate triple is calculated and used to execute the subsequent step S105 to construct the cultural and tourism knowledge association graph corresponding to the target region.
[0075] Specifically, one possible implementation is to first, for the i-th (a positive integer with a value greater than 0) historical story entity... It can be derived from historical story entities contained in the entity association rule base. With intangible cultural heritage skills From the semantic confidence scores between the two entities, K (positive integers greater than 0, such as 5) intangible cultural heritage skill entities with the highest semantic confidence scores between them and the i-th historical story entity are selected. This means extracting the top-K (e.g., K=5) intangible cultural heritage skill entities with the highest semantic confidence scores between them and the i-th historical story entity. Related intangible cultural heritage entities .
[0076] Then, from the entity association rule base containing intangible cultural heritage skills entities With derivative products From the semantic confidence between the two, we select the derivative product entities corresponding to each of the K intangible cultural heritage skill entities. .
[0077] Next, various historical figures (such as...) can be utilized. The system selects K intangible cultural heritage (ICH) skill entities from the entity association rule base, and constructs M (positive integers greater than 0) candidate triples for each of the K ICH skill entities. Each candidate triple includes a historical story entity, an ICH skill entity, and a derivative product entity. For example, a certain candidate triple... Its composition can be: =“Miao Ethnic Folk Songs” (Historical Story) → =“Miao silver ornaments” (physical product of intangible cultural heritage craftsmanship) → =“Double Dragons Fighting for a Treasure Silver Necklace” (physical derivative product).
[0078] Furthermore, for each of the M candidate triplets, taking the j-th candidate triplet (whose value is a positive integer greater than 0 and not greater than M) as an example, we can first examine the historical story entities it contains. With intangible cultural heritage skills The semantic confidence between them and the intangible cultural heritage skill entities they contain With derivative products The semantic confidence between them is multiplied to obtain the result of the multiplication calculation.
[0079] Then, calculate the historical story entities contained in the j-th candidate triple. The corresponding historical story entity The matrix (X) containing keywords, and the derivative product entities contained in the j-th candidate triple. The corresponding derivative product entity The similarity between the matrix (X) and the keyword is calculated to obtain the similarity result.
[0080] Next, the obtained multiplication and similarity calculation results can be weighted and summed to obtain a weighted sum, which is then used as the association score corresponding to the j-th candidate triplet. This process is repeated to calculate the association score for each of the M candidate triplets. The specific calculation formula is as follows: (3) in, This represents the association score corresponding to the j-th candidate triple; , representing historical story entities With intangible cultural heritage skills The semantic confidence between them can be calculated by referring to the above formula (2); This indicates the physical manifestation of intangible cultural heritage techniques. With derivative products The semantic confidence between them can also be calculated by referring to the above formula (2), only needing to... and Replace with and That's all; This represents the weighting parameter, and its specific value is not limited. It can be set according to the actual situation and experience, such as 0.3. Representing historical story entities The corresponding matrix (X) of keywords and derivative product entities The corresponding similarity between the matrix (X) and the keyword is calculated in a way that is not limited to any specific method and can be set according to the actual situation and empirical values. For example, in practical applications, if With keyword matrix, If the rows and columns of the matrix containing the keywords are completely identical, then it can be directly treated as two matrices / vectors for calculating the distance or cosine. Alternatively, if... With keyword matrix, If the rows and columns of the entity and keyword matrix are not completely consistent, you can first align them according to the intersection of the entity and keyword matrix, and then calculate the cosine similarity at the entity level or the overall level.
[0081] S105: Select triples with correlation scores higher than the preset score threshold from all candidate triples as target triples to construct a cultural and tourism knowledge correlation graph corresponding to the target region.
[0082] In this embodiment, after generating (M) candidate triples consisting of historical story entities, intangible cultural heritage skill entities, and derivative product entities through step S104, and calculating the correlation score corresponding to each candidate triple, further, firstly, the triples with correlation scores higher than a preset score threshold (the specific value is not limited and can be set according to the actual situation and experience, such as 0.5) can be selected from all candidate triples as target triples to remove redundant correlations. For example, taking the preset score threshold as 0.5 as an example, when the correlation score of the candidate triple (Miao ancient song, Miao silver ornament, double dragon snatching treasure silver necklace) is calculated to be 0.68 using the above formula (3), the candidate triple can be retained as the target triple.
[0083] Then, the selected target triples can be stored in a graph database (such as Neo4j), with the historical story entities, intangible cultural heritage skill entities, and derivative product entities contained in the selected target triples all used as node attributes, and the association scores of the corresponding target triples used as edge attributes, to construct a cultural tourism knowledge association graph corresponding to the target region, as shown in the example below. Figure 2 As shown, this allows merchants in the target area to obtain information from... Figure 2 The association graph shown allows for quick searching of skills and products highly related to one's local culture, enabling the development of competitive specialty products.
[0084] In summary, this embodiment provides a method for constructing a cultural tourism knowledge association graph. First, it acquires cultural tourism knowledge text for a target region; then, it extracts target entities from the text and generates a matrix of target entities and keywords. The target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities. Next, based on the matrix of target entities and keywords, it calculates the association confidence between two target entities in a target entity pair within the text. Then, based on the association confidence and semantic similarity between the two target entities in the target entity pair, it calculates the semantic confidence between them. Using the semantic confidence between the two target entities in the target entity pair, it generates an entity association rule base. Next, using the entity association rule base, it generates candidate triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities. It calculates the association score corresponding to each candidate triple. Finally, it selects triples from all candidate triples whose association scores are higher than a preset score threshold as target triples to construct the cultural tourism knowledge association graph corresponding to the target region.
[0085] As can be seen, this application achieves the construction of a chain-like intelligent association graph of "historical stories → intangible cultural heritage skills → derivative products" by mining the statistical patterns (which can be understood as association confidence) and semantic associations (which can be understood as semantic confidence) between target entities (i.e., historical story entities, intangible cultural heritage skill entities, and derivative product entities) contained in the cultural and tourism knowledge text of the target region. Specifically, it uses target triples composed of historical story entities, intangible cultural heritage skill entities, and derivative product entities with association scores higher than a preset score threshold to construct the cultural and tourism knowledge association graph corresponding to the target region. This not only solves the problems of high cost, low efficiency, and low real-time and accuracy of existing cultural and tourism knowledge association methods, achieving an ideal association effect, but also facilitates merchants in the target region to quickly find skills and products highly related to their local cultural characteristics from this cultural and tourism knowledge association graph, thereby developing distinctive products with market competitiveness and improving the product buying and selling experience between merchants and buyers.
[0086] Second Embodiment
[0087] This embodiment will introduce a device for constructing a cultural tourism knowledge association graph. For related content, please refer to the above method embodiment.
[0088] See Figure 3 This is a schematic diagram of the composition of a cultural tourism knowledge association graph construction device provided in this embodiment. The device 300 includes: The acquisition unit 301 is used to acquire cultural and tourism knowledge text of the target region; extract target entities from the cultural and tourism knowledge text; and generate a matrix of target entities and keywords; the target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities; The first calculation unit 302 is used to calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text based on the matrix of the target entities and keywords. The second calculation unit 303 is used to calculate the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair; and to generate an entity association rule base using the semantic confidence between the two target entities in the target entity pair. The third calculation unit 304 is used to generate candidate triples composed of the historical story entity, the intangible cultural heritage skill entity, and the derivative product entity using the entity association rule base; and to calculate the association score corresponding to each candidate triple. The construction unit 305 is used to select triples with a correlation score higher than a preset score threshold from all the candidate triples as target triples to construct the cultural and tourism knowledge correlation graph corresponding to the target region.
[0089] In one implementation of this embodiment, the acquisition unit 301 is specifically used for: The target entity is located in the cultural and tourism knowledge text. TF-IDF feature extraction is performed to obtain a feature vector. A matrix of the target entity and keywords is generated based on the feature vector.
[0090] In one implementation of this embodiment, the first computing unit 302 is specifically used for: Based on the matrix of target entities and keywords, the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text are mined, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence rules of target entity pairs.
[0091] In one implementation of this embodiment, the first computing unit 302 is specifically used for: Based on the matrix of target entities and keywords, the Apriori algorithm is used to mine the co-occurrence frequency of target entity pairs in the cultural and tourism knowledge text, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence frequency of target entity pairs.
[0092] In one implementation of this embodiment, the apparatus further includes: The fourth calculation unit is used to generate semantic vectors corresponding to the two target entities in the target entity pair; and to calculate the cosine similarity between the two target entities based on the semantic vectors corresponding to the two target entities, as the semantic similarity between the two target entities. The second calculation unit 303 is specifically used for: The semantic confidence between the two target entities in the target entity pair is obtained by multiplying the association confidence between the two target entities in the target entity pair by the cosine similarity.
[0093] In one implementation of this embodiment, the second calculation unit 303 is specifically used for: Target entity pairs with semantic confidence scores higher than a preset confidence threshold are selected; and an entity association rule base is generated using two target entities from the selected target entities and the semantic confidence score between the two target entities.
[0094] In one implementation of this embodiment, the entity association rule base includes historical story entities and intangible cultural heritage skill entities, as well as the semantic confidence between them; the entity association rule base also includes intangible cultural heritage skill entities and derivative product entities, as well as the semantic confidence between them; the third calculation unit 304 includes: The first filtering subunit is used to filter out K intangible cultural heritage skill entities with the highest semantic confidence between the i-th historical story entity and the i-th historical story entity from the entity association rule base; where i is a positive integer greater than 0; and K is a positive integer greater than 0. The second filtering subunit is used to filter out the derivative product entities corresponding to each of the K intangible cultural heritage skill entities from the entity association rule base; A subunit is constructed to utilize each historical story entity, K intangible cultural heritage skill entities selected from the entity association rule base, and derivative product entities corresponding to each of the K intangible cultural heritage skill entities selected from the entity association rule base to construct M candidate triples; where M is a positive integer greater than 0; wherein each candidate triple includes a historical story entity, an intangible cultural heritage skill entity, and a derivative product entity.
[0095] In one implementation of this embodiment, the third computing unit 304 includes: The multiplication calculation subunit is used to multiply the semantic confidence between the historical story entity and the intangible cultural heritage skill entity contained in the j-th candidate triplet by the semantic confidence between the intangible cultural heritage skill entity and the derivative product entity contained in it, and obtain the multiplication calculation result; where j is a positive integer greater than 0 and not greater than M. The similarity calculation subunit is used to calculate the similarity between the matrix of historical story entities and keywords corresponding to the historical story entities contained in the j-th candidate triplet and the matrix of derivative product entities and keywords corresponding to the derivative product entities contained in the j-th candidate triplet, and to obtain the similarity calculation result. The weighted summation calculation subunit is used to perform a weighted summation calculation on the multiplication calculation result and the similarity calculation result to obtain a weighted summation calculation result, and use the weighted summation calculation result as the association score corresponding to the j-th candidate triple; and so on, until the association score corresponding to each candidate triple is calculated.
[0096] In one implementation of this embodiment, the construction unit 305 is specifically used for: From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples. The historical story entities, intangible cultural heritage skill entities, and derivative product entities contained in the selected target triples are used as node attributes, and the correlation score of the corresponding target triples is used as edge attributes to construct the cultural tourism knowledge association graph corresponding to the target region.
[0097] Furthermore, this application embodiment also provides a cultural tourism knowledge association graph construction device, including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to execute any of the above-described implementations of the cultural tourism knowledge association graph construction method.
[0098] refer to Figure 4 The diagram illustrates a structural schematic suitable for implementing the cultural tourism knowledge association graph construction device in the embodiments of this application. The cultural tourism knowledge association graph construction device in the embodiments of this application may include, but is not limited to, terminals, servers, etc., that have applications installed capable of constructing cultural tourism knowledge association graphs. Figure 4 The cultural and tourism knowledge association graph construction device shown is merely an example of an electronic device and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0099] like Figure 4 As shown, the cultural tourism knowledge association graph construction device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage device 408 into the random access memory (RAM) 403. When the cultural tourism knowledge association graph construction device is powered on, the RAM 403 also stores various programs and data required for device operation. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0100] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, memory cards, hard drives, etc.; and communication devices 409. Communication device 409 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 A device for constructing a cultural and tourism knowledge association graph with various apparatuses is shown; however, it should be understood that implementation or possession of all the apparatuses shown is not required. More or fewer apparatuses may be implemented alternatively.
[0101] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to execute any of the above-described methods for constructing a cultural and tourism knowledge association graph.
[0102] Furthermore, this application embodiment also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-described methods for constructing a cultural tourism knowledge association graph.
[0103] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0104] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0105] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0106] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for constructing a cultural tourism knowledge association graph, characterized in that, include: Acquire textual information on cultural and tourism knowledge of the target region; The system extracts target entities from the cultural and tourism knowledge text and generates a matrix of target entities and keywords; the target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities. Based on the matrix of target entities and keywords, calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text; Calculate the semantic confidence between the two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair; And filter out target entity pairs whose semantic confidence is higher than the preset confidence threshold; And by using two target entities from the filtered target entities, and the semantic confidence between the two target entities, an entity association rule base is generated; Using the entity association rule base, M candidate triples are generated, consisting of the historical story entity, the intangible cultural heritage skill entity, and the derivative product entity; where M is a positive integer greater than 0; and the association score corresponding to each candidate triple is calculated; wherein each candidate triple includes a historical story entity, an intangible cultural heritage skill entity, and a derivative product entity; From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples to construct the cultural and tourism knowledge correlation graph corresponding to the target region. The calculation of the association score corresponding to each of the candidate triples includes: For the j-th candidate triple, the semantic confidence between the historical story entity and the intangible cultural heritage skill entity contained in it is multiplied by the semantic confidence between the intangible cultural heritage skill entity and the derivative product entity contained in it to obtain the multiplication result; where j is a positive integer greater than 0 and not greater than M; Calculate the similarity between the matrix of historical story entities and keywords corresponding to the historical story entities contained in the j-th candidate triplet and the matrix of derivative product entities and keywords corresponding to the derivative product entities contained in the j-th candidate triplet, and obtain the similarity calculation result; The multiplication result and the similarity result are weighted and summed to obtain a weighted sum result, which is then used as the association score corresponding to the j-th candidate triple; this process is repeated until the association score corresponding to each candidate triple is calculated.
2. The method according to claim 1, characterized in that, The generation of the matrix of target entities and keywords includes: The target entity is located in the cultural and tourism knowledge text. TF-IDF feature extraction is performed to obtain a feature vector. A matrix of the target entity and keywords is generated based on the feature vector.
3. The method according to claim 1, characterized in that, The step of calculating the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text based on the matrix of target entities and keywords includes: Based on the matrix of target entities and keywords, the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text are mined, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence rules of target entity pairs.
4. The method according to claim 3, characterized in that, The step of mining the co-occurrence rules of target entity pairs in the cultural and tourism knowledge text based on the matrix of target entities and keywords, and calculating the association confidence between two target entities in the target entity pair based on the obtained co-occurrence rules, includes: Based on the matrix of target entities and keywords, the Apriori algorithm is used to mine the co-occurrence frequency of target entity pairs in the cultural and tourism knowledge text, and the association confidence between two target entities in the target entity pair is calculated based on the obtained co-occurrence frequency of target entity pairs.
5. The method according to claim 1, characterized in that, Before calculating the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair, the method further includes: Generate semantic vectors corresponding to each of the two target entities in the target entity pair; and calculate the cosine similarity between the two target entities based on the semantic vectors corresponding to each of the two target entities, which is used as the semantic similarity between the two target entities. The step of calculating the semantic confidence between two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair includes: The semantic confidence between the two target entities in the target entity pair is obtained by multiplying the association confidence between the two target entities in the target entity pair by the cosine similarity.
6. The method according to claim 1, characterized in that, The entity association rule base includes historical story entities and intangible cultural heritage skill entities, as well as the semantic confidence between them; the entity association rule base also includes intangible cultural heritage skill entities and derivative product entities, as well as the semantic confidence between them; the step of using the entity association rule base to generate M candidate triples composed of the historical story entities, intangible cultural heritage skill entities, and derivative product entities includes: For the i-th historical story entity, select K intangible cultural heritage skill entities with the highest semantic confidence among the i-th historical story entity from the entity association rule base; where i is a positive integer greater than 0; and K is a positive integer greater than 0. Filter out the derivative product entities corresponding to each of the K intangible cultural heritage skill entities from the entity association rule base; Using various historical story entities, K intangible cultural heritage skill entities selected from the entity association rule base, and derivative product entities corresponding to each of the K intangible cultural heritage skill entities selected from the entity association rule base, M candidate triples are constructed.
7. The method according to claim 1, characterized in that, The process of selecting triplets from all candidate triplets whose association scores are higher than a preset score threshold as target triplets is used to construct a cultural tourism knowledge association graph corresponding to the target region, including... From all the candidate triples, triples with a correlation score higher than a preset score threshold are selected as target triples. The historical story entities, intangible cultural heritage skill entities, and derivative product entities contained in the selected target triples are used as node attributes, and the correlation score of the corresponding target triples is used as edge attributes to construct the cultural tourism knowledge association graph corresponding to the target region.
8. A device for constructing a cultural tourism knowledge association graph, characterized in that, include: The acquisition unit is used to acquire cultural and tourism knowledge texts of the target region; The system extracts target entities from the cultural and tourism knowledge text and generates a matrix of target entities and keywords; the target entities include historical story entities, intangible cultural heritage skill entities, and derivative product entities. The first calculation unit is used to calculate the association confidence between two target entities in the target entity pair in the cultural and tourism knowledge text based on the matrix of the target entities and keywords. The second calculation unit is used to calculate the semantic confidence between the two target entities in the target entity pair based on the association confidence and semantic similarity between the two target entities in the target entity pair; And filter out target entity pairs whose semantic confidence is higher than the preset confidence threshold; And by using two target entities from the filtered target entities, and the semantic confidence between the two target entities, an entity association rule base is generated; The third calculation unit is used to generate M candidate triples consisting of the historical story entity, the intangible cultural heritage skill entity, and the derivative product entity using the entity association rule base; where M is a positive integer greater than 0; and to calculate the association score corresponding to each candidate triple; wherein each candidate triple includes a historical story entity, an intangible cultural heritage skill entity, and a derivative product entity; The construction unit is used to select triples with a correlation score higher than a preset score threshold from all the candidate triples as target triples, in order to construct the cultural and tourism knowledge correlation graph corresponding to the target region. The third computing unit includes: The multiplication calculation subunit is used to multiply the semantic confidence between the historical story entity and the intangible cultural heritage skill entity contained in the j-th candidate triplet by the semantic confidence between the intangible cultural heritage skill entity and the derivative product entity contained in it, and obtain the multiplication calculation result; where j is a positive integer greater than 0 and not greater than M. The similarity calculation subunit is used to calculate the similarity between the matrix of historical story entities and keywords corresponding to the historical story entities contained in the j-th candidate triplet and the matrix of derivative product entities and keywords corresponding to the derivative product entities contained in the j-th candidate triplet, and to obtain the similarity calculation result. The weighted summation calculation subunit is used to perform a weighted summation calculation on the multiplication calculation result and the similarity calculation result to obtain a weighted summation calculation result, and use the weighted summation calculation result as the association score corresponding to the j-th candidate triple; and so on, until the association score corresponding to each candidate triple is calculated.
9. A device for constructing a cultural tourism knowledge association graph, characterized in that, include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method described in any one of claims 1-7.
11. A computer program product, characterized in that, The program product includes a computer program that, when executed by an electronic product, can implement the method described in any one of claims 1-7.
Citation Information
Patent Citations
Knowledge graph construction method
CN115221335A
Knowledge graph construction method and device, electronic equipment and nonvolatile storage medium
CN115495595A