Heterogeneous graph data product description matching method, system and equipment for strengthening multi-type entity semantic relationship and medium
By constructing a heterogeneous knowledge graph for data product argumentation, integrating external causal knowledge, and optimizing entity relationship representation, the problems of insufficient mining of causal knowledge and the influence of noise features in existing methods are solved, and higher accuracy data product description matching is achieved.
Patent Information
- Application Number
- CN202510983552.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-11-21
AI Technical Summary
In existing data product description matching methods, hierarchical network-based models fail to fully exploit causal knowledge, and heterogeneous graph-based methods are prone to including noisy features and do not effectively distinguish the semantic features of edges, resulting in low matching accuracy.
Construct a heterogeneous knowledge graph for data product argumentation, integrate external causal knowledge, generate graph representation vectors for entities and relationships, extract causal knowledge subgraphs, and determine matching results by combining contextual semantic features. Optimize the representation of entities and relationships through graph embedding models.
It enhances the completeness and accuracy of causal knowledge, improves the semantic distinguishability of data product description pairs, and enhances matching accuracy and generalization ability.
Smart Images

Figure CN120994841A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data intelligence, and particularly relates to a method, system, device and medium for matching heterogeneous graph data product descriptions by strengthening multi-type entity semantic relationships. BACKGROUND
[0002] With the rapid development of data economy, data has become an important production factor, and the demand for data trading, data sharing and data fusion is growing. In the fields of electricity, finance, medicine, government affairs and others, data markets are being built, and how to accurately and efficiently match data products has become a key problem. The data product description matching task aims to identify the product with similar semantics and matching functions from multiple candidate data product descriptions to meet the target demand, providing technical support for data trading, intelligent recommendation, data retrieval and other applications. Therefore, it is of great theoretical significance and practical value to study the data product description matching method. Common methods can be divided into two categories:
[0003] 1. Hierarchical network-based method
[0004] The hierarchical network-based method extracts semantic features of data product descriptions from word level, sentence level to document level by constructing multi-level semantic representation, in order to achieve more fine-grained matching. This method usually uses attention mechanism to enhance the ability to capture key information and improve matching accuracy. In specific implementation, the hierarchical network method first encodes the data product description, and uses a multi-level neural network structure to extract features of different granularities. Then, the key terms are filtered out through word-level attention mechanism, and the understanding of context is enhanced by combining sentence-level attention. Some methods also use document-level semantic aggregation to improve the matching effect in the global range. This method is suitable for scenarios where data product description texts have high similarity, and can effectively extract multi-granularity semantic information. However, this method mainly relies on text content and does not fully model the entity relationship between data products, which may be difficult to match data products with different expression methods but similar semantics.
[0005] 2. Heterogeneous graph-based method
[0006] The method based on heterogeneous graph enhances the understanding ability of data product description by constructing a data product knowledge graph and integrating entity, attribute, and relationship information into the matching process. This method not only relies on text information but also introduces external knowledge to make up for the semantic missing problem in the data product description text. In specific implementation, first, a heterogeneous graph is constructed, entity information is extracted from the data product description, and the semantic relationship of the data product is extended in combination with the external knowledge base. Next, the graph neural network is used to encode the features of the heterogeneous graph, extract the semantic path of the data product, and calculate the matching score in combination with the path weighting mechanism. Some methods also enhance the modeling ability of the logical relationship between data products through causal reasoning. This method is suitable for scenarios where data product descriptions have different expression methods but similar semantics, and can improve the matching accuracy using external knowledge. However, this method has high computational overhead and strong dependence on the knowledge base, which may be limited by the quality of the knowledge base.
[0007] In summary, the existing data product description matching method based on hierarchical network extracts semantic features of the description context through attention mechanism, but does not deeply mine the causal relationship between descriptions, affecting the accuracy of description matching. The method based on heterogeneous graph models the causal relationship between data product descriptions through causal knowledge subgraph, but is prone to contain noise features and does not distinguish the semantic features of edges, resulting in low matching accuracy. The existing methods mainly have the following problems: (1) the causal relationship between data product descriptions is not fully mined, affecting the semantic accuracy of matching; (2) the causal knowledge subgraph features are prone to contain noise information unrelated to the data product description, and the semantic features of edges are not effectively distinguished, reducing the matching accuracy. SUMMARY
[0008] In view of the above problems, the present application is proposed.
[0009] Therefore, the technical problem solved by the present application is: how to solve the problem of low data product description matching accuracy in the existing data product description matching method based on hierarchical network, which fails to fully mine causal knowledge, and the method based on heterogeneous graph is prone to contain noise features and does not effectively distinguish the semantic features of edges.
[0010] To solve the above technical problems, the application provides the following technical solutions: a heterogeneous graph data product description matching method for strengthening multi-type entity semantic relationship, which comprises the following steps: obtaining a data product description pair, and constructing a data product argumentation knowledge heterogeneous graph based on an external knowledge base and a data product dataset; generating a graph representation vector of entities and relationships in the data product argumentation knowledge heterogeneous graph based on the data product argumentation knowledge heterogeneous graph; extracting a causal knowledge subgraph associated with the data product description pair from the data product argumentation knowledge heterogeneous graph, and generating subgraph features of the causal knowledge subgraph in combination with the graph representation vector; and fusing the subgraph features and context semantic features of the data product description pair to determine a matching result of the data product description pair.
[0011] As a preferred scheme of the heterogeneous graph data product description matching method for strengthening multi-type entity semantic relationship, the data product argumentation knowledge heterogeneous graph comprises argumentation knowledge derived from the data product dataset and causal knowledge derived from the external knowledge base. The beneficial effect of this preferred scheme is that the argumentation knowledge contained in the data product itself is fused with the professional causal knowledge of the external knowledge base to construct a heterogeneous graph with richer knowledge dimensions. Because internal data evidence and external prior knowledge are used simultaneously, the completeness and accuracy of the causal relationship can be significantly enhanced, providing a more solid and comprehensive knowledge base for subsequent semantic matching, and effectively solving the problem that existing methods cannot fully mine deep causal relationships between descriptions.
[0012] As a preferred scheme of the heterogeneous graph data product description matching method for strengthening multi-type entity semantic relationship, the generation of the graph representation vector of entities and relationships in the data product argumentation knowledge heterogeneous graph is specifically based on the entities associated with any relationship in the data product argumentation knowledge heterogeneous graph and the local graph structure information of the entities to determine the representation vector of the relationship. The beneficial effect of this preferred scheme is that the representation vector of the relationship is dynamically determined based on the entities connected by the relationship and their local graph structure information, so that the semantic features of the edges are no longer static, but can perceive the specific graph context. Because the representation of the relationship incorporates the information of its adjacent structure, the model can more accurately model and distinguish the semantic relationship between multi-type entities, solving the problem of low matching accuracy caused by the inability of existing heterogeneous graph methods to effectively distinguish the semantic features of the edges.
[0013] As a preferred scheme of the method for matching product description pairs of heterogeneous graph data products with strengthened multi-type entity semantic relationships, in the process of generating the graph representation vectors of entities and relationships in the data product argumentation knowledge heterogeneous graph, the process further comprises training a graph embedding model to generate the graph representation vectors, wherein the training is configured to improve the confidence of valid entity relationship triples in the data product argumentation knowledge heterogeneous graph and reduce the confidence of invalid entity relationship triples.
[0014] As a preferred scheme of the method for matching product description pairs of heterogeneous graph data products with strengthened multi-type entity semantic relationships, the subgraph features of the causal knowledge subgraph are generated by collecting vector information of entity relationship triples in the data product argumentation knowledge heterogeneous graph that are semantically associated with the data product description pair.
[0015] As a preferred scheme of the method for matching product description pairs of heterogeneous graph data products with strengthened multi-type entity semantic relationships, the fusion of the subgraph features and the context semantic features of the data product description pair to determine the matching result of the data product description pair comprises: inputting the data product description pair into a pre-trained language model to obtain the context semantic features of the data product description pair; performing feature combination on the subgraph features and the context semantic features to generate a fusion feature representation; inputting the fusion feature representation into a classifier to output the matching probability of the data product description pair.
[0016] As a preferred scheme of the method for matching product description pairs of heterogeneous graph data products with strengthened multi-type entity semantic relationships, the external knowledge base is a predefined causal relationship knowledge base.
[0017] The application provides a system for matching product description pairs of heterogeneous graph data products with strengthened multi-type entity semantic relationships.
[0018] To solve the above technical problems, the application further provides the following technical solutions: a heterogeneous graph data product description matching system for strengthening multi-type entity semantic relationship, comprising: a data product argumentation knowledge graph construction module, configured to acquire a data product description pair and construct a data product argumentation knowledge heterogeneous graph based on an external knowledge base and a data product dataset; a graph representation learning module, configured to generate graph representation vectors of entities and relationships in the data product argumentation knowledge heterogeneous graph based on the data product argumentation knowledge heterogeneous graph; a subgraph modeling module, configured to extract a causal knowledge subgraph associated with the data product description pair from the data product argumentation knowledge heterogeneous graph, and generate subgraph features of the causal knowledge subgraph in combination with the graph representation vectors; and a matching result determination module, configured to fuse the subgraph features and context semantic features of the data product description pair to determine a matching result of the data product description pair.
[0019] The application provides a computer device, comprising a memory and a processor, and the memory stores a computer program, characterized in that the processor implements the steps of the method for matching data product descriptions of a heterogeneous graph for strengthening multi-type entity semantic relationship when executing the computer program.
[0020] The application provides a computer readable storage medium, which stores a computer program, characterized in that the computer program is executed by a processor to implement the steps of the method for matching data product descriptions of a heterogeneous graph for strengthening multi-type entity semantic relationship.
[0021] The application has the following beneficial effects: compared with the existing data product description matching method, the application not only fuses external causal knowledge, constructs an argumentation knowledge heterogeneous graph, and enhances the completeness and accuracy of causal knowledge, but also strengthens causal knowledge subgraph features by using multiple semantic relationships, and optimizes the representation of entities and relationships by using a heterogeneous graph embedding method, thereby improving the semantic distinguishing ability of the model for data product description pairs and enhancing the causal knowledge representation ability. In addition, the application can effectively improve the data product description pair recognition accuracy without relying on a large-scale parameter encoder, thereby verifying the generalization ability and applicability of the method. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0023] Figure 1 The overall flowchart of the method for matching data product descriptions of a heterogeneous graph for strengthening multi-type entity semantic relationship provided by an embodiment of the application is shown in the following figure:
[0024] Figure 2 The principle diagram of the method for matching heterogeneous graph data product descriptions with enhanced multi-type entity semantic relationships is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0026] Embodiment 1, reference Figure 1 and Figure 2 For the first embodiment of the present application, the embodiment provides a method for matching heterogeneous graph data product descriptions with enhanced multi-type entity semantic relationships, comprising:
[0027] Step S100: obtaining a data product description pair and constructing a data product argumentation knowledge heterogeneous graph based on an external knowledge base and a data product dataset;
[0028] Step S200: generating a graph representation vector of entities and relationships in the data product argumentation knowledge heterogeneous graph based on the data product argumentation knowledge heterogeneous graph;
[0029] Step S300: extracting a causal knowledge subgraph associated with the data product description pair from the data product argumentation knowledge heterogeneous graph, and generating subgraph features of the causal knowledge subgraph in combination with the graph representation vector;
[0030] Step S400: fusing the subgraph features and the context semantic features of the data product description pair to determine the matching result of the data product description pair.
[0031] It should be noted that the technical principle of the present application is as follows: first, extracting triples in a data product dataset text as data product argumentation knowledge, fusing causal knowledge and data product argumentation knowledge to construct a data product argumentation knowledge heterogeneous graph; second, enhancing multi-type entity semantic relationships, learning data product argumentation knowledge heterogeneous graph representation using a heterogeneous graph embedding algorithm; third, extracting a causal knowledge subgraph of a data product description pair from the data product argumentation knowledge heterogeneous graph; fourth, extracting context semantic features of the data product description pair, fusing causal knowledge subgraph features and data product description pair context semantic features to train a model; and fifth, identifying data product description pairs in test samples.
[0032] Illustratively, in an alternative embodiment, the technical solution of the present application is implemented by the following steps:
[0033] Step 1: A new method for constructing a heterogeneous graph of data product argumentation knowledge is proposed, which combines external causal knowledge and data product argumentation knowledge to construct a heterogeneous graph of data product argumentation knowledge, enhancing the knowledge representation ability of the heterogeneous graph.
[0034] Step 1.1: Extract triples from the relevant data set of the data product to construct a preliminary data product argumentation knowledge subgraph.
[0035] Step 1.2: Extract and preprocess the entities of the data product description and the candidate data product description by matching the causal relationship from CauseNet, and construct a causal knowledge graph containing causal knowledge.
[0036] Step 1.3: Fuse the data product argumentation knowledge subgraph and the causal knowledge subgraph into a data product argumentation knowledge heterogeneous graph.
[0037] Step 2: Propose multi-type entity semantic relationship enhancement, use graph attention mechanism-based dynamic learning edge weight to extract entity semantic relationship of the edge, and use it as the main feature of the causal knowledge subgraph, to enhance the subgraph representation ability of the data product description recognition model.
[0038] Step 2.1: Context-aware graph embedding initialization.
[0039] Step 2.2: Use the scoring function to evaluate the confidence of the triple.
[0040] Step 2.3: Calculate the loss of the positive sample of the triple according to the score.
[0041] Step 2.4: Use the structure-aware self-adversarial negative sampling mechanism for optimization.
[0042] Step 2.5: Calculate the loss of the positive and negative samples of the triple and construct the objective function.
[0043] Step 2.6: Construct the representation of the data product argumentation knowledge heterogeneous graph.
[0044] Step 3: Perform knowledge extraction, extract triples of entities contained in the data product description pair from the data product argumentation knowledge heterogeneous graph as the causal knowledge subgraph, to enhance its association with the data product description pair.
[0045] Step 3.1: Construct the causal knowledge subgraph.
[0046] Step 3.2: Calculate the features of the causal knowledge subgraph.
[0047] Step 4: Perform sentence pair entity semantic relationship enhancement, fuse the causal knowledge subgraph features and the context semantic features of the data product description pair to construct a data product description pair recognition model to enhance the model recognition performance.
[0048] Step 4.1: Calculate the sentence pair representation.
[0049] Step 4.2: Calculate the probability of the data product description pair.
[0050] Step 4.3: Calculate the binary cross-entropy loss for training.
[0051] Step 5: Test, obtain sentence pair representation using trained model, calculate prediction probability, and get prediction result.
[0052] Embodiment 2, with reference to Figure 1 and Figure 2 , is a second embodiment of the present application, which provides a method for matching heterogeneous graph data product descriptions based on the above-mentioned embodiment. This embodiment aims to elaborate on the specific implementation of the method for matching heterogeneous graph data product descriptions based on the above-mentioned embodiment, so as to ensure that the skilled person in the art can understand and implement the present application without any obstacles.
[0053] In the present application, the data product description pair is obtained in step S100, and a data product argumentation knowledge heterogeneous graph is constructed based on the external knowledge base and the data product dataset, including: the data product argumentation knowledge heterogeneous graph includes argumentation knowledge from the data product dataset and causal knowledge from the external knowledge base.
[0054] Specifically, this step first extracts triples from the relevant data set of the data product to construct a preliminary data product argumentation knowledge subgraph; then matches the causal relationship from the external knowledge base (such as CauseNet) to construct a causal knowledge subgraph containing causal knowledge; finally, the two are fused to form a data product argumentation knowledge heterogeneous graph. The detailed breakdown is as follows:
[0055] First, construct the data product argumentation knowledge subgraph. Use natural language processing tools (such as OpenIE) to extract argumentation knowledge from the relevant data set X of the data product. Each sample x in the data set i contains a given data product description p, its context c p , and multiple candidate data product descriptions d w and their contexts c w . The extracted argumentation knowledge is organized in the form of triples (head entity, relationship, tail entity) to form an argumentation knowledge subgraph.
[0056] Second, construct the causal knowledge subgraph. Use entity linking tools (such as TagMe) to extract entity sets E α and E βAfter the pre-processing of word stemming and lowercasing, the entities are matched against an external causal knowledge base (preferably a pre-defined causal knowledge base, in this embodiment, CauseNet is used as an example). The matching process is to find all triples from CauseNet knowledge base where the head entity belongs to the first entity set and the tail entity belongs to the second entity set, and then collect these triples to form a causal knowledge subgraph.
[0057] Finally, the argumentation knowledge subgraph and the causal knowledge subgraph are fused into a data product argumentation knowledge heterogeneous graph. The fusion process can be understood as the union operation of the two graphs, that is, all triples in the two subgraphs are merged to form a larger and more comprehensive heterogeneous graph.
[0058] In an alternative embodiment, the method of constructing a data product argumentation knowledge heterogeneous graph in step S100 can also use a joint extraction model based on a pre-trained language model. The model uses a pre-trained language model such as BERT or RoBERTa as a basic encoder. The working principle is: after inputting the data product description text into the encoder, two parallel output layers are set at the top of the model. The first output layer is a sequence labeling layer, which is used to identify the head entity (HeadEntity) and the tail entity (Tail Entity) in the text. The second output layer is a relationship classification layer, which is used to determine the relationship between the identified entity pairs. Because the model performs both entity recognition and relationship extraction in a single framework, sharing the underlying text semantic representation, the model can use the internal constraints between entities and relationships for joint optimization.
[0059] In another alternative embodiment, the selection of the external knowledge base in step S100 is not limited to CauseNet. The source of the external knowledge base can be expanded. For example, in addition to CauseNet, a general knowledge graph DBpedia can be introduced. The specific operation is: link the identified entities (such as “a power company”) in the data product description with the entries in DBpedia, and extract their attribute triples, such as (a power company, industry, energy). Similarly, a special knowledge graph in the financial field can be introduced to extract relationship triples for the entity “A shares” (A shares, contains, a power company). Because non-causal relationship triples such as “industry” and “contains” are introduced, the data product argumentation knowledge heterogeneous graph generated after final fusion contains not only the causal knowledge of the original scheme, but also the knowledge of entity attributes, classification, and other dimensions, providing a basis for entity attribute level judgment for subsequent matching.
[0060] In the embodiment of the present application, in step S200, the graph representation vector of the entity and the relationship is generated based on the data product argument knowledge heterogeneous graph. Specifically, the representation vector of the relationship is determined according to the entity associated with any relationship in the data product argument knowledge heterogeneous graph and the local graph structure information of the entity. The process further includes generating the graph representation vector by training a graph embedding model; wherein the training is used to improve the confidence of the valid entity relationship triple and reduce the confidence of the invalid entity relationship triple. Specifically, the following steps are included:
[0061] A1: Context-aware graph embedding initialization. For each triple in the heterogeneous graph, a number of negative samples are first constructed. The entity is initialized as a real vector. Crucially, the representation vector of the relationship is not static, but is dynamically calculated according to the head entity, tail entity and their neighbor context connected to it through a graph attention mechanism (GAT). This embodies the idea of determining the representation of the relationship according to the entity and the local graph structure information. This mechanism enables the relationship representation to perceive the specific graph structure environment in which it is located, allowing it to have different semantic representations in different contexts.
[0062] A2: Confidence evaluation of triples using a scoring function. The score of a triple is calculated by a scoring function to measure its authenticity. In the embodiment of the present application, the scoring function is implemented by calculating the distance between the result of combining the tail entity vector with the head entity and the relationship vector, the smaller the distance, the higher the confidence of the triple.
[0063] A3: Optimization using structure-aware self-adversarial negative sampling mechanism and construction of objective function. In order to efficiently train the model, the present application adopts a structure-aware self-adversarial negative sampling mechanism. This mechanism considers not only the score of the negative sample when sampling, but also its structural complexity, and preferentially selects "high-quality" negative samples with high scores (i.e. the model considers them to be true) and complex structures for training. The sampling probability of the negative sample is determined by a function, the value of which increases with the increase of the score and the structural complexity of the negative sample. Finally, a joint objective function is constructed to optimize the model, which combines the loss of positive samples and the weighted loss of negative samples, the goal being to widen the score gap between positive and negative samples. By minimizing the objective function, the model learns to distinguish between entity and relationship representation vectors of positive and negative triples, and finally obtains the representation of the entire heterogeneous graph.
[0064] In an alternative embodiment, the model for generating graph representation vectors in step S200 is not limited to the customized model based on GAT and self-adversarial sampling described above. The TransE model can also be used as an alternative solution for generating graph representation vectors. The working principle of the TransE model is to define the relationship r in the knowledge graph as a translation operation from the head entity h to the tail entity t in a low-dimensional vector space. Specifically, the goal is to make the representation vector eh of the head entity plus the representation vector r of the relationship as close as possible to the representation vector et of the tail entity, i.e., eh+r≈et. The training process of the model is achieved by defining a distance-based scoring function f(h, r, t) = ||eh+r-et||, and minimizing the function value. Because the TransE model only contains vectors of entities and relationships as learnable parameters, and does not involve complex matrix operations, it can learn low-dimensional vector representations for entities and relationships in the graph.
[0065] In another alternative embodiment, the negative sampling strategy in step S200 can also use a method based on a generative adversarial network (GAN), which consists of a generator network G and a discriminator network D, where the discriminator D is the graph embedding model in the present application. The input of the generator G is a random noise vector, and the output is a fake triple. At each step of training, the goal of the generator G is to generate a fake triple that can give a high confidence score to the discriminator D; while the goal of the discriminator D is to accurately distinguish between real positive sample triples and fake triples generated by the generator G. Because the generator and the discriminator engage in an adversarial game during training, the generator can continuously generate negative samples that are difficult for the current discriminator model to distinguish.
[0066] In the embodiments of the present application, in step S300, a causal knowledge subgraph associated with the data product description pair is extracted from the data product argumentation knowledge heterogeneous graph, and a subgraph feature is generated. Specifically, the vector information of the entity relationship triple in the data product argumentation knowledge heterogeneous graph that is semantically associated with the data product description pair is collected to generate the subgraph feature. The process includes:
[0067] B1: Constructing a causal knowledge subgraph. For a specific data product description pair, first extract the set of all entities from it. Then, traverse the entire data product argumentation knowledge heterogeneous graph and filter out triples whose head entity or tail entity belongs to the entity set. These filtered triples collectively constitute a causal knowledge subgraph that is strongly related to the data product description pair.
[0068] B2: Calculating the causal knowledge subgraph feature. The vector representations of all triples in the subgraph are collected. In this embodiment, the summing method is used for collection to obtain the final feature representation of the subgraph. This feature vector condenses the structured knowledge information related to the current data product description pair.
[0069] In an alternative embodiment, the method of generating subgraph features in step S300 can employ a more complex aggregation strategy. The causal knowledge subgraph features can be calculated using an attention mechanism-based weighted aggregation method. Each triple vector in the subgraph is assigned a dynamically calculated attention coefficient to represent its contribution to the final subgraph feature. The value of the attention coefficient is determined by performing a learnable nonlinear transformation on the triple vector itself to obtain an importance score, and then normalizing the importance scores of all triples in the subgraph. The final subgraph feature is obtained by weighted summation of all triple vectors and their corresponding attention coefficients. Because this method can determine the contribution of a triple to the final feature based on its own data characteristics, it can generate more discriminative subgraph representations.
[0070] In the embodiments of the present application, step S400 of fusing the subgraph features and the contextual semantic features of the data product description pair to determine the matching result includes the following steps C1-C3:
[0071] C1: input the data product description pair into a pre-trained language model to obtain the contextual semantic features of the data product description pair.
[0072] Specifically, for a given sentence pair, concatenate it with the respective context into a sequence of a specific format. Then input this sequence into a pre-trained language model (such as RoBERTa), and extract the vector corresponding to a specific position (such as the [CLS] identifier) of the model output as the contextual semantic features of the data product description pair.
[0073] C2: combine the subgraph features and the contextual semantic features to generate a fused feature representation.
[0074] This embodiment uses a simple feature addition method for fusion, adding the vectors of the contextual semantic features and the causal knowledge subgraph features to obtain the final sentence pair representation. This fused feature contains both deep contextual semantics from the text and structured causal knowledge from the knowledge graph.
[0075] C3: input the fused feature representation into a classifier to output the matching probability of the data product description pair.
[0076] Input the fused feature into a classifier composed of a linear layer and a Sigmoid activation function to calculate the probability that the sentence pair is a positive match (i.e., the description is consistent). During training, use the binary cross-entropy loss function to optimize the model end-to-end. This loss function compares the model's predicted probability with the true label to guide the model's parameter updates.
[0077] For example, in a specific application test, the method of the present application can effectively handle the data product description matching task. The input test sample set is used to calculate the matching probability of all candidate sentences in each sample, and the probability value is sorted, and the highest ranked candidate description is output as the final matching result. For example, in a certain power data transaction scenario, the data product description of a data demand party is "need load prediction data of each region in the past year", and the candidate data product description has A: "provide historical load data" and B: "provide future load prediction service". The traditional text similarity based method may misjudge A as a better match due to the word "load data". However, the method of the present application can understand the causal and functional relationship between "load prediction data" and "prediction service" through the constructed knowledge graph, and capture the time sequence correspondence between "past year" and "history" from the text, so as to correctly determine B as a more accurate match, thereby improving the accuracy of data product description matching. Experiments show that compared with the baseline model, the method has significant improvement in precision and mean reciprocal rank (MRR) indicators on the data product data set.
[0078] In an optional embodiment, the feature fusion mechanism in step S400 can adopt a gating mechanism. The feature combination can also adopt a gating mechanism, the principle of which is to introduce a gating value dynamically determined by the input features to adaptively control the fusion proportion of the two features. Specifically, the calculation of the gating value is to concatenate the context semantic feature vector and the causal knowledge subgraph feature vector, and then apply a linear transformation containing learnable parameters and a nonlinear activation transformation with a value range between zero and one to the concatenated vector. The final fusion feature vector is a linear interpolation between the context semantic feature and the causal knowledge subgraph feature, and the interpolation ratio is the aforementioned calculated gating value. Because the fusion ratio is determined according to the specific features of each input, the adaptive weighting of the two information sources can be achieved.
[0079] Embodiment 3 is a third embodiment of the present application, which provides a heterogeneous graph data product description matching system for strengthening multi-type entity semantic relationship, comprising:
[0080] A data product argumentation knowledge graph construction module is used to obtain a data product description pair and construct a data product argumentation knowledge heterogeneous graph based on an external knowledge base and a data product data set;
[0081] A graph representation learning module is used to generate graph representation vectors of entities and relationships in the data product argumentation knowledge heterogeneous graph based on the data product argumentation knowledge heterogeneous graph;
[0082] The subgraph modeling module is configured to extract a causal knowledge subgraph associated with the data product description pair from the data product argumentation knowledge heterogeneous graph, and generate subgraph features of the causal knowledge subgraph in combination with a graph representation vector.
[0083] The matching result determination module is configured to fuse the subgraph features and context semantic features of the data product description pair to determine a matching result of the data product description pair.
[0084] Embodiment 4 is the fourth embodiment of the present application, which is different from the first three embodiments in that: if the function is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0085] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered a list of executable instructions for implementing logic functions, and can be specifically embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, apparatus, or device and execute the instructions, or in conjunction with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with these instruction execution systems, apparatuses, or devices.
[0086] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electrical device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer readable medium can be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for instance via an optical scanner, then compiled, interpreted, or otherwise processed, using a suitable medium, into a computer readable medium.
[0087] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0088] Embodiment 5, reference Figure 2 For the fifth embodiment of the application, a method for matching heterogeneous graph data product descriptions with enhanced multi-type entity semantic relationships is provided. In order to verify the beneficial effects of the application, scientific demonstration is carried out through experiments.
[0089] Step 1, a new data product demonstration knowledge heterogeneous graph construction method is proposed, which uses external causal knowledge to match the causal knowledge of data product description pairs to enhance the representation ability of data product description pairs, and integrates causal knowledge and data product demonstration knowledge to construct data product demonstration knowledge heterogeneous graph to enhance the knowledge expression ability of heterogeneous graph.
[0090] Step 1.1, extract triples (head entity, relationship, tail entity) from the relevant data set of the data product, and construct a preliminary data product demonstration knowledge subgraph. Given the relevant data set X = {x1,…x i} of the data product, x i is a sample, x i = {p, c p , d1, c1, … d w , c w}, p is the given data product description, c p is the context of the given data product description, d w is the wth candidate data product description, cw is the context of the wth candidate data product description. When w = 1, {p, d1} is a data product description pair, and when w ≠ 1, {p, d w} is a sentence pair. N candidates is the number of candidate data product descriptions, is the context set of N candidates candidate data product descriptions.
[0091] Firstly, we extract data product argumentation knowledge from x i using OpenIE. Argumentation knowledge sub-graph is denoted as G triple = (E TR , R TR , T TR ). Where E TR is the set of entities, R TP is the set of relations, and T TR is the set of triples, i.e. G triple is composed as shown in equation (1).
[0092]
[0093] Where k1 is the number of triples in G triple . is the head entity of the ith triple, r i is the relation of the ith triple, is the tail entity of the ith triple.
[0094] Step 1.2, match the cause-effect knowledge in the data product description pair using CauseNet. The matching process is as follows: first, CauseNet is denoted as G CN = (E CN , R CN , T CN ). E CN is the set of entities, R CN is the set of relations, and T CN is the set of triples, i.e. Secondly, extract all entities in the first data product description c p using TagMe, and get the entity set Then extract all entities in the candidate data product description c1 using TagMe, and get the entity set Again, perform morphological reduction and lowercase processing on the entities in E α and E β , and if the entity is composed of multiple words, use the symbol ‘_’ to connect. Finally, according to CauseNet, we extract the cause-effect knowledge from E α and Eβ Head entities and tail entities with causal relationship are found in the middle and constitute triples, which constitute a causal knowledge graph, denoted as G cause The causal knowledge matching is shown in formula (2).
[0095]
[0096] where k2 is the number of triples in the causal knowledge graph, is the head entity, is the tail entity. E α is the entity set of argument p, E β is the entity set of the context c w of the candidate data product description, T CN is the triple set of CauseNet.
[0097] Step 1.3, G triple and G cause compose a data product argument knowledge heterogeneous graph, denoted as G=(E,R,T). The knowledge graph fusion is shown in formula (3).
[0098]
[0099] where E is the entity set, R is the relationship set, and T is the triple set, N t is the number of triples.
[0100] Step 2, multi-type entity semantic relationship enhancement is proposed, which uses graph attention mechanism based dynamic learning edge weight to extract entity semantic relationship of edge, and takes it as the main feature of causal knowledge subgraph, to enhance the subgraph representation ability of data product description to recognition model.
[0101] Step 2.1, context-aware graph embedding initialization. Construct negative samples and initialize the head, tail entity and edge representation of triples, for triples tr i ∈G, construct N neg negative samples, tr i =(e h , r, e t ). The initial embedding of entity e h , e t is a real vector, and the representation of relationship r is dynamically generated by the improved graph attention mechanism (GAT).
[0102] Take the head entity e h and its adjacent entity set N(e h ) as input, and calculate the tail entity e tsemantic relevance weight. The attention mechanism takes the tail entity embedding as the reference (Query) to evaluate the contribution of the head entity and each neighbor entity in the current triple semantic modeling, thereby obtaining the structural context vector:
[0103]
[0104] where W, W1, W2 are learnable matrices, || represents concatenation of two vectors, and c is the structural context vector. Finally, the head entity, tail entity, and the aggregated context representation are concatenated and input into a multi-layer perceptron (MLP) to generate the context-aware edge representation vector:
[0105] r = MLP([e h ||e t ||c]) (7)
[0106] where D is the entity and relation vector feature dimension, and r is the edge representation vector. The edge representation is not obtained by directly updating the entity, but by taking the tail entity as the semantic reference to guide the head entity neighbor structure to model and converge to the edge representation. The semantic representation of each edge not only integrates the embedding features of the head and tail entities, but also explicitly encodes the semantic importance of the head entity's adjacency structure in the context of a specific triple. This structure realizes the structural expansion of GAT from node updating to edge modeling, and is a context-aware representation learning mechanism for relationship edges.
[0107] Step 2.2, use the scoring function to evaluate the confidence of the triple, i.e. use the scoring function to calculate the score of the triple representation. The scoring function is shown in equation (5).
[0108]
[0109] where d i is the triple score value, e h , e t , and r are the representation vectors of the head, tail entity, and edge, respectively.
[0110] Step 2.3, calculate the loss of the positive sample triple according to the score, and the loss calculation is shown in equation (6).
[0111]
[0112] where L is the loss value, σ is the sigmoid function, and γ is the interval value to distinguish positive and negative samples.
[0113] To improve the model's ability to distinguish triples with different semantic strengths, a confidence factor w i, which is used to measure the relative importance of triples in the training process. This factor is calculated statically by combining the context structure complexity and the relationship frequency.
[0114] The context structure complexity of each triple is defined as the weighted combination of the number of neighbor nodes of the head entity and the tail entity in the knowledge graph, specifically:
[0115] C i = a deg(e h ) + (1-a) deg(e t ) (10)
[0116] where deg(e h ), deg(e t ) represent the degree (i.e., the number of connected relationships) of the head and tail entities, respectively, and a e [0, 1] is an adjustable weight. This degree measures the structural complexity of the entity in the graph, and the higher the degree, the richer the context of the entity.
[0117] The frequency of the relationship r appearing in the training set is defined as:
[0118]
[0119] where N r represents the number of triples in which the relationship r appears, and N represents the total number of triples. Taking the complement value 1-freq(r) represents the rarity, embodying the "inverse frequency" idea in TF-IDF. The lower the frequency, the more rare the relationship, the higher the degree of semantic recognition and learning value, and therefore a higher confidence is given.
[0120] Combining the structural complexity and the relationship rarity, the final confidence factor is obtained:
[0121] w i = β norm(C i ) + (1-β) (1-freq(r)) (12)
[0122] where norm(C i ) represents the normalized value of the structural complexity in the training set, and β e [0, 1] is a balance coefficient.
[0123] Step 2.4, optimization using structure-aware self-adversarial negative sampling mechanism. For each negative sample, its score is calculated and used as a preliminary basis for evaluating the quality of the negative sample. According to the score and the structure score of the negative sample, the sampling probability is calculated by weighted summation, and the negative sample is sampled from the negative sample set according to the sampling probability. The higher the probability, the greater the chance of being selected. Negative samples with higher scores and more complex structures will be sampled first. The probability calculation method is shown in formula (14), and the calculation formula of the structure score is shown in formula (13).
[0124]
[0125] where p is the probability distribution, a is the sampling probability, N neg is the number of negative samples. d' j is the jth negative sample representation score, is the structure score, and are the head entity and tail entity neighbor sets, respectively.
[0126] Step 2.5, calculate the triple positive and negative sample loss and build the objective function. The calculation method is shown in formula (15).
[0127]
[0128] where y is the interval value that distinguishes positive and negative samples, d i is the i-th triple positive sample representation score, p i is the probability distribution value of the i-th triple negative sample score, d' i is the i-th negative sample representation score value.
[0129] Step 2.6, build the data product argumentation knowledge heterogeneous graph representation and joint text semantic modeling. After training the multi-type entity semantic relationship enhancement module, the data product argumentation knowledge heterogeneous graph G, entity set E all , and relationship set R all are obtained. The triple vector calculation method is shown in formula (16).
[0130]
[0131] where Em(tr i ) is the i-th triple vector in the data product argumentation knowledge heterogeneous graph, r i , are the head entity, relationship, and tail entity vectors of the i-th triple, respectively.
[0132] Take the union of all triple representations to obtain the data product argumentation knowledge heterogeneous graph representation Em(G), N i is the number of triples. The data product argumentation knowledge heterogeneous graph representation is shown in formula (17).
[0133]
[0134] Step 3, perform knowledge extraction, extract the triples of the entities contained in the data product description pair from the data product argumentation knowledge heterogeneous graph as the causal knowledge subgraph to enhance its association with the data product description pair.
[0135] Step 3.1, extract the entity set from the data product description pair {p, d1} and match the relevant triples based on the data product argumentation knowledge heterogeneous graph to construct the causal knowledge subgraph G c . For the sample Take the data product description pair {p, d1} as an example to describe the process. First, extract the entity set p from p and d1, second, extract the vector representation p' of the entity set p from Em(G), and then mark the subgraph constructed by the i-th sample in the data product argumentation knowledge heterogeneous graph as SG i . The sample-related subgraph SG i means selecting a subgraph that is structurally related to the entity set in the sample from the global knowledge heterogeneous graph, which specifically includes triples that have direct connections or no more than 2-hop paths between all head entities or tail entities and at least one entity. This construction method takes into account semantic coverage and computational efficiency, effectively filtering out graph structure areas that have structural coupling relationships with semantic entities in the sample for subsequent extraction and matching of causal knowledge subgraphs. Finally, extract triples of entities contained in the data product description pair from SG i as the causal knowledge subgraph, and the knowledge subgraph matching method is shown in equation (18).
[0136]
[0137] Where G c is the causal knowledge subgraph of the data product description pair. r, are the head entity, semantic relationship, and tail entity vectors of the i-th triple in G c , and bk is the number of triples in G c .
[0138] Step 3.2, calculate the causal knowledge subgraph features. Sum the triple features contained in the causal knowledge subgraph to obtain the causal knowledge subgraph features, and the causal knowledge subgraph feature calculation method is shown in equation (19).
[0139]
[0140] Where Em(tr i ) is the i-th triple representation in the causal knowledge subgraph G c .
[0141] Step 4, enhance the entity semantic relationship of the sentence pair, fuse the causal knowledge subgraph features and the context semantic features of the data product description pair to construct a data product description pair recognition model to enhance the model recognition performance.
[0142] Step 4.1, calculate the sentence pair representation. For the sample Take the sentence pair {p, dw The process is described using x as an example. i Data product description p and candidate data product description d in the middle. w Context c of data product description p Context c of candidate data product description w Combined into "[CLS]p[SEP]c p [SEP]d w [SEP]c w The sequence is then input into the RoBERTa model to obtain the contextual semantic features of the data product description pair. The sentence pair representation is obtained by fusing the causal knowledge subgraph features and the contextual semantic features of the data product description pair. The sentence pair representation is calculated as shown in formula (20).
[0143] Em(S w ) = Em(CLS w )+Em(G c (20)
[0144] Among them, Em(S w () represents a given data product description p and candidate data product description d. w The sentence pairs are represented by Em(CLS). w Em(G) is the contextual semantic feature of the data product description pair. c ) is a feature of the causal knowledge subgraph.
[0145] Step 4.2, calculate the probability of the data product description pair. This yields {p,d} w} Sentence pairs are represented as Em(S) w After that, the model uses the sigmoid normalization function to calculate {p,d} w} represents the probability of a data product description pair, and the probability calculation is shown in formula (21).
[0146] P w =σ(W p Em(S w (21)
[0147] Where σ is the sigmoid activation function, W p b are the weight matrix and bias term of the linear layer, and P is the weight matrix and bias term of the linear layer. w It is the probability value that sentence pair w belongs to the data product description pair.
[0148] Step 4.3: During the training process, the loss is calculated using binary cross-entropy, as shown in formula (22).
[0149]
[0150] Where, Ncandidates is the number of candidate data product description pairs, y w is the true value label, the value of 1 represents a data product description pair, and the value of 0 represents not a data product description pair, P w is the probability value of the wth sentence pair belonging to the data product description pair, represents the loss value. In the training phase, the loss is calculated by the above process, and the parameters are updated by back propagation, and finally the trained data product description pair recognition model is obtained
[0151] Step 5, test, use the trained model to obtain sentence pair representation, calculate the prediction probability, and get the prediction result. In the test phase, input test sample TX={tx1,…tx i}, use the model to obtain the wth sentence pair representation in tx i , calculate the probability value of the sentence pair belonging to the data product description pair in turn and sort, and finally output the serial number of the first ranked sentence pair as the serial number of the data product description pair.
[0152] The experimental data comes from the data product dataset. The model uses the RoBERTa encoder, the number of hidden layers is 12, the output dimension is 768, the maximum input length is 512, the batch size is 2, the training round is 20, the Adam optimizer is used, the learning rate is 1e-5, and the dropout rate is 0.01.
[0153] The experiment uses the precision Precision@1(P@1) and the mean reciprocal rank index (MRR) to evaluate the results. The calculation formulas are shown in formulas (23) and (24):
[0154]
[0155] Among them, the precision represents the proportion of actual positive examples in the examples classified as positive examples, n is the number of samples actually classified as positive examples and predicted as positive examples, N1 is the number of all samples predicted as positive examples. The mean reciprocal rank index (MRR) takes the reciprocal of the correct answer ranking of the sample as the accuracy, and takes the average of the accuracy of all samples. N is the number of samples, and rank i is the ranking of the i th sample correct answer.
[0156] This experiment is carried out on a computer and a server. The specific configuration of the computer is: Inter i7-6700, memory 8G, operating system is windows 10, 64 bit; The specific configuration of the server is: GPU RTX 6000 for graphics card, operating system is Linux Ubuntu 64 bit.
[0157] Test results: According to the heterogeneous graph data product description matching method for strengthening multiple types of entity semantic relationships, the data product description matching task is carried out on the data product data set, the precision and average reciprocal rank indicators are improved, and good effects are obtained in the data product description matching task.
[0158] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced without departing from the spirit and scope of the present application, and they should be covered in the scope of the claims of the present application.
Claims
1. A method for matching product descriptions in heterogeneous graph data that enhances semantic relationships among multiple entity types, characterized by: include: Obtain data product description pairs and construct a heterogeneous knowledge graph of data product argumentation based on external knowledge bases and data product datasets; Based on the heterogeneous knowledge graph of the data product argumentation, a graph representation vector of entities and relationships in the heterogeneous knowledge graph of the data product argumentation is generated; Extract causal knowledge subgraphs associated with the data product description pairs from the data product argumentation knowledge heterogeneous graph, and generate subgraph features of the causal knowledge subgraphs by combining the graph representation vectors; By integrating the subgraph features with the contextual semantic features of the data product description pair, the matching result of the data product description pair is determined.
2. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 1, characterized in that: The heterogeneous graph of argumentation knowledge for the data product includes argumentation knowledge derived from the dataset of the data product and causal knowledge derived from the external knowledge base.
3. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 2, characterized in that: The step of generating the graph representation vectors of entities and relations in the heterogeneous graph of data product argumentation knowledge specifically involves determining the representation vector of the relation based on the entity associated with any relation in the heterogeneous graph of data product argumentation knowledge and the local graph structure information of the entity.
4. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 3, characterized in that: The process of generating graph representation vectors of entities and relationships in the heterogeneous graph of the data product argumentation knowledge also includes generating the graph representation vectors by training a graph embedding model. The training is used to improve the confidence of valid entity relation triples in the heterogeneous knowledge graph of the data product and reduce the confidence of invalid entity relation triples.
5. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 4, characterized in that: The subgraph features for generating the causal knowledge subgraph are specifically generated by collecting the vector information of entity relationship triples that are semantically associated with the data product description in the heterogeneous graph of data product argumentation knowledge.
6. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 5, characterized in that: The process of fusing the subgraph features with the contextual semantic features of the data product description pair to determine the matching result of the data product description pair includes: The data product description pairs are input into a pre-trained language model to obtain the contextual semantic features of the data product description pairs; The subgraph features and the context semantic features are combined to generate a fused feature representation; The fused feature representation is input into the classifier, which outputs the matching probability of the data product description pair.
7. The heterogeneous graph data product description matching method for enhancing semantic relationships of multiple entity types as described in claim 6, characterized in that: The external knowledge base is a predefined causal relationship knowledge base.
8. A heterogeneous graph data product description matching system that enhances semantic relationships among multiple entity types, employing the heterogeneous graph data product description matching method for enhancing semantic relationships among multiple entity types as described in any one of claims 1 to 7, characterized in that, include: The data product justification knowledge graph construction module is used to obtain data product description pairs and construct a heterogeneous knowledge graph for data product justification based on an external knowledge base and a data product dataset. The graph representation learning module is used to generate graph representation vectors of entities and relationships in the data product argumentation knowledge heterogeneous graph based on the data product argumentation knowledge heterogeneous graph. The subgraph modeling module is used to extract causal knowledge subgraphs associated with the data product description pairs from the heterogeneous graph of data product argumentation knowledge, and generate subgraph features of the causal knowledge subgraphs by combining the graph representation vectors. The matching result determination module is used to fuse the subgraph features with the contextual semantic features of the data product description pair to determine the matching result of the data product description pair.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the heterogeneous graph data product description matching method for enhancing semantic relationships of multiple types of entities as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the heterogeneous graph data product description matching method for enhancing semantic relationships of multiple types of entities as described in any one of claims 1 to 7.