An entity relation joint extraction method adopting redundancy and noise reduction strategies

By combining span exhaustive search and entity-pair exhaustive search with a redundancy denoising strategy, a shared parameter model is constructed, which solves the problems of nested entities and excessive computation, and improves the effect of joint entity relationship extraction.

CN116701560BActive Publication Date: 2026-05-15BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF TECH
Filing Date
2023-06-09
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing methods for joint entity relationship extraction have shortcomings in handling nested entities and excessive computation. In particular, methods based on shared parameters cannot effectively deal with nested entities and have the problem of error cascading, while single-step exhaustive methods have excessive computation and too many negative samples.

Method used

A span exhaustive strategy is adopted for named entity recognition. The entity pair exhaustive strategy is combined with relation extraction. Negative samples are screened through redundancy and noise reduction strategies. A joint entity relation extraction model with shared parameters is constructed to reduce cascading errors and noise.

Benefits of technology

It effectively solves the nested entity problem, reduces computational cost and the number of negative samples, improves the model's recall and accuracy, reduces cascading errors, and enhances overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116701560B_ABST
    Figure CN116701560B_ABST
Patent Text Reader

Abstract

The present application relates to the field of deep learning technology and natural language processing, and particularly relates to an entity relation joint extraction method adopting redundancy and noise reduction strategy.The main implementation scheme of the present application is as follows: S1, converting the sentences in the data set into sentence vectors;S2, converting the sentence vectors into span representation sequences, and performing named entity recognition on the sequences to generate an entity probability matrix;S3, combining the named entities into binary tuples two by two, and determining whether there is a relation between each binary tuple;S4, classifying the binary tuples with relations to determine their relation categories.The extraction method proposed in the present application can effectively alleviate the problems existing in current research, such as step-by-step cascade errors, excessive calculation and difficulty in dealing with nested entities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of deep learning technology and natural language processing, and in particular to a method for joint extraction of entity relations using redundancy and noise reduction strategies. Background Technology

[0002] Entity relation extraction (RE) can extract structured data that can be understood by computers from unstructured text, thus supporting tasks such as knowledge graph construction, intelligent question answering, and semantic search, and plays an important role in natural language processing. This task involves two sub-tasks: Named Entity Recognition (NER) and Relation Extraction (RE). NER is responsible for identifying entities with specific meanings in text and classifying them into predefined entity types, such as names of people, places, and organizations. RE is responsible for determining the relationship categories between entities in sentences that have been labeled with entities and entity types. There are two methods for accomplishing these two tasks: independent modeling and joint extraction. Joint extraction can automatically identify entities, entity types, and specific relationship types between entities in an end-to-end model, and has the advantages of simple extraction logic and high extraction efficiency, making it an important research direction in the field of entity relations.

[0003] The task of joint extraction is defined as follows: Given a set of relation types R, and a given sentence S = {w1, w2, ..., w...} n Entity relation joint extraction establishes a unified model and outputs all relation triples in S.<h,r,t> Where r∈R, h represents the head entity, and t represents the tail entity. For example, when the input sentence is "Li* founded Li's Company", the joint model will output the triple <Li*, founded, Li's Company>.

[0004] Methods for joint entity relation extraction can be divided into two categories: feature engineering-based methods and deep learning-based methods.

[0005] Feature engineering is a method that transforms raw data into features that express the essential characteristics of a problem. Applying the features obtained through feature engineering to a model can improve its performance. Joint extraction based on feature engineering requires designing features according to the characteristics of the data. When the conditions of a feature function are met, that function is triggered, thus completing the joint extraction task. This method heavily relies on human expertise and domain knowledge in the feature acquisition process and suffers from error propagation issues, ultimately affecting the joint extraction results.

[0006] With the continuous development and optimization of deep learning technology, entity relation joint extraction based on deep learning has become the mainstream method. Depending on the interaction methods of NER and RE tasks, it can be divided into, for example... Figure 1The three types shown are: shared parameters, joint decoding, and single-step exhaustive methods.

