CN111476023B - Method and device for identifying entity relationship - Google Patents

Method and device for identifying entity relationship Download PDF

Info

Publication number
CN111476023B
CN111476023B CN202010443143.5A CN202010443143A CN111476023B CN 111476023 B CN111476023 B CN 111476023B CN 202010443143 A CN202010443143 A CN 202010443143A CN 111476023 B CN111476023 B CN 111476023B
Authority
CN
China
Prior art keywords
entity
result
target
coding
corpus text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010443143.5A
Other languages
Chinese (zh)
Other versions
CN111476023A (en
Inventor
刘嘉庆
王志海
喻波
魏力
谢福进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN202010443143.5A priority Critical patent/CN111476023B/en
Publication of CN111476023A publication Critical patent/CN111476023A/en
Application granted granted Critical
Publication of CN111476023B publication Critical patent/CN111476023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Machine Translation (AREA)

Abstract

The application discloses a method and a device for identifying entity relations. Wherein the method comprises the following steps: acquiring an entity tag set in a corpus text to be identified; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity. The application solves the technical problems of poor recognition efficiency and recognition precision of recognizing entity relations among entities in the prior art.

Description

Method and device for identifying entity relationship
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for identifying entity relationships.
Background
The relation extraction task is widely applied to data simplification and knowledge graph construction, and the extraction of entity relation among entities is an important problem to be solved urgently on the basis of correctly identifying the entities by identifying a section of natural language input by a given user.
Named entity recognition and relation extraction are important steps for constructing a knowledge graph, and are beneficial to many natural language processing NLP tasks. At present, two methods are widely applied to entity identification and relation extraction tasks: one is in series and the other is in combination. The tandem approach described above decomposes this task into two different subtasks, named Entity Recognition (NER) and Relationship Classification (RC), the traditional NER models being linear statistical models, e.g., hidden markov (HMM) models and Conditional Random Field (CRF) models.
The entity relationship identification in the traditional serial method relies on manual extraction of features, and then the next step of identification extraction is performed, so that the effect of error accumulation is generated. And the joint extraction method based on word order converts the joint extraction task into the labeling problem, so that the relation extraction among entities can be realized. However, the extraction cannot solve the problem of relationship overlapping, but only can solve the problem of one-to-one relationship from end to end; moreover, when processing text labeling coding, sparse matrixes appear, which increase time and space complexity if direct calculation is undoubtedly, and are susceptible to noise interference.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a method and a device for identifying entity relationships, which at least solve the technical problems of poor identification efficiency and poor identification precision of identifying entity relationships between entities in the prior art.
According to an aspect of an embodiment of the present application, there is provided a method of identifying an entity relationship, including: acquiring an entity tag set in a corpus text to be identified; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
Optionally, determining whether the encoding result of each position in the corpus text to be identified is a target entity includes: classifying the coding result of each position by adopting two full-connection layer classifiers to obtain a classification result; judging whether the coding result is the target entity according to the classification result.
Optionally, under the condition that a plurality of entities exist in the sentence of the corpus text to be recognized, the start pointer and the end pointer in the coding layer are paired by adopting a nearby matching principle.
Optionally, the target joint extraction model is a multi-layer bi-directional transformer encoder BERT-based joint extraction model for pre-training the depth bi-directional representation by jointly adjusting contexts in all layers.
Optionally, each relationship category corresponding to the entity relationship is processed by adopting an independent group of topic classification models; each character in each named entity employs the features of BERT for encoding and average pooling operations.
Optionally, before acquiring the entity tag set in the corpus text to be identified, the method further includes: acquiring an original corpus text; labeling a plurality of entities contained in the original corpus text to obtain a labeling result, wherein the labeling result comprises the following steps: a plurality of entities and entity relationships between the entities; taking the labeling result as a sample data set, and dividing the sample data set into a training set, a testing set and a verification set; training the training model by adopting the training set and verifying the training result by adopting the verification set to obtain the target joint extraction model, wherein a symbol digital system TensorFlow based on data stream programming is adopted as a framework of the training model.
Optionally, after obtaining the target joint extraction model, the method further includes: testing the target joint extraction model by adopting the test set to obtain a test result; determining and judging the accuracy of the entity relation according to the test result, and judging whether the accuracy is smaller than a preset accuracy threshold; if the judgment result is yes, performing optimization processing on the entity relation type according to the ordering result of the accuracy rate until the accuracy rate is greater than or equal to the preset accuracy rate threshold value.
According to another aspect of the embodiment of the present application, there is also provided an apparatus for identifying entity relationships, including: the acquisition module is used for acquiring an entity tag set in the corpus text to be identified; the processing module is used for carrying out coding processing on the entity tag set by adopting a coding layer in the target joint extraction model; the judging module is used for judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; the output module is configured to output triplet information if the determination result is yes, where the triplet information includes: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
According to another aspect of the embodiment of the present application, there is further provided a nonvolatile storage medium, where the nonvolatile storage medium includes a stored program, and when the program runs, a device where the nonvolatile storage medium is controlled to execute any one of the above methods for identifying entity relationships.
According to another aspect of the embodiment of the present application, there is further provided a processor, where the processor is configured to execute a program stored in a memory, where the program executes any one of the above methods for identifying entity relationships.
In the embodiment of the application, the entity tag set in the corpus text to be identified is obtained; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity and the entity relation between the head entity and the tail entity achieve the aim of improving the efficiency of identifying entity relation among the entities, thereby realizing the technical effects of improving the identification precision and the identification accuracy and further solving the technical problems of poor identification efficiency and identification precision of identifying entity relation among the entities in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a method of identifying entity relationships according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative joint extraction model according to an embodiment of the application;
fig. 3 is a schematic structural diagram of an apparatus for recognizing entity relationships according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, in order to facilitate understanding of the embodiments of the present application, some terms or nouns referred to in the present application will be explained below:
joint Extraction (Joint Extraction): the joint learning framework extracts entities and relations together by using a single model, and can effectively integrate information of the entities and the relations.
Relationship classification (relation classification): relationship classification refers to determining which relationship two entities are in a sentence.
BERT: the feature quantity of the bidirectional encoder, which is totally called as the characteristic quantity of the bidirectional encoder from the converter, is a multi-layer bidirectional converter encoder based on fine tuning, is a novel language model developed and issued by Google, and is used for a plurality of natural language processors such as question-answering, named entity recognition, natural language reasoning, text classification and the like.
Natural Language Processing (NLP) refers to the ability of a machine to understand and interpret human writing and speaking. The goal of NLP is to make the machine as intelligent as a human in understanding language. The final goal is to make up the gap between human communication (natural language) and computer understanding (machine language). It is a science integrating linguistics, computer science and mathematics. Thus, the research in this field will involve natural language, so it has a close relationship with the research in linguistics, but has important differences. Natural language processing is not a general study of natural language, but rather, is the development of computer systems, and in particular software systems therein, that can effectively implement natural language communications.
The main task of named entity recognition is to recognize proper nouns such as person names, place names, organization names, time, numbers and the like in texts and classify and recognize the proper nouns. The relationship existing between named entities is the relationship that the entities have. Entity relationship identification is an important component of information extraction, and has important significance for research and application of information extraction technology. The identification of the relationship between the entities is a key core technology and has very important significance for information retrieval, machine translation and the like.
Example 1
In accordance with an embodiment of the present application, there is provided an embodiment of a method of identifying entity relationships, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
FIG. 1 is a flow chart of a method of identifying entity relationships, as shown in FIG. 1, according to an embodiment of the present application, the method comprising the steps of:
step S102, acquiring an entity tag set in a corpus text to be identified;
step S104, adopting a coding layer in the target joint extraction model to code the entity tag set;
step S106, judging whether the coding result of each position in the corpus text to be identified is a target entity, and obtaining a judging result, wherein the target entity is a head entity or a tail entity;
step S108, if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
In the embodiment of the application, the entity tag set in the corpus text to be identified is obtained; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity and the entity relation between the head entity and the tail entity achieve the aim of improving the efficiency of identifying entity relation among the entities, thereby realizing the technical effects of improving the identification precision and the identification accuracy and further solving the technical problems of poor identification efficiency and identification precision of identifying entity relation among the entities in the prior art.
Optionally, in the embodiment of the application, the target joint extraction model is used for extracting the entity and the entity relationship at one time, so that the association relationship of the entity and the entity relationship can be reasonably integrated.
The embodiment of the application provides a method for identifying entity relationships, which is essentially a method for carrying out the joint extraction of entities and entity relationships based on a BERT joint extraction model.
It should be noted that, in the embodiment of the application, the joint extraction model based on BERT is adopted, and the overlapping extraction of multiple relation entities is realized by constructing the composite relation feature, so that the problem of identifying the entity relation of multiple entities can be effectively solved, and meanwhile, the compression of the data characteristic tensor is realized by adopting a triplet coding mode aiming at the sparsification of the input tensor. In addition, the embodiment of the application trains by utilizing the TensorFlow framework of the deep learning framework of Google during model training, and TensorFlow is an industrial deep learning framework, is stable and reliable, and can obviously improve the model training speed.
An alternative framework of a joint extraction model in an embodiment of the present application is shown in fig. 2, where the joint extraction model includes: entity layer Entity, relation layer Relation, BERT coding layer BERT-ENCODER. The start position of the entity as shown in fig. 2 may be represented by start, the end position of the entity may be represented by end, the set relationship type may be represented by work, and if all 0's represent no work such relationship; the set relationship type may also be represented by loc, and if the value of the corresponding position is 1, the relationship type that the entity position has loc may be represented by the joint coding matrix shown in fig. 2, which may be the joint coding matrix of hn+vsub, that is, the result of entity prediction and the label.
Firstly, inputting a corpus text to be recognized, namely an original corpus text, then encoding words in the corpus text to be recognized through a BERT-based joint extraction model, encoding the words through an encoding layer of the BERT-based joint extraction model to obtain an encoded corpus text, inputting a joint encoding matrix, obtaining a label of an entity through the BERT-based joint extraction model, and then performing encoding extraction in a pointer form to obtain an entity relation.
The embodiment of the application can be applied to the identification scene of the character relationship in the public security stroke, mainly comprises the entity relationship among the characters, the organizations and the organizations, and can be used for rapidly extracting the character organization information in the stroke, namely the entity relationship, so that the purposes of simplifying the time for reading the stroke and improving the efficiency of the case can be achieved.
In an alternative embodiment, before acquiring the entity tag set in the corpus text to be identified, the method further includes:
step S202, obtaining an original corpus text;
step S204, labeling a plurality of entities contained in the original corpus text to obtain a labeling result, wherein the labeling result comprises: a plurality of entities and entity relationships between the entities;
step S206, the labeling result is used as a sample data set, and the sample data set is divided into a training set, a testing set and a verification set;
step S208, training the training model by using the training set and verifying the training result by using the verification set to obtain the target joint extraction model, wherein a symbol digital system TensorFlow based on data stream programming is used as a framework of the training model.
In an application scene in public security stroke analysis, firstly, a branch marking tool is utilized to mark the relation among entities in the stroke, then, training and verification are carried out by utilizing the data sets to obtain a target joint extraction model, then, testing is carried out by utilizing a testing set, and further, relation types with lower accuracy or higher accuracy are optimized, so that the accuracy of the model is improved, finally, a corpus text to be identified is input into the target joint extraction model for prediction, and triple information containing entity relations of a head entity, a tail entity and the head entity is output.
In the embodiment of the application, 500 inquiry strokes are acquired in an optional application example, and characters, organizations and relationship types are obtained as a sample data set by marking names, organization names, addresses and the like contained in the strokes. The stroke data are divided into three data sets of a training set, a testing set and a verification set, the training iteration times are 53734 when the model is trained, and optimization is carried out according to the loss value of each iteration after training is completed.
As an alternative embodiment, the following is a recognition result obtained by recognizing the corpus text to be recognized by using a trained target joint extraction model, where the corpus text to be recognized is shown in the following table 1, and the entity relationship obtained by recognition is shown in the following table 2:
TABLE 1
TABLE 2
Entity 1: wang Jianghua Entity 2: safety part Relationship type: work
Entity 1: wang Jianghua Entity 2: zhang He Relationship type: higher
Entity 1: safety part Entity 2: golden pond for martial arts Relationship type: higher
According to the method and the device, the optional embodiment of the application, hundreds of real stroke texts are adopted as training data quantity, and aiming at the condition that the same number of strokes is adopted, a plurality of data are needed to achieve training accuracy.
In an optional embodiment, determining whether the encoding result of each position in the corpus text to be identified is a target entity includes:
step S302, classifying the coding result of each position by adopting two full-connection layer classifiers to obtain a classification result;
step S304, judging whether the coding result is the target entity according to the classification result.
As an alternative embodiment, in the case that there are multiple entities in the sentence of the corpus text to be recognized, the start pointer and the end pointer in the coding layer are paired by using a rule of nearby matching.
As another alternative embodiment, the target joint extraction model is a multi-layer bi-directional transformer encoder BERT-based joint extraction model for pre-training depth bi-directional representations by jointly adjusting contexts in all layers.
Aiming at the technical problem of overlapping the current processing relationship, the embodiment of the application takes the label of the relationship as the serial number of the discrete label distributed to the entity pair, and the expression causes the relationship classification to be a machine learning problem, for example, when the same entity in the same context participates in a plurality of effective relationships (namely overlapping triples), a classifier needs a great deal of supervised learning to determine the corresponding relationship between the context and the relationship, and the embodiment of the application can learn the entity relationship class without a great deal of corpus.
As an alternative embodiment, the above BERT coding layer is coded as follows:
and (3) obtaining the complete set of all characters and the entity tag by reading text data, traversing the obtained complete set of data, and coding the obtained complete set of characters one by one according to the coding of BERT, wherein BERT is a new language representation model which represents the bi-directional coder representation of a transducer. Unlike other language representation models, BERT aims to pre-train a deep bi-directional representation by jointly adjusting the contexts in all layers.
A Named Entity Recognition (NER) module is used to identify all possible named entity objects by classifying the encoded result for each location with two classifiers to determine whether it is the beginning or ending location of the entity. As an alternative embodiment, it is determined whether each encoding result is a target entity by the following expression:
wherein y is j J-th word, W, output for coding layer in target joint extraction model start 、c start Head entity parameter W of full connection layer classifier end 、c end Is the tail entity parameter of the full connection layer classifier,for the coding result is the header entity,>the coding result is a tail entity.
As an alternative embodiment, the start pointer and the end pointer are paired by a rule of close matching for the case where there are a plurality of entities in the sentence of the text to be recognized.
In the Relational Classification (RC) module, for each entity, the subject word after it is predicted is required, and the main difference from the label of the entity is that: 1. the corresponding relation category of each relation is a group of independent topic classification models; 2. the input of the part is added with the characteristics of the entities besides the BERT coding result of the input sequence, each character of each named entity is coded by the characteristics of the BERT and is subjected to the average pooling operation, and the expression of the relation classification module is as follows:
wherein y is as defined above j For the output of the j-th word,head parameters representing full connection layer classifier, delta represents sign of activation function, ++>Tail parameter representing full connection layer classifier, < ->Representing the head-to-tail encoding of the relationship layer, v is the joint encoding of the output of the entity layer to the relationship layer, where the activation function of the relationship layer is the RELU function.
It should be noted that, the loss function of the joint extraction model is calculated according to the sum of the loss functions of the named entity and the relation, i.e. the two loss functions are added, and the calculation formula of the loss function is as follows: loss = (1-epsilon) loss (entity) +epsilon loss (tail) e ,rela)
Where loss is the total loss of the joint extraction model, loss (entity) is the loss of the entity, loss (tail e Rela) is a loss of a relationship, epsilon is a weight occupied by an entity or a relationship, epsilon is a parameter of a loss function, and represents the proportion occupied by two tasks in the loss function respectively.
The model of the named entity and the relation is calculated respectively to cause error accumulation, so that the accuracy of the model is reduced.
In an alternative embodiment, each relationship category corresponding to the entity relationship is processed by using an independent set of topic classification models; each character in each named entity employs the features of BERT for encoding and average pooling operations.
As an alternative embodiment, after obtaining the target joint extraction model, the method further includes:
step S402, testing the target joint extraction model by adopting the test set to obtain a test result;
step S404, determining and judging the accuracy of the entity relation according to the test result, and judging whether the accuracy is smaller than a preset accuracy threshold;
step S406, if the judgment result is yes, performing optimization processing on the entity relationship type according to the ordering result of the accuracy rate until the accuracy rate is greater than or equal to the preset accuracy rate threshold value.
In the above-mentioned alternative embodiment of the present application, the preprocessing of data is required first, then the training of the model is performed, the public security stroke data used herein divides the known tag data (original corpus text) into three data sets, which are respectively a training set, a testing set and a verification set, the training set and the verification set are utilized to perform training and verification, and the testing set is utilized to perform the testing of the model; according to the embodiment of the application, the TensorFlow is used as a framework for training the model in the process of training the model, so that the accuracy of the category between the entities can be improved after training is finished, then the entity relationship type with the highest accuracy is optimized until the set threshold is reached, and then other categories are optimized, so that the accuracy of model identification can be effectively improved.
Example 2
According to an embodiment of the present application, there is further provided an embodiment of an apparatus for implementing the above method for identifying an entity relationship, and fig. 3 is a schematic structural diagram of an apparatus for identifying an entity relationship according to an embodiment of the present application, as shown in fig. 3, where the apparatus for identifying an entity relationship includes: an acquisition module 30, a processing module 32, a judgment module 34 and an output module 36, wherein:
the acquiring module 30 is configured to acquire an entity tag set in a corpus text to be identified; the processing module 32 is configured to perform coding processing on the entity tag set by using a coding layer in the target joint extraction model; the judging module 34 is configured to judge whether the coding result of each position in the corpus text to be identified is a target entity, so as to obtain a judging result, where the target entity is a head entity or a tail entity; the output module 36 is configured to output triplet information if the determination result is yes, where the triplet information includes: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
It should be noted that each of the above modules may be implemented by software or hardware, for example, in the latter case, it may be implemented by: the above modules may be located in the same processor; alternatively, the various modules described above may be located in different processors in any combination.
Here, the above-mentioned obtaining module 30, processing module 32, judging module 34 and outputting module 36 correspond to steps S102 to S108 in embodiment 1, and the above-mentioned modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in embodiment 1. It should be noted that the above modules may be run in a computer terminal as part of the apparatus.
It should be noted that, the optional or preferred implementation manner of this embodiment may be referred to the related description in embodiment 1, and will not be repeated here.
The above-mentioned device for identifying entity relationships may further include a processor and a memory, where the above-mentioned obtaining module 30, processing module 32, judging module 34, output module 36, etc. are stored as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, the kernel fetches corresponding program units from the memory, and one or more of the kernels can be arranged. The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
According to an embodiment of the present application, there is also provided a storage medium embodiment. Optionally, in this embodiment, the storage medium includes a stored program, where when the program runs, the device where the storage medium is controlled to execute any one of the above methods for identifying entity relationships.
Alternatively, in this embodiment, the storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group, and the storage medium includes a stored program.
Optionally, the program controls the device in which the storage medium is located to perform the following functions when running: acquiring an entity tag set in a corpus text to be identified; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
According to an embodiment of the present application, there is also provided a processor embodiment. Optionally, in this embodiment, the processor is configured to run a program, where the program runs on the processor to perform any one of the above methods for identifying entity relationships.
The embodiment of the application provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program: acquiring an entity tag set in a corpus text to be identified; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: acquiring an entity tag set in a corpus text to be identified; adopting a coding layer in the target joint extraction model to code the entity tag set; judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity; if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, and the entity relationship between the head entity and the tail entity.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method of identifying entity relationships, comprising:
acquiring an entity tag set in a corpus text to be identified;
adopting a coding layer in a target joint extraction model to code the entity tag set;
judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity;
and if the judgment result is yes, outputting triplet information, wherein the triplet information comprises: the head entity, the tail entity, the entity relationship of the head entity and the tail entity;
the method for coding the entity tag set by adopting a coding layer in the target joint extraction model comprises the following steps: and coding the character sets of the entity tag set one by one.
2. The method according to claim 1, wherein determining whether the encoding result of each position in the corpus text to be identified is a target entity comprises:
classifying the coding result of each position by adopting two full-connection layer classifiers to obtain a classification result;
judging whether the coding result is the target entity according to the classification result.
3. The method according to claim 2, wherein in case there are a plurality of entities in the sentence of the corpus text to be recognized, the start pointer and the end pointer in the coding layer are paired using a rule of nearby matching.
4. The method of claim 1, wherein the target joint extraction model is a multi-layer bi-directional transformer encoder BERT-based joint extraction model for pre-training depth bi-directional representations by jointly adjusting contexts in all layers.
5. The method of claim 1, wherein each relationship category corresponding to the entity relationship is processed using an independent set of topic classification models; each character in each named entity employs the features of BERT for encoding and average pooling operations.
6. The method of claim 1, wherein prior to obtaining the set of entity tags in the corpus text to be identified, the method further comprises:
acquiring an original corpus text;
labeling a plurality of entities contained in the original corpus text to obtain a labeling result, wherein the labeling result comprises: a plurality of entities and entity relationships between the entities;
taking the labeling result as a sample data set, and dividing the sample data set into a training set, a testing set and a verification set;
training the training model by adopting the training set and verifying the training result by adopting the verification set to obtain the target joint extraction model, wherein a symbolic digital system TensorFlow based on data stream programming is adopted as a framework of the training model.
7. The method of claim 6, wherein after deriving the target joint extraction model, the method further comprises:
testing the target joint extraction model by adopting the test set to obtain a test result;
determining and judging the accuracy of the entity relation according to the test result, and judging whether the accuracy is smaller than a preset accuracy threshold;
and if the judgment result is yes, performing optimization processing on the entity relation type according to the ordering result of the accuracy rate until the accuracy rate is greater than or equal to the preset accuracy rate threshold value.
8. An apparatus for identifying relationships between entities, comprising:
the acquisition module is used for acquiring an entity tag set in the corpus text to be identified;
the processing module is used for carrying out coding processing on the entity tag set by adopting a coding layer in the target joint extraction model;
the judging module is used for judging whether the coding result of each position in the corpus text to be identified is a target entity or not to obtain a judging result, wherein the target entity is a head entity or a tail entity;
the output module is used for outputting triplet information if the judging result is yes, wherein the triplet information comprises: the head entity, the tail entity, the entity relationship of the head entity and the tail entity;
the processing module is further configured to code the character sets of the entity tag set one by one.
9. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform the method of identifying entity relationships according to any one of claims 1 to 7.
10. A processor for executing a program stored in a memory, wherein the program is executed to perform the method of identifying entity relationships of any one of claims 1 to 7.
CN202010443143.5A 2020-05-22 2020-05-22 Method and device for identifying entity relationship Active CN111476023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010443143.5A CN111476023B (en) 2020-05-22 2020-05-22 Method and device for identifying entity relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010443143.5A CN111476023B (en) 2020-05-22 2020-05-22 Method and device for identifying entity relationship

Publications (2)

Publication Number Publication Date
CN111476023A CN111476023A (en) 2020-07-31
CN111476023B true CN111476023B (en) 2023-09-01

Family

ID=71760402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010443143.5A Active CN111476023B (en) 2020-05-22 2020-05-22 Method and device for identifying entity relationship

Country Status (1)

Country Link
CN (1) CN111476023B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111931503B (en) * 2020-08-04 2024-01-26 腾讯科技(深圳)有限公司 Information extraction method and device, equipment and computer readable storage medium
CN112183023A (en) * 2020-09-28 2021-01-05 云知声智能科技股份有限公司 Multi-relation extraction method and terminal
CN112948536A (en) * 2020-11-09 2021-06-11 袭明科技(广东)有限公司 Information extraction method and device for web resume page
CN112837765B (en) * 2021-01-12 2023-01-20 山东众阳健康科技集团有限公司 Automatic coding method and system for disease diagnosis
CN112883736A (en) * 2021-02-22 2021-06-01 零氪科技(北京)有限公司 Medical entity relationship extraction method and device
CN112989788A (en) * 2021-03-12 2021-06-18 平安科技(深圳)有限公司 Method, device, equipment and medium for extracting relation triples
CN113420120B (en) * 2021-06-24 2024-05-31 平安科技(深圳)有限公司 Training method, extraction method, equipment and medium for key information extraction model
CN113886529B (en) * 2021-10-22 2022-12-02 苏州空天信息研究院 Information extraction method and system for network security field
CN114330323B (en) * 2022-03-08 2022-06-28 成都数联云算科技有限公司 Entity relationship joint extraction method and device, computer terminal and storage medium
CN117494688B (en) * 2023-12-29 2024-03-29 深圳智能思创科技有限公司 Form information extraction method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108536679A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 Name entity recognition method, device, equipment and computer readable storage medium
CN109063159A (en) * 2018-08-13 2018-12-21 桂林电子科技大学 A kind of entity relation extraction method neural network based
CN109492113A (en) * 2018-11-05 2019-03-19 扬州大学 Entity and relation combined extraction method for software defect knowledge
CN109739983A (en) * 2018-12-23 2019-05-10 北京明朝万达科技股份有限公司 Identify the method, apparatus and computer-readable medium of public security notes character relation
CN109902145A (en) * 2019-01-18 2019-06-18 中国科学院信息工程研究所 A kind of entity relationship joint abstracting method and system based on attention mechanism
CN110196913A (en) * 2019-05-23 2019-09-03 北京邮电大学 Multiple entity relationship joint abstracting method and device based on text generation formula
CN110781683A (en) * 2019-11-04 2020-02-11 河海大学 Entity relation joint extraction method
CN110795543A (en) * 2019-09-03 2020-02-14 腾讯科技(深圳)有限公司 Unstructured data extraction method and device based on deep learning and storage medium
CN110851575A (en) * 2019-09-23 2020-02-28 上海深芯智能科技有限公司 Dialogue generating system and dialogue realizing method
CN111079431A (en) * 2019-10-31 2020-04-28 北京航天云路有限公司 Entity relation joint extraction method based on transfer learning
CN111177393A (en) * 2020-01-02 2020-05-19 广东博智林机器人有限公司 Knowledge graph construction method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9836453B2 (en) * 2015-08-27 2017-12-05 Conduent Business Services, Llc Document-specific gazetteers for named entity recognition
CN109165385B (en) * 2018-08-29 2022-08-09 中国人民解放军国防科技大学 Multi-triple extraction method based on entity relationship joint extraction model

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108536679A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 Name entity recognition method, device, equipment and computer readable storage medium
CN109063159A (en) * 2018-08-13 2018-12-21 桂林电子科技大学 A kind of entity relation extraction method neural network based
CN109492113A (en) * 2018-11-05 2019-03-19 扬州大学 Entity and relation combined extraction method for software defect knowledge
WO2020093761A1 (en) * 2018-11-05 2020-05-14 扬州大学 Entity and relationship joint extraction method oriented to software bug knowledge
CN109739983A (en) * 2018-12-23 2019-05-10 北京明朝万达科技股份有限公司 Identify the method, apparatus and computer-readable medium of public security notes character relation
CN109902145A (en) * 2019-01-18 2019-06-18 中国科学院信息工程研究所 A kind of entity relationship joint abstracting method and system based on attention mechanism
CN110196913A (en) * 2019-05-23 2019-09-03 北京邮电大学 Multiple entity relationship joint abstracting method and device based on text generation formula
CN110795543A (en) * 2019-09-03 2020-02-14 腾讯科技(深圳)有限公司 Unstructured data extraction method and device based on deep learning and storage medium
CN110851575A (en) * 2019-09-23 2020-02-28 上海深芯智能科技有限公司 Dialogue generating system and dialogue realizing method
CN111079431A (en) * 2019-10-31 2020-04-28 北京航天云路有限公司 Entity relation joint extraction method based on transfer learning
CN110781683A (en) * 2019-11-04 2020-02-11 河海大学 Entity relation joint extraction method
CN111177393A (en) * 2020-01-02 2020-05-19 广东博智林机器人有限公司 Knowledge graph construction method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于强化学习的实体关系联合抽取模型;陈佳沣;《计算机应用》;全文 *

Also Published As

Publication number Publication date
CN111476023A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
CN111476023B (en) Method and device for identifying entity relationship
CN111897908B (en) Event extraction method and system integrating dependency information and pre-training language model
CN111625641B (en) Dialog intention recognition method and system based on multi-dimensional semantic interaction representation model
CN111159407B (en) Method, apparatus, device and medium for training entity recognition and relation classification model
CN111259142A (en) Specific target emotion classification method based on attention coding and graph convolution network
CN109992664B (en) Dispute focus label classification method and device, computer equipment and storage medium
CN112487812B (en) Nested entity identification method and system based on boundary identification
CN108549658A (en) A kind of deep learning video answering method and system based on the upper attention mechanism of syntactic analysis tree
CN111046670B (en) Entity and relationship combined extraction method based on drug case legal documents
CN109918681B (en) Chinese character-pinyin-based fusion problem semantic matching method
CN110046356B (en) Label-embedded microblog text emotion multi-label classification method
CN111460142B (en) Short text classification method and system based on self-attention convolutional neural network
CN112699686B (en) Semantic understanding method, device, equipment and medium based on task type dialogue system
CN110909144A (en) Question-answer dialogue method and device, electronic equipment and computer readable storage medium
CN111695053A (en) Sequence labeling method, data processing device and readable storage medium
CN116343190B (en) Natural scene character recognition method, system, equipment and storage medium
CN114528835A (en) Semi-supervised specialized term extraction method, medium and equipment based on interval discrimination
CN113239690A (en) Chinese text intention identification method based on integration of Bert and fully-connected neural network
CN113704396A (en) Short text classification method, device, equipment and storage medium
CN114428860A (en) Pre-hospital emergency case text recognition method and device, terminal and storage medium
CN113157913A (en) Ethical behavior discrimination method based on social news data set
CN115859989A (en) Entity identification method and system based on remote supervision
CN115994220A (en) Contact net text data defect identification method and device based on semantic mining
CN115357711A (en) Aspect level emotion analysis method and device, electronic equipment and storage medium
CN114398482A (en) Dictionary construction method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant