Document-level relation extraction method based on generative model
By introducing high-precision example guidance and lightweight discrimination modules into the generative model, the problem of large and random search space in generative relationship extraction is solved, and the accuracy and controllability of document-level relationship extraction is improved, and the generation is better. Relationship summary.
Patent Information
- Application Number
- CN202411162236.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The existing generative relationship extraction method has a large search space and strong randomness in the decision-making process, which makes the output sequence difficult to control and is prone to fall into an unstable state, affecting the accuracy and controllability of relationship extraction.
Using a document-level relationship extraction method based on a generative model, combining high-precision example guidance and lightweight discriminant modules, the generative model understands and refines the relationship summary in a complex context, and maps it to predefined relationship categories to achieve accurate Improvement of sexuality and controllability.
The accuracy and controllability of relationship extraction are improved, and the generative model has adaptive learning ability, can dynamically learn human intentions, and output better and more accurate relationship summary.
Smart Images

Figure CN119088980A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information processing, and in particular relates to a document-level relationship extraction method based on a generation model. Background Art
[0002] Relation extraction is an important task in the field of natural language processing, which aims to identify and extract entities and relationships between entities from natural language text. These relationships can be explicitly stated in the text or inferred from the context. Specifically, relation extraction is to extract triples such as subject, object, and relationship from a text.
[0003] According to the extraction scope of text, relation extraction can be divided into sentence-level relation extraction and document-level relation extraction, where:
[0004] Sentence-level relation extraction focuses on entity relations in a single sentence. It needs to process and parse the grammar and semantics within the sentence, but the context scope is relatively limited.
[0005] Document-level relationship extraction focuses more on the entity relationships between multiple sentences and paragraphs, involves cross-sentence understanding, long-distance dependency analysis, and has a wider context range;
[0006] In actual application scenarios, entities are often scattered in every corner of a document. The direct associations, indirect causal relationships, and sequential relationships between entities together form a complex entity relationship network. This requires the relationship extraction algorithm to have the ability to read and understand across sentences, and to be able to identify and extract entities and the relationships between them from a global perspective. Therefore, document-level relationship extraction has gradually replaced sentence-level relationship extraction and has become the research focus and difficulty in the field of relationship extraction.
[0007] According to the paradigm type, relation extraction can be divided into "discriminative extraction" and "generative extraction", as follows:
[0008] Discriminative extraction aims to "identify and extract" predefined entities and relationships between entities directly from the text. They usually treat relationship extraction as a classification problem and assign a relationship label to each pair of entities;
[0009] Generative extraction attempts to “generate or rewrite” sentences or phrases that represent entities and relations.
[0010] They usually regard relation extraction as a sequence generation task and generate a new sequence that describes entities and the relationships between them. Compared with discriminative extraction, which is easily restricted by patterns in specific scenarios and specific fields, generative extraction has stronger transferability and scalability, making it possible to unify relation extraction tasks in different scenarios and different fields. However, generative extraction has a large search space and strong randomness in the decision-making process, and is prone to unstable states, making the output sequence difficult to control. Therefore, we propose a document-level relation extraction method based on a generative model. Summary of the invention
[0011] The purpose of the present invention is to provide a document-level relationship extraction method based on a generative model. First, the excellent understanding ability of the generative model in complex contexts is utilized, assisted by high-precision examples to accurately capture and extract the relationship summary of the subject and object in the document, and then a lightweight discrimination module is introduced to map the relationship summary to predefined relationship categories, thereby achieving a dual improvement in the accuracy and controllability of relationship extraction.
[0012] The technical solution adopted by the present invention is as follows:
[0013] A document-level relation extraction method based on a generative model comprises the following steps:
[0014] First, the training phase:
[0015] Step 1: Divide the original data into training data and test data. The training data is used to train the model, and the test data is used to test the model.
[0016] Step 2: Initialize the generative model G, input training data in three formats: document, subject, and object, and obtain a summary of the relationship between the subject and object in the document;
[0017] Step 3: Initialize the discriminant module C, input the training data in three formats: summary, subject, and object, and obtain the relationship labels of the subject and object in the document;
[0018] Step 4: Calculate the loss of the relation label and the true label, and train G and C end-to-end through back-propagation;
[0019] Step 5: For each correctly classified training data, save the relation summary generated by G and the semantic vector generated by C to construct a query set;
[0020] Second, the testing phase:
[0021] Step 6: Input the test data in the document, subject, and object formats into C, and extract the semantic vector e of the test data;
[0022] Step 7: Use the nearest neighbor algorithm to search for the n training data in the query set that are most similar to e, and construct their relationship summaries into an example set;
[0023] Step 8: Input test data in four formats, namely, document, subject, object, and example set, into G to guide the generative model to output a better relation summary;
[0024] Step 9: Input the test data in three formats, namely summary, subject and object, into C to obtain the relationship labels between the subject and object in the document.
[0025] In step 2, the concatenated document doc, subject sub, and object obj are used as the input of G:
[0026] G input =doc||sub||obj ①
[0027] For G input Vectorized encoding is as follows:
[0028] First, convert the text into word vectors that are easy for computers to understand and process:
[0029] Word embedding i =W e ×v i ②
[0030] Among them, word embedding i is the word vector of the i-th word, W e is a word vector matrix of dimension d×m, where d is the word vector dimension, m is the word table size, and v i is the one-hot encoding of the i-th word;
[0031] Then, we calculate the position vectors that represent the order in which the words appear in the text:
[0032] Position embedding pos,2j =sin(pos / 10000 2j / d ) ③
[0033] Position embedding pos,2j+1 =cos(pos / 10000 2j+1 / d ) ④
[0034] Among them, pos is the position of the i-th word in the text, 2j is an even dimension, 2j+1 is an odd dimension, and d is the position vector dimension, which is the same size as the word vector dimension;
[0035] In order to more completely model the semantic and syntactic information of words in the text, the word vector is added to the position vector to obtain the representation vector of the i-th word:
[0036] embedding i =word embedding i +position embedding pos ⑤
[0037] Finally, a text containing seq_len words will be vectorized and encoded into a representation vector matrix W with a dimension of seq_len×d. input .
[0038] In step 2, G includes Masked Attention, Add&Norm, Feed Forward, and Softmax, as follows:
[0039] Masked Attention enables each word to learn and evaluate the importance of all words in its preceding sequence, thereby efficiently and accurately learning from W input The most core and critical features are extracted as follows:
[0040] First, initialize the three linear transformation matrices W Q , W k , W v , their dimensions are all d×hidden_size;
[0041] Calculate the query matrix Q:
[0042] Q=W input ×W Q ⑥
[0043] Calculate the key matrix K:
[0044] K=W input ×W K ⑦
[0045] Calculate the value matrix V:
[0046] V=W input ×W V ⑧
[0047] After linear transformation, the dimensions of Q, K, and V become seq_len×hidden_size;
[0048] Then, the attention coefficient Attention coeff between words is calculated, whose dimension is seq_len×seq_len, representing the closeness and importance of each pair of words:
[0049]
[0050] Since the probability of each word appearing depends only on all the words before it and has nothing to do with the subsequent words, it is necessary to perform a mask operation on the Attention coeff so that the attention of each word is focused only on the preceding sequence:
[0051] Masked Attention coeff=softmax(Attention coeff+mask) ⑩
[0052] Among them, the value of mask is infinitely small. After normalization by the softmax function, the MaskedAttention coeff of the word and the subsequent words becomes zero;
[0053] Finally, the Masked Attention coeff and value matrix V are obtained from W input Extract the most core and critical features:
[0054]
[0055] Add&Norm improves the efficiency and stability of model training through residual connections and layer normalization. Residual connections add skip connections between different network layers to enable features to propagate directly across layers, thereby preventing gradient disappearance and alleviating the degradation problem of deep networks.
[0056] Among them, layer normalization standardizes the feature distribution of each word to a mean of 0 and a variance of 1, which is used to alleviate the data offset problem between different network layers and accelerate the convergence speed of model training:
[0057]
[0058] Feed Forward first maps the Add&Norm output to a higher-dimensional space and introduces a nonlinear function to learn deeper features, and then remaps the features back to a low-dimensional space to facilitate the calculation of subsequent network layers;
[0059]
[0060] Softmax, based on the Feed Forward output, calculates the probability of all words in the vocabulary being selected each time; G selects the word with the highest probability each time and serially generates a summary of the relationship between the subject and the object in the document:
[0061]
[0062] In step 3, the summary abs, subject sub, and object obj are concatenated as the input of C:
[0063]
[0064] C input After vectorization encoding, a text containing seq_len words will be vectorized to obtain a representation vector matrix W with a dimension of seq_len×d. input .
[0065] In step 3, C includes Mean Pool and Softmax, as follows:
[0066] Mean Pool, by taking the average of the representation vector of each word, input Compressed into a d-dimensional semantic vector e, representing C input Content and purpose:
[0067]
[0068] Softmax, based on e, predicts the relationship labels between the subject and the object in the document:
[0069]
[0070] In step 4, the loss between the predicted label predict label and the true label true label is calculated by the cross entropy loss function:
[0071]
[0072] After the training in step 5 is completed, for each correctly classified training data, the relationship summary abs generated by G and the semantic vector e generated by C are saved to construct a query set Query Set.
[0073] In step 8, the document doc, subject sub, object obj, and sample set Sample Set are concatenated as the input of G:
[0074]
[0075] Based on the guidance of Sample Set, G generates a better and more accurate summary of the relationship between the subject and the object in the document.
[0076] In step 9, the summary abs, subject sub, and object obj are concatenated as the second input of C:
[0077]
[0078] C predicts the relationship labels between the subject and the object in the document through Mean Pool and Softmax.
[0079] The technical effects achieved by the present invention are:
[0080] The document-level relationship extraction method based on a generative model of the present invention adopts information compression. For any pair of specific subjects and objects, the content related thereto is often highly sparsely distributed in the document. If the relationship extraction model does not adopt a targeted screening strategy, but blindly and directly performs a global scan of the entire document, it is bound to introduce a large amount of noise irrelevant to the target, thereby affecting the accuracy of relationship extraction. The method adopts a generative model to compress and refine the document, extract the relationship summary of the subject and object in the document, and thus screen out information closely related to the target.
[0081] The document-level relationship extraction method based on a generative model of the present invention performs relationship mapping. The search space of the generative model in the decision-making process is large and the randomness is strong. It is difficult to ensure that the results generated each time are completely consistent, which increases the uncertainty of the output. For this reason, the present invention introduces a lightweight discrimination module to map the relationship summary output by the generative model to a predefined relationship category, thereby achieving a dual improvement in the accuracy and controllability of relationship extraction.
[0082] The document-level relationship extraction method based on a generative model of the present invention also includes guided generation. The generative model has adaptive learning capabilities and can dynamically and autonomously learn examples carefully selected by humans to generate outputs that are closer to human intentions. The method uses a nearest neighbor algorithm to search for training data that is most similar to the test data and correctly classified, and uses the training data as high-value samples to drive the generative model to output a better and more accurate relationship summary. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 It is a flow chart of a document-level relationship extraction method based on a generative model of the present invention;
[0084] Figure 2 It is a schematic diagram of vector encoding of the present invention;
[0085] Figure 3 It is a schematic diagram of the structure of the generation model of the present invention;
[0086] Figure 4 It is a schematic diagram of the structure of the discrimination module of the present invention. DETAILED DESCRIPTION
[0087] In order to make the purpose and advantages of the present invention more clearly understood, the present invention is specifically described below in conjunction with embodiments. It should be understood that the following text is only used to describe one or several specific embodiments of the present invention, and does not strictly limit the scope of protection of the specific claims of the present invention.
[0088] like Figure 1-4 As shown, a document-level relationship extraction method based on a generative model includes a training phase and a testing phase, as follows:
[0089] The training phase includes:
[0090] Step 1: Divide the original data into training data and test data. The training data is used to train the model, and the test data is used to test the model.
[0091] Step 2: Initialize the generative model G;
[0092] Concatenate the document doc, subject sub, and object obj as the input of G:
[0093] G input =doc||sub||obj ①
[0094] like Figure 2 As shown, for G input Perform vectorized encoding;
[0095] First, convert the text into word vectors that are easy for computers to understand and process:
[0096] Word embedding i =W e ×v i ②
[0097] Among them, word embedding i is the word vector of the i-th word, W e is a word vector matrix of dimension d×m, where d is the word vector dimension, m is the word table size, and v i is the one-hot encoding of the i-th word;
[0098] Word embedding matrix W e It can be obtained in many ways, such as Word2Vec, Glove, and pre-trained Transformer;
[0099] Then, we calculate the position vectors that represent the order in which the words appear in the text:
[0100] Position embedding pos,2j =sin(pos / 10000 2j / d ) ③
[0101] Position embedding pos,2j+1 =cos(pos / 10000 2j+1 / d ) ④
[0102] Among them, pos is the position of the i-th word in the text, 2j is an even dimension, 2j+1 is an odd dimension, and d is the position vector dimension, which is the same size as the word vector dimension;
[0103] In order to more completely model the semantic and syntactic information of words in the text, the word vector is added to the position vector to obtain the representation vector of the i-th word:
[0104] embedding i =word embedding i +position embedding pos ⑤
[0105] Finally, a text containing seq_len words will be vectorized and encoded into a representation vector matrix W with a dimension of seq_len×d. input ;
[0106] like Figure 3 As shown, G contains Masked Attention, Add&Norm, Feed Forward, and Softmax, as follows:
[0107] Masked Attention forces each word to learn and evaluate the importance of all words in its preceding sequence, thereby efficiently and accurately learning from W input Extract the most core and critical features;
[0108] First, initialize the three linear transformation matrices W Q , W k , W v , their dimensions are all d×hidden_size;
[0109] Calculate the query matrix Q:
[0110] Q=W input ×W Q ⑥
[0111] Calculate the key matrix K:
[0112] K=W input ×W K ⑦
[0113] Calculate the value matrix V:
[0114] V=W input×W V ⑧
[0115] After linear transformation, the dimensions of Q, K, and V become seq_len×hidden_size. Generally speaking, hidden_size is larger than d, which is beneficial to improving the expressiveness of the model.
[0116] Then, the attention coefficient Attention coeff between words is calculated, whose dimension is seq_len×seq_len, representing the closeness and importance of each pair of words:
[0117]
[0118] Since the probability of each word appearing depends only on all the words before it and has nothing to do with the subsequent words, it is necessary to perform a mask operation on the Attention coeff so that the attention of each word is focused only on the preceding sequence:
[0119] Masked Attention coeff=softmax(Attention coeff+mask) ⑩
[0120] Among them, the value of mask is infinitely small. After normalization by the softmax function, the MaskedAttention coeff of the word and the subsequent words becomes zero;
[0121] Finally, the Masked Attention coeff and value matrix V are obtained from W input Extract the most core and critical features:
[0122]
[0123] Add&Norm improves the efficiency and stability of model training through residual connections and layer normalization. Residual connections add skip connections between different network layers to enable features to propagate directly across layers, thereby preventing gradient vanishing and alleviating the degradation problem of deep networks. Layer normalization standardizes the feature distribution of each word to a mean of 0 and a variance of 1, alleviating the data offset problem between different network layers and accelerating the convergence of model training:
[0124]
[0125] Feed Forward first maps the Add&Norm output to a higher-dimensional space and introduces nonlinear functions such as ReLU to learn deeper features, and then remaps the features back to a low-dimensional space to facilitate the calculation of subsequent network layers;
[0126]
[0127] Softmax calculates the probability of all words in the vocabulary being selected each time according to the Feed Forward output; G selects the word with the highest probability each time and serially generates a summary of the relationship between the subject and the object in the document:
[0128]
[0129] Step 3: Initialize the discrimination module C;
[0130] Concatenate the summary abs, subject sub, and object obj as the input of C:
[0131]
[0132] like Figure 2 As shown, for C input After vectorization encoding, a text containing seq_len words will be vectorized to obtain a representation vector matrix W with a dimension of seq_len×d. input ;
[0133] like Figure 4 As shown, C contains Mean Pool and Softmax, as follows:
[0134] Mean Pool takes the average of the representation vectors of each word and converts W input Compressed into a d-dimensional semantic vector e, representing C input Content and purpose:
[0135]
[0136] Softmax predicts the relationship labels between the subject and the object in the document based on e:
[0137]
[0138] Step 4: Calculate the loss between the predicted label predict label and the true label true label through the cross entropy loss function:
[0139]
[0140] Train G and C end-to-end via back-propagation;
[0141] Step 5: After the training is completed, for each correctly classified training data, save the relation summary abs generated by G and the semantic vector e generated by C to construct a query set Query Set;
[0142] The testing phase includes:
[0143] Step 6: Concatenate the document doc, subject sub, and object obj as the first input of C, as follows:
[0144]
[0145] C passes through Mean Pool and outputs representation C input_1 The semantic vector e of
[0146] Generative models have adaptive learning capabilities and can dynamically and autonomously learn from examples carefully selected by humans to generate outputs that are closer to human intentions.
[0147] Step 7: Use the nearest neighbor algorithm to search for the n training data in the Query Set that are most similar to e, and construct their relationship summaries into a high-value sample set Sample Set;
[0148] Step 8: Concatenate the document doc, subject sub, object obj, and sample set Sample Set as the input of G:
[0149]
[0150] G generates a better and more accurate summary of the relationship between the subject and the object in the document based on the guidance of the Sample Set;
[0151] Step 9: Concatenate the summary abs, subject sub, and object obj as the second input of C:
[0152]
[0153] C predicts the relationship labels between the subject and the object in the document through Mean Pool and Softmax.
[0154] Traditional natural language processing generally requires four tasks, as follows:
[0155] Relation extraction,relation extraction is an important task in the field of natural language processing,,which aims to identify and extract entities and the relationships between,entities from natural language texts; these relationships can be explicitly stated in the text,or inferred from the context. Specifically,,relation extraction is to extract triples such as (subject, object,,relation) from a text;
[0156] Generative models play an important role in the field of machine learning and artificial intelligence. They usually adopt the Transformer architecture, which is composed of an encoder and a decoder. The encoder converts the input into a high-dimensional vector, while the decoder uses these high-dimensional vectors to generate output. Generative models model the target data space by explicitly learning the joint probability distribution of data, and have good data understanding and interpretation capabilities.
[0157] Discriminant model: The discriminant model models the mapping relationship between input content and output categories through conditional probability modeling. It has the advantages of strong controllability, high accuracy, and good convergence. It performs well in text classification tasks. Typical structures include fully connected neural network MLP and recurrent neural network RNN.
[0158] Semantic vector, semantic vector is a technology that embeds discrete text (such as words, phrases) into continuous vector space, allowing computers to efficiently understand and process it. Semantic vectors can be trained together with the model through back propagation to better represent the content and purpose of the text, so that the semantic vectors of similar texts are close in position in the vector space, improving the performance of the model.
[0159] The present invention firstly utilizes the excellent understanding ability of the generative model in complex contexts, supplemented by high-precision example guidance, to accurately capture and extract the relationship summary of the subject and object in the document, and then introduces a lightweight discriminant module to map the relationship summary to predefined relationship categories, thereby achieving a dual improvement in the accuracy and controllability of relationship extraction.
[0160] The above is only a preferred embodiment of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention. The structures, devices and operating methods not specifically described and explained in the present invention shall be implemented according to the conventional means in the art unless otherwise specified and limited.
Claims
1. A document-level relation extraction method based on generative model, Features: The steps include: First, the training phase: Step 1: Divide the original data into training data and test data. The training data is used to train the model, and the test data is used to test the model. Step 2: Initialize the generative model G, input training data in three formats: document, subject, and object, and obtain a summary of the relationship between the subject and object in the document; Step 3: Initialize the discriminant module C, input the training data in three formats: summary, subject, and object, and obtain the relationship labels of the subject and object in the document; Step 4: Calculate the loss of the relation label and the true label, and train G and C end-to-end through back-propagation; Step 5: For each correctly classified training data, save the relation summary generated by G and the semantic vector generated by C to construct a query set; Second, the testing phase: Step 6: Input the test data in the document, subject, and object formats into C, and extract the semantic vector e of the test data; Step 7: Use the nearest neighbor algorithm to search for the n training data in the query set that are most similar to e, and construct their relationship summaries into an example set; Step 8: Input test data in four formats, namely, document, subject, object, and example set, into G to guide the generative model to output a better relation summary; Step 9: Input the test data in three formats, namely summary, subject and object, into C to obtain the relationship labels between the subject and object in the document.
2. According to the document-level relationship extraction method based on the generative model according to claim 1, Features: In step 2, the concatenated document doc, subject sub, and object obj are used as the input of G: G input =doc||sub||obj ① For G input Vectorized encoding is as follows: First, convert the text into word vectors that are easy for computers to understand and process: word embedding i =W e ×v i ② Among them, word embeddingi is the word vector of the i-th word, W e is a word vector matrix of dimension d×m, where d is the word vector dimension, m is the word table size, and v i is the one-hot encoding of the i-th word; Then, we calculate the position vectors that represent the order in which the words appear in the text: position embedding pos,2j =sin(pos / 10000 2j / d ) ③ position embedding pos,2j+1 =cos(pos / 10000 2j+1 / d ) ④ Among them, pos is the position of the i-th word in the text, 2j is an even dimension, 2j+1 is an odd dimension, and d is the position vector dimension, which is the same size as the word vector dimension; In order to more completely model the semantic and syntactic information of words in the text, the word vector is added to the position vector to obtain the representation vector of the i-th word: embeddingi=word embedding i +position embedding pos ⑤ Finally, a text containing seq_len words will be vectorized and encoded into a representation vector matrix W with a dimension of seq_len×d. input .
3. According to the document-level relationship extraction method based on the generative model described in claim 1, Features: In step 2, G includes Masked Attention, Add&Norm, Feed Forward, and Softmax, as follows: Masked Attention forces each word to learn and evaluate the importance of all words in its preceding sequence, thereby efficiently and accurately learning from W input The most core and critical features are extracted as follows: First, initialize the three linear transformation matrices W Q , W k , W v , their dimensions are all d×hidden_size; Calculate the query matrix Q: Q=W input ×W Q ⑥ Calculate the key matrix K: K=W input ×W K ⑦ Calculate the value matrix V: V=W input ×W V ⑧ After linear transformation, the dimensions of Q, K, and V become seq_len×hidden_size; Then, the attention coefficient Attention coeff between words is calculated, whose dimension is seq_len×seq_len, representing the closeness and importance of each pair of words: Since the probability of each word appearing depends only on all the words before it and has nothing to do with the subsequent words, it is necessary to perform a mask operation on the Attention coeff so that the attention of each word is focused only on the preceding sequence: Masked Attention coeff=softmax(Attention coeff+mask) ⑩ Among them, the value of mask is infinitely small. After normalization by the softmax function, the MaskedAttention coeff of the word and the subsequent words becomes zero; Finally, the Masked Attention coeff and value matrix V are obtained from W input Extract the most core and critical features: Add&Norm improves the efficiency and stability of model training through residual connections and layer normalization. Residual connections add skip connections between different network layers to enable features to propagate directly across layers, thereby preventing gradient disappearance and alleviating the degradation problem of deep networks. Among them, layer normalization standardizes the feature distribution of each word to a mean of 0 and a variance of 1, which is used to alleviate the data offset problem between different network layers and accelerate the convergence speed of model training: FeedForward first maps the Add&Norm output to a higher-dimensional space and introduces a nonlinear function to learn deeper features, and then remaps the features back to a low-dimensional space to facilitate the calculation of subsequent network layers; Softmax calculates the probability of all words in the vocabulary being selected each time according to the Feed Forward output; G selects the word with the highest probability each time and serially generates a summary of the relationship between the subject and the object in the document:
4. According to the document-level relationship extraction method based on the generative model described in claim 1, Features: In step 3, the summary abs, subject sub, and object obj are concatenated as the input of C: C input After vectorization encoding, a text containing seq_len words will be vectorized to obtain a representation vector matrix W with a dimension of seq_len×d. input .
5. According to the document-level relationship extraction method based on the generative model according to claim 1, Features: In step 3, C includes Mean Pool and Softmax, as follows: Mean Pool takes the average of the representation vectors of each word and converts W input Compressed into a d-dimensional semantic vector e, representing C input Content and purpose: Softmax predicts the relationship labels between the subject and the object in the document based on e:
6. According to the document-level relationship extraction method based on the generative model according to claim 5, Features: In step 4, the loss between the predicted label predict label and the true label true label is calculated by the cross entropy loss function:
7. The document-level relationship extraction method based on a generative model according to claim 1, Features: After the training in step 5 is completed, for each correctly classified training data, the relationship summary abs generated by G and the semantic vector e generated by C are saved to construct a query set Query Set.
8. The document-level relationship extraction method based on a generative model according to claim 1, Features: In step 6, the document doc, subject sub, and object obj are concatenated as the first input of C, as follows: C passes through Mean Pool and outputs representation C input_1 The semantic vector e.
9. The document-level relationship extraction method based on a generative model according to claim 1, Features: In step 8, the document doc, subject sub, object obj, and sample set Sample Set are concatenated as the input of G: Based on the guidance of Sample Set, G generates a better and more accurate summary of the relationship between the subject and the object in the document.
10. The document-level relationship extraction method based on a generative model according to claim 1, Features: In step 9, the summary abs, subject sub, and object obj are concatenated as the second input of C: C predicts the relationship labels between the subject and the object in the document through Mean Pool and Softmax.
Citation Information
Patent Citations
Information extraction, discussion information extraction and data processing method for information extraction
CN116775864A
Modular self-supervision for document-level relation extraction
US20230019081A1