[0007] Models based on shared parameters improve performance by training together using shared neural network parameters. They decompose joint extraction into different subtasks, which share sequence encoding layer information and then use different decoders to obtain the results of each subtask. However, this method cannot effectively handle nested entities and suffers from error cascading.

[0008] The joint decoding-based model obtains the final result through a unified decoder. This method can better utilize the correlation between tasks, but the overall efficiency of the model may be affected and the parameter tuning is more difficult.

[0009] The single-step exhaustive model extracts entities by traversing substrings of all words in a sentence, simultaneously extracting corresponding relationships during the traversal. This method can solve problems such as nested entities, single entity overlap, and entity pair overlap. With the rapid growth of computing power in recent years, the single-step exhaustive approach has achieved remarkable results. However, this method still has some problems, such as high computational cost and the generation of a large number of negative samples during the calculation process.

[0010] The shared parameter method cannot effectively handle nested entity cases and suffers from cascading errors; while the single-step exhaustive method can effectively solve the nested entity problem, it has too much computation and too many negative samples. Summary of the Invention

[0011] To address the aforementioned problems, this invention provides a joint entity relation extraction method employing redundancy and noise reduction strategies. Although this method belongs to the shared-parameter joint extraction approach, it utilizes a span-based exhaustive strategy for named entity recognition and an entity-pair exhaustive strategy for relation extraction, thus combining the advantages of single-step exhaustive strategies and resolving issues such as nested entities. This invention employs a filtering method to remove some negative samples during training, effectively alleviating the computational burden of single-step exhaustive methods and addressing the problem of excessive negative samples generated. This invention integrates the above processes into a shared-parameter joint entity relation extraction model, effectively reducing cascading errors and improving the joint extraction performance.

[0012] The entity relation joint extraction method using redundancy and noise reduction strategies provided by this invention includes:

[0013] S1. Convert the sentences in the dataset into sentence vectors;

[0014] S2. Convert the sentence vector into a span representation sequence, and perform named entity recognition on the sequence to generate an entity probability matrix;

[0015] S3. Combine named entities into pairs of tuples and determine whether there is a relationship between each pair of tuples;

[0016] S4. Classify the relations of the binary pairs that have relations to obtain the triples.

[0017] Further, step S2 includes:

[0018] S20, regarding the sentence vector {h1,h2,…,h...} n Perform start position transformation and end position transformation to generate vector sequences of start position and end position;

[0019] S21. Generate a span representation based on the start position sequence and the end position sequence;

[0020] S22. Generate an exhaustive matrix Sp based on all span representations, where the vector in the i-th row and j-th column of the matrix represents a span representation of length i and starting position j; empty positions in the matrix are filled with a 0 vector.

[0021] S23. Input matrix Sp into the first classifier and identify named entities based on the entity probabilities output by the first classifier.

[0022] Furthermore, the step of identifying named entities based on the entity probability output by the first classifier includes:

[0023] The first classifier maps the input exhaustive matrix Sp to the probability space corresponding to the entity type label, thereby outputting the probability value of each span as an entity.

[0024] The probability values ​​output by the first classifier form the entity probability matrix P. NER In P NER The element value in the i-th row and j-th column represents the probability that a span of length i and starting position j is an entity.

[0025] The span corresponding to an element with a probability greater than 0.5 is identified as a named entity.

[0026] Furthermore, during training, the process also includes: S24, determining the positive and negative examples of the identified named entities based on the true labels of the sentences in the dataset, and then generating loss functions for the positive and negative examples.

[0027] Further, step S3 includes:

[0028] S31. Generate entity representations from the span representations determined to be named entities through linear transformation, and generate a sequence of entity representations;

[0029] S32. Perform expansion, transpose, and concatenation operations on the entity representation sequence E to obtain the relation decision matrix Re;

[0030] S33. Use a binary classifier to perform binary classification on the relationship decision matrix Re and output the probability matrix YN; the lower the value of the element in the probability matrix YN, the greater the probability that there is a relationship between the entities.

