A neural-symbolic graph-guided relation extraction method and device
Patent Information
- Application Number
- CN202611040220.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-09
AI Technical Summary
[0005]为了解决现有技术中存在长尾关系样本稀疏导致判别边界模糊导致关系抽取精度低的问题,本发明提供一种基于神经符号图导向的关系抽取方法及装置
[0014]本发明方法利用大语言模型从训练语料中动态归纳细粒度的实体关系类型约束,并据此生成经过逻辑校验的高质量长尾伪数据,从特征流形层面有效缓解了长尾关系的样本稀疏问题;同时,通过图卷积网络在动态约束图上进行消息传递,实现了头部关系向尾部关系的结构化知识迁移,使得尾部关系即使在训练样本极度匮乏的情况下仍能建立清晰的判别边界,显著提升了长尾关系的抽取精度与召回率。
Smart Images

Figure CN122886608A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of relation extraction technology, and particularly relates to a relation extraction method and apparatus based on neural symbol graph guidance. Background Technology
[0002] Relation extraction is an important task in Natural Language Processing (NLP), aiming to identify semantic relationships between entities from unstructured text. Existing graph-based relation extraction methods construct static knowledge graphs by using predefined entity type constraints and leverage graph convolutional networks for message passing to achieve knowledge transfer from head relations to tail relations.
[0003] However, the existing methods have the following problems:
[0004] The sparse sample size of long-tail relationships leads to blurred discrimination boundaries. Long-tail distributions are prevalent in remote supervised datasets, resulting in a severe lack of training samples for tail relationships. This prevents models from constructing robust discrimination boundaries for these categories. Existing methods primarily rely on resampling or weighting strategies to adjust gradient directions at the optimization level, but they do not address the sparsity of the sample distribution from the feature space perspective, making it difficult to fundamentally solve the overfitting problem of tail relationships. Summary of the Invention
[0005] To address the problem of low accuracy in relation extraction due to the sparse long-tail relation samples in existing technologies leading to blurred discrimination boundaries, this invention provides a relation extraction method and apparatus based on neural symbol graph guidance.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] The first aspect of this invention provides a relation extraction method based on neural symbol graph guidance, comprising the following steps:
[0008] Entity relation type constraints are derived from the corpus training set. A dynamic constraint graph is generated based on these entity relation type constraints, and an enhanced training set is constructed. The entity relation type constraints are the allowed head entity types and tail entity types for each relation. The dynamic constraint graph includes nodes and edges. The nodes represent relations, and the edges represent entity type constraints shared by two nodes.
[0009] For sentences in the corpus training set, semantic vectors of the text stream are extracted using a segmented dilated convolutional neural network;
[0010] Perform graph convolution on the dynamic constraint graph to obtain the structured embedding of relation nodes;
[0011] Structured embedding of the relation nodes The model is dynamically weighted and fused with the semantic vectors of the text stream. A joint optimization strategy combining dynamic reweighting and supervised contrastive loss is used to achieve model training and relation category mapping.
[0012] A second aspect of the present invention provides a relation extraction device based on neural symbol graph guidance, comprising a memory and a controller connected in sequence, wherein the memory stores a computer program, and the controller is used to read the computer program and execute the relation extraction method based on neural symbol graph guidance described in the first aspect.
[0013] The beneficial effects of this invention are:
[0014] This invention utilizes a large language model to dynamically summarize fine-grained entity relation type constraints from the training corpus, and generates high-quality long-tail pseudo-data that has undergone logical verification. This effectively alleviates the sample sparsity problem of long-tail relations from the feature manifold level. At the same time, by using a graph convolutional network to perform message passing on the dynamic constraint graph, it realizes the structured knowledge transfer from head relations to tail relations. This enables tail relations to establish clear discrimination boundaries even when training samples are extremely scarce, significantly improving the extraction accuracy and recall rate of long-tail relations. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of the method proposed in this invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0018] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.
[0020] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0021] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use, or the orientation or positional relationship commonly understood by those skilled in the art. They are only used for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. In addition, the terms "first," "second," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0022] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0023] The first aspect of this invention discloses a relation extraction method based on neural symbol graph guidance, specifically, Figure 1 As shown, the method includes steps S1 to S4.
[0024] Step S1: Summarize entity relation type constraints from the corpus training set, generate a dynamic constraint graph based on these constraints, and construct an enhanced training set based on long-tail relations. The entity relation type constraints are the allowed head and tail entity types for each relation. The dynamic constraint graph includes nodes and edges; nodes represent relations, and edges represent entity type constraints shared by two nodes. Specifically, this step includes steps S11 to S15.
[0025] Step S11: Extract a preset number of relations with confidence levels higher than a preset confidence threshold from the relation set of the corpus training set as a support set, and construct a composite prompt based on each relation in the support set and the training set.
[0026] Specifically, the set of relations in the corpus training set , Represents a relation, 1≤ ≤ , This represents the total number of training central relations.
[0027] Among them, support set The dataset includes only a small number of relation samples; typically, the number of high-confidence samples per relation is set to 5 to 10. The preset confidence threshold is generally set at 0.9.
[0028] The constructed compound hint is Used to instruct large language models to mine entity type constraints from the original corpus.
[0029] Step S12: Input the composite prompt into the large language model to perform generative reasoning, output the constraint pattern of natural language description, and map it into entity relation type constraints of triple structure through the post-processing parsing module. The entity relation type constraints are used to constrain the head entity type and tail entity type allowed for each relation.
[0030] Among them, constraint mode for:
[0031] ,
[0032] In the formula, Represents a large language model.
[0033] Entity relation type constraints of the mapped triple structure for:
[0034] ,
[0035] In the formula, It is a collection of fine-grained entity types.
[0036] in, The relationship is defined explicitly. Allowed header entity types Ending entity type .
[0037] Step S13: Construct a dynamic constraint graph based on all relations and corresponding entity relation type constraints. The dynamic constraint graph includes nodes and edges. Nodes represent relations, and edges represent entity type constraints shared by two nodes.
[0038] Specifically, in this step, relationships are treated as nodes, and edge connections are established through shared entity type constraints to form an adaptive dynamic constraint graph.
[0039] Step S14: Filter out the tail relations in the relation set, and construct a conditional probability generation model for the tail relations based on the entity type constraints in the dynamic constraint graph and the seed context related to the head entity type and tail entity type retrieved from the corpus training set. .
[0040] Specifically, this step first counts the total number of samples for each relation in the relation set within the corpus training set. The total number of samples responding to a relation is less than a preset threshold. The relationship is classified as a tail relationship.
[0041] Right now The relationship is classified as a tail relationship, i.e. a long tail relationship. The preset number threshold is generally set to 100 to 300.
[0042] Based on the entity type constraints in the dynamic constraint graph and the head entity type corresponding to the tail relation retrieved from the corpus training set. Ending entity type Related seed context Construct a conditional probability generation model ,in,
[0043] ,
[0044] In the formula, This represents the conditional probability distribution constructed based on a large language model.
[0045] Step S15: Use named entity recognition tools to predict the conditional probability generative model. The entity type in the relation is used as the relation in the augmented training set if the entity type matches the entity type in the entity relation type constraint.
[0046] In this step, only high-quality samples that pass the logical consistency check are included in the enhanced training set. This continues until the sample size of the tail relationship reaches the set equilibrium threshold.
[0047] Step S2: Extract the semantic vector of the text stream from the sentences in the corpus training set using a segmented dilated convolutional neural network.
[0048] Specifically, this step includes steps S21 to S23.
[0049] Step S21: Perform high-dimensional mapping on the sentences in the corpus training set to obtain a high-dimensional dense vector sequence. Use dilation convolution operation with dilation rate d to calculate the convolution features of word vectors in the sentence, where d = [1,2,3].
[0050] Specifically, this step uses a pre-trained language model to map the word sequence of a sentence into a high-dimensional dense vector sequence. , In the formula, For real numbers, For sentence length, For word embedding dimension.
[0051] For the word vector at position i in the sentence, the convolutional features for:
[0052] ,
[0053] In the formula, Represents a non-linear activation function. Indicates the weights of the dilated convolution kernel. This represents the input features within a sliding window centered on the i-th word. The distance between the convolution kernel looking at a few words to the left and right. This is a bias term.
[0054] Long-distance semantic dependencies are captured using a multi-scale dilatation rate d = [1,2,3].
[0055] Step S22: Perform segmentation, max pooling, and concatenation operations on the convolutional features sequentially to obtain the global feature representation of the sentence.
[0056] Specifically, this step first divides the convolutional features into three segments based on the positions of the first and last entities in the sentence. During this division, the convolutional features preceding the first entity in the sentence are divided into segments preceding the entity. The convolutional features from the first entity to the last entity are divided into inter-entity segments. The convolutional features following the last entity are divided into post-entity segments. .
[0057] Then, the fragment before the entity. Inter-entity fragments and entity fragment After performing max pooling, a concatenation operation is performed to obtain the global feature representation of the sentence. ,in,
[0058] ,
[0059] In the formula, [·;·;·] represents the max pooling operation, and [·;·;·] represents the vector concatenation operation. It represents the hyperbolic tangent function.
[0060] Step S23: Calculate the relevance weights between the global feature representation and the entity embedding. ,pass (Element-wise product) weights and adjusts the sentence features to obtain the text stream semantic vector wb .
[0061] Among them, the text stream output wb for:
[0062] The specific calculation process is as follows: First, construct the entity embedding vector.
[0063]
[0064] In the formula, the head entity Tail-end entity vector representation , [;] represents matrix concatenation. The original attention score is calculated using a non-linear mapping method.
[0065]
[0066] In the formula, The weight matrix represents the entity space mapping. This represents the weight matrix used to transform sentence features in nonlinear attention. This represents the weight matrix of the last layer used for output mapping in nonlinear attention. This represents the global feature vector of the sentence. This represents the hyperbolic tangent function. To transform the raw scores into weights that conform to a probability distribution, the Softmax function is used for normalization, resulting in the final relevance weight vector.
[0067]
[0068] Step S3: Perform graph convolution on the dynamic constraint graph to obtain the structured embedding of the relation nodes. Specifically, this step includes steps S31 and S32.
[0069] Step S31: Convert the dynamic constraint graph into an adjacency matrix. Based on the adjacency matrix The degree matrix is calculated. Perform inter-layer propagation of the graph convolutional layer to obtain the node feature matrix.
[0070] Among them, the The node feature matrix of the layer is ,but +1 layer node feature matrix for:
[0071] ,
[0072] ,
[0073] In this formula, It is an adjacency matrix with self-loops. The degree matrix, i.e. .
[0074] In the formula, It is a non-linear activation function. Given an adjacency matrix with self-loops, It is the identity matrix; For the first The learnable transformation weight matrix of the layer.
[0075] The above operations achieve symmetric normalization of the adjacency matrix, preventing numerical explosion or gradient vanishing in multi-level propagation.
[0076] Through multi-layer graph convolution operations, tail relation nodes can aggregate rich semantic features from head relation nodes. This mechanism enables the effective transfer of knowledge from high-frequency head to low-frequency tail classes, that is, it utilizes the general feature patterns learned from the ample training data of head relations to help improve the feature representation of tail relations.
[0077] Step S32: After multi-layer graph convolution operations, obtain the structured embedding of relation nodes. .
[0078] The embedding The ontological constraints and topological information of the relations are explicitly encoded.
[0079] Step S4: Structured embedding of the relation nodes The model is dynamically weighted and fused with the semantic vectors of the text stream. A joint optimization strategy combining dynamic reweighting and supervised contrastive loss is used to achieve model training and relation category mapping.
[0080] Specifically, this step includes steps S41 to S44.
[0081] Step S41: Structured embedding of the relation nodes and text stream semantic vectors The components are concatenated, and gating coefficients are generated through a parameterized linear transformation layer and a sigmoid activation function. .
[0082] Among them, the gating coefficient for:
[0083] ,
[0084] In the formula, [·;·] represents the vector concatenation operation, Wg and bg are the weight matrix and bias term of the gated network, respectively, and σ(·) is the Sigmoid activation function, which maps the output value to the (0,1) interval, representing the throughput of the information flow.
[0085] Step S42: Based on the gating coefficient Structured embedding of the relation nodes We perform a weighted summation with the semantic vectors of the text stream to obtain relation discriminant features. .
[0086] Among them, relation discriminant features for:
[0087] .
[0088] Step S43: Map the relation discrimination features to the final relation category based on the feature output of the additional nonlinear projection head.
[0089] Among them, the final relationship category for:
[0090] 'i' represents the i-th package. This represents a multilayer perceptron, which consists of "linear layers, activation functions, and more linear layers". Represents the discriminative feature of the i-th relation. .
[0091] Step S44: With the goal of minimizing the loss function, train the large model based on the corpus training set and the augmented training set.
[0092] The loss function in this scheme is: The loss function is constructed based on dynamic weights of relation categories and supervised contrastive loss function.
[0093] Specifically, supervised contrastive loss function for:
[0094]
[0095] In the formula, This is the set of positive sample indices that have the same relational labels as the current benchmark. For temperature hyperparameters, To represent the contrast feature embedding of the i-th sample in the current batch, which is being used as the comparison benchmark, To represent all items in the current batch that are related to Feature embeddings of other samples with the same relation labels.
[0096] The constructed loss function is for:
[0097] ,
[0098] In the formula, For balance coefficient, For the first Example package correspondence tags In the Dynamic weights during training rounds. This represents the maximum value of the total number of relation samples in the entire training corpus. To balance the sensitivity hyperparameters, Current relationship label The total number of samples in the entire training corpus. An annealing function that decays with each training epoch. The total number of example packets included in the current training batch. For the classifier to the first The final fusion features of each example package Predict its true relationship label The predicted probability.
[0099] Specifically, the optimizer chosen is AdamW, and the initial learning rate is set to... The batch size was set to 160, and the training was conducted for a total of 30 rounds. The AUC metric was evaluated on the validation set every 500 steps, and the optimal model weights were saved.
[0100] To mitigate the training bias caused by the scarcity of long-tail relationship samples, a dynamic pattern induction and data augmentation strategy based on a large language model is implemented, for example:
[0101] For the 53 relation types defined in the dataset, five high-confidence samples were randomly selected from the training corpus as support sets for few-sample hints. LLaMA-3-70B was used to perform deep semantic analysis of the context, and dynamic pattern induction was performed to generate fine-grained entity type constraint triples specific to each relation. Then, the sample distribution of each relation is statistically analyzed, and categories with fewer than 100 samples are defined as tail relations. A structured data generation task is then performed, using the inductively derived type constraints and seed context as input to generate pseudo-label data until the sample size of the relation reaches the set equilibrium threshold of 200. To ensure generation quality, BERT-Large is introduced as a discriminator to perform logical consistency checks on the generated samples, removing noisy samples with prediction confidence below 0.8, ultimately constructing a high-quality augmented dataset. .
[0102] The model initialization process is divided into two parallel modules: text stream and symbol stream. In the text stream, the word vector matrix... The system is initialized using a pre-trained BERT-Base, and the encoding layer employs a segmented dilated convolutional neural network with a kernel size of 3 and a dilation rate of [missing information]. To cover multi-scale semantic dependencies; in the symbolic flow, a dynamic adjacency matrix is constructed based on the entity type constraints generated in stage one. To initialize the relational graph structure, the number of layers in the graph convolutional network is set to 2, and the Dropout rate is set to 0.5 to prevent over-smoothing.
[0103] The training process is performed on a dataset that mixes raw and augmented data, employing a multi-instance learning strategy for packet-level training, and defining dynamic loss function weights. ,in , The annealing function is linearly decaying with epochs; the optimizer chosen is AdamW, and the initial learning rate is... Eight NVIDIA GeForce RTX 4090 GPUs were used, with a batch size of 160; contrast loss was introduced. As a secondary target, temperature coefficient This narrows the feature distance between real samples and generated samples; the model is trained for 30 epochs, and the AUC metric is evaluated on the validation set every 500 steps, and the optimal model weights are saved.
[0104] This approach utilizes a large language model to dynamically summarize fine-grained entity relation type constraints from the training corpus, and generates high-quality long-tail pseudo-data that has undergone logical verification. This effectively alleviates the sample sparsity problem of long-tail relations at the feature manifold level. Simultaneously, by using a graph convolutional network for message passing on the dynamic constraint graph, structured knowledge transfer from head relations to tail relations is achieved. This ensures that tail relations can still establish clear discrimination boundaries even with extremely scarce training samples, significantly improving the extraction accuracy and recall rate of long-tail relations.
[0105] Secondly, the neural symbol adaptive gating fusion mechanism designed in this invention can automatically attenuate the confidence of the neural text stream when the text semantics are ambiguous or there is high-intensity noise, and instead rely on the symbol constraint graph for logical inference. This hard denoising mechanism completely avoids the inherent defect of traditional soft attention methods in forcibly assigning weights in garbage data, enabling the model to decisively reject predictions in all noisy packets and completely preserve semantic features in all valid packets, thereby fundamentally improving the model's robustness to noise from remote supervision labels.
[0106] Furthermore, this invention achieves a deep fusion of unstructured text semantics and structured symbolic constraints through a dual-stream architecture that integrates parallel encoding and gating. Under the control of gating units, the dual-stream features form complementary and enhanced relational discriminative representations, enabling the model to not only possess context-aware flexibility but also be strictly constrained by explicit logical rules. This design allows the model to achieve stable and excellent extraction performance in both stringent generalization scenarios where entity pairs in the training and test sets are mutually exclusive, and in standard evaluation scenarios where entity pairs overlap. This demonstrates that the model truly learns logical discriminative boundaries with generalization capabilities, rather than simply relying on statistical memory of entity co-occurrence.
[0107] Finally, the dynamic long-tail perception optimization strategy proposed in this invention achieves soft attention to long-tail samples at the micro level and optimizes the geometric structure of the feature space at the macro level through joint optimization of category-sensitive reweighting and supervised contrastive learning. This reshapes the originally loose and isolated long-tail features into compact and highly discriminative topological clusters. The synergistic effect of each core module forms a complete neural symbolic closed loop from data augmentation and two-stream coding to gating decision-making, jointly ensuring the comprehensive technical advantages of this invention in terms of relation extraction accuracy, long-tail generalization ability, and noise robustness.
[0108] The present invention discloses a relation extraction device based on neural symbol graph guidance, comprising a memory and a controller connected in sequence. The memory stores a computer program, and the controller is used to read the computer program and execute the relation extraction method based on neural symbol graph guidance described in the first aspect.
[0109] Specifically, the operating principle of the device in the second aspect is detailed in the first aspect and will not be repeated here.
[0110] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A relation extraction method based on neural symbol graph guidance, characterized in that, Includes the following steps: Entity relation type constraints are derived from the corpus training set. A dynamic constraint graph is generated based on these entity relation type constraints, and an enhanced training set is constructed based on long-tail relations. The entity relation type constraints are the allowed head entity types and tail entity types for each relation. The dynamic constraint graph includes nodes and edges. The nodes represent relations, and the edges represent entity type constraints shared by two nodes. For sentences in the corpus training set, semantic vectors of the text stream are extracted using a segmented dilated convolutional neural network; Perform graph convolution on the dynamic constraint graph to obtain the structured embedding of relation nodes; Structured embedding of the relation nodes The model is dynamically weighted and fused with the semantic vectors of the text stream. A joint optimization strategy combining dynamic reweighting and supervised contrastive loss is used to achieve model training and relation category mapping.
2. The relation extraction method based on neural symbol graph guidance according to claim 1, characterized in that... The process of inducing entity relation type constraints from the corpus training set, generating a dynamic constraint graph based on these entity relation type constraints, and constructing an enhanced training set based on long-tail relations includes: Extract a preset number of relations with confidence levels higher than a preset confidence threshold from the relation set of the corpus training set as a support set, and construct a composite prompt based on each relation in the support set and the training set; The composite prompts are input into the large language model to perform generative reasoning, and the constraint patterns described in natural language are output. These are then mapped to entity relation type constraints in a triplet structure through the post-processing parsing module. A dynamic constraint graph is constructed based on all relations and their corresponding entity relation type constraints. Tail relations are selected from the relation set, and a conditional probability generation model for the tail relation is constructed based on the entity type constraints in the dynamic constraint graph and the seed contexts related to the head entity type and tail entity type corresponding to the tail relation retrieved from the corpus training set. The named entity recognition tool is used to predict the entity type in the conditional probability generation model. In response to the entity type being consistent with the entity type in the entity relation type constraint, the relation is used as the relation in the augmented training set.
3. The relation extraction method based on neural symbol graph guidance according to claim 1, characterized in that... The process of extracting semantic vectors from sentences in the corpus training set using a segmented dilated convolutional neural network includes: The sentences in the training set of the corpus are mapped in high dimension to obtain a high-dimensional dense vector sequence. The convolution features of word vectors in the sentence are calculated by dilation convolution operation with dilation rate d, where d = [1,2,3]. The convolutional features are sequentially segmented, max-pooled, and concatenated to obtain the global feature representation of the sentence; Calculate the relevance weights between the global feature representation and the entity embedding. By weighting and adjusting the sentence features through element-wise multiplication, the semantic vector of the text stream is obtained.
4. The relation extraction method based on neural symbol graph guidance according to claim 3, characterized in that... The process of segmenting, max-pooling, and concatenating the convolutional features sequentially to obtain the global feature representation of the sentence includes: The convolutional features are divided into three segments based on the positions of the first and last entities in the sentence. Specifically, the convolutional features preceding the first entity are divided into a "pre-entity segment". The convolutional features from the first entity to the last entity are divided into inter-entity segments. The convolutional features following the last entity are divided into segments following the entity. Max pooling is performed on the pre-entity fragment, inter-entity fragment, and post-entity fragment, followed by concatenation to obtain the global feature representation of the sentence.
5. The relation extraction method based on neural symbol graph guidance according to claim 1, characterized in that... The step of performing graph convolution on the dynamic constraint graph to obtain the structured embedding of relation nodes includes: The dynamic constraint graph is transformed into an adjacency matrix. Based on the adjacency matrix The degree matrix is calculated. Perform inter-layer propagation of the graph convolutional layer to obtain the node feature matrix; After multi-layer graph convolution operations, the structured embedding of relational nodes is obtained.
6. The relation extraction method based on neural symbol graph guidance according to claim 1, characterized in that... The structured embedding of the relation nodes Dynamically weighted fusion with text stream semantic vectors, combined with a joint optimization strategy of dynamic reweighting and supervised contrastive loss, is used to achieve model training and relation category mapping, including: Structured embedding of the relation nodes and text stream semantic vectors The components are concatenated, and gating coefficients are generated through a parameterized linear transformation layer and a sigmoid activation function. ; Based on the gating coefficient Structured embedding of the relation nodes We perform a weighted summation with the semantic vectors of the text stream to obtain relation discriminant features. ; The relationship discrimination features are mapped to the final relationship category based on the feature output of the additional nonlinear projection head. To minimize the loss function With the goal of training a large model based on the corpus training set and the augmented training set, a large model is trained.
7. The relation extraction method based on neural symbol graph guidance according to claim 6, characterized in that... The gating coefficient for: , In the formula, [·;·] represents the vector concatenation operation, Wg and bg are the weight matrix and bias term of the gated network, respectively, and σ(·) is the Sigmoid activation function.
8. The relation extraction method based on neural symbol graph guidance according to claim 6, characterized in that... The relation discriminant features for: 。 9. A relation extraction method based on neural symbol graph guidance according to claim 6, characterized in that... The loss function The loss function is constructed based on dynamic weights of relation categories and a supervised contrastive loss function. for: In the formula, This is the set of positive sample indices that have the same relational labels as the current benchmark, where , To address the temperature hyperparameter, a nonlinear projection head is attached to the feature output to map the fused features to the contrast space. And normalize it. The constructed loss function is for: , For balance coefficient, For the first Example package correspondence tags In the Dynamic weights during training rounds. This represents the maximum value of the total number of relation samples in the entire training corpus. To balance the sensitivity hyperparameters, For the current relationship label The total number of samples in the entire training corpus. An annealing function that decays with each training epoch. The total number of example packets included in the current training batch. For the classifier to the first The final fusion features of each example package Predict its true relationship label The predicted probability.
10. A relation extraction device based on neural symbol graph guidance, comprising a memory and a controller connected in sequence, wherein the memory stores a computer program, characterized in that: The controller is used to read the computer program and execute the relation extraction method based on neural symbol graph guidance as described in any one of claims 1-9.