Information processing apparatus, information processing method, and machine-readable storage medium
By constructing multiple training samples and using pre-trained language models, we learn the importance of entity descriptions in different contexts, solving the problems of low computational efficiency and dependence on manual annotation in the existing technology, and achieving efficient and effective document-level entity relationship extraction. accuracy.
Patent Information
- Application Number
- CN202310369065.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2024-10-15
AI Technical Summary
Existing document-level entity relationship extraction methods cannot effectively determine the importance of descriptions based on context, resulting in low computational efficiency or requiring a large amount of manual annotation.
By constructing multiple training samples to reflect the local context relationship and global context of entity pairs, the pre-trained language model is used to learn the importance of each entity description in different contexts, avoiding additional manual annotation.
It improves the accuracy and computational efficiency of the document-level entity relationship extraction model, reduces the dependence on manual annotation, and achieves the ability to accurately determine the importance of descriptions in different contexts.
Smart Images

Figure CN118780286A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of information processing, and in particular to an information processing device, an information processing method, and a machine-readable storage medium for natural language processing. Background Art
[0002] This section provides background information related to the present disclosure which is not necessarily prior art.
[0003] Document-Level Relation Extraction (DLRE) refers to extracting the relationship between entity pairs in a document. The characteristic of this task is that a document often contains multiple entities, so it is necessary to determine the relationship between all entity pairs. For an entity, the document may contain multiple descriptions of the entity. Figure 1 As shown, the left box shows an English document as a document example, in which the content (in bold) between each pair of "*" in the document represents a description. For ease of explanation, Figure 1 The four descriptions describing the same entity are marked in bold and underlined. The DLRE model takes documents and entity / description information as input and outputs entity pairs [et i ,et j ](i and j are non-zero natural numbers). Figure 1 The 0s and 1s in the right box represent identifiers of different categories of relations.
[0004] There is a very important step in the DLRE model, which is to obtain the vector representation (embedding) of each entity. The usual practice is to first obtain the vector representation of each description, and then merge the vector representations of the descriptions representing the same entity together as the vector representation of the entity, such as Figure 2 As shown in (a), the four described vectors are represented by h m According to the formula, we sum up and get the vector representation h of the entity. e .
[0005] Although this vector representation method is efficient and easy to calculate, it also has obvious problems. All descriptions have the same weight in the summation process, but in different relationships and contexts, different descriptions often play different roles. Figure 2As shown in (b), "Samuel Herbert Cohen", "He", "he" and "He" are four descriptions representing the same entity. In the "nationality" relationship, the description "Suel Herbert Cohen" can be judged to have a more important semantic role based on the context; while in the relationship "death time", the last description "He" has a more important semantic role than other descriptions. However, the current entity vector representation method cannot achieve this function of judging the importance of descriptions based on the context.
[0006] In order to solve the above problems, some methods have been proposed. The existing methods can be divided into two categories:
[0007] 1. Rely on manual annotation information to distinguish the importance of descriptions. For example, in DocRED (Document-Level Relation Extraction Dataset), each relation is annotated with a set of sentences that describe the relation, so that its importance can be determined based on the position of the description. However, there are very few datasets with such annotations, and this supervised method is difficult to promote.
[0008] 2. Use the attention mechanism to calculate the attention score of each description and all relations in the entity, and distinguish the importance of the description by the score. The problem with this method is that the attention mechanism increases the amount of calculation of the model, and the time complexity of the model is O(n 2 ) is improved to O(n 3 ), which increases the amount of calculation by an order of magnitude and affects the calculation efficiency.
[0009] In order to solve at least one of the above problems, the present application proposes a new document-level entity relationship extraction method. Summary of the invention
[0010] This section provides a general summary of the disclosure, and is not a comprehensive disclosure of its full scope or all of its features.
[0011] The purpose of the present disclosure is to provide an information processing device, an information processing method and a machine-readable storage medium for document-level entity relationship extraction.
[0012] According to one aspect of the present disclosure, there is provided an information processing device, comprising: a construction unit, which constructs a plurality of training samples corresponding to each entity pair respectively for each entity pair in the original training samples through original training samples, and at least a part of the plurality of training samples reflects the local contextual relationship between entities in the entity pairs; and a training unit, which uses the plurality of training samples to train a pre-trained language model in a document-level relationship extraction model for each entity pair to learn the importance of the description of the entity in each entity pair in different contexts.
[0013] According to another aspect of the present disclosure, an information processing method is provided, comprising: constructing a plurality of training samples corresponding to each entity pair in the original training samples, at least a portion of the plurality of training samples reflecting the local contextual relationship between entities in the entity pairs; and using the plurality of training samples to train a pre-trained language model in a document-level relationship extraction model for each entity pair to learn the importance of the description of the entity in each entity pair in different contexts.
[0014] According to another aspect of the present disclosure, a machine-readable storage medium is provided, which carries a program product including machine-readable instruction codes stored therein, wherein the instruction codes, when read and executed by a computer, enable the computer to perform the information processing method according to the present disclosure.
[0015] By using the information processing device, information processing method and machine-readable storage medium according to the present disclosure, a pre-trained language model can learn the importance of descriptions in different contexts without the need for additional manual annotation.
[0016] Further areas of applicability will become apparent from the description provided herein.The description and specific examples in this summary are intended for purposes of illustration only and are not intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are for illustrative purposes only of selected embodiments and not all possible implementations, and are not intended to limit the scope of the present disclosure. In the drawings:
[0018] Figure 1 is a schematic diagram illustrating the input and output of the DLRE model;
[0019] Figure 2 The diagram shows the calculation of vector representation of entities and the problems that exist;
[0020] Figure 3 is a block diagram illustrating a structure of an information processing device according to an embodiment of the present disclosure;
[0021] Figure 4 A block diagram illustrating the principle of an information processing device according to an embodiment of the present disclosure;
[0022] Figure 5 Example graphs constructed to illustrate training samples;
[0023] Figure 6 A flowchart illustrating an information processing method according to an embodiment of the present disclosure;
[0024] Figure 7A flowchart illustrating an information processing method according to another embodiment of the present disclosure; and
[0025] Figure 8 is a block diagram of an exemplary structure of a general-purpose personal computer in which the information processing apparatus and method according to the embodiments of the present disclosure can be implemented.
[0026] Although the present disclosure is susceptible to various modifications and alternative forms, specific embodiments thereof have been shown as examples in the drawings and are described in detail herein. It should be understood, however, that the description of specific embodiments herein is not intended to limit the present disclosure to the specific forms disclosed, but rather, the present disclosure is intended to cover all modifications, equivalents, and alternatives that fall within the spirit and scope of the present disclosure. It should be noted that throughout the several drawings, corresponding reference numerals indicate corresponding parts. DETAILED DESCRIPTION
[0027] Examples of the present disclosure will now be more fully described with reference to the accompanying drawings.The following description is merely exemplary in nature and is not intended to limit the present disclosure, application, or uses.
[0028] Example embodiments are provided so that the disclosure will be exhaustive and will fully convey its scope to those skilled in the art. Numerous specific details such as examples of specific components, devices, and methods are set forth to provide a detailed understanding of the embodiments of the present disclosure. It will be apparent to those skilled in the art that the example embodiments may be implemented in many different forms without the use of specific details, none of which should be construed as limiting the scope of the present disclosure. In certain example embodiments, well-known processes, well-known structures, and well-known techniques are not described in detail.
[0029] Combine the following Figures 3 to 5 To illustrate how the information processing device according to an embodiment of the present disclosure performs document-level entity relationship extraction.
[0030] Figure 3 1 is a block diagram illustrating the structure of an information processing device according to an embodiment of the present disclosure. Figure 3 As shown, the information processing device 100 according to an embodiment of the present disclosure may include a construction unit 110 and a training unit 120 .
[0031] The construction unit 110 may construct a plurality of training samples corresponding to each entity pair respectively for each entity pair in the original training samples through the original training samples.
[0032] The original training samples are at the document level, for example, they can be multiple Figure 1The document shown on the left side has the locations of entities and corresponding descriptions and the relationships between entities marked. It should be noted that in the present application, the construction unit 110 constructs multiple training samples for each entity pair, and at least a portion of the multiple training samples reflects the local contextual relationship between entities in the entity pair.
[0033] In addition, the construction unit 110 provides the constructed plurality of training samples to the training unit 120 .
[0034] Furthermore, the training unit 120 can use the multiple training samples provided by the construction unit 110 to train a pre-trained language model (PTLM) in the document-level relation extraction model for each entity pair to learn the importance of the description of the entity in each entity pair in different contexts. Figure 2 The vector representation h in the formula (a) is m to learn the importance of descriptions in different contexts.
[0035] Thus, the information processing device 100 according to the present application can pre-train the pre-trained language model by constructing multiple training samples reflecting the local contextual relationship between the entities in the entity pair for each entity pair, thereby learning the importance of the description of the entity in each entity pair in different contexts. This is the first step of the two-step training method proposed in the present application. Through this step of training, the pre-trained language model can learn the importance of descriptions in different contexts without the need for additional manual annotation.
[0036] Combine the following Figure 4 and Figure 5 More details of the two-step training method proposed in this application are explained in more detail. Figure 4 is a block diagram illustrating the principle of an information processing device according to an embodiment of the present disclosure, and Figure 5 Example graph constructed to illustrate the training samples.
[0037] The method for training the DLRE model proposed in this application expands the existing DLRE model training process into two steps, such as Figure 4 This application adds a training step: separate training is performed for each entity pair; different contexts are selected for each entity pair to construct multiple learning samples, and the importance of description is learned through different samples.
[0038] First, construct unit 110 ( Figure 4 (not shown) can obtain new training samples based on the original training samples at the document level.
[0039] In the present application, three types of positive training samples (local context instances including entity pairs in the original training samples; document-level instances; and entity pair instances) and negative training samples are constructed for each entity pair in the document.
[0040] 1. Local context instance
[0041] If there is a relationship between entity pairs, then the mention pairs that are close to each other are more likely to represent this relationship. Figure 2 In the example (b), "Samuel Herbert Cohen" and "Australia" represent the "nationality" relationship, and "He" and "1969" represent the "death date" relationship. It should be noted that Figure 2 The example in (b) shows the relationship between descriptions for the convenience of explanation. The relationship between descriptions is not labeled in the actual training samples.
[0042] Therefore, a part of sentences can be selected as training samples according to the positions of the descriptions corresponding to the two entities. To this end, the construction unit 110 can select a part of sentences in the entire document as local context instances based on the positions of the descriptions of the two entities in the entity pair.
[0043] Specifically, the construction unit 110 obtains the local context instance by the following method: obtaining a set of identifiers of sentences in which one or more descriptions corresponding to each entity in the entity pair are located; obtaining an intersection or a union based on the two sets; and obtaining a sentence in the document as a local context instance based on the intersection or the union. A possible exemplary method will be described below.
[0044] First, assume that the first set of sentence identifiers corresponding to the first entity i in the entity pair in the document is pi = [pi1, pi2, ..., pi n ], and the second set of sentence identifiers corresponding to the second entity j in the entity pair described in the document is pj = [pj1, pj2, ..., pj m ], where pi n Indicates that the nth description corresponding to the first entity i is located in the pith in the document n In sentences, and pj m Indicates that the mth description corresponding to the second entity j is located in the pjth m In the sentence, i, j, m, n, pi n 、pj m are all non-zero natural numbers.
[0045] if Then the construction unit 110 selects all sentences between the interval [t, w] as local context instances, where t = min(sp(pi)∪sp(pj)), w = max(sp(pi)∪sp(pj)), where sp(p) represents the sentence coverage of the description corresponding to the entity in the document. For example, pi = [3,5,7], pj = [8,9], then sp(pi) = interval [3,7], sp(pj) = interval [8,9], so the sentences between the interval [3,9] can be obtained as local context instances. Wherein, t and w are both non-zero natural numbers.
[0046] if Then the construction unit 110 selects all sentences between the interval [h, k] as local context instances, where h = min(sp(pi) ∩sp(pj)), k = max(sp(pi) ∩sp(pj)), and both h and k are non-zero natural numbers. For example, pi = [3, 5, 7], pj = [4, 5, 8], then sp(pi) = interval [3, 7], sp(pj) = interval [4, 8], so the sentences between the interval [4, 7] can be obtained as local context instances.
[0047] As another example, if The construction unit 110 can also take the interval [p h ,p k ] as local context instances. The following method is used to obtain the interval [p h ,p k ]: Take the intersection of pi and pj, and reduce the number of elements in the intersection downward until p is satisfied. h ≤p k , and p h 、p k ∈pi∪pj, and there is no p h <p’<p k , so that [p h ,p'] or [p',p k ] contains the description of both the first entity i and the second entity j. For example, pi = [3,5,7], pj = [4,5,8], then pi∩pj = [5], and the sentence marked as 5 can be obtained as the local context instance. As another example, pi = [3,5,7], pj = [3,5,8], then pi∩pj = [3,5], after reducing the number of elements in the intersection, the sentence marked as 3 can be obtained as the local context instance.
[0048] 2. Document level instance
[0049] The construction unit 110 retains the entire document including the entity pair in the original training sample as a document-level instance, which is used as the global context of the entity pair. The document-level instance retains the content of the original document and is used to learn global features.
[0050] 3. Entity-to-Instance
[0051] Entity pair instances reflect entity relationships based on common sense. Some entity relationships are common sense, and there is no clear information in the context to indicate the relationship between the two. For example, "Greece" and "Piraeus" are in the "country region" relationship, but there may be no information in the body of the document to explain this relationship, so the context is invalid for this type of entity relationship. Therefore, the construction unit 110 obtains entity pair instances by constructing training samples that only contain the description content of each entity in the entity pair. The constructed training samples that only contain the names of entity pairs can act as a dictionary.
[0052] like Figure 5 As shown, the original document sample is the same as Figure 1 For the sake of convenience, only one entity pair [AirAsia Zest, Pasay City] is used as an example. In this document, the first entity in the entity pair has four descriptions "Zest Airways, Inc.", "AirAsia Zest", "Asian Spirit and Zest Air" and "AirAsiaZest", and the second entity has one description "Pasay City".
[0053] In this case, if Figure 5 As shown, the document-level instances are the entire documents, the local context instances are the sentences that include these descriptions, and the entity pair instances are the contents of these descriptions.
[0054] 4. Negative training samples
[0055] The above is the construction of training samples for entity pairs that have associations (positive training samples). In addition to these entity pairs that originally have relationships, the construction unit 110 also samples entity pairs that do not have relationships to construct negative training samples. Therefore, negative training samples indicate samples related to entity pairs that do not have relationships. The construction unit 110 constructs negative training samples by the following method: sampling entity pairs that do not have relationships in the original training samples; and marking the sampled entity pairs as having no relationship.
[0056] Specifically, the construction unit 110 can randomly extract m entity pairs, each of which has no association in the original sample, and then add a relationship "none" to each of the m entity pairs, such as ["2013", "Pasay City", "none"].
[0057] For negative training samples, the construction unit 110 can construct document-level negative samples and entity negative samples. The document-level negative sample is a training sample that includes the entire document in which the sampled entity pair is located, and the entity negative sample is a training sample that includes the content of the description of each entity in the sampled entity pair. Since there is no context description of the "none" relationship for the negative training sample, the local context instance is not helpful.
[0058] After constructing the training sample, the construction unit 110 may provide the constructed new training sample to the training unit 120. Figure 4 It can be seen that the training unit 120 may include a PTLM 1201, an encoder 1202, and a classifier 1203. Because each sample is only for one entity pair, the network structure of the training unit 120 may use the structure of the PTLM 1201, the encoder 1202, and the classifier 1203, through which the PTLM learns entity representations in different contexts, thereby learning the importance of the description of the entity in each entity pair in different contexts.
[0059] In the first step of training above, different context instances are constructed for each entity pair, and the importance of descriptions is learned through different contexts. At the same time, a pre-trained language model (such as BERT, Bidirectional Encoder Representations from Transformers) is trained. In the second step of training, the previously trained language model is used for regular training.
[0060] The trained PTLM 1201 can be directly used to train the DLRE model. Specifically, the trained PTLM 1201 and the backbone model 130 can be combined as a document-level relation extraction (DLRE) model, and the original training samples can be used to train the DLRE model. The backbone model 130 can select multiple existing models, such as the ATLOP (Adaptive Thresholding and Localized Context Pooling) model, the KD-DocRE (Knowledge Distillation-Document-level Relation Extraction) model, the SAIS (Supervising and Augmenting Intermediate Steps) model, etc.
[0061] Usually, the training of the DLRE model directly uses the existing PTLM. Since the present application enables the PTLM to learn a better entity representation method in the first step of training, the accuracy of the DLRE model can be further improved. At the same time, since the existing DLRE model is not modified, but only a training step is added, the operating efficiency of the model can be guaranteed during actual prediction.
[0062] Therefore, compared with the existing methods in the background technology, the method of the present application does not require additional manual annotation, while also ensuring the computational efficiency of the model.
[0063] Combine the following Figure 6 The information processing method according to the embodiment of the present disclosure is described below.
[0064] like Figure 6 As shown, the information processing method according to the embodiment of the present disclosure starts at step S110. In step S110, multiple training samples corresponding to each entity pair are constructed respectively for each entity pair in the original training sample, and at least a part of the multiple training samples reflects the local contextual relationship between entities in the entity pair.
[0065] Next, in step S120, a pre-trained language model in the document-level relationship extraction model is trained for each entity pair using multiple training samples to learn the importance of the description of the entity in each entity pair in different contexts. After this, the process ends.
[0066] According to an embodiment of the present disclosure, the plurality of training samples include: a local context instance including an entity pair in the original training sample, and a portion of sentences in the entire document are selected as the local context instance based on the positions of the descriptions of the two entities in the entity pair.
[0067] According to an embodiment of the present disclosure, the plurality of training samples also include the entire document including the entity pair in the original training sample and the entity pair instance. The entity pair instance is obtained by constructing a training sample containing only the description content of each entity in the entity pair.
[0068] According to an embodiment of the present disclosure, the plurality of training samples further include: negative training samples, which indicate samples related to entity pairs without a relationship. Negative training samples are constructed by the following method: sampling entity pairs without a relationship in the original training samples; and marking the sampled entity pairs as having no relationship.
[0069] Specifically, negative training samples include document-level negative samples and entity negative samples. Document-level negative samples are training samples that include the entire document where the sampled entity pair is located, and entity negative samples are training samples that include the description content of each entity in the sampled entity pair.
[0070] According to an embodiment of the present disclosure, a pre-trained language model is trained using a combined structure of a pre-trained language model, an encoder, and a classifier.
[0071] Thus, the information processing method according to the embodiment of the present disclosure can pre-train the pre-trained language model by constructing multiple training samples reflecting the local contextual relationship between the entities in the entity pair for each entity pair, thereby learning the importance of the description of the entity in each entity pair in different contexts. Thus, the pre-trained language model can learn the importance of the description through different contexts without the need for additional manual annotation.
[0072] Combine the following Figure 7 An information processing method according to another embodiment of the present disclosure is described below.
[0073] like Figure 7 As shown, the information processing method according to the embodiment of the present disclosure starts at step S210. In step S210, the trained pre-trained language model and the backbone model are combined as a document-level relationship extraction model.
[0074] Next, in step S220, the document-level relationship extraction model is trained using the original training samples, after which the process ends.
[0075] Therefore, the information processing method according to the embodiment of the present disclosure does not require additional manual annotation to learn the importance of the description of the entity in each entity pair in different contexts, while also ensuring the computational efficiency of the model.
[0076] Various specific implementations of the above steps of the information processing method according to the embodiment of the present disclosure have been described in detail above and will not be repeated here.
[0077] Obviously, each operation process of the information processing method according to the present disclosure can be implemented in the form of a computer executable program stored in various machine-readable storage media.
[0078] Moreover, the purpose of the present disclosure can also be achieved in the following manner: a storage medium storing the above-mentioned executable program code is directly or indirectly provided to a system or device, and a computer or a central processing unit (CPU) in the system or device reads out and executes the above-mentioned program code. In this case, as long as the system or device has the function of executing the program, the embodiment of the present disclosure is not limited to the program, and the program can also be in any form, for example, a target program, a program executed by an interpreter, or a script program provided to an operating system, etc.
[0079] The above-mentioned machine-readable storage media include, but are not limited to: various memories and storage units, semiconductor devices, disk units such as optical, magnetic and magneto-optical disks, and other media suitable for storing information.
[0080] In addition, the technical solution of the present disclosure can also be implemented by connecting a computer to a corresponding website on the Internet, downloading and installing the computer program code according to the present disclosure into the computer, and then executing the program.
[0081] Figure 8 is a block diagram of an exemplary structure of a general-purpose personal computer in which the information processing apparatus and method according to the embodiments of the present disclosure can be implemented.
[0082] like Figure 8 As shown, a CPU 1301 performs various processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1308 to a random access memory (RAM) 1303. In the RAM 1303, data required when the CPU 1301 performs various processes and the like is also stored as needed. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output interface 1305 is also connected to the bus 1304.
[0083] The following components are connected to the input / output interface 1305: an input device 1306 (including a keyboard, a mouse, etc.), an output device 1307 (including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.), a storage device 1308 (including a hard disk, etc.), and a communication device 1309 (including a network interface card such as a LAN card, a modem, etc.). The communication device 1309 performs communication processing via a network such as the Internet. A drive 1310 may also be connected to the input / output interface 1305 as needed. A removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the drive 1310 as needed, so that a computer program read therefrom is installed in the storage device 1308 as needed.
[0084] In the case where the above-described series of processing is realized by software, a program constituting the software is installed from a network such as the Internet or a storage medium such as the removable medium 1311 .
[0085] It should be understood by those skilled in the art that such storage media is not limited to Figure 8 The removable medium 1311 shown has a program stored therein and is distributed separately from the device to provide the program to the user. Examples of the removable medium 1311 include magnetic disks (including floppy disks (registered trademark)), optical disks (including compact disk read only memory (CD-ROM) and digital versatile disks (DVD)), magneto-optical disks (including minidiscs (MD) (registered trademark)), and semiconductor memories. Alternatively, the storage medium may be a ROM 1302, a hard disk included in the storage device 1308, or the like, in which the program is stored and distributed to the user together with the device containing them.
[0086] In the system and method of the present disclosure, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present disclosure. In addition, the steps of performing the above series of processes can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0087] Although the embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings, it should be understood that the embodiments described above are only used to illustrate the present disclosure and do not constitute a limitation of the present disclosure. For those skilled in the art, various modifications and changes can be made to the above embodiments without departing from the essence and scope of the present disclosure. Therefore, the scope of the present disclosure is limited only by the attached claims and their equivalents.
[0088] Regarding the implementation methods including the above embodiments, the following additional notes are also disclosed:
[0089] Note 1. An information processing device, comprising:
[0090] a construction unit, which constructs a plurality of training samples corresponding to each entity pair in the original training samples, respectively, through the original training samples, at least a part of the plurality of training samples reflecting the local contextual relationship between entities in the entity pairs; and
[0091] A training unit uses the multiple training samples to train a pre-trained language model in a document-level relationship extraction model for each entity pair, so as to learn the importance of the description of the entity in each entity pair in different contexts.
[0092] Note 2. The information processing device according to Note 1, wherein the plurality of training samples include: local context instances of the entity pairs included in the original training samples, and
[0093] The construction unit selects a portion of sentences in the entire document as the local context instance based on the positions of the descriptions of the two entities in the entity pair.
[0094] Note 3. The information processing device according to Note 2, wherein the construction unit obtains the local context instance by the following method:
[0095] Obtain a set of identifiers of sentences containing one or more descriptions corresponding to each entity in the entity pair;
[0096] Find the intersection or union of two sets; and
[0097] Based on the intersection or union, sentences in the document are obtained as the local context instances.
[0098] Supplement 4. The information processing device according to Supplement 3, wherein:
[0099] Assume that the first set corresponding to the first entity in the entity pair is pi = [pi1, pi2, ..., pi n ], and the second set corresponding to the second entity in the entity pair is pj=[pj1,pj2,…,pj m ], where pi n Indicates that the nth description corresponding to the first entity is located at the pith in the document n In sentences, and pj m Indicates that the mth description corresponding to the second entity is located in the pjth m In a sentence, then:
[0100] if Then the construction unit selects all sentences between the interval [h, k] as the local context instances, where h = min(sp(pi) ∩sp(pj)), k = max(sp(pi) ∩sp(pj)), where sp(p) represents the sentence coverage of the description corresponding to the entity in the document, and
[0101] if Then the construction unit selects all sentences between the interval [t, w] as the local context instances, where t = min(sp(pi) ∪sp(pj)), w = max(sp(pi) ∪sp(pj)), and
[0102] Among them, m, n, pi n 、pj m , h, k, t and w are all non-zero natural numbers.
[0103] Note 5. The information processing device according to Note 2, wherein the plurality of training samples further comprises:
[0104] The entire document including the entity pair in the original training sample; and
[0105] Entity to instance.
[0106] Note 6. The information processing device according to Note 5, wherein the construction unit obtains the entity pair instance by constructing a training sample containing only the content of the description of each entity in the entity pair.
[0107] Supplement 7. The information processing device according to Supplement 2, wherein the plurality of training samples further include: negative training samples, the negative training samples indicating samples related to entity pairs with no relationship, and wherein the construction unit constructs the negative training samples by the following method:
[0108] Sampling entity pairs that do not have a relationship in the original training sample; and
[0109] The sampled entity pairs are labeled without any relationship.
[0110] Note 8. The information processing device according to Note 7, wherein the negative training samples include document-level negative samples and entity negative samples, and
[0111] The document-level negative sample is a training sample including the entire document where the sampled entity pair is located, and the entity negative sample is a training sample including the content of the description of each entity in the sampled entity pair.
[0112] Note 9. An information processing method, comprising:
[0113] Constructing a plurality of training samples corresponding to each entity pair in the original training samples, respectively, by using the original training samples, wherein at least a portion of the plurality of training samples reflects a local contextual relationship between entities in the entity pairs; and
[0114] The pre-trained language model in the document-level relationship extraction model is trained for each entity pair using the multiple training samples to learn the importance of the description of the entity in each entity pair in different contexts.
[0115] Note 10. The method according to Note 9 further includes:
[0116] combining the trained pre-trained language model and the backbone model as the document-level relation extraction model; and
[0117] The document-level relationship extraction model is trained using the original training samples.
[0118] Note 11. The method according to Note 9 or 10, wherein the plurality of training samples include: local context instances including the entity pairs in the original training samples, and
[0119] A portion of sentences in the entire document is selected as the local context instance based on the positions of the descriptions of the two entities in the entity pair.
[0120] Note 12. The method according to Note 11, wherein the local context instance is obtained by the following method:
[0121] Obtain a set of identifiers of sentences containing one or more descriptions corresponding to each entity in the entity pair;
[0122] Find the intersection or union of two sets; and
[0123] Based on the intersection or union, sentences in the document are obtained as the local context instances.
[0124] Note 13. The method according to Note 12, wherein:
[0125] Assume that the first set corresponding to the first entity in the entity pair is pi = [pi1, pi2, ..., pi n ], and the second set corresponding to the second entity in the entity pair is pj=[pj1,pj2,…,pj m ], where pi n Indicates that the nth description corresponding to the first entity is located at the pith in the document n In sentences, and pj mIndicates that the mth description corresponding to the second entity is located in the pjth m In a sentence, then:
[0126] if Then all sentences between the interval [h, k] are selected as the local context instances, where h = min(sp(pi) ∩sp(pj)), k = max(sp(pi) ∩sp(pj)), where sp(p) represents the sentence coverage of the description corresponding to the entity in the document, and
[0127] if Then select all sentences between the interval [t, w] as the local context instances, where t = min(sp(pi) ∪sp(pj)), w = max(sp(pi) ∪sp(pj)), and
[0128] Among them, m, n, pi n 、pj m , h, k, t and w are all non-zero natural numbers.
[0129] Note 14. The method according to Note 11, wherein the plurality of training samples further comprises:
[0130] The entire document including the entity pair in the original training sample; and
[0131] Entity to instance.
[0132] Note 15. The method according to Note 14, wherein the entity pair instance is obtained by constructing a training sample that contains only the content of the description of each entity in the entity pair.
[0133] Note 16. The method according to Note 11, wherein the plurality of training samples further comprises: negative training samples, the negative training samples indicating samples related to entity pairs with no relationship, and wherein the negative training samples are constructed by the following method:
[0134] Sampling entity pairs that do not have a relationship in the original training sample; and
[0135] The sampled entity pairs are labeled without any relationship.
[0136] Note 17. The method according to Note 16, wherein the negative training samples include document-level negative samples and entity negative samples, and
[0137] The document-level negative sample is a training sample including the entire document where the sampled entity pair is located, and the entity negative sample is a training sample including the content of the description of each entity in the sampled entity pair.
[0138] Note 18. The method according to Note 9, wherein the pre-trained language model is trained using a combined structure of the pre-trained language model, an encoder and a classifier.
[0139] Note 19. The method according to Note 10, wherein the pre-trained language model includes a BERT model, and the backbone model includes one of an ATLOP model, a KD-DocRE model, and a SAIS model.
[0140] Note 20. A machine-readable storage medium carrying a program product including machine-readable instruction codes stored therein, wherein the instruction codes, when read and executed by a computer, enable the computer to perform the information processing method described in Notes 9-19.
Claims
1. An information processing device, include: A construction unit, which constructs a plurality of training samples corresponding to each entity pair in the original training sample, respectively, through the original training sample, wherein at least a part of the plurality of training samples reflects a local contextual relationship between entities in the entity pair; as well as A training unit uses the multiple training samples to train a pre-trained language model in a document-level relationship extraction model for each entity pair, so as to learn the importance of the description of the entity in each entity pair in different contexts.
2. The information processing device according to claim 1, in, The plurality of training samples include: local context instances including the entity pairs in the original training samples, and The construction unit selects a portion of sentences in the entire document as the local context instance based on the positions of the descriptions of the two entities in the entity pair.
3. The information processing device according to claim 2, in, The construction unit obtains the local context instance by the following method: Obtain a set of identifiers of sentences containing one or more descriptions corresponding to each entity in the entity pair; Find the intersection or union of two sets; and Based on the intersection or union, sentences in the document are obtained as the local context instances.
4. The information processing device according to claim 3, in, Assume that the first set corresponding to the first entity in the entity pair is pi=[pi 1 ,pi 2 ,…,pi n ], and the second set corresponding to the second entity in the entity pair is pj=[pj 1 ,pj 2 ,…,pj m ], where pi n Indicates that the nth description corresponding to the first entity is located at the pith in the document n In sentences, and pj m Indicates that the mth description corresponding to the second entity is located in the pjth m In a sentence, then: if Then the construction unit selects all sentences between the interval [h, k] as the local context instances, where h = min(sp(pi) ∩sp(pj)), k = max(sp(pi) ∩sp(pj)), where sp(p) represents the sentence coverage of the description corresponding to the entity in the document, and if Then the construction unit selects all sentences between the interval [t, w] as the local context instances, where t = min(sp(pi) ∪sp(pj)), w = max(sp(pi) ∪sp(pj)), and Among them, m, n, pi n 、pj m , h, k, t and w are all non-zero natural numbers.
5. The information processing device according to claim 2, in, The plurality of training samples further include: The entire document including the entity pair in the original training sample; and Entity to instance.
6. The information processing device according to claim 5, in, The construction unit obtains the entity pair instance by constructing a training sample that only contains the description content of each entity in the entity pair.
7. The information processing device according to claim 2, in, The plurality of training samples further include: negative training samples, the negative training samples indicating samples related to entity pairs without a relationship, and wherein the construction unit constructs the negative training samples by the following method: Sampling entity pairs that do not have a relationship in the original training sample; and The sampled entity pairs are labeled without any relationship.
8. The information processing device according to claim 7, in, The negative training samples include document-level negative samples and entity negative samples, and The document-level negative sample is a training sample including the entire document where the sampled entity pair is located, and the entity negative sample is a training sample including the content of the description of each entity in the sampled entity pair.
9. An information processing method, include: Constructing a plurality of training samples corresponding to each entity pair in the original training samples, respectively, through the original training samples, wherein at least a portion of the plurality of training samples reflects a local contextual relationship between entities in the entity pairs; as well as The pre-trained language model in the document-level relationship extraction model is trained for each entity pair using the multiple training samples to learn the importance of the description of the entity in each entity pair in different contexts.
10. A machine-readable storage medium carrying a program product including machine-readable instruction codes stored therein, in, When the instruction code is read and executed by a computer, it can cause the computer to execute the information processing method according to claim 9.