[0031] S34. Determine the existence of the pairs corresponding to the elements with values ​​less than 0.5 in the YN matrix, and find the representation pir of the corresponding pairs in the Re matrix. p =(e i ,e j ), forming a set Pair = [pir1, pir2, ..., pir |Pair| ].

[0032] Furthermore, during training, step S3 also includes: S35, calculating the loss of the binary classifier. noise The formula is:

[0033] loss noise =∑-ylog(p y )-(1-y)log(1-p y )

[0034] Where y∈{0,1} represents whether the binary tuple pir has a relation in the real case. If the relation exists, y is 1, and pir is 1. y represents the correlation probability in the YN matrix corresponding to pir.

[0035] Furthermore, during training, step S4 also includes calculating the loss of the relation classification network:

[0036] loss RE =∑∑-T y log(p y )-(1-T y log(1-p) y )

[0037] Where y represents a relation type, T y pir represents the true value of the relation type y, p y This is to predict the probability that pir is the type of relation y.

[0038] Furthermore, during training, the process also includes: step S5, calculating the overall loss and adjusting the parameters of the first classifier, the second classifier, and the relation classification network according to the backpropagation algorithm;

[0039] The formula for the overall loss function is:

[0040] loss = lossNER +loss noise +loss RE .

[0041] The entity relation joint extraction method using redundancy and noise reduction strategies provided by this invention has the following advantages compared with existing entity relation joint extraction methods:

[0042] 1. This invention solves the problems of entity nesting and relationship overlap by using span-based named entity recognition and relation extraction through entity combination traversal.

[0043] 2. In this invention, the redundancy strategy and the noise reduction strategy work together to reduce the cascading error caused by recall among the modules of the model. At the same time, the noise introduced by the redundancy strategy can be eliminated. Furthermore, the bottleneck limitation of the model is not obvious, and the overall performance is not limited by any specific module. Attached Figure Description

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

[0045] Figure 1 This is a classification diagram based on a deep learning-based joint recognition method;

[0046] Figure 2 This is a flowchart of a joint extraction method according to an embodiment of the present invention;

[0047] Figure 3 This is an exhaustive matrix (upper triangular matrix) representing the span of an embodiment of the present invention. Detailed Implementation

[0048] 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, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] Before introducing the method proposed in this invention, two concepts are first introduced: triples and unrelated binary tuples. A triple is composed of a head entity h, a tail entity t, and the relationship r between the head and tail entities, in the form of...<h,r,t> Unrelated tuples consist of two entities that have no relation to each other. For example, the sentence "Zhang** founded Zhang's Company, Li* founded Li's Company" contains two triples: <Zhang**, founded, Zhang's Company> and <Li*, founded, Li's Company>. The entities "Zhang**" and "Li's Company" have no relation, therefore <Zhang**, Li's Company> is an unrelated tuple.

[0050] This invention employs a span-based exhaustive strategy for named entity recognition and an entity-pair exhaustive strategy for relation extraction, combining the advantages of single-step exhaustive strategies and addressing issues such as nested entities. First, a redundancy strategy is used to extract an entity set containing all correct entities. These entities are then paired and, through relation detection, are filtered out to remove unrelated pairs introduced by redundancy and those between entities within the sentence. Next, the filtered entity pairs are classified for relations, and a second filtering using the matrix obtained from the relation detection method is applied to extract triples from the sentence. This filtering approach effectively alleviates the computational burden of single-step exhaustive methods. This invention integrates the above processes into a shared-parameter joint entity-relation extraction method. The redundancy strategy weakens cascading errors, and the noise reduction strategy eliminates noise introduced by the redundancy strategy, improving the joint extraction effect.

[0051] The overall framework of the present invention is as follows Figure 2 As shown, the method includes:

[0052] S1. Convert the sentences in the dataset into sentence vectors;

[0053] S2. Convert the sentence vector into a span representation sequence {span} 1,ls1 ,...,span m,lsm The sequence is then subjected to named entity recognition, and an entity probability matrix P is generated. NER ;

[0054] S3. Combine named entities into pairs of tuples and determine whether there is a relationship between each pair of tuples;

[0055] S4. Classify the relations of the binary pairs that have relations to obtain the triples.

[0056] In step S1, the pre-trained BERT model is used to encode the sentence, and the output of the last layer of the model is used as the sentence S = (w1, w2, ..., w l The sentence vector of )

[0057] {h1,h2,…,h n}) = BERT({w1, w2, …, w l )

[0058] where {w1, w2, …, w l} is the original word sequence of sentence S, wi represents the i-th word in sentence S, n is the length of the encoded sentence vector, and {h1, h2, …, h i} corresponds to the sequence formed after sentence S is tokenized. For example, after tokenizing the sentence "Li * founded Li's company", the vector sequence ["Li", "*", "found", "ed", "Li's", "comp", "any"] is obtained. In this example, l and n are 9 and 8 respectively. n}

[0059] In step S1, the pre-trained BERT model is used. This model is officially released by Google, and its parameters do not need to participate in training and updating.

[0060] In step S2, the sentence vector is represented as a span representation sequence, and named entity recognition is performed on all span representation sequences. A span refers to a segment in a sentence. For example, in the sentence "Li * founded Li's company", "* found" and "Li's company" are both spans of this sentence. This step uses a redundancy strategy, that is, it is considered that all combinations of words in spans may be entities, which will be more than the normal number of entities. Therefore, this invention extracts all correct entities at the cost of sacrificing a small part of accuracy, and strives to achieve as high a recall rate as possible to avoid the cascading error problem between NER and RE tasks caused by insufficient recall rate. Here, the cascading error means that if an error occurs in the NER task, the error will be accumulated and amplified, affecting the efficiency of the subsequent RE task. The steps of step S2 include:

[0061] S20: Perform a start position transformation and an end position transformation on the sentence vector {h1, h2, …, h n} to generate a vector sequence of start positions and a vector sequence of end positions for span representation:

[0062] {start1, start2, …, start n} = Trans start ({h1, h2, …, h n )

[0063] {end1, end2, …, end n} = Trans end ({h1, h2, …, h n )

[0064] Trans start and Transend There are two independent fully connected layers, whose parameters will be updated after one round of training. The obtained start position sequence and end position sequence will participate in the subsequent span representation. For example, start0 can be understood as the vector representation when "Li" is the start position, and end0 can be understood as the vector representation when "Li" is the end position. The generation of the start position sequence and end position sequence is a commonly used method existing, which will not be elaborated here.

[0065] S21. Generate span representation span according to the start position sequence and end position sequence i,ls :

[0066] span i,ls = concat([start i ; end i+ls ; pos ls )

[0067] where i (0 <= i < n) is the start position, with a length of ls, and pos ls is the embedding vector obtained by multiplying the length ls by a learnable embedding matrix (the initial parameters of this matrix are randomly initialized by a normal distribution and then updated at the end of one round of training). concat is the concatenation operation, and 1 < i + ls <= n. That is, after concatenating the start position vector, end position vector, and length embedding vector, the representation vector of this span is formed. The parameter matrix needs to be trained.

[0068] In the specific implementation of the present invention, the result after concatenating the position vector, end position vector, and length embedding vector is used as the span representation. For better understanding, the following uses words for span representation: A span refers to a segment in a sentence. For example, ["Li", "*", "chuang", "jian", "le", "Li's", "gong", "si"], and the span representation span 0,1 is composed of the 0th element "Li" of the start position sequence, the 1st element "*" of the end position sequence, and pos1, representing "Li*"; the span representation span 0,2 is composed of the 0th element "Li" of the start position sequence, the 2nd element "chuang" of the end position sequence, and pos2, representing "Li*chuang"; the span representation span 0,3 is composed of the 0th element "Li" of the start position sequence, the 3rd element "jian" of the end position sequence, and pos3, representing "Li*chuangjian"... The span representation span 7,1 is composed of the 7th element "gong" of the start position sequence, the 8th element "si" of the end position sequence, and pos1, representing "gongsi". Generating span representation is also a commonly used method, which will not be elaborated here.

[0069] S22. Generate an exhaustive matrix Sp based on all span representations. The vector in the i-th row and j-th column of the matrix represents a span of length i starting at position j; empty positions in the matrix are filled with a vector of 0, such as... Figure 3 As shown.

[0070] S23. Input the matrix Sp into the first classifier, and identify named entities based on the entity probabilities output by the first classifier. The first classifier is a conventional classifier, consisting of three parts: normalization, linear mapping, and a sigmoid activation function. The first classifier maps the input exhaustive matrix Sp to the probability space corresponding to the entity type label, thus outputting the probability value of each span as an entity. The probability values ​​output by the first classifier form the entity probability matrix P. NER In P NER The value of the element in the i-th row and j-th column represents the probability that the span of length i and starting position j is an entity. If this value is greater than 0.5, it will be identified as an entity.

[0071] The parameters of the first classifier will be updated once after all samples (i.e. sentences) in the training set of the dataset have completed a training cycle.

[0072] During training, the following steps are also included: S24, calculating the loss for the named entity recognition part. NER .

[0073] In step S24, based on the true labels of sentences in the dataset, the positive and negative examples of the identified named entities are determined, and then corresponding loss functions are generated for the positive and negative examples. For example, in the sentence "Zhang** created Zhang's Company", if "Zhang**", "Zhang's Company", and "*created" are identified as entities in step S23, then the first two predictions are correct and are positive examples, while "*created" is incorrectly predicted and is a negative example.

[0074] For positive samples, the loss function of NER is:

[0075] loss NER_pos =∑logp

[0076] For negative samples, the loss function of NER is:

[0077] loss NER_neg =∑log(1-p)

[0078] The final loss is:

[0079]

[0080] λ in the formula NER The automatic harmonic factor is calculated as follows:

[0081]

[0082] Where N positive_ner and N negative_ner These represent the number of positive and negative samples in the NER training samples, respectively. ρ in the formula... NER ∈(0,1] represents the factor adjustment for the positive sample loss relative to the negative sample loss. This invention uses this factor adjustment mechanism to adjust the penalty for misclassification of positive samples. This loss function is applied in S4 and can be used as part of the total loss.

[0083] In step S3, the identified named entities are paired to form tuples, and it is determined whether there is a relationship between the two entities. This includes the following steps:

[0084] S31. Generate an entity representation sequence E = [e1, e2, ..., e] for the span representation that is determined to be an entity. |E| ]; For P NER The rows and columns identified as entities are found in matrix Sp, and the span representation is extracted. A fully connected layer is used to perform a linear transformation to convert it into an entity representation. All entity representations form the entity representation sequence E.

[0085] S32. Perform expansion, transpose, and concatenation operations on the entity representation sequence E to obtain the representation matrix (head, tail), which is the relation determination matrix Re.

[0086] (1) To process the entity sequence E, first, expand it using the copying method:

[0087]

[0088] Where E expanded The dimensions are m×m×dim e dim e The dimension is the entity vector.

[0089] (2) E expanded Transpose to obtain Will With E expanded By concatenating the matrices, we obtain the representation matrix of (head, tail):

[0090]

[0091] Re is the relation determination matrix. i,j Representative entity e i and entity e j The binary tuple (e) i ,e jThis step is responsible for combining the entities obtained in S31 in pairs.

[0092] S33. Use a binary classifier to perform binary classification on the Re matrix, outputting a probability matrix YN indicating whether there is a relationship. This binary classifier is similar to the first classifier, consisting of three parts: normalization, linear mapping, and a sigmoid activation function. The Re matrix is ​​input into the binary classifier to obtain the YN matrix (Yes or No), which is the probability matrix indicating whether there is a relationship. The lower the value of each element in this matrix, the greater the probability that there is a relationship between the entities. i,j Representative entity e i and entity e j The binary tuple (e) i ,e j The probability value that there is no relationship, if YN i,j If the value is less than 0.5, then a preliminary determination will be made (e i ,e j (It is related.)

[0093] S34. Determine the existence of the pairs corresponding to the elements with values ​​less than 0.5 in the YN matrix, and find the representation pir of the corresponding pairs in the Re matrix. p =(e i ,e j ), forming a set Pair = [pir1, pir2, ..., pir |Pair| ].

[0094] Steps S32 and S33 are the implementation methods of the noise reduction idea of ​​the present invention. By exhaustively enumerating and filtering the pairs, a preliminary detection and judgment is made on whether there is a relationship between the pairs. This not only has the advantages of the single-step exhaustive strategy, but also reduces the amount of subsequent calculation by filtering out unrelated pairs.

[0095] Training also includes: S35, calculating the loss of the binary classifier. noise The formula is:

[0096] loss noise =∑-ylog(p y )-(1-y)log(1-p y )

[0097] Where y∈{0,1} represents whether the binary tuple pir has a relation in the real case. If the relation exists, y is 1, and pir is 1. y represents the correlation probability in the YN matrix corresponding to pir.

[0098] Step S4: Using a relation classification network, classify the set of related entity pairs Pair = [pir1, pir2, ..., pir...] |Pair|We categorize them to determine the types of relationships.

[0099] Relationship classification networks can be classifiers, including normalization, linear mapping, and sigmoid activation functions. P RE The element in row p and column q represents the tuple pir. p The probability of belonging to relation q is considered, therefore the relation category with the highest probability (denoted as max) is selected as the final relation classification result. The parameters of the relation classification network are also updated uniformly during training.

[0100] If the binary pir p =(e i ,e j The corresponding max is less than YN i,j That is, the binary tuple pir p If the probability of having no relation is greater than the probability of belonging to any relation, then pir p These will ultimately be classified as unrelated binary pairs. This is a secondary screening process that can effectively improve the accuracy of model recognition.

[0101] During training, the following steps are also included: Step S42, calculating the loss for relation classification:

[0102] loss RE =∑∑-T y log(p y )-(1-T y log(1-p) y )

[0103] Where y represents a relation type, T y ∈{0,1}, if pir belongs to class y, then T y p is 1 if it is not 0 otherwise y Let T be the probability value corresponding to class y in the prediction. If there are three relation classes in the dataset, represented as {0, 1, 2}, then for class 1 (i.e., y = 1), if pir actually belongs to class 1, then T... y If the final prediction result for the PIR category in the method is {0.3, 0.1, 0.6}, then p y It is 0.1.

[0104] During training, the process also includes: Step S5, calculating the overall loss and adjusting the parameters of the first classifier, the second classifier, and the relationship classification network according to the backpropagation algorithm. The formula for the overall loss function is:

[0105] loss = loss NER +loss noise +loss RE

[0106] In the training process of deep neural networks, an overall loss function is typically calculated, and then the parameters of each classifier and network are updated based on this loss function. This process is usually called backpropagation. This invention also adopts this approach. After calculating the overall loss, the parameters of each module, including the first classifier, the second classifier, and the relation classification network, are updated sequentially through backpropagation. Through this process, the parameters are continuously updated, thereby improving the performance of this invention and outputting all triples in the sentence.

[0107] The following example uses data from the NYT dataset to illustrate the entity relation joint extraction method based on redundancy and noise reduction strategies proposed in this invention and its advantages. NYT (New York Time) is a news corpus containing 66,195 sentence samples, including 3 entity types and 24 relation types.

[0108] Table 1 Experimental Results (The last row shows the experimental results using the method of this invention)

[0109]

[0110] First, the training set of the NYT dataset is used as input to the BERT model, and BERT is used to encode it. Then, a redundancy strategy is used to extract the entity set containing all correct entities. These entities are then paired, and relation detection is performed to filter out unrelated bigrams in the sentence. Next, the filtered entity pairs are classified for relations, and the relation detection module's values ​​are used for secondary filtering to extract triples from the sentence. The model is trained on the NYT dataset using these steps, and then tested on the NYT dataset's test set. The experimental results are shown in Table 1. Observing Table 1, it can be seen that the model proposed in this invention achieves optimal performance in both Precision and F1 score, and is only 0.7% lower than the optimal result in Recall. This verifies that this invention can improve the performance of the model for joint entity relation extraction and has certain advantages.

[0111] Those skilled in the art will understand that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A method for joint entity relation extraction employing redundancy and noise reduction strategies, characterized in that, The method includes: S1. Convert the sentences in the dataset into sentence vectors; S2. Convert the sentence vector into a span representation sequence, and perform named entity recognition on the sequence to generate an entity probability matrix; S3. Combine named entities into pairs of tuples and determine whether there is a relationship between each pair of tuples; S4. Classify the binary pairs that have a relation using a relation classification network to obtain triples; Step S2 includes: S20, regarding the sentence vector {h1,h2,…,h...} n Perform start position transformation and end position transformation to generate vector sequences of start position and end position; S21. Generate a span representation based on the start position sequence and the end position sequence; S22. Generate an exhaustive matrix Sp based on all span representations, where the vector in the i-th row and j-th column of the matrix represents a span representation of length i and starting position j; empty positions in the matrix are filled with a 0 vector. S23. Input matrix Sp into the first classifier and identify named entities based on the entity probabilities output by the first classifier. Step S3 includes: S31. Generate entity representations from the span representations determined to be named entities through linear transformation, and generate a sequence of entity representations; S32. Perform expansion, transpose, and concatenation operations on the entity representation sequence E to obtain the relation decision matrix Re; S33. Use a binary classifier to perform binary classification on the relation decision matrix Re and output the probability matrix YN. S34. Determine the existence of the pairs corresponding to the elements with values ​​less than 0.5 in the probability matrix YN.

2. The entity relation joint extraction method according to claim 1, characterized in that, The step of identifying named entities based on the entity probability output by the first classifier includes: The first classifier maps the input exhaustive matrix Sp to the probability space corresponding to the entity type label, thereby outputting the probability value of each span as an entity. The probability values ​​output by the first classifier form the entity probability matrix P. NER In P NER The element value in the i-th row and j-th column represents the probability that a span of length i and starting position j is an entity. The span corresponding to an element with a probability greater than 0.5 is identified as a named entity.

3. The entity relation joint extraction method according to claim 1, characterized in that, During training, the process also includes: S24, determining the positive and negative examples of the identified named entities based on the real labels of the sentences in the dataset, and then generating loss functions for the positive and negative examples.

4. The entity relation joint extraction method according to claim 3, characterized in that, For positive samples, the loss function is: loss NER_pos =∑logp For negative samples, the loss function is: loss NER_neg =∑log(1-p) The final loss is: loss NER =ρ NER *λ NER *loss NER_pos +loss NER_neg λ in the formula NER As the harmonic factor, ρ NER ∈(0,1] represents the factor adjustment for positive sample loss relative to negative sample loss.

5. The entity relation joint extraction method according to claim 4, characterized in that, The harmonic factor is calculated as follows: Where, N positive_ner and N negative_ner These represent the number of positive and negative samples in the training samples, respectively.

6. The entity relation joint extraction method according to claim 3, characterized in that, During training, step S3 also includes: S35, calculating the loss of the binary classifier. noise The formula is: loss noise =∑-ylog(p y )-(1-y)log(1-p y ) Where y∈{0,1} represents whether the binary tuple pir has a relation in the real case. If the relation exists, y is 1, and pir is 1. y represents the correlation probability in the YN matrix corresponding to pir.

7. The entity relation joint extraction method according to claim 1, characterized in that, During training, step S4 also includes calculating the loss of the relation classification network: loss RE =∑∑-T y log(p y )-(1-T y )log(1-p y ) Where y represents a relation type, T y pir represents the true value of the relation type y, p y To predict the probability that the pair pir represents the type of relation y.

8. The entity relation joint extraction method according to claim 1, characterized in that, During training, the process also includes: Step S5, calculating the overall loss and adjusting the parameters of the first classifier, the second classifier, and the relation classification network according to the backpropagation algorithm; the formula for the overall loss function is: loss=loss NER +loss noise +loss RE , Where, loss NER The final loss function for positive and negative samples is loss. noise Let loss be the loss function of the binary classifier. RE Let be the loss function for the relation classification network.