A relation extraction method and system based on entity replacement and floating mark
By replacing the entity pairs of relations to be extracted with fixed labels and adding special representations, combined with pre-trained models and sentence template processing, the problems of feature confusion and poor generalization performance in entity and relation extraction in existing technologies are solved, thereby improving the accuracy of relation extraction and the stability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-03-24
Smart Images

Figure CN115935952B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and more specifically, to a method and system for relation extraction based on entity substitution and dangling tags. Background Technology
[0002] With the development of big data technology, data in various fields is growing exponentially, the vast majority of which is unstructured data. How to extract structured knowledge from unstructured data (especially text data) is a hot topic in information extraction. Among them, relation extraction technology based on natural language processing has attracted widespread attention from scholars and various industries.
[0003] Currently, there are two main types of relation extraction methods: one is the joint extraction method based on entities and relations; the other is the streamlined extraction method represented by pipeline. The joint extraction method based on entities and relations assumes that entities and relations belong to the same semantic space. It requires the full integration of entity features and relation features before joint training of a model to achieve mutual promotion between entities and relations. Although this method avoids error propagation, the contextual representations of entities and relations are essentially different information. Sharing their information can lead to feature confusion, resulting in a chaotic learning model. The streamlined extraction method represented by pipeline assumes that entities and relations belong to different semantic spaces. It requires the extraction of entities and relations to be divided into two tasks: entity recognition and relation extraction. This method reduces the difficulty of entity and relation extraction, but it still has the following shortcomings: (1) In most cases, a relation often has only a small amount of labeled data, resulting in unsatisfactory generalization performance of the model; (2) It has a poor effect on the extraction of implicit relations. Summary of the Invention
[0004] This invention provides a relation extraction method and system based on entity replacement and floating markers. The entity pairs of the relation to be extracted are replaced with fixed markers, which facilitates subsequent representation learning of sentence templates and makes the relation expression more general, thus solving the relation classification error caused by interference from entity pair names. At the same time, special representations are added before and after the entity pairs, and the floating marker is placed at the end of the sentence, which solves the problem of insufficient entity information representation during relation extraction, resulting in poor model generalization performance.
[0005] In a first aspect, embodiments of the present invention provide a relation extraction method based on entity replacement and dangling markers, the method comprising the following steps:
[0006] (1) Perform entity replacement and dangling mark processing on the original text to obtain the detected text;
[0007] (2) Perform language feature extraction processing on the pre-trained model of the detected text input to obtain feature vectors of special labels; among which, special labels include labels obtained by entity replacement and dangling label processing;
[0008] (3) Perform vector concatenation on the feature vectors to obtain the concatenated feature vector, and input the concatenated feature vector into a fully connected neural network for language feature extraction to obtain the entity relationship score vector;
[0009] (4) Input the entity relationship score vector into the normalized exponential function to perform probability distribution prediction processing of the relationship label in order to obtain the category probability distribution map;
[0010] (5) Decode the category probability distribution map to obtain the relationship category labels.
[0011] In the above embodiments, the entity pairs of relations to be extracted are replaced with fixed tags, which facilitates the subsequent representation learning of sentence templates, making the expression of relations more general and solving the relation classification errors caused by interference from entity pair names. At the same time, special representations are added before and after the entity pairs, and the floating tags are placed at the end of the sentence, which solves the problem of insufficient entity information representation during relation extraction, resulting in poor model generalization performance.
[0012] As some optional implementations of this application, the process of performing entity replacement and dangling mark processing on the original text to obtain the detected text is as follows:
[0013] (1.1) Input the original text into the entity recognition model to obtain all entities;
[0014] (1.2) Form two entities into an entity pair and perform entity replacement processing on the entity pair, that is, replace the entity pair with the form of entity type tag;
[0015] (1.3) Perform hover mark processing on entity pairs, that is, add special features before and after entity pairs, and hover mark the special features at the end of the entity pair to obtain the detected text.
[0016] As some optional implementations of this application, before performing entity replacement and dangling mark processing on the original text, it is necessary to perform data cleaning on the original text and remove invalid characters.
[0017] In the above embodiments, by cleaning the original text, invalid characters are effectively removed, making the subsequent extraction of relationships from the detected text more accurate.
[0018] As one of the optional implementations of this application, the process of performing language feature extraction on the pre-trained model for detecting text input to obtain feature vectors for specific labels is as follows:
[0019] (2.1) Map the detected text from the semantic space to the vector space;
[0020] (2.2) Input the detected text in the vector space into the pre-trained model and perform language feature extraction to obtain the feature vector of the special label.
[0021] As some optional implementations of this application, the process of inputting the feature concatenation vector into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector is as follows:
[0022] (3.1) Concatenate the feature vectors of all special labels to obtain a concatenated feature vector;
[0023] (3.2) Input the concatenated feature vector into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector.
[0024] In the above embodiments, the feature vectors connecting the fixed marker positions and the feature vectors representing the special characteristics in front of the floating marker entities are used for relationship classification and the relationships between entities are presented in the form of a probability distribution. In this way, connecting the feature vectors can make full use of statement information and entity information and obtain the probability value of the relationship category.
[0025] As one of the optional implementations of this application, the process of inputting the entity relationship score vector into a normalized exponential function to predict the probability distribution of the relationship label to obtain the category probability distribution is as follows:
[0026] (4.1) Input the entity relationship score vector into the normalized exponential function, predict the probability of the relationship category label through the normalized exponential function, and obtain the category probability distribution map based on the probability of the relationship category label;
[0027] (4.2) Calculate the loss function of the category probability distribution map based on manually labeled data.
[0028] As some optional implementations of this application, the process of decoding the category probability distribution map to obtain the relationship category labels is as follows:
[0029] (5.1) Obtain the location of the maximum probability based on the probability distribution map of the category, where the relationship category label corresponding to the location of the maximum probability is the predicted relationship category label;
[0030] (5.2) Decode the predicted relation category labels to obtain the relation category labels, i.e. the relation of the entity pair.
[0031] In a second aspect, the present invention provides a relation extraction system based on entity replacement and dangling markers, the system comprising:
[0032] A preprocessing unit is used to perform entity replacement and dangling mark processing on the original text to obtain the detected text;
[0033] The feature vector unit is used to perform language feature extraction processing on the pre-trained model of the detected text input to obtain feature vectors of special labels; wherein, the special labels include labels obtained by entity replacement and dangling label processing;
[0034] The scoring vector unit is used to perform vector concatenation on the feature vector to obtain a concatenated feature vector, and input the concatenated feature vector into a fully connected neural network for language feature extraction to obtain an entity relationship scoring vector.
[0035] The probability distribution unit is used to input the entity relationship score vector into a normalized exponential function to perform probability distribution prediction processing of the relationship label in order to obtain a category probability distribution map.
[0036] A decoding unit is used to decode the category probability distribution map to obtain the relationship category label.
[0037] In a third aspect, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor performing the relation extraction method based on entity replacement and dangling tags.
[0038] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the relation extraction method based on entity replacement and dangling markers.
[0039] The beneficial effects of this invention are as follows:
[0040] 1. This invention replaces the entity pairs of relations to be extracted with fixed labels, which facilitates the subsequent representation learning of sentence templates, making the expression of relations more general and solving the relation classification errors caused by interference from entity pair names; at the same time, special representations are added before and after the entity pairs, and the floating label is placed at the end of the sentence, which solves the problem of insufficient entity information representation during relation extraction, resulting in poor model generalization performance.
[0041] 2. This invention uses the feature vectors of fixed marker positions and the feature vectors of special representations in front of floating marker entities for relation classification and presents the relationship between entities in the form of a probability distribution. In this way, the connection of feature vectors can make full use of statement information and entity information and obtain the probability value of relation category.
[0042] 3. The sentence template used in this invention can alleviate the problems of insufficient feature extraction and incomplete feature fusion, and effectively improve the accuracy of relation extraction and its generalization performance. Attached Figure Description
[0043] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating the steps of a relation extraction method based on entity replacement and dangling markers according to an embodiment of the present invention;
[0045] Figure 2 This is an example diagram of a relation extraction method based on entity replacement and dangling markers according to an embodiment of the present invention. Detailed Implementation
[0046] To better understand the above technical solutions, the technical solutions of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solutions of the present invention, rather than limitations on the technical solutions of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0047] It should also be understood that, in order to simplify the description of the invention and thus aid in the understanding of at least one embodiment, multiple features may sometimes be grouped into a single embodiment, drawing, or description thereof in the foregoing description of the embodiments of the invention. However, this method of disclosure does not imply that the subject matter of the invention requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of the single embodiment disclosed above.
[0048] Example 1
[0049] This invention provides a relationship extraction method based on entity replacement and dangling markers. Please refer to [link to relevant documentation]. Figure 1 , Figure 2 The method is as follows:
[0050] (1) Perform entity replacement and dangling mark processing on the original text to obtain the detected text.
[0051] In this embodiment of the invention, the process for obtaining the detected text is as follows:
[0052] (1.1) Input the original text into the entity recognition model to obtain all entities;
[0053] (1.2) Combine two entities into an entity pair and perform entity replacement processing on the entity pair, that is, replace the entity pair with the form of entity type tags (e.g., [SUB=XXX], [OBJ=XXX], where "XXX" represents the type tag of the entity, SUB represents the header entity, and OBJ represents the tail entity);
[0054] (1.3) Perform floating token processing on entity pairs, that is, add special tokens before and after entity pairs, and place the special tokens at the end of the entity pair to obtain the detection text (e.g., [SUB_START=XXX], [SUB_END=XXX], [OBJ_START=XXX], [OBJ_END=XXX], where "XXX" represents the type label of the entity, SUB_START and OBJ_START indicate the start, and SUB_END and OBJ_END indicate the end. For example, the original text "Zhang San was born in Chengdu" is converted into the detection text "[SUB=PER]born in [OBJ=LOC], [SUB_START=PER]Zhang San[SUB_END=PER], [OBJ_START=LOC]Chengdu[OBJ_END=LOC]"). That is, floating token: place the information to be marked (e.g., entity category information) at the end of the input statement; treat the input statement and the end-of-sentence token information as a single statement as a whole input.
[0055] In this embodiment, the entity pairs of relations to be extracted are replaced with fixed markers, which facilitates subsequent representation learning using sentence templates, making the expression of relations more general and solving the relation classification errors caused by interference from entity pair names. At the same time, special representations are added before and after the entity pairs, and the markers are placed at the end of the sentence, which solves the problem of insufficient entity information representation during relation extraction, resulting in poor model generalization performance. Furthermore, the use of sentence templates can alleviate the problems of insufficient feature extraction and incomplete feature fusion, effectively improving the accuracy of relation extraction and its generalization performance.
[0056] In this embodiment of the invention, before performing entity replacement and dangling tag processing on the original text, it is necessary to clean the original text to remove invalid characters. By cleaning the original text, invalid characters are effectively removed, making the subsequent text relationship extraction more accurate.
[0057] (2) The pre-trained model of the detected text input is subjected to language feature extraction processing to obtain the feature vector of special labels; among which, special labels include labels obtained by entity replacement and dangling label processing.
[0058] In this embodiment of the invention, the process for obtaining the feature vector of a special label is as follows:
[0059] (2.1) Mapping the detected text from the semantic space to the vector space is specifically represented as follows:
[0060] {X1, ..., X |s|} = embedding({x1, ..., x...) |s|})
[0061] Among them, X i Represents a special characteristic x i The representation vector; each detected text contains |s| special representations x i ;
[0062] (2.2) Input the detected text in the vector space into the pre-trained model for language feature extraction to obtain feature vectors for special labels, specifically represented as follows:
[0063] {h1, ..., h |s|} = PLM({X1, ..., X...) |s|})
[0064] Here, PLM stands for pre-trained language model, such as BERT, GPT, Elmo, Albert, etc.; h i This represents the feature representation of the i-th representation vector after passing through the pre-trained model.
[0065] (3) Perform vector concatenation on the feature vectors to obtain the concatenated feature vector, and input the concatenated feature vector into a fully connected neural network for language feature extraction to obtain the entity relationship score vector.
[0066] In this embodiment of the invention, the process for obtaining the entity relationship score vector is as follows:
[0067] (3.1) Concatenate the feature vectors of all special labels to obtain a concatenated feature vector;
[0068] For example, the feature vectors of the extracted special labels [SUB=XXX], [OBJ=XXX], [SUB_START=XXX], and [OBJ_START=XXX] are denoted as h. sUB h oBJ h suB_START h oBJ_START Then the feature concatenation vector is:
[0069] h = concat(h) SUB h OBJ h SUB_START h OBJ_START )
[0070] Among them, h SUB The h represents the feature vector obtained from a pre-trained model representing a specific label [SUB=XXX]; OBJ The h represents the feature vector obtained from a pre-trained model representing a specific label [OBJ=XXX]; SUB_START The h represents the feature vector obtained from the pre-trained model for the special label [SUB_START=XXX]; OBJ_START This represents the feature vector obtained from a pre-trained model for the special label [OBJ_START=XXX].
[0071] (3.2) The concatenated feature vector is input into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector, specifically represented as follows:
[0072] g = MLP(h)
[0073] Here, MLP represents a fully connected neural network, whose output dimension is equal to the number of relation categories; g represents the entity relation score vector, i.e., the relation score.
[0074] In this embodiment of the invention, the feature vector connecting the fixed marker position and the feature vector representing the special characteristics in front of the floating marker entity are used for relationship classification and the relationship between entities is presented in the form of a probability distribution. In this way, the connection of feature vectors can make full use of statement information and entity information and obtain the probability value of the relationship category.
[0075] (4) Input the entity relationship score vector into the normalized exponential function to perform probability distribution prediction processing of the relationship label in order to obtain the category probability distribution map;
[0076] In this embodiment of the invention, the process for obtaining the category probability distribution is as follows:
[0077] (4.1) The entity relation score vector g = (g1, g2, ..., g n Input a normalized exponential function, predict the probability of relation category labels using the normalized exponential function (Softmax function), and obtain the category probability distribution map on the label space Y based on the probability of relation category labels, specifically represented as follows:
[0078]
[0079] Where i represents the number of relation category labels, and j represents the j-th relation category label;
[0080] (4.2) The loss function for calculating the category probability distribution map based on manually labeled data is specifically expressed as follows:
[0081] loss = -log p(y = y label )
[0082] Among them, y label It is a manual label;
[0083] (5) Decode the category probability distribution map to obtain the relationship category labels;
[0084] In this embodiment of the invention, the process for obtaining relationship category labels is as follows:
[0085] (5.1) Obtain the location of the maximum probability based on the probability distribution map of the category, where the relationship category label corresponding to the location of the maximum probability is the predicted relationship category label;
[0086] (5.2) Decode the predicted relation category labels to obtain the relation category labels, i.e., the relations between entity pairs. Please refer to [link to documentation]. Figure 2 The position with the highest probability is "born", with a corresponding probability value of 0.6. Therefore, the relationship category label "born" is obtained, which means "birth".
[0087] Example 2
[0088] This invention provides a relationship extraction system based on entity replacement and dangling markers, the system comprising:
[0089] A preprocessing unit is used to perform entity replacement and dangling mark processing on the original text to obtain the detected text;
[0090] The feature vector unit is used to perform language feature extraction processing on the pre-trained model of the detected text input to obtain feature vectors of special labels; wherein, the special labels include labels obtained by entity replacement and dangling label processing;
[0091] The scoring vector unit is used to perform vector concatenation on the feature vector to obtain a concatenated feature vector, and input the concatenated feature vector into a fully connected neural network for language feature extraction to obtain an entity relationship scoring vector.
[0092] The probability distribution unit is used to input the entity relationship score vector into a normalized exponential function to perform probability distribution prediction processing of the relationship label in order to obtain a category probability distribution map.
[0093] A decoding unit is used to decode the category probability distribution map to obtain the relationship category label.
[0094] Example 3
[0095] This invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the computer program executes a relation extraction method based on entity replacement and dangling tags as described in Embodiment 1 when the processor is running.
[0096] The computer device provided in this embodiment can implement the method described in Embodiment 1. To avoid repetition, it will not be described again here.
[0097] Example 4
[0098] This invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the relation extraction method based on entity replacement and dangling markers described in Embodiment 1.
[0099] The computer-readable storage medium provided in this embodiment can implement the method described in Embodiment 1. To avoid repetition, it will not be described again here.
[0100] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0101] The memory can be used to store the computer program and / or modules. The processor implements various functions of the relation extraction system based on entity substitution and dangling tags in the invention by running or executing the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart memory card, secure digital card, flash memory card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0102] If a relationship extraction system based on entity replacement and dangling markers is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program storable in a computer-readable storage medium. When executed by a processor, this computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory, random access memory, dot carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0103] The basic concepts of this invention have been described. It is obvious to those skilled in the art that the detailed disclosure above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this specification. Such modifications, improvements, and corrections are suggested in this specification and therefore remain within the spirit and scope of the exemplary embodiments described herein.
[0104] Computer storage media may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and suitable combinations thereof. Computer storage media can be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer storage medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.
Claims
1. A relation extraction method based on entity replacement and dangling markers, characterized in that, The method includes the following steps: (1) Perform entity replacement and dangling mark processing on the original text to obtain the detected text; The process of performing entity replacement and dangling mark processing on the original text to obtain the detected text is as follows: (1.1) Input the original text into the entity recognition model to obtain all entities; (1.2) Form two entities into an entity pair and perform entity replacement processing on the entity pair, that is, replace the entity pair with the form of entity type tag; (1.3) Perform hover mark processing on entity pairs, that is, add special features before and after entity pairs, and hover mark the special features at the end of the entity pair to obtain the detected text; (2) Perform language feature extraction processing on the pre-trained model of the detected text input to obtain feature vectors of special labels; wherein, special labels include labels obtained by entity replacement and dangling label processing; The process of extracting language features from the pre-trained model of the detected text input to obtain feature vectors for specific labels is as follows: (2.1) Map the detected text from the semantic space to the vector space; (2.2) Input the detected text in the vector space into the pre-trained model and perform language feature extraction to obtain the feature vector of the special label; (3) Perform vector concatenation on the feature vectors to obtain the feature concatenation vector, and input the feature concatenation vector into a fully connected neural network for language feature extraction to obtain the entity relationship score vector; The process of inputting the concatenated feature vector into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector is as follows: (3.1) Concatenate the feature vectors of all special labels to obtain a concatenated feature vector; (3.2) Input the concatenated feature vector into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector; (4) Input the entity relationship score vector into the normalized exponential function to perform probability distribution prediction processing of the relationship label to obtain the category probability distribution map; The process of inputting the entity relationship score vector into a normalized exponential function to predict the probability distribution of relationship labels and obtain the category probability distribution is as follows: (4.1) Input the entity relationship score vector into the normalized exponential function, predict the probability of the relationship category label through the normalized exponential function, and obtain the category probability distribution map based on the probability of the relationship category label; (4.2) Calculate the loss function of the category probability distribution map based on manually labeled data; (5) Decode the category probability distribution map to obtain the relationship category labels; The process of decoding the category probability distribution map to obtain the relationship category labels is as follows: (5.1) Obtain the location of the maximum probability based on the probability distribution map of the category, where the relationship category label corresponding to the location of the maximum probability is the predicted relationship category label; (5.2) Decode the predicted relation category labels to obtain the relation category labels, i.e. the relation of the entity pair.
2. The relationship extraction method based on entity replacement and dangling markers according to claim 1, characterized in that, Before performing entity replacement and dangling mark processing on the original text, it is necessary to clean the original text and remove invalid characters.
3. A relationship extraction system based on entity replacement and dangling markers, characterized in that, The system includes: A preprocessing unit is used to perform entity replacement and dangling mark processing on the original text to obtain the detected text; The process of performing entity replacement and dangling mark processing on the original text to obtain the detected text is as follows: Input the original text into the entity recognition model to obtain all entities; Combine two entities into an entity pair and perform entity replacement processing on the entity pair, that is, replace the entity pair with the form of entity type tag; The entity pairs are subjected to dangling mark processing, that is, special features are added before and after the entity pairs, and the special features are dangling marks at the end of the entity pairs to obtain the detected text; The feature vector unit is used to perform language feature extraction processing on the pre-trained model of the detected text input to obtain feature vectors of special labels; wherein, the special labels include labels obtained by entity replacement and dangling label processing; The process of extracting language features from the pre-trained model of the detected text input to obtain feature vectors for specific labels is as follows: Map the detected text from the semantic space to the vector space; The detected text in the vector space is input into the pre-trained model for language feature extraction to obtain feature vectors for specific labels; The scoring vector unit is used to perform vector concatenation on the feature vector to obtain a concatenated feature vector, and input the concatenated feature vector into a fully connected neural network for language feature extraction to obtain an entity relationship scoring vector. The process of inputting the concatenated feature vector into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector is as follows: The feature vectors of all special labels are concatenated to obtain a single concatenated feature vector. The concatenated feature vector is input into a fully connected neural network for semantic feature extraction to obtain the entity relationship score vector. A probability distribution unit is used to input the entity relationship score vector into a normalized exponential function to perform probability distribution prediction processing of the relationship label in order to obtain a category probability distribution map. The process of inputting the entity relationship score vector into a normalized exponential function to predict the probability distribution of relationship labels and obtain the category probability distribution is as follows: Input the entity relationship score vector into the normalized exponential function, predict the probability of the relationship category label through the normalized exponential function, and obtain the category probability distribution map based on the probability of the relationship category label; The loss function for calculating the category probability distribution map is based on manually labeled data; A decoding unit is used to decode the category probability distribution map to obtain the relationship category label; The process of decoding the category probability distribution map to obtain the relationship category labels is as follows: The location of the maximum probability is obtained from the probability distribution map of the category, and the relationship category label corresponding to the location of the maximum probability is the predicted relationship category label. The predicted relation category labels are decoded to obtain the relation category labels, i.e., the relations of entity pairs.
4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the relation extraction method based on entity replacement and dangling markers as described in any one of claims 1-2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the relation extraction method based on entity replacement and dangling markers as described in any one of claims 1-2.
Citation Information
Patent Citations
Entity relationship extraction method and device of text and storage medium
CN110569366A