CN113191118A - Text relation extraction method based on sequence labeling - Google Patents

Text relation extraction method based on sequence labeling Download PDF

Info

Publication number
CN113191118A
CN113191118A CN202110501103.6A CN202110501103A CN113191118A CN 113191118 A CN113191118 A CN 113191118A CN 202110501103 A CN202110501103 A CN 202110501103A CN 113191118 A CN113191118 A CN 113191118A
Authority
CN
China
Prior art keywords
word
entity
sequence
vector
pair
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.)
Granted
Application number
CN202110501103.6A
Other languages
Chinese (zh)
Other versions
CN113191118B (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.)
Shandong Computer Science Center National Super Computing Center in Jinan
Original Assignee
Shandong Computer Science Center National Super Computing Center in Jinan
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 Shandong Computer Science Center National Super Computing Center in Jinan filed Critical Shandong Computer Science Center National Super Computing Center in Jinan
Priority to CN202110501103.6A priority Critical patent/CN113191118B/en
Publication of CN113191118A publication Critical patent/CN113191118A/en
Application granted granted Critical
Publication of CN113191118B publication Critical patent/CN113191118B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/117Tagging; Marking up; Designating a block; Setting of attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to the technical field of data processing, in particular to a text relation extraction method based on sequence labeling, which comprises the steps of constructing a training data set similar to prediction data, and presetting all possible bidirectional entity relations and three fixed dependency relations; segmenting an input sentence into a word sequence, and inputting the word sequence into a pre-training model to obtain an expression vector of a word in each sentence; forming a unique word pair sequence by using a handshake-like mode on the word vector sequence; inputting the obtained vector pair sequence into a neural network classification layer; calculating loss and performing back propagation; judging the category of each word pair, and judging whether the word pair has a corresponding relation of the position; and decoding the final result by using the pseudo code shown in the figure according to the corresponding relation, and finally obtaining all the extracted triples. The invention can simultaneously complete two tasks: entity identification and relationship classification. The extraction accuracy and the recall rate are obviously improved, and the extraction method has great improvement.

Description

Text relation extraction method based on sequence labeling
Technical Field
The invention relates to the technical field of data processing, in particular to a text relation extraction method based on sequence labeling.
Background
The triple relation is a knowledge representation mode capable of being stored in a structured mode, is widely applied to the field of natural language understanding, and plays a great role. In the field of natural language text, a piece of text knowledge can always be represented by one or more triples. Then the structured triple relationship is extracted from one or more pieces of text, i.e., the knowledge represented by the discrete text is converted into a form that can be understood or stored by a machine, a task referred to as relationship extraction.
Relationship extraction methods, ranging from early statistical methods to recent neural network methods, have evolved over the years, with relationship extraction tasks ranging from simple single relationship extraction to overlapping relationship extraction. The single relation extraction means that only one ternary relation exists in one text, and the overlapping relation extraction means that a plurality of ternary relations exist in one text and overlap exists. Overlapping relationships are divided into entity overlapping and single entity overlapping, and in order to better explain the overlapping relationships, fig. 1 shows three relationship types.
In the conventional method, there are three disadvantages: 1) some relation extraction methods regard the relation extraction task as a relation classification task, that is, entities already labeled in a given text classify the relation between the entities, and this method is not suitable for practical applications. 2) Some methods simplify the problem of relation extraction, only solve the problem of single relation extraction, and do not consider the actual situation; in fact, multiple relationship extraction is the most common problem in our practical application. 3) The method of the stream-through method divides the relationship extraction task into two separate tasks, namely an entity identification task and a relationship classification task, does not consider the correlation between the two tasks, and causes the problem of exposure deviation, namely when a final result is generated in a certain sequence, the result of the next step is influenced by the result of the previous step.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a text relation extraction method based on sequence labeling, which can simultaneously complete two tasks: entity identification and relationship classification.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a text relation extraction method based on sequence labeling comprises the following steps:
step 1, presetting all possible entity relation types and establishing a relation set R;
step 2, constructing a training data set suitable for the business field, wherein the entity relationship in the training data must include all preset relationship types;
step 3, expanding a relation set R, and presetting all possible bidirectional entity relations to obtain a data set R';
step 4, constructing a dependency relationship set R for the tripless
Step 5, segmenting the input sentence into word sequences, and inputting the word sequences into a pre-training model to obtain a set of expression vectors of words in each sentence
Figure BDA0003056534350000021
Wherein d is the dimension of the hidden layer vector represented by the preset hyper-parameter, hiIs a word vector;
step 6, forming a unique word pair sequence for the word vector sequence H obtained in the step 5, and doubly traversing the word sequence to form a word vector pair;
step 7, constructing a training target for the word pairs generated in step 6, for each word pair (W)i,Wj) J ≧ i construct a 0-valued vector of length 2r +3
Figure BDA0003056534350000022
(target vector), where R is the number of relationships in the relationship set R;
step 8, inputting the word vector pair sequence obtained in the step 6 into a neural network classification layer, and finally classifying and outputting the number of classes to be 2r + 3; the classification layer function is as follows:
Figure BDA0003056534350000031
Figure BDA0003056534350000032
Figure BDA0003056534350000033
wherein h isi∈H,hj∈H,[hi;hj]In order to perform the vector splicing operation,
Figure BDA0003056534350000034
the intermediate vector obtained by the Post-Norm function is the spliced vector,
Figure BDA0003056534350000035
is composed of
Figure BDA0003056534350000036
The vector after the linear transformation is carried out,
Figure BDA0003056534350000037
and
Figure BDA0003056534350000038
in order to be a parameter that can be trained,
Figure BDA0003056534350000039
and
Figure BDA00030565343500000310
is a deviation parameter;
step 9, training stage ri,jInputting a Circle Loss function, calculating Loss and performing back propagation;
step 10, predicting r in step 8i,jJudging, namely judging the category of each word pair; r isi,jEach position in the label list represents different labels, if the value of a certain position is greater than 0, the corresponding relation of the word pair at the position is judged, and if the value of the certain position is less than 0, the corresponding relation at the position is not obtained;
and step 11, decoding the final result by using a pseudo code according to the corresponding relation of each word pair obtained in the step 10, and finally obtaining all extracted triples.
Further, in step 3, the two-way entity relationship is a relationship with two different orientations, i.e. a forward orientation relationship, a directional orientation relationship and a reverse orientation relationship.
Further, in step 4, the dependency relationship set RsThere are three dependencies: head entity head to tail entity head, head entity tail to tail entity tail, entity head to entity tail.
Further, in step 5, the pre-training model is one of BERT, ALBERT, RoBERTa, ERNIE, XLNet, etc.
Further, in step 6, the traversal process is as follows: each word vector and the word vectors (including itself) behind it form a word vector pair, and the word sequence is traversed to obtain the final word vector pair
Figure BDA0003056534350000041
And (4) pairing word vectors, wherein n is the number of the word vectors.
Further, in step 9, the loss function is as follows:
Figure BDA0003056534350000042
wherein the content of the first and second substances,
Figure BDA0003056534350000043
and
Figure BDA0003056534350000044
the prediction scores are respectively positive and negative examples, L and K are respectively a positive example set and a negative example set, L is a Circle Loss value, and e is a base number of a natural logarithm function.
Further, in step 11, the pseudo code is as shown in fig. 3.
The invention has the technical effects that:
compared with the prior art, the text relation extraction method based on the sequence labeling can simultaneously complete two tasks: entity identification and relationship classification. Aiming at the problem of entity overlapping in a text, the invention designs a new labeling method which can solve the problem of overlapping of a plurality of entities. Also, in order to solve the exposure deviation, the labeling method of the present invention uses a joint extraction method, which can label the relationship between entities at the same time as labeling the entities. The method has the advantages that the extraction accuracy and the recall rate are remarkably improved, and the method is greatly improved.
Drawings
FIG. 1 is an exemplary diagram of an overlapping relationship according to the present invention;
FIG. 2 is a diagram of a model of the present invention;
FIG. 3 is a pseudo code diagram according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings of the specification.
Example 1:
the text relation extraction method based on sequence labeling comprises the following steps:
step 1, presetting all possible entity relationship types and establishing a relationship set R: and aiming at the business scene, determining key knowledge information in the field in an expert demonstration mode, or determining important attributes of business objects in the business scene. For example, in the medical field, the important attributes of attribute analysis for drugs include: the indications, the administration methods, the adverse reactions, the cautionary matters, etc., according to which four or more preset relationships of the medicine can be obtained and added to the relationship set R.
Step 2, constructing a training data set suitable for the business field: first, we define a complete piece of training data that must contain all the ternary relationships contained in the original sentence S and S that exist in the set of relationships R. Secondly, a section or a sentence of text is given, and the triples meeting the requirements are extracted to form training data through manual analysis and combination of the preset relation R. For example, the statement S is "A drug is indicated with B, C, D. ", three ternary relationships for S can be determined, including (A drug, indication of indication, B), (A drug, indication of indication, C), (A drug, indication of indication, D). Accordingly, an effective training sentence can be constructed.
And 3, expanding a relation set R (containing R relations in total), namely expanding each relation into two relations (forward and reverse) with different directions to obtain a data set R' containing 2R relations in total. For example, the relationship "indication" is to be expanded to two relationships "indication-positive" and "indication-negative". For both entities (A, B), the relationship pointed to by A to B is determined to be a forward relationship, and the relationship pointed to by B to A is a reverse relationship.
Step 4, constructing a dependency relationship set R for the triplessThere are three dependencies in common: head to head (starting entity head points to target entity head), tail to tail (starting entity tail points to target entity tail), head to tail (entity head points to target entity tail)Pointing to the end of the entity). Here, the starting entity refers to the previous entity in the triplet, i.e., the initiator of the relationship, and the target entity refers to the next entity in the triplet, i.e., the recipient of the relationship.
Step 5, segmenting the input sentence into word sequences, and inputting the word sequences into a BERT pre-training model to obtain a set of expression vectors of words in each sentence
Figure BDA0003056534350000061
Wherein d is the dimension of the hidden layer vector represented by the preset hyper-parameter, hiIs a word vector.
Step 6, forming a unique word pair sequence by using a handshake-like mode on the word vector sequence H obtained in the step 5That is, each word vector needs to "handshake" with the word vectors (including itself) following it to form a word vector pair, so that double-traversing the word sequence results in
Figure BDA0003056534350000062
For word vector pairs, wherein n is the number of word vectors;
step 7, constructing a training target for the word pairs generated in step 6, for each word pair (W)i,Wj) J ≧ i construct a 0-valued vector of length 2r +3
Figure BDA0003056534350000063
(target vector), where R is the number of relationships in the relationship set R. For relational triplets (E)1,Ri',E2),Ri'E.g. R', we define, Ej'[1]J' E (1,2) is an entity Ej'The first character of (E)j'[-1]J' E (1,2) is an entity Ej'V is the last character ofi,j[idx]Representing the value of the target vector idx position of the word pair. If W isi∈E1,Wj∈E2Then set vi,j[i']1 is ═ 1; if W isi=E1[1],Wj=E1[-1]Or Wi=E2[1],Wj=E2[-1]Then set vi,j[2r+3]1 is ═ 1; if it is notWi=E1[1],Wj=E2[1]Then set vi,j[2r+2]1 is ═ 1; if W isi=E1[-1],Wj=E2[-1]Then set vi,j[2r+1]=1。
And 8, inputting the word vector pair sequence obtained in the step 6 into a neural network classification layer, and finally classifying and outputting the number of classes to be 2r + 3. The classification layer function is as follows:
Figure BDA0003056534350000071
Figure BDA0003056534350000072
Figure BDA0003056534350000073
wherein h isi∈H,hj∈H,[hi;hj]In order to perform the vector splicing operation,
Figure BDA0003056534350000074
the intermediate vector obtained by the Post-Norm function is the spliced vector,
Figure BDA0003056534350000075
is composed of
Figure BDA0003056534350000076
The vector after the linear transformation is carried out,
Figure BDA0003056534350000077
and
Figure BDA0003056534350000078
in order to be a parameter that can be trained,
Figure BDA0003056534350000079
and
Figure BDA00030565343500000710
is a deviation parameter. In particular, the Post-Norm function is:
h′=Post-Norm(h)
=LayerNorm(DropOut(GELU(Wh+b))+h)
step 9, training stage ri,jAnd an object matrix vi,jMake a comparison according to vi,jWill r isi,jDivide into positive or negative cases and divide ri,jInputting a Circle Loss function, calculating Loss and performing back propagation; the loss function is as follows:
Figure BDA00030565343500000711
wherein the content of the first and second substances,
Figure BDA00030565343500000712
and
Figure BDA00030565343500000713
the prediction scores are respectively positive and negative examples, L and K are respectively a positive example set and a negative example set, L is a Circle Loss value, and e is a base number of a natural logarithm function.
Step 10, predicting r in step 8i,jJudging, namely judging the category of each word pair; r isi,jEach position in the label list represents different labels, if the value of a certain position is greater than 0, the corresponding relation of the word pair at the position is judged, and if the value of the certain position is less than 0, the corresponding relation at the position is not obtained;
and 11, decoding a final result by using the pseudo code shown in fig. 3 according to the corresponding relation of each word pair obtained in the step 10, and finally obtaining all extracted triples.
The pseudo code in FIG. 3: receiving a marked sequence S, a dictionary M for mapping the index of S to the index pair of the original sentence, and an original input sentence, and finally outputting a triple set. Line 1 of the code initializes a dependency containing a head-to-tailThe method comprises the steps of collecting a word index pair E of a relation, initializing a dictionary H which maps a bidirectional entity relation to a head-to-head word index pair on line 2 of a code, initializing a dictionary T which maps the bidirectional entity relation to a tail-to-tail word index pair on line 3 of the code, initializing a result collection R on line 4 of the code, establishing a dictionary which maps indexes to relation types on line 5 of the code, initializing the number R of the bidirectional entity relation on line 6 of the code, initializing indexes of three dependency relations in a target vector on line 7 of the code, traversing the whole annotation sequence S on lines 8-20 of the code, converting the indexes of the annotation sequence belonging to the head-to-tail relation into the head-to-tail word index pair of an original sentence through the dictionary M and adding the head-to-tail word index pair of the original sentence on line 9-11 of the code, traversing all bidirectional relations on lines 12-19 of the code, and mapping the word index pair belonging to the head-to-head word index pair contained in line 13-to-tail word index pair contained in line On the set of relationships, lines 16-18 of the code map the word index pairs belonging to the "tail-to-tail" relationship to the set of bi-directional relationships it contains, lines 21-38 of the code doubly traverse set E, lines 23-24 of the code define E [ i [ ]],E[j]For the head and tail word index pairs of an entity, line 25 of the code defines PhIs an entity E [ i ]]And E [ j ]]Represents a "head to head" relationship, and the code 26 line defines PtIs an entity E [ i ]]And E [ j ]]The tail word index pair of (1) represents a "tail-to-tail" relationship, with code line 27 defining H [ P ]h]For querying P in dictionary H by head word index pairhCorresponding two-way relationship, code line 28 defines T [ P ]t]For querying P in dictionary T by tail word index pairtCorresponding two-way relationship, code 29 lines set H [ P ]h]And set T [ P ]t]The intersection of the two sets of relationships results in a Set of relationshipsrLine 30-36 of code judges SetrAdding a triple into the Set R in a non-empty state, extracting an entity fragment from an original statement through a head-tail index of a starting entity in a code 31 line, extracting an entity fragment from an original statement through a head-tail index of a target entity in a code 32 line, and traversing the Set of relationship Set through the code 33-35 linesrAnd each predicted relationship is added to the final output result combination R, and the code 39 row returns the final result and ends the flow.
The entities are unified titles of objectively existing objects or concepts; the triple is a knowledge representation form existing in a form of (initial entity, relation, target entity); the entity head refers to the first character of the entity character fragment, for Chinese, refers to the first Chinese character of the entity word, and for English, refers to the first word of the entity word group; the entity tail refers to the last character of the entity character fragment, for Chinese, refers to the last Chinese character of the entity word, and for English, refers to the last word of the entity word group;
test example:
the model of the invention achieves the leading level in public data sets NYT and WEBNLG, both of which are English data sets, wherein the NYT data set is from a paper Modeling relationships and theoretical relationships with out LabeledText, which extracts triples on the new york time corpus by using a remote supervised learning method; the WEBNLG dataset is from a paper Creating training corppora for ng micro-planes, which uses text generation to generate a piece of text and matches a preset ternary relationship. The results of the experiment are shown in table 1.
Figure BDA0003056534350000091
TABLE 1 comparison of the method of this patent with other methods
Among them, the NoveTagging method is from the article "Joint Extraction of experiments and relations based on a novel Tagging scheme", the GraphRel method is from the article "Extraction of Relational efficiencies by an end-to-end neural model with copy mechanism", the OrderCopyRE method is from the article "Learning the Extraction order of multiple Relational efficiencies in a sensor with translation mechanism leaving", and the CasRel method is from the article "Heart Binary Tagging for translation Triple Extraction".
The calculation method of the F1 evaluation index is as follows:
Figure BDA0003056534350000101
the F1 index represents the overall level of prediction results and is a harmonic average of model accuracy and recall. As can be seen from Table 1, the method of the present invention achieves the best effect on both data sets, and can improve the key index F1 by 1-2% compared with the latest method, and the extraction accuracy and the recall rate are both significantly improved compared with other methods. The following three problems are solved well: 1) and simultaneously, the problems of entity extraction and relationship classification among entities are solved. 2) And correctly extracting the overlapped triples in the text. 3) The problem of exposure deviation is solved, and the accuracy of extraction is improved.
The above embodiments are only specific examples of the present invention, and the protection scope of the present invention includes but is not limited to the product forms and styles of the above embodiments, and any suitable changes or modifications made by those skilled in the art according to the claims of the present invention shall fall within the protection scope of the present invention.

Claims (7)

1. A text relation extraction method based on sequence labeling is characterized in that: the method comprises the following steps:
step 1, presetting all possible entity relation types and establishing a relation set R;
step 2, constructing a training data set suitable for the business field, wherein the entity relationship in the training data must include all preset relationship types;
step 3, expanding a relation set R, and presetting all possible bidirectional entity relations to obtain a data set R';
step 4, constructing a dependency relationship set R for the tripless
Step 5, segmenting the input sentence into word sequences, and inputting the word sequences into a pre-training model to obtain a set of expression vectors of words in each sentence
Figure FDA0003056534340000011
Wherein d is the dimension of the hidden layer vector represented by the preset hyper-parameter, hiIs a word vector;
step 6, forming a unique word pair sequence for the word vector sequence H obtained in the step 5, and doubly traversing the word sequence to form a word vector pair;
step 7, constructing a training target for the word pairs generated in step 6, for each word pair (W)i,Wj) J ≧ i construct a 0-valued vector of length 2r +3
Figure FDA0003056534340000012
(target vector), where R is the number of relationships in the relationship set R;
step 8, inputting the word vector pair sequence obtained in the step 6 into a neural network classification layer, and finally classifying and outputting the number of classes to be 2r + 3; the classification layer function is as follows:
Figure FDA0003056534340000013
Figure FDA0003056534340000014
Figure FDA0003056534340000015
wherein h isi∈H,hj∈H,[hi;hj]In order to perform the vector splicing operation,
Figure FDA0003056534340000016
the intermediate vector obtained by the Post-Norm function is the spliced vector,
Figure FDA0003056534340000017
is composed of
Figure FDA0003056534340000018
The vector after the linear transformation is carried out,
Figure FDA0003056534340000019
and
Figure FDA00030565343400000110
in order to be a parameter that can be trained,
Figure FDA00030565343400000111
and
Figure FDA00030565343400000112
is a deviation parameter;
step 9, training stage ri,jInputting a Circle Loss function, calculating Loss and performing back propagation;
step 10, predicting r in step 8i,jJudging, namely judging the category of each word pair; r isi,jEach position in the label list represents different labels, if the value of a certain position is greater than 0, the corresponding relation of the word pair at the position is judged, and if the value of the certain position is less than 0, the corresponding relation at the position is not obtained;
and step 11, decoding the final result by using a pseudo code according to the corresponding relation of each word pair obtained in the step 10, and finally obtaining all extracted triples.
2. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 3, the two-way entity relationship is a relationship of two different directions, namely a forward direction, a direction and a reverse direction.
3. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 4, the dependency relationship set RsThere are three dependencies: head entity head to tail entity head, head entity tail to tail entity tail, entity head to entity tail.
4. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 5, the pre-training model is one of BERT, ALBERT, RoBERTA, ERNIE, and XLNET.
5. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 6, the traversal process is as follows: each word vector and the word vectors (including itself) behind it form a word vector pair, and the word sequence is traversed to obtain the final word vector pair
Figure FDA0003056534340000021
And (4) pairing word vectors, wherein n is the number of the word vectors.
6. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 9, the loss function is as follows:
Figure FDA0003056534340000031
wherein the content of the first and second substances,
Figure FDA0003056534340000032
and
Figure FDA0003056534340000033
the prediction scores are respectively positive and negative examples, L and K are respectively a positive example set and a negative example set, L is a Circle Loss value, and e is a base number of a natural logarithm function.
7. The method of extracting text relations based on sequence labeling according to claim 1, wherein: in step 11, the pseudo code is as shown in fig. 3.
CN202110501103.6A 2021-05-08 2021-05-08 Text relation extraction method based on sequence annotation Active CN113191118B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110501103.6A CN113191118B (en) 2021-05-08 2021-05-08 Text relation extraction method based on sequence annotation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110501103.6A CN113191118B (en) 2021-05-08 2021-05-08 Text relation extraction method based on sequence annotation

Publications (2)

Publication Number Publication Date
CN113191118A true CN113191118A (en) 2021-07-30
CN113191118B CN113191118B (en) 2023-07-18

Family

ID=76984478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110501103.6A Active CN113191118B (en) 2021-05-08 2021-05-08 Text relation extraction method based on sequence annotation

Country Status (1)

Country Link
CN (1) CN113191118B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113792539A (en) * 2021-09-15 2021-12-14 平安科技(深圳)有限公司 Entity relation classification method and device based on artificial intelligence, electronic equipment and medium
CN115358341A (en) * 2022-08-30 2022-11-18 北京睿企信息科技有限公司 Relation model-based reference disambiguation training method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425065A (en) * 2007-10-31 2009-05-06 日电(中国)有限公司 Entity relation excavating method and device
CN103678316A (en) * 2012-08-31 2014-03-26 富士通株式会社 Entity relationship classifying device and entity relationship classifying method
CN106484675A (en) * 2016-09-29 2017-03-08 北京理工大学 Fusion distributed semantic and the character relation abstracting method of sentence justice feature
CN106649275A (en) * 2016-12-28 2017-05-10 成都数联铭品科技有限公司 Relation extraction method based on part-of-speech information and convolutional neural network
CN107133220A (en) * 2017-06-07 2017-09-05 东南大学 Name entity recognition method in a kind of Geography field
CN108280062A (en) * 2018-01-19 2018-07-13 北京邮电大学 Entity based on deep learning and entity-relationship recognition method and device
CN109408812A (en) * 2018-09-30 2019-03-01 北京工业大学 A method of the sequence labelling joint based on attention mechanism extracts entity relationship
CN111931506A (en) * 2020-05-22 2020-11-13 北京理工大学 Entity relationship extraction method based on graph information enhancement

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425065A (en) * 2007-10-31 2009-05-06 日电(中国)有限公司 Entity relation excavating method and device
CN103678316A (en) * 2012-08-31 2014-03-26 富士通株式会社 Entity relationship classifying device and entity relationship classifying method
CN106484675A (en) * 2016-09-29 2017-03-08 北京理工大学 Fusion distributed semantic and the character relation abstracting method of sentence justice feature
CN106649275A (en) * 2016-12-28 2017-05-10 成都数联铭品科技有限公司 Relation extraction method based on part-of-speech information and convolutional neural network
CN107133220A (en) * 2017-06-07 2017-09-05 东南大学 Name entity recognition method in a kind of Geography field
CN108280062A (en) * 2018-01-19 2018-07-13 北京邮电大学 Entity based on deep learning and entity-relationship recognition method and device
CN109408812A (en) * 2018-09-30 2019-03-01 北京工业大学 A method of the sequence labelling joint based on attention mechanism extracts entity relationship
CN111931506A (en) * 2020-05-22 2020-11-13 北京理工大学 Entity relationship extraction method based on graph information enhancement

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JACOB DEVLIN 等: "BERT:Pre-training of Deep Bidirectional Transformers for Language Understanding", 《ARXIV》, pages 1 - 16 *
TAKUMA KATO 等: "Embeddings of Label Components for Sequence Labeling: A Case Study of Fine-grained Named Entity Recognition", 《ARXIV》, pages 1 - 8 *
张建虎: "基于CNN和双向LSTM的中文分词于词性标注一体化模型", 《中国优秀硕士学位论文全文数据库》, pages 138 - 1265 *
陈河宏: "基于深度学习的在线医疗咨询文本命名实体识别", 《中国优秀硕士学位论文全文数据库》, pages 054 - 66 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113792539A (en) * 2021-09-15 2021-12-14 平安科技(深圳)有限公司 Entity relation classification method and device based on artificial intelligence, electronic equipment and medium
CN113792539B (en) * 2021-09-15 2024-02-20 平安科技(深圳)有限公司 Entity relationship classification method and device based on artificial intelligence, electronic equipment and medium
CN115358341A (en) * 2022-08-30 2022-11-18 北京睿企信息科技有限公司 Relation model-based reference disambiguation training method and system

Also Published As

Publication number Publication date
CN113191118B (en) 2023-07-18

Similar Documents

Publication Publication Date Title
CN110298037B (en) Convolutional neural network matching text recognition method based on enhanced attention mechanism
CN110162593B (en) Search result processing and similarity model training method and device
US20220309762A1 (en) Generating scene graphs from digital images using external knowledge and image reconstruction
CN108182295B (en) Enterprise knowledge graph attribute extraction method and system
CN108829722A (en) A kind of Dual-Attention relationship classification method and system of remote supervisory
Wilkinson et al. Neural Ctrl-F: segmentation-free query-by-string word spotting in handwritten manuscript collections
US11687716B2 (en) Machine-learning techniques for augmenting electronic documents with data-verification indicators
CN111753024A (en) Public safety field-oriented multi-source heterogeneous data entity alignment method
US20170075872A1 (en) Information analysis system
CN111222318B (en) Trigger word recognition method based on double-channel bidirectional LSTM-CRF network
CN110851176B (en) Clone code detection method capable of automatically constructing and utilizing pseudo-clone corpus
CN115438215B (en) Image-text bidirectional search and matching model training method, device, equipment and medium
CN113051914A (en) Enterprise hidden label extraction method and device based on multi-feature dynamic portrait
CN113191118A (en) Text relation extraction method based on sequence labeling
CN110188359B (en) Text entity extraction method
CN116484024A (en) Multi-level knowledge base construction method based on knowledge graph
CN111209362A (en) Address data analysis method based on deep learning
CN112347761B (en) BERT-based drug relation extraction method
CN113821635A (en) Text abstract generation method and system for financial field
CN114564563A (en) End-to-end entity relationship joint extraction method and system based on relationship decomposition
CN112148886A (en) Method and system for constructing content knowledge graph
CN110569355B (en) Viewpoint target extraction and target emotion classification combined method and system based on word blocks
CN114880427A (en) Model based on multi-level attention mechanism, event argument extraction method and system
CN113342950A (en) Answer selection method and system based on semantic union
CN113626584A (en) Automatic text abstract generation method, system, computer 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