Traditional culture knowledge reasoning method and system based on graph neural network

CN122905070APending Publication Date: 2026-10-13XIAN INST OF INTERPRETATION & TRANSLATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139586.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

同一条关系类型连接两个实体时,无论这两个实体分属相同文化域还是不同文化域,其注意力权重的计算方式完全一致,导致跨文化边上的信息传递无法根据文化亲疏进行适应性调节,大量弱相关甚至不可靠的跨文化边被赋予过高权重,而真正有历史源流关系的跨文化路径却可能被淹没在噪声中

Benefits of technology

[0017]上述基于图神经网络的传统文化知识推理方法及系统,通过获取源自不同文化域的传统文化知识数据,从中提取得到文化实体,以文化实体为节点、以实体间的多元关系为边构建传统文化异质知识图谱,并为各节点分配文化域标签的技术手段,能够实现多源分散的传统文化知识的结构化整合和跨域知识的异质关系统一表征的技术效果,可以解决传统文化知识分散在不同文化域中、知识体系相互独立和实体关联关系混杂单一导致的跨文化域知识推理缺乏统一结构化知识载体和明确域属性依据的问题;通过根据各节点的文化域标签构建文化偏置矩阵,根据文化偏置矩阵构建得到文化域感知异构图注意力网络,将各节点的属性信息向量化得到节点表示后输入文化域感知异构图注意力网络,计算各条边的注意力权重,并根据注意力权重完成邻居信息聚合和节点表示更新的技术手段,能够实现融合文化域差异特征的异质图谱节点表征学习,差异化分配不同文化域邻居信息的聚合权重的技术效果,可以解决传统异构图注意力网络忽略文化域属性差异、对不同来源的邻居信息进行无差别聚合导致的无法体现文化域特性和跨文化域知识推理存在语义偏差的问题;通过从传统文化异质知识图谱中筛选出属于不同文化域且无直接边连接的节点对,对节点对进行路径采样得到路径实例集合,将各路径实例输入路径编码器进行编码,再对编码结果进行注意力聚合得到节点对的路径上下文向量的技术手段,能够实现跨文化域节点间长距离隐含关联路径的挖掘和多路径语义信息的整合表征的技术效果,可以解决传统知识推理仅依赖节点直接邻接信息开展分析、无法捕捉跨文化域节点间的长链路隐含关联导致的跨域知识推理缺乏逻辑链路支撑和推理过程呈黑箱状态的问题;通过结合更新后节点表示和路径上下文向量,计算各节点对和各多元关系之间的关联合理性得分,将关联合理性得分超过关联阈值的节点对和多元关系判定为存在隐含关联,最终输出传统文化知识推理结果的技术手段,能够实现融合节点级语义特征和路径级逻辑特征的跨文化域隐含知识关联精准判定的技术效果,可以解决传统知识推理方法仅基于单一节点表示进行关联预测、缺乏路径逻辑验证导致的跨文化域隐含知识挖掘准确率不足和推理结果可信度偏低的问题,可以挖掘不同文化域传统文化知识间的潜在关联,完善传统文化知识图谱体系,提升传统文化知识推理结果的准确性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905070A_ABST
    Figure CN122905070A_ABST
Patent Text Reader

Abstract

The application relates to a traditional culture knowledge reasoning method and system based on a graph neural network. The method comprises the following steps: acquiring multi-cultural domain traditional culture knowledge data, extracting cultural entities, and constructing a traditional culture heterogeneous knowledge graph with cultural domain labels; constructing a cultural bias matrix and a cultural domain perception heterogeneous graph attention network; vectorizing and aggregating neighbor information of each node to generate updated node representations; screening node pairs across cultural domains and without direct edges, sampling path instances, and encoding and aggregating to obtain path context vectors; combining the updated node representations and the path context to calculate a relevance rationality score, determining implicit relevance, and outputting a traditional culture knowledge reasoning result. The method can integrate multi-domain traditional culture knowledge, perceive cultural domain differences, effectively mine long-distance implicit cross-cultural domain relevance, improve the accuracy and explainability of traditional culture knowledge reasoning, and help improve the traditional culture knowledge system and cross-domain inheritance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of knowledge graph reasoning and graph neural networks, and in particular relates to a method and system for reasoning about traditional cultural knowledge based on graph neural networks. Background Technology

[0002] With the deepening of digital humanities research, a large amount of traditional cultural knowledge is being organized and stored in the form of structured knowledge graphs. These knowledge graphs cover cultural entities such as figures, works, ideas, artifacts, historical events, geographical locations, and art forms from different cultural spheres, as well as the diverse relationships between these entities, including creation, citation, evolution, influence, and dissemination. However, due to limitations in the cultural perspective during construction and restrictions on relationship extraction methods, most relationships in existing traditional cultural knowledge graphs remain at the level of explicit connections within a single cultural domain, and the deep, implicit connections between entities in different cultural domains have not been fully explored.

[0003] In cross-cultural knowledge reasoning scenarios, there may be connections between two entities from different cultural domains that require multiple tracing steps to become apparent. For example, an idea or concept in one cultural domain may indirectly influence an art form in another cultural domain through several intermediate entities. Existing knowledge reasoning methods based on graph neural networks mainly rely on the similarity of node features and relation types when calculating attention weights, lacking the ability to perceive the heterogeneity of the cultural domain dimension. When two entities are connected by the same relation type, regardless of whether the two entities belong to the same or different cultural domains, the calculation method for their attention weights is completely identical. This results in the information transmission at cross-cultural edges failing to adapt to cultural affinity, with many weakly related or even unreliable cross-cultural edges being assigned excessively high weights, while truly historically related cross-cultural paths may be submerged in noise. Furthermore, existing methods, when dealing with multi-hop paths, typically lack explicit modeling of cultural domain transition points along the path, failing to effectively capture the semantic features of cross-cultural transmission paths. Summary of the Invention

[0004] Therefore, it is necessary to provide a traditional cultural knowledge reasoning method and system based on graph neural networks that can perceive cultural domain differences, adaptively adjust the intensity of cross-cultural information transmission, and improve the accuracy of implicit association reasoning, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for reasoning about traditional cultural knowledge based on graph neural networks, including:

[0006] We acquire traditional cultural knowledge data from different cultural domains, extract cultural entities from the traditional cultural knowledge data, construct a heterogeneous knowledge graph of traditional culture with cultural entities as nodes and the multi-dimensional relationships between cultural entities as edges, and assign cultural domain labels to each node.

[0007] Based on the cultural domain labels, a cultural bias matrix is ​​constructed, and based on the cultural bias matrix, a cultural domain perception heterogeneous graph attention network is constructed.

[0008] The attribute information corresponding to each node is vectorized to obtain the node representation of each node. The node representation is then input into the cultural domain perceptual heterogeneous graph attention network to calculate the attention weights of each edge connecting each node. Based on the attention weights, the neighbor information of each node is aggregated and the representation is updated to obtain the updated node representation of each node.

[0009] Node pairs belonging to different cultural domains and without edge connections are selected from the heterogeneous knowledge graph of traditional culture. Path sampling is performed on the node pairs to obtain a set of path instances. Each path instance in the set of path instances is input into the path encoder for encoding to obtain the encoding result. Attention aggregation is performed on the encoding result to obtain the path context vector of the node pair.

[0010] Based on the updated node representations and path context vectors, the association rationality scores between each node pair and each multi-element relationship are calculated. Node pairs and multi-element relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and the reasoning results of traditional cultural knowledge are output.

[0011] Secondly, this application also provides a traditional culture knowledge reasoning system based on graph neural networks, the system comprising:

[0012] The graph construction module is used to acquire traditional cultural knowledge data from different cultural domains, extract cultural entities from the traditional cultural knowledge data, construct a heterogeneous knowledge graph of traditional culture with cultural entities as nodes and the multi-dimensional relationships between cultural entities as edges, and assign cultural domain labels to each node.

[0013] The network construction module is used to construct a cultural bias matrix based on cultural domain labels, and to construct a cultural domain perception heterogeneous graph attention network based on the cultural bias matrix.

[0014] The encoding update module is used to vectorize the attribute information corresponding to each node to obtain the node representation of each node. The node representation is then input into the cultural domain-aware heterogeneous graph attention network to calculate the attention weights of each edge connecting each node. Based on the attention weights, the module aggregates neighbor information and updates the representation of each node to obtain the updated node representation of each node.

[0015] The path aggregation module is used to filter out node pairs belonging to different cultural domains and without edge connections from the heterogeneous knowledge graph of traditional culture, perform path sampling on the node pairs to obtain a set of path instances, input each path instance in the set of path instances into the path encoder for encoding, obtain the encoding result, and perform attention aggregation on the encoding result to obtain the path context vector of the node pair.

[0016] The reasoning output module is used to calculate the association rationality score between each node pair and each multi-element relationship based on the updated node representation and path context vector. Node pairs and multi-element relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and the reasoning results of traditional cultural knowledge are output.

[0017] The aforementioned method and system for reasoning about traditional cultural knowledge based on graph neural networks acquires traditional cultural knowledge data from different cultural domains, extracts cultural entities from them, constructs a heterogeneous knowledge graph of traditional culture using cultural entities as nodes and multiple relationships between entities as edges, and assigns cultural domain labels to each node. This technical approach achieves the structured integration of dispersed traditional cultural knowledge from multiple sources and the unified representation of heterogeneous relationships across domains. It addresses the problem of a lack of unified structured knowledge carriers and clear domain attribute basis for cross-cultural domain knowledge reasoning caused by the dispersion of traditional cultural knowledge across different cultural domains, the independence of knowledge systems, and the mixed and singular nature of entity relationships. Furthermore, by constructing a cultural domain label based on each node... A bias matrix is ​​used to construct a cultural domain-aware heterogeneous graph attention network. The attribute information of each node is vectorized to obtain node representations, which are then input into the cultural domain-aware heterogeneous graph attention network. Attention weights for each edge are calculated, and neighbor information aggregation and node representation updates are performed based on these attention weights. This technique enables the learning of node representations in heterogeneous graphs that integrate cultural domain differences, and differentiates the aggregation weights of neighbor information from different cultural domains. It addresses the problems of traditional heterogeneous graph attention networks ignoring cultural domain attribute differences and indiscriminately aggregating neighbor information from different sources, leading to a failure to reflect cultural domain characteristics and semantic biases in cross-cultural knowledge reasoning. This approach, through the study of traditional cultural heterogeneity... This technique involves selecting node pairs belonging to different cultural domains without direct edge connections from a knowledge graph, sampling paths between these pairs to obtain a set of path instances, inputting each path instance into a path encoder for encoding, and then performing attention aggregation on the encoding results to obtain the path context vector of the node pair. This approach enables the discovery of long-distance implicit association paths between nodes across cultural domains and the integration and representation of multi-path semantic information. It addresses the problems of traditional knowledge reasoning, which relies solely on direct adjacency information and fails to capture long-link implicit associations between nodes across cultural domains, resulting in a lack of logical support and a black-box reasoning process. By combining the updated node representation and the path context vector, the technique calculates the path context vector of each node pair. This technique, which scores the reasonableness of associations between point pairs and various multi-dimensional relationships, determines that node pairs and multi-dimensional relationships with reasonableness scores exceeding the association threshold are implicitly associated, and ultimately outputs the reasoning results of traditional cultural knowledge. This technique can achieve the technical effect of accurately determining the implicit knowledge associations across cultural domains by integrating node-level semantic features and path-level logical features. It can solve the problems of insufficient accuracy in cross-cultural domain implicit knowledge mining and low credibility of reasoning results caused by traditional knowledge reasoning methods that only rely on single node representations for association prediction and lack path logic verification. It can also explore the potential associations between traditional cultural knowledge in different cultural domains, improve the traditional cultural knowledge graph system, and enhance the accuracy and reliability of traditional cultural knowledge reasoning results. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of a traditional cultural knowledge reasoning method based on graph neural networks according to the present invention;

[0020] Figure 2 This is a flowchart illustrating the generation of updated node representations in one optional embodiment of the present invention;

[0021] Figure 3 This is a structural diagram of a traditional cultural knowledge reasoning system based on graph neural networks according to the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0023] In one embodiment, such as Figure 1 As shown, a method for reasoning about traditional cultural knowledge based on graph neural networks is provided. This embodiment illustrates the application of this method to a knowledge reasoning terminal. It is understood that this method can also be applied to a knowledge reasoning server, and further to a knowledge reasoning system including both a knowledge reasoning terminal and a knowledge reasoning server, and is implemented through the interaction between the knowledge reasoning terminal and the knowledge reasoning server. In this embodiment, the method includes the following steps:

[0024] Step S101: Obtain traditional cultural knowledge data from different cultural domains, extract cultural entities from the traditional cultural knowledge data, construct a heterogeneous knowledge graph of traditional culture with cultural entities as nodes and the multi-dimensional relationships between cultural entities as edges, and assign cultural domain labels to each node.

[0025] Optionally, the knowledge reasoning terminal can acquire traditional cultural knowledge data from data sources such as ancient book databases, intangible cultural heritage resource databases, and regional cultural thematic databases. Through named entity recognition algorithms and relation extraction algorithms, it can extract various cultural entities and the multi-dimensional semantic relationships between cultural entities from the traditional cultural knowledge data. The knowledge reasoning terminal can use various cultural entities as nodes and the multi-dimensional semantic relationships between cultural entities as edges to construct a heterogeneous knowledge graph of traditional culture. The knowledge reasoning terminal can assign corresponding cultural domain labels to each node in the heterogeneous knowledge graph of traditional culture according to the cultural domain to which each cultural entity belongs.

[0026] Specifically, a cultural domain can be a cultural category divided according to dimensions such as regional cultural circles, ethnic cultural systems, and historical cultural contexts. A cultural domain can be a basic unit that distinguishes different cultural systems. Traditional cultural knowledge data can be a multi-source data collection recording various traditional cultural contents. Traditional cultural knowledge data can include, but is not limited to, knowledge content in various forms such as texts, cultural relics archives, and folk records. A cultural entity can be a basic unit with independent semantics in traditional cultural knowledge. A cultural entity can include, but is not limited to, figures, works, ideas, cultural relics, historical events, geographical locations, and art forms. Multiple relationships can be various types of semantic associations between different cultural entities. Multiple relationships can include, but are not limited to, creation, citation, evolution from, influence, and dissemination to. A heterogeneous knowledge graph of traditional culture can be a heterogeneous graph structure including multiple types of nodes and multiple types of edges. A heterogeneous knowledge graph of traditional culture can be used to structure and store and organize traditional cultural entities and relationships in different cultural domains. A cultural domain label can be a cultural domain attribute identifier attached to a node. A cultural domain label can be used to mark the cultural domain to which a node belongs.

[0027] Step S102: Based on the cultural domain labels, construct the cultural bias matrix, and based on the cultural bias matrix, construct the cultural domain perception heterogeneous graph attention network.

[0028] Optionally, the knowledge reasoning terminal can count the number of cultural domain labels of all nodes in the heterogeneous knowledge graph of traditional culture to obtain the number of cultural domain types; the knowledge reasoning terminal can initialize a two-dimensional matrix with the dimension of the number of cultural domain types multiplied by the number of cultural domain types, set each element in the matrix as a trainable parameter to obtain a cultural bias matrix; the knowledge reasoning terminal can integrate and embed the cultural bias matrix into the attention calculation module of the heterogeneous graph attention network to construct a cultural domain perception heterogeneous graph attention network.

[0029] Specifically, the cultural bias matrix can be a parameter matrix used to characterize the bias intensity of information flow between different cultural domains. The element in the i-th row and j-th column of the cultural bias matrix corresponds to the information transfer weight correction coefficient from the i-th cultural domain to the j-th cultural domain. The cultural bias matrix can adaptively learn the degree of cultural affinity between different cultural domains during model training. The cultural domain-aware heterogeneous graph attention network can be a heterogeneous graph attention network that integrates the cultural domain bias mechanism. The cultural domain-aware heterogeneous graph attention network can introduce cultural domain transfer bias for correction during the attention score calculation stage, perceive the cultural domain attributes of nodes, and differentiate the information transfer intensity on the edges of the same cultural domain and cross-cultural domains, thereby improving the feature representation quality of cross-cultural domain knowledge reasoning.

[0030] Step S103: Vectorize the attribute information corresponding to each node to obtain the node representation of each node. Input the node representation into the cultural domain perceptual heterogeneous graph attention network to calculate the attention weight of each edge connecting each node. Then, based on the attention weight, aggregate the neighbor information and update the representation of each node to obtain the updated node representation of each node.

[0031] Optionally, the knowledge reasoning terminal can extract attribute information such as entity name, attribute description, and source of classic texts corresponding to each node, and vectorize the attribute information to obtain the node representation of each node; the knowledge reasoning terminal can input the node representation of all nodes into the cultural domain perceptual heterogeneous graph attention network to calculate the attention weight of each edge connecting each node; the knowledge reasoning terminal can perform weighted aggregation of the node representations of all neighboring nodes of each node according to the attention weight, and then perform fusion and update by combining the node representations to obtain the updated node representation of each node.

[0032] Specifically, the node representation can be a low-dimensional dense vector corresponding to a cultural entity, and the node representation can be used to characterize the semantic and attribute features of the cultural entity itself; the attention weight can be the weight coefficient of each edge in the neighbor information aggregation process, and the attention weight can be used to determine the degree of influence of the information of the corresponding neighbor node on the feature update of the target node; the neighbor information aggregation can be a process of weighted fusion of the features of all neighbor nodes according to the attention weight, and the neighbor information aggregation can be used to enhance the neighborhood information of the node features; the updated node representation can be the node feature vector obtained after neighbor information aggregation and representation update, and the updated node representation can integrate its own semantics, neighborhood association information and cultural domain attributes.

[0033] Step S104: Select node pairs belonging to different cultural domains and without edge connections from the heterogeneous knowledge graph of traditional culture, perform path sampling on the node pairs to obtain a set of path instances, input each path instance in the set of path instances into the path encoder for encoding, obtain the encoding result, and perform attention aggregation on the encoding result to obtain the path context vector of the node pair.

[0034] Optionally, the knowledge reasoning terminal can traverse all nodes in the heterogeneous knowledge graph of traditional culture, and filter out node pairs belonging to different cultural domains that do not have direct edge connections. For each node pair, the knowledge reasoning terminal can perform multi-path sampling through a biased random walk strategy to generate multiple multi-hop path instances connecting the two nodes of the node pair, and summarize them to obtain a path instance set. The knowledge reasoning terminal can input each path instance in the path instance set into the path encoder for sequence semantic encoding to obtain the encoding result corresponding to each path instance. The knowledge reasoning terminal can use an attention aggregation mechanism to perform weighted fusion of the encoding results of all path instances, integrate the semantic and logical information of the path instances, and obtain the path context vector of each node pair.

[0035] Specifically, a node pair can be an entity pair consisting of two cultural entities belonging to different cultural domains and having no direct related edges; a path instance can be a multi-hop related path connecting the two nodes in a node pair, and a path instance can include, but is not limited to, the sequence of nodes and edges traversed sequentially on the path, and can be used to represent a potential logical link between two nodes; a path instance set can be a set of all path instances sampled for each node pair; a path encoder can be a neural network model used to perform deep semantic encoding on path instances, and can be used to extract the semantic and structural features of path instances; the encoding result can be a feature vector output by the path encoder, and can be used to represent the semantic information of a single path; a path context vector can be a feature vector that aggregates all valid path semantic and logical information between node pairs, and can be used to represent the overall features of a potential related path between two real nodes.

[0036] Step S105: Based on the updated node representation and path context vector, calculate the association rationality score between each node pair and each multi-element relationship. Node pairs and multi-element relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and the reasoning results of traditional cultural knowledge are output.

[0037] Optionally, the knowledge reasoning terminal can calculate the embedding matching score by combining the updated node representations of the two nodes in a node pair and the vector representation of the candidate multivariate relation; the knowledge reasoning terminal can calculate the path matching score by combining the path context vector of the node pair and the vector representation of the candidate multivariate relation; the knowledge reasoning terminal can perform weighted fusion of the embedding matching score and the path matching score to obtain the association rationality score between each node pair and the corresponding candidate multivariate relation; the knowledge reasoning terminal can compare the association rationality score of each node pair with the association threshold, and determine that node pairs and multivariate relations with association rationality scores exceeding the association threshold have implicit associations; the knowledge reasoning terminal can summarize all the implicit associations that are determined to be valid and generate the traditional culture knowledge reasoning result.

[0038] Specifically, the association rationality score can be a quantitative score that measures the reasonableness of a certain type of multivariate relationship between two nodes. The higher the association rationality score, the greater the possibility that there is an implicit association between the two nodes. The association threshold can be a pre-set threshold for judging implicit associations. The association threshold can be used to filter implicit association results that meet the confidence level and can be used to ensure the reliability of the reasoning results of traditional cultural knowledge. Implicit associations can be potential semantic relationships between nodes that are not explicitly recorded in the heterogeneous knowledge graph of traditional culture but are obtained through reasoning mining. The reasoning results of traditional cultural knowledge can be the set of all implicit associations mined. The reasoning results of traditional cultural knowledge can include node pairs and corresponding predicted relationships. The reasoning results of traditional cultural knowledge can be used to supplement and improve the heterogeneous knowledge graph of traditional culture and expand the traditional cultural knowledge system.

[0039] The aforementioned traditional cultural knowledge reasoning method based on graph neural networks acquires traditional cultural knowledge data from multiple cultural domains, extracts cultural entities, and constructs a heterogeneous traditional cultural knowledge graph with cultural domain labels. It then constructs a cultural bias matrix and a cultural domain-perceptual heterogeneous graph attention network. Each node is vectorized and its neighbor information is aggregated to generate an updated node representation. Node pairs that cross cultural domains and have no direct edges are selected, path instances are sampled, encoded, and aggregated to obtain path context vectors. Finally, the updated node representations and path context are combined to calculate the association rationality score, determine implicit associations, and output the traditional cultural knowledge reasoning result. This method can integrate traditional cultural knowledge from multiple domains, perceive cultural domain differences, effectively mine long-distance implicit associations across cultural domains, improve the accuracy and interpretability of traditional cultural knowledge reasoning, and contribute to the improvement and cross-domain inheritance of the traditional cultural knowledge system.

[0040] In one embodiment, a cultural bias matrix is ​​constructed based on cultural domain labels, and a cultural domain perceptual heterogeneous graph attention network is constructed based on the cultural bias matrix, which may include:

[0041] Step S201: Count the number of cultural domain tags to obtain the total number of cultural domain types.

[0042] Optionally, the knowledge reasoning terminal can traverse all nodes in the heterogeneous knowledge graph of traditional culture and obtain the cultural domain labels of all nodes; the knowledge reasoning terminal can perform deduplication statistics on the cultural domain labels, count the total number of different cultural domain labels, and obtain the number of cultural domain types.

[0043] Specifically, the number of cultural domain types can be the total number of different cultural domain types included in the heterogeneous knowledge graph of traditional culture, and the number of cultural domain types can be used to determine the dimension of the cultural bias matrix.

[0044] Step S202: Construct a matrix with dimensions equal to the number of cultural domain types multiplied by the number of cultural domain types, and set each element in the matrix as a trainable parameter to obtain the cultural bias matrix.

[0045] Optionally, the knowledge reasoning terminal can initialize a two-dimensional matrix with the number of rows and columns equal to the number of cultural domains, based on the number of cultural domain types. The knowledge reasoning terminal can set each element in the matrix as a trainable parameter to obtain a cultural bias matrix.

[0046] Specifically, the element in the i-th row and j-th column of the cultural bias matrix can correspond to the information flow bias intensity from the i-th cultural domain to the j-th cultural domain. The information flow bias intensity can be a quantitative parameter that characterizes the credibility and influence of information transmission between two cultural domains. The higher the information flow bias intensity, the closer the cultural connection between the two cultural domains and the higher the weight of cross-domain information transmission.

[0047] Step S203: Integrate the cultural bias matrix into the attention calculation module of the heterogeneous graph attention network to construct the cultural domain-aware heterogeneous graph attention network.

[0048] Optionally, the knowledge reasoning terminal can embed the cultural bias matrix into the attention calculation module of the heterogeneous graph attention network to transform and integrate the heterogeneous graph attention network structure, thereby constructing a cultural domain-aware heterogeneous graph attention network.

[0049] Specifically, the attention calculation module can be a functional module in a heterogeneous graph attention network responsible for calculating edge attention weights; the cultural domain-aware heterogeneous graph attention network can be a heterogeneous graph attention network that integrates a cultural bias matrix. The cultural domain-aware heterogeneous graph attention network can be used to automatically perceive the cultural domain attributes of nodes when calculating attention weights and to differentiate and adjust the information transmission intensity under different cultural domain combinations.

[0050] In one embodiment, inputting the node representations into a cultural domain-aware heterogeneous graph attention network and calculating the attention weights of each edge connecting the nodes may include:

[0051] Step S301: Obtain the source node and target node of each edge, and retrieve the cultural transfer bias term corresponding to the edge from the cultural bias matrix based on the cultural domain label of the source node and the cultural domain label of the target node.

[0052] Optionally, the knowledge reasoning terminal can determine the source node and target node of each edge in the heterogeneous knowledge graph of traditional culture; the knowledge reasoning terminal can extract the cultural domain labels of the source node and the target node respectively; the knowledge reasoning terminal can locate the corresponding matrix element in the cultural bias matrix according to the cultural domain labels of the source node and the target node, and use the matrix element as the cultural transfer bias term corresponding to the edge.

[0053] Specifically, the source node can be the starting end node of the edge, and the target node can be the ending end node of the edge; the culture transfer bias term can be the bias parameter extracted from the culture bias matrix that corresponds to the combination of the culture domains of the two nodes, and the culture transfer bias term can be used to correct the attention score of the edge.

[0054] Step S302: Perform a linear transformation on the node representation of the source node to obtain the query vector, perform a linear transformation on the node representation of the target node to obtain the key vector, and calculate the scaled dot product of the query vector and the key vector to obtain the original attention score.

[0055] Optionally, the knowledge reasoning terminal can perform a linear transformation on the node representation of the source node using a trainable query transformation matrix to obtain the corresponding query vector; the knowledge reasoning terminal can perform a linear transformation on the node representation of the target node using a trainable key transformation matrix to obtain the corresponding key vector; the knowledge reasoning terminal can calculate the dot product of the query vector and the key vector and divide it by a scaling factor to obtain the original attention score.

[0056] Specifically, the query vector and key vector can be node feature vectors after linear transformation. The query vector can be used for querying in attention calculation, and the key vector can be used for key matching in attention calculation. The scaled dot product can be the standard calculation method for dot product attention. The scaled dot product can adjust the range of dot product values ​​through a scaling factor to ensure training stability. The original attention score can be the attention score calculated based on the query vector and key vector.

[0057] Step S303: Add the culture transfer bias term and the original attention score to obtain the culture-corrected attention score. Normalize the culture-corrected attention scores corresponding to all incoming edges of each target node to obtain the attention weights of each edge connecting each target node.

[0058] Optionally, the knowledge reasoning terminal can add the culture transfer bias term and the original attention score to obtain the culture-corrected attention score; the knowledge reasoning terminal can perform softmax normalization on the culture-corrected attention scores corresponding to all incoming edges of each target node to obtain the attention weight.

[0059] Specifically, the culture-corrected attention score can be the attention score after being corrected by the culture transfer bias term. The culture-corrected attention score can be used to simultaneously reflect the similarity of node features and the strength of cultural domain association. Normalization can be the process of converting multiple attention scores into weights in the form of a probability distribution. Normalization can ensure the additivity and rationality of the weights.

[0060] In one embodiment, such as Figure 2 As shown, neighbor information is aggregated and representations are updated for each node based on attention weights to obtain the updated node representation, which may include:

[0061] Step S401: Based on the attention weights corresponding to the incoming edges of each target node, the node representations of the source nodes corresponding to the incoming edges are weighted and summed to obtain the neighbor aggregation vector.

[0062] Optionally, the knowledge reasoning terminal can obtain the attention weights corresponding to the incoming edges of each target node and the node representations of the corresponding source nodes; the knowledge reasoning terminal can use the attention weights as coefficients to perform a weighted summation operation on the node representations of all source nodes to obtain the neighbor aggregation vector.

[0063] Specifically, the neighbor aggregation vector can be a vector that integrates the features of all the neighboring nodes of the target node. The neighbor aggregation vector can be used to represent the summary result of neighborhood information.

[0064] Step S402: Perform vector fusion on the neighbor aggregation vector and the node representation of the target node to obtain the fused vector, and vectorize the cultural domain label of the node to obtain the cultural domain embedding vector.

[0065] Optionally, the knowledge reasoning terminal can perform vector fusion of the neighbor aggregation vector and the node representation of the target node to obtain a fused vector; the knowledge reasoning terminal can convert the cultural domain label of the node into a low-dimensional dense vector to obtain a cultural domain embedding vector.

[0066] Specifically, the fusion vector can be an intermediate vector that combines the node's own features and the features of its neighbor aggregation; the cultural domain embedding vector can be a vectorized representation of the cultural domain label, and the cultural domain embedding vector can be used to characterize the semantic features of the cultural domain.

[0067] Step S403: Gated cultural fine-tuning is performed on the fusion vector based on the cultural domain embedding vector to obtain the updated node representation.

[0068] Optionally, the knowledge reasoning terminal can concatenate the fusion vector and the cultural domain embedding vector and input them into the gating network to calculate the gating vector; the knowledge reasoning terminal can perform gating culture fine-tuning based on the gating vector, controlling the adjustment range of the cultural domain embedding vector on the fusion vector, to obtain the fine-tuned vector; the knowledge reasoning terminal can perform layer normalization on the fine-tuned vector to obtain the updated node representation.

[0069] Optionally, the formula for calculating the updated node representation can be:

[0070] ;

[0071] ;

[0072] In the formula, For nodes The updated node representation, For nodes The fusion vector, For the gated vector, For nodes Cultural domain tags The corresponding cultural domain embedding vector, For layer normalization function, This represents the element-wise multiplication operation; For a trainable linear transformation parameter matrix, For the sigmoid function, This indicates a vector concatenation operation.

[0073] Specifically, gating culture fine-tuning can be a process of adaptively adjusting the degree of influence of cultural domain features on node representation through a gating mechanism. Gating culture fine-tuning can be used to avoid excessive interference of cultural information with the semantic features of the node itself while injecting cultural domain attribute information. The gating vector can be a weight vector that controls the intensity of cultural domain information injection.

[0074] In one embodiment, path sampling of node pairs to obtain a set of path instances may include:

[0075] Step S501: Take the first node in the node pair as the starting point of the walk and the second node in the node pair as the ending point of the walk.

[0076] Optionally, the knowledge reasoning terminal can set the first node in the node pair as the starting point of the random walk; the knowledge reasoning terminal can set the second node in the node pair as the ending point of the random walk.

[0077] Step S502: Starting from the starting point, walk along the edges in the heterogeneous knowledge graph of traditional culture, record the sequence of nodes and edges passed through, and terminate the walk when the end point is reached or the upper limit of the walk length is reached, thus obtaining a path instance.

[0078] Optionally, the knowledge reasoning terminal can set the transition probability of the walk, starting from the starting point, and randomly walk along the edges in the heterogeneous knowledge graph of traditional culture according to the transition probability; the knowledge reasoning terminal can record the nodes and edges passed during the walk in sequence to obtain the node sequence and edge sequence; the knowledge reasoning terminal can set the upper limit of the walk length, and terminate the walk when the walk reaches the end point or when the number of steps reaches the upper limit of the walk length, and integrate the recorded node sequence and edge sequence into a path instance.

[0079] Specifically, the upper limit of the traversal length can be a preset limit on the maximum number of hops of a single path. The upper limit of the traversal length can be used to avoid introducing too much noise due to excessively long paths. The path instance can be a sequence that includes the node sequence and edge sequence recorded during the traversal. The path instance can be used to record the multi-hop association links between two nodes.

[0080] Step S503: Perform a walk operation on all node pairs to obtain a set of path instances.

[0081] Optionally, the knowledge reasoning terminal can perform a walk operation on each node pair to sample multiple path instances; the knowledge reasoning terminal can summarize all path instances of all node pairs to obtain a path instance set.

[0082] Specifically, the path instance set can be the total set of all path instances obtained by sampling all node pairs.

[0083] In one embodiment, each path instance in the path instance set is input into a path encoder for encoding to obtain the encoding result. Attention aggregation is then performed on the encoding result to obtain the path context vector of the node pair, which may include:

[0084] Step S601: Concatenate the node representations at each position on each path instance to obtain a concatenated vector. Determine whether the cultural domain labels of two adjacent nodes on the path instance are the same. If the cultural domain labels are different, generate a cultural transition marker vector based on the cultural domain labels and insert the cultural transition marker vector into the concatenated vector at the position corresponding to the node to obtain the path sequence representation.

[0085] Optionally, the knowledge reasoning terminal can extract the node representations corresponding to each position of the path instance in the order of the path instance, and concatenate the node representations end to end to obtain a concatenated vector; the knowledge reasoning terminal can compare the cultural domain labels of two adjacent nodes on the path instance in turn to identify the position where the cultural domain changes and obtain the cultural transition position; the knowledge reasoning terminal can insert the corresponding cultural transition marker vector at the cultural transition position to obtain the path sequence representation.

[0086] Specifically, the cultural transition marker vector can be an identifier vector used to mark the location where the cultural domain changes on the path. The cultural transition marker vector can be used to enable the path encoder to explicitly perceive the boundary position across cultural domains and enhance the feature extraction of cross-domain propagation paths. The path sequence representation can be a path sequence vector that integrates node features and cultural transition markers.

[0087] Step S602: Input the path sequence representation into the path encoder for encoding operation to obtain the encoding result.

[0088] Optionally, the knowledge reasoning terminal can input the path sequence representation into a path encoder based on the Transformer architecture for deep encoding. The Transformer's self-attention mechanism captures long-distance dependencies and semantic associations in the path sequence to obtain the encoding result.

[0089] Specifically, the path encoder based on the Transformer architecture can be a sequence encoding model with a self-attention mechanism, which can be used to capture sequence dependencies and semantic associations in long paths, thereby improving the quality of path encoding; the encoding result can be the path sequence features output by the path encoder.

[0090] Step S603: Add the node representations of the nodes in the node pair to obtain the node and vector, perform a linear transformation on the node and vector to obtain the query vector, and perform attention pooling on the encoding result based on the query vector to obtain the path representation vector.

[0091] Optionally, the knowledge reasoning terminal can add the node representations of the two nodes in a node pair element by element to obtain a node and a vector; the knowledge reasoning terminal can map the node and vector into a query vector through a linear transformation matrix; the knowledge reasoning terminal can use the query vector as the query and perform attention-weighted pooling on the encoding result to obtain a path representation vector.

[0092] Specifically, nodes and vectors can be fused vectors of the features of two nodes in a node pair. Nodes and vectors can be used to guide attention pooling to path locations that are more closely associated with the endpoints of the node pair. Path representation vectors can be fixed-length feature vectors of a single path. Path representation vectors can be used to characterize the overall semantics of the entire path.

[0093] Step S604: Vectorize each multivariate relation to obtain a relation vector representation. Using the relation vector representation and the node representation of the node in the node pair as query terms, perform attention aggregation operation on the path representation vector of the node pair to obtain the path context vector of the node pair.

[0094] Optionally, the knowledge reasoning terminal can map each multivariate relation into a low-dimensional vector to obtain a relation vector representation; the knowledge reasoning terminal can use the relation vector representation and the node representations of the two nodes in the node pair as query terms to calculate the attention weight of each path representation vector; the knowledge reasoning terminal can perform weighted aggregation of the path representation vectors according to the attention weight to obtain the path context vector of the node pair.

[0095] Specifically, the relation vector representation can be a vectorized representation of a multi-way relation, and the relation vector representation can be used to represent the semantic features of a multi-way relation; the path context vector can be a comprehensive feature vector that aggregates all valid path information.

[0096] In one embodiment, calculating the association rationality score between each node pair and each multivariate relationship based on the updated node representation and path context vector may include:

[0097] Step S701: Calculate the embedding score based on the updated node representation of the first node, the updated node representation of the second node, and the relation vector representation.

[0098] Alternatively, the formula for calculating the embedding score can be:

[0099] ;

[0100] In the formula, For embedding score, This is the updated node representation of the first node. This is the updated node representation for the second node. Represented as a relation vector. Represents rotation transformation operations in complex space. The Euclidean norm of a vector;

[0101] Specifically, the embedding score can be an association matching score calculated based on node embedding and relation embedding. The embedding score can measure the reasonableness of the relationship between two nodes from the semantic level of nodes.

[0102] Step S702: Calculate the path score based on the path context vector and relation vector representation.

[0103] Alternatively, the formula for calculating the path score can be:

[0104] ;

[0105] In the formula, Score the path. For path context vectors, This represents the vector transpose operation. It is a trainable compatibility matrix;

[0106] Specifically, the path score can be an association matching score calculated based on the path context vector. The path score can measure the reasonableness of the relationship between two nodes from the logical path level, providing interpretable logical support for the reasoning results. The trainable compatibility matrix can be used to achieve semantic alignment between the path feature space and the relationship feature space.

[0107] Step S703: The embedding score and path score are weighted and summed to obtain the correlation rationality score between each node pair and each multivariate relationship.

[0108] Optionally, the knowledge reasoning terminal can set corresponding weight coefficients for the embedding score and the path score respectively; the knowledge reasoning terminal can multiply the embedding score and the path score by their respective weight coefficients and then add them together to obtain the association rationality score.

[0109] Specifically, the association rationality score can simultaneously consider node-level semantic features and path-level logical features, thereby improving the comprehensiveness and accuracy of association determination.

[0110] In one embodiment, determining node pairs and multi-relationships with association rationality scores exceeding an association threshold as having implicit associations and outputting traditional cultural knowledge reasoning results may include:

[0111] Step S801: Compare the reasonableness scores of all associations for each node pair, and determine the multivariate relationship with the highest reasonableness score as the predicted relationship for each node pair.

[0112] Optionally, the knowledge reasoning terminal can traverse all association rationality scores of each node pair and select the multivariate relationship with the highest association rationality score as the predicted relationship of that node pair.

[0113] Specifically, the predicted relationship can be the multivariate relationship with the highest confidence between node pairs.

[0114] Step S802: Compare the association rationality score and association threshold of the predicted relationship of each node pair. Node pairs and predicted relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and association relationship records of node pairs are generated. Each association relationship record is used as the reasoning result of traditional cultural knowledge.

[0115] Optionally, the knowledge reasoning terminal can compare the association rationality score and association threshold of each node pair and the predicted relationship, determine the node pair and the predicted relationship that the association rationality score exceeds the association threshold as having implicit association, and record the two nodes of the node pair and the predicted relationship to generate an association relationship record; the knowledge reasoning terminal can summarize all association relationship records to obtain the most traditional cultural knowledge reasoning result.

[0116] Specifically, the association record can be a structured record of each implicit association, and the association record can be the basic unit of the reasoning result; the reasoning result of traditional cultural knowledge can be directly imported into the heterogeneous knowledge graph of traditional culture to realize the automatic completion of the heterogeneous knowledge graph of traditional culture and the expansion of the knowledge system.

[0117] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0118] Based on the same inventive concept, this application also provides a graph neural network-based traditional cultural knowledge reasoning system for implementing the above-mentioned graph neural network-based traditional cultural knowledge reasoning method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more graph neural network-based traditional cultural knowledge reasoning system embodiments provided below can be found in the limitations of the graph neural network-based traditional cultural knowledge reasoning method described above, and will not be repeated here.

[0119] In one exemplary embodiment, such as Figure 3 As shown, a traditional culture knowledge reasoning system 500 based on graph neural networks is provided, including:

[0120] The graph construction module 501 can be used to acquire traditional cultural knowledge data from different cultural domains, extract cultural entities from the traditional cultural knowledge data, construct a heterogeneous knowledge graph of traditional culture with cultural entities as nodes and the multi-dimensional relationships between cultural entities as edges, and assign cultural domain labels to each node.

[0121] The network construction module 502 can be used to construct a cultural bias matrix based on cultural domain labels, and to construct a cultural domain perception heterogeneous graph attention network based on the cultural bias matrix.

[0122] The encoding update module 503 can be used to vectorize the attribute information corresponding to each node to obtain the node representation of each node, input the node representation into the cultural domain perceptual heterogeneous graph attention network, calculate the attention weight of each edge connecting each node, and perform neighbor information aggregation and representation update for each node based on the attention weight to obtain the updated node representation of each node.

[0123] The path aggregation module 504 can be used to filter out node pairs belonging to different cultural domains and without edge connections from the heterogeneous knowledge graph of traditional culture, perform path sampling on the node pairs to obtain a set of path instances, input each path instance in the set of path instances into the path encoder for encoding, obtain the encoding result, and perform attention aggregation on the encoding result to obtain the path context vector of the node pair.

[0124] The reasoning output module 505 can be used to calculate the association rationality score between each node pair and each multi-element relationship based on the updated node representation and path context vector. Node pairs and multi-element relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and the reasoning results of traditional cultural knowledge are output.

[0125] The above embodiments merely illustrate several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the embodiments of this application, and these all fall within the protection scope of the embodiments of this application.

Claims

1. A method for reasoning about traditional cultural knowledge based on graph neural networks, characterized in that, The method includes: Traditional cultural knowledge data from different cultural domains is acquired, and cultural entities are extracted from the traditional cultural knowledge data. Using the cultural entities as nodes and the multi-dimensional relationships between the cultural entities as edges, a heterogeneous knowledge graph of traditional culture is constructed, and cultural domain labels are assigned to each node. Based on the cultural domain labels, a cultural bias matrix is ​​constructed, and based on the cultural bias matrix, a cultural domain perceptual heterogeneous graph attention network is constructed. The attribute information corresponding to each node is vectorized to obtain the node representation of each node. The node representation is input into the cultural domain-aware heterogeneous graph attention network to calculate the attention weight of each edge connecting each node. Then, based on the attention weight, the neighbor information of each node is aggregated and the representation is updated to obtain the updated node representation of each node. From the heterogeneous knowledge graph of traditional culture, node pairs belonging to different cultural domains and without the edge connection are selected. Path sampling is performed on the node pairs to obtain a path instance set. Each path instance in the path instance set is input into the path encoder for encoding to obtain the encoding result. Attention aggregation is performed on the encoding result to obtain the path context vector of the node pair. Based on the updated node representation and the path context vector, the association rationality score between each node pair and each multi-relationship is calculated. Node pairs and multi-relationships with association rationality scores exceeding the association threshold are judged to have implicit associations, and the reasoning result of traditional cultural knowledge is output.

2. The method according to claim 1, characterized in that, The process of constructing a cultural bias matrix based on the cultural domain labels, and then constructing a cultural domain perceptual heterogeneous graph attention network based on the cultural bias matrix, includes: The number of cultural domain tags is counted to obtain the total number of cultural domain types. Construct a matrix with dimensions equal to the product of the number of cultural domain types, and set each element in the matrix as a trainable parameter to obtain a cultural bias matrix; wherein, the element in the i-th row and j-th column of the cultural bias matrix represents the information flow bias intensity from the i-th cultural domain to the j-th cultural domain. The cultural bias matrix is ​​integrated into the attention calculation module of the heterogeneous graph attention network to construct the cultural domain-aware heterogeneous graph attention network.

3. The method according to claim 1, characterized in that, The step of inputting the node representations into the cultural domain-aware heterogeneous graph attention network and calculating the attention weights of each edge connecting the nodes includes: Obtain the source node and target node of each edge, and retrieve the culture transfer bias term corresponding to the edge from the culture bias matrix based on the culture domain label of the source node and the culture domain label of the target node; A linear transformation is performed on the node representation of the source node to obtain a query vector, and a linear transformation is performed on the node representation of the target node to obtain a key vector. The scaled dot product of the query vector and the key vector is then calculated to obtain the original attention score. The culture transfer bias term and the original attention score are added together to obtain the culture-corrected attention score. The culture-corrected attention scores corresponding to all incoming edges of each target node are normalized to obtain the attention weights of each edge connecting each target node.

4. The method according to claim 3, characterized in that, The step of aggregating neighbor information and updating the representation of each node according to the attention weight to obtain the updated node representation of each node includes: Based on the attention weights corresponding to the incoming edges of each target node, the node representations of the source nodes corresponding to the incoming edges are weighted and summed to obtain the neighbor aggregation vector; The neighbor aggregation vector and the node representation of the target node are fused to obtain a fused vector, and the cultural domain label of the node is vectorized to obtain a cultural domain embedding vector. Gated cultural fine-tuning is performed on the fusion vector based on the cultural domain embedding vector to obtain the updated node representation; wherein, the calculation formula for the updated node representation is: ; ; In the formula, For the node The updated node representation, For the node The fusion vector, For the gated vector, For the node The cultural domain tags mentioned above The corresponding cultural domain embedding vector, For layer normalization function, This represents the element-wise multiplication operation; For a trainable linear transformation parameter matrix, For the sigmoid function, This indicates a vector concatenation operation.

5. The method according to claim 1, characterized in that, The step of sampling the path between the nodes to obtain a set of path instances includes: The first node in the node pair is taken as the starting point of the journey, and the second node in the node pair is taken as the ending point of the journey. Starting from the starting point, the player walks along the edges in the heterogeneous knowledge graph of traditional culture, recording the sequence of nodes and edges traversed, until the player reaches the ending point or the upper limit of the walking length is reached, thus terminating the walking and obtaining a path instance. Perform the walk operation on all the node pairs to obtain the set of path instances.

6. The method according to claim 1, characterized in that, The step of inputting each path instance in the path instance set into the path encoder for encoding to obtain the encoding result, and then performing attention aggregation on the encoding result to obtain the path context vector of the node pair includes: The node representations at each position on each path instance are concatenated to obtain a concatenated vector. It is then determined whether the cultural domain labels of two adjacent nodes on the path instance are the same. If the cultural domain labels are different, a cultural transition marker vector is generated based on the cultural domain labels. This cultural transition marker vector is inserted into the concatenated vector at the position corresponding to the node to obtain a path sequence representation. The cultural transition marker vector is used to mark the positions in the path sequence representation where the cultural domain changes. The path sequence representation is input into the path encoder for encoding operations to obtain the encoding result; The node representations of the nodes in the node pair are added together to obtain a node and vector. A linear transformation is performed on the node and vector to obtain a query vector. Attention pooling is then performed on the encoding result based on the query vector to obtain a path representation vector. Each of the multivariate relations is vectorized to obtain a relation vector representation. The relation vector representation and the node representation of the node in the node pair are used as query terms. Attention aggregation operation is performed on the path representation vector of the node pair to obtain the path context vector of the node pair.

7. The method according to claim 5 or 6, characterized in that, The step of calculating the association rationality score between each node pair and each multi-variable relationship based on the updated node representation and the path context vector includes: The embedding score is calculated based on the updated node representation of the first node, the updated node representation of the second node, and the relation vector representation; wherein the formula for calculating the embedding score is: ; In the formula, The embedding score, This refers to the updated node representation of the first node. The updated node representation for the second node. Let the relation vector be represented. Represents rotation transformation operations in complex space. The Euclidean norm of a vector; The path score is calculated based on the path context vector and the relation vector representation; wherein, the formula for calculating the path score is: ; In the formula, Score the path. For the path context vector, This represents the vector transpose operation. It is a trainable compatibility matrix; The embedding score and the path score are weighted and summed to obtain the association rationality score between each node pair and each multivariate relationship.

8. The method according to claim 1, characterized in that, The step of determining that the node pairs and the multi-relationships whose association rationality scores exceed the association threshold are implicitly associated, and outputting the reasoning result of traditional cultural knowledge, includes: Compare the association rationality scores of all the node pairs and determine the multivariate relationship with the highest association rationality score as the predicted relationship of each node pair; By comparing the association rationality score and the association threshold of the predicted relationship of each node pair, the node pair and the predicted relationship with the association rationality score exceeding the association threshold are determined to have the implicit association, and the association relationship record of the node pair is generated. Each association relationship record is used as the reasoning result of the traditional culture knowledge; wherein, the association relationship record includes the node in the node pair and the predicted relationship corresponding to the node pair.

9. A traditional cultural knowledge reasoning system based on graph neural networks, characterized in that, The system includes: The graph construction module is used to acquire traditional cultural knowledge data from different cultural domains, extract cultural entities from the traditional cultural knowledge data, construct a heterogeneous knowledge graph of traditional culture with the cultural entities as nodes and the multi-dimensional relationships between the cultural entities as edges, and assign cultural domain labels to each node. The network construction module is used to construct a cultural bias matrix based on the cultural domain labels, and to construct a cultural domain perceptual heterogeneous graph attention network based on the cultural bias matrix. The encoding update module is used to vectorize the attribute information corresponding to each node to obtain the node representation of each node, input the node representation into the cultural domain-aware heterogeneous graph attention network, calculate the attention weight of each edge connecting each node, and perform neighbor information aggregation and representation update for each node according to the attention weight to obtain the updated node representation of each node. The path aggregation module is used to filter out node pairs belonging to different cultural domains and without edge connections from the heterogeneous knowledge graph of traditional culture, perform path sampling on the node pairs to obtain a path instance set, input each path instance in the path instance set into the path encoder for encoding to obtain the encoding result, and perform attention aggregation on the encoding result to obtain the path context vector of the node pair. The reasoning output module is used to calculate the association rationality score between each node pair and each multi-variable relationship based on the updated node representation and the path context vector, determine the node pair and the multi-variable relationship with the association rationality score exceeding the association threshold as having implicit association, and output the reasoning result of traditional cultural knowledge.