CN113609846B - Method and device for extracting entity relationship in statement - Google Patents

Method and device for extracting entity relationship in statement Download PDF

Info

Publication number
CN113609846B
CN113609846B CN202110902057.0A CN202110902057A CN113609846B CN 113609846 B CN113609846 B CN 113609846B CN 202110902057 A CN202110902057 A CN 202110902057A CN 113609846 B CN113609846 B CN 113609846B
Authority
CN
China
Prior art keywords
feature vector
target
entities
dependency
syntactic
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
CN202110902057.0A
Other languages
Chinese (zh)
Other versions
CN113609846A (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.)
Xian Jiaotong University
Capital Normal University
Original Assignee
Xian Jiaotong University
Capital Normal University
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 Xian Jiaotong University, Capital Normal University filed Critical Xian Jiaotong University
Priority to CN202110902057.0A priority Critical patent/CN113609846B/en
Publication of CN113609846A publication Critical patent/CN113609846A/en
Application granted granted Critical
Publication of CN113609846B publication Critical patent/CN113609846B/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/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

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

Abstract

The application provides a method and a device for extracting entity relations in sentences, wherein the method for extracting the entity relations comprises the following steps: acquiring a first feature vector sequence of a target sentence containing multiple word embedding features; generating a semantic feature vector for representing semantic information of the target sentence and a syntactic dependency feature vector for representing dependency relations between entities in the target sentence based on the first feature vector sequence of the target sentence; splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities; and determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector. By the method and the device, the characteristics of the target sentence can be fully extracted, so that the dependency of the relation extraction process on the word list is relieved, and the accuracy of the relation extraction result is improved.

Description

Method and device for extracting entity relationship in statement
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for extracting an entity relationship in a statement.
Background
With the rapid development of networks and informatization, new threats and attacks present a development trend of persistence and expansion, of which Advanced Persistent Attack (APT) is a typical representative. The APT attack puts in special trojan (commonly called as trojan) to the target computer to achieve the purposes of stealing national confidential information, business information of important enterprises, destroying network infrastructure and the like. Security companies release massive threat intelligence every day, and most of the threat intelligence is presented in characters, and attack relations cannot be displayed intuitively. The threat intelligence report mainly describes what tools the threat organization uses to attack a certain industry in a certain country by what means, what manner the security team detects the defense, etc. The APT report presented in the text mode is not beneficial for the security operator to quickly sense the abnormality, so that the efficiency of the security operator to know the latest attack event is extremely low. The final result is that although there is a lot of threat information, most of the threat information is not processed and summarized in time, so that the potential safety hazard to the country and enterprises is very large.
And information extraction can convert unstructured threat intelligence text into structured data, wherein relationship extraction is an important task in information extraction. The threat information relation extraction lays a solid foundation for further network security mining analysis and defense deployment, and has good practical application value and theoretical significance in the aspect of network security defense. At present, the threat information relationship extraction task mainly has the following problems: 1) The length of the sentence of the threat intelligence text is longer, the quantity of tokens or characters contained in the sentence in the threat intelligence relationship data set is far larger than that of the general field data set, and the sentence characteristics are difficult to extract fully and effectively; 2) Because the threat intelligence text contains information in professional fields such as file hash, encryption algorithm, defense measures and the like, the relation extraction process has strong dependence on the known word list, so that the relation extraction result has limitation.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for extracting an entity relationship in a statement, which can fully extract features of a target statement to alleviate dependency of a relationship extraction process on a vocabulary, and present a relationship between entities in a form of probability distribution to improve accuracy of a relationship extraction result.
The embodiment of the application provides an extraction method of entity relations in sentences, which comprises the following steps:
acquiring a first feature vector sequence of a target sentence containing multiple word embedding features;
generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement;
splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities;
and determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector.
Further, the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; the obtaining of the first feature vector sequence of the target sentence including the multiple word embedding features includes:
performing word segmentation processing on the target sentence to obtain a plurality of words corresponding to the target sentence;
for each word segmentation, splicing one or more word embedding features corresponding to the word segmentation to obtain a first feature vector of the word segmentation;
and generating a first feature vector sequence of the target sentence containing multiple word embedding features based on the obtained first feature vector of the word segmentation.
Further, the generating a semantic feature vector characterizing semantic information of the target sentence based on the first feature vector sequence of the target sentence includes:
obtaining semantic information of the target sentence through a trained semantic feature conversion model based on the first feature vector sequence of the target sentence;
and inputting the semantic information of the target sentence into the trained multilayer perceptron to obtain the semantic feature vector of the target sentence.
Further, the generating a syntactic dependency feature vector characterizing dependency relationships between entities in the target sentence based on the first feature vector sequence of the target sentence includes:
generating a second feature vector containing the participle of a context layer based on the first feature vector of the participle aiming at each participle in the target sentence;
constructing a syntactic dependency graph of the target sentence, which takes the participles as nodes and the dependency relationship between the participles as edges, based on the generated second feature vectors of the participles;
identifying entity nodes from the nodes of the syntactic dependency graph of the target statement; the entity node is a node corresponding to a participle containing an entity label;
for any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target statement based on the syntactic dependency graph of the target statement;
and generating a syntactic dependency characteristic vector for characterizing the dependency relationship between the entities based on the syntactic dependency graph between the entities.
Further, the generating a second feature vector containing the word segmentation of the context layer based on the first feature vector of the word segmentation includes:
acquiring an upper hidden layer state vector of the word segmentation based on the first feature vector of the word segmentation and a trained forward long-and-short term memory network;
obtaining a state vector of a lower hidden layer of the word segmentation based on the first feature vector of the word segmentation and a trained backward long-and-short term memory network;
and splicing the state vector of the upper hidden layer and the state vector of the lower hidden layer to generate a second feature vector of the participle.
Further, the extracting, based on the syntactic dependency graph of the target sentence, the syntactic dependency graph between the entities that characterize the dependency relationship between the entities in the target sentence includes:
identifying an action word node from nodes of the syntactic dependency graph of the target sentence based on the syntactic dependency graph of the target sentence; the verb node is a node corresponding to a participle with a part-of-speech tag as a verb;
identifying a shortest dependency path between entity nodes passing through at least one verb node and an associated node of a node on the shortest dependency path between the entity nodes from the syntactic dependency graph of the target sentence;
and obtaining a syntactic dependency graph representing the dependency relationship between the entities based on the shortest dependency path between the entities and the associated node.
Further, generating a syntactic dependency feature vector characterizing dependency relationships between entities based on the syntactic dependency graph between the entities, includes:
based on the syntactic dependency graph among the entities, taking the nodes in the syntactic dependency graph among the entities as target nodes;
for each target node, determining an adjacent node adjacent to the target node;
determining a third feature vector of the target node representing the dependency relationship between the target node and the adjacent node according to the second feature vectors of the target node and the adjacent node;
splicing the third feature vectors of the target nodes to determine syntax splicing vectors representing the dependency relationship among the entities;
and generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic stitching vector and the trained multilayer perceptron.
The embodiment of the present application further provides an extraction device for entity relationships in statements, where the extraction device includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first feature vector sequence of a target statement containing multiple word embedding features;
a generating module, configured to generate, based on the first feature vector sequence of the target sentence, a semantic feature vector that characterizes semantic information of the target sentence and a syntax dependent feature vector that characterizes a dependency relationship between entities in the target sentence;
the splicing module is used for splicing the semantic feature vector and the syntactic dependency feature vector to obtain a relation feature vector representing the relation between the entities;
and the determining module is used for determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector.
Further, the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; the obtaining module, when obtaining a first feature vector sequence of a target sentence containing multiple word embedding features, is configured to:
performing word segmentation processing on the target sentence to obtain a plurality of word segments corresponding to the target sentence;
for each word segmentation, splicing one or more word embedding features corresponding to the word segmentation to obtain a first feature vector of the word segmentation;
and generating a first feature vector sequence of the target sentence containing multiple word embedding features based on the obtained first feature vector of the word segmentation.
Further, when the generating module generates a semantic feature vector that characterizes semantic information of the target sentence based on the first feature vector sequence of the target sentence, the generating module is configured to:
obtaining semantic information of the target sentence through a trained semantic feature conversion model based on the first feature vector sequence of the target sentence;
and inputting the semantic information of the target sentence into the trained multilayer perceptron to obtain the semantic feature vector of the target sentence.
Further, when generating a syntactic dependency feature vector characterizing dependency relationships between entities in the target sentence based on the first sequence of feature vectors of the target sentence, the generation module is configured to:
generating a second feature vector containing the participle of a context layer based on the first feature vector of the participle for each participle in the target sentence;
constructing a syntactic dependency graph of the target sentence, which takes the participles as nodes and takes the dependency relationship among the participles as edges, based on the generated second feature vectors of the participles;
identifying entity nodes from nodes of a syntactic dependency graph of the target statement; the entity node is a node corresponding to a participle containing an entity label;
for any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target statement based on the syntactic dependency graph of the target statement;
and generating a syntactic dependency characteristic vector for characterizing the dependency relationship between the entities based on the syntactic dependency graph between the entities.
Further, when the generating module generates a second feature vector containing the word segmentation of the context layer based on the first feature vector of the word segmentation, the generating module is configured to:
acquiring an upper hidden layer state vector of the participle based on the first feature vector of the participle and a trained forward long-time and short-time memory network;
obtaining a state vector of a lower hidden layer of the participle based on the first feature vector of the participle and a trained backward long-and-short time memory network;
and splicing the state vector of the upper hidden layer and the state vector of the lower hidden layer to generate a second feature vector of the participle.
Further, when extracting a syntactic dependency graph between entities characterizing dependency relationships between entities in the target sentence based on the syntactic dependency graph of the target sentence, the generating module is configured to:
identifying verb nodes from the nodes of the syntactic dependency graph of the target sentence based on the syntactic dependency graph of the target sentence; the verb node is a node corresponding to a participle with a part-of-speech tag as a verb;
identifying a shortest dependency path between entity nodes passing through at least one verb node and associated nodes of nodes on the shortest dependency path between the entity nodes from the syntactic dependency graph of the target statement;
and obtaining a syntactic dependency graph representing the dependency relationship between the entities based on the shortest dependency path between the entities and the associated node.
Further, when generating a syntactic dependency feature vector characterizing dependency relationships between entities based on the syntactic dependency graph between the entities, the generation module is configured to:
based on the syntactic dependency graphs among the entities, taking the nodes in the syntactic dependency graphs among the entities as target nodes;
for each target node, determining an adjacent node adjacent to the target node;
determining a third feature vector of the target node representing the dependency relationship between the target node and the adjacent node according to the second feature vectors of the target node and the adjacent node;
splicing the third feature vectors of the target nodes to determine syntax splicing vectors representing the dependency relationship between the entities;
and generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic splicing vector and the trained multilayer perceptron.
An embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate with each other through the bus, and when the processor executes the machine-readable instructions, the processor executes the steps of the method for extracting entity relations in the statement.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the step of the method for extracting entity relationships in statements as described above is executed.
According to the method and the device for extracting the entity relationship in the sentence, the first feature vector sequence of the target sentence containing the embedding features of various words is obtained; the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement; splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities; and determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector. The characteristics of the target sentences can be fully extracted to relieve the dependency of the relation extraction process on the word list, and the relation between the entities is presented in a probability distribution mode to improve the accuracy of the relation extraction result.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a flowchart illustrating a method for extracting an entity relationship in a statement according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a step of generating syntactic dependency feature vectors characterizing dependencies between entities in a target sentence, provided by an embodiment of the present application;
FIG. 3a is a diagram illustrating a syntactic dependency graph of a target sentence provided by an embodiment of the present application;
FIG. 3b illustrates a diagram of a syntactic dependency graph between entities as provided by an embodiment of the present application;
FIG. 4 is a schematic structural diagram illustrating an apparatus for extracting entity relationships in statements according to an embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. Every other embodiment that can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present application falls within the protection scope of the present application.
First, an application scenario to which the present application is applicable will be described. The method and the device can be applied to the relation extraction process between entities in the threat intelligence text.
Research shows that with the rapid development of networks and informatization, new threats and attacks show a continuous and expanded development trend, wherein Advanced sustainable Attack (APT) is a typical representative. The APT attack puts in special trojan (commonly known as trojan) to the target computer to achieve the purposes of stealing national confidential information, business information of important enterprises, destroying network infrastructure and the like. Security companies release a great deal of threat intelligence every day, and most of the threat intelligence is presented in words and cannot visually display attack relations. Threat intelligence reports mainly describe what tools a threat organization uses to attack a certain industry in a certain country in what way, what way a security team detects defenses, etc. The APT report presented in the text mode is not beneficial for the security operator to quickly sense the abnormality, so that the efficiency of the security operator to know the latest attack event is extremely low. The final result is that although there is a lot of threat information, most of them are not processed and summarized in time, thus causing great potential safety hazard to countries and enterprises.
And information extraction can convert unstructured threat intelligence text into structured data, wherein relationship extraction is an important task in information extraction. The threat information relation extraction lays a solid foundation for further network security mining analysis and defense deployment, and has good practical application value and theoretical significance in the aspect of network security defense. At present, the threat information relationship extraction task mainly has the following problems: 1) The sentence length of the threat intelligence text is longer, the number of tokens or characters contained in the sentences in the threat intelligence relationship data set is far larger than that of the general field data set, and the sentence characteristics are difficult to extract fully and effectively; 2) Because the threat intelligence text contains information in professional fields such as file hash, encryption algorithm, defense measures and the like, the relation extraction process has strong dependence on the known word list, so that the relation extraction result has limitation.
Based on this, the embodiment of the application provides an extraction method of entity relationships in statements, which can fully extract features of a target statement to relieve dependency of a relationship extraction process on a word list, and present relationships among entities in a probability distribution manner to improve accuracy of a relationship extraction result.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for extracting entity relationships in statements according to an embodiment of the present disclosure. As shown in fig. 1, the method for extracting an entity relationship in a statement provided in the embodiment of the present application includes:
step S101, a first feature vector sequence of a target sentence containing multiple word embedding features is obtained.
In the step, sentence division processing is firstly carried out on the threat intelligence text to obtain a plurality of target sentences, and for each target sentence, the relation between entities in the target sentence can be extracted. Here, a target sentence is expressed by using a plurality of word embedding features together to obtain a first feature vector sequence of the target sentence. In specific implementation, the first feature vector sequence of the target sentence containing the embedded features of the plurality of words can be obtained through the following steps:
step 1011, performing word segmentation processing on the target sentence to obtain a plurality of words corresponding to the target sentence.
In this step, a space may be used to separate words, symbols, and characters in the target sentence, so as to obtain a plurality of segmented words corresponding to the target sentence.
Step 1012, for each word segmentation, splicing one or more word embedding features corresponding to the word segmentation to obtain a first feature vector of the word segmentation.
In this step, word embedding characteristics corresponding to the word segmentation are firstly obtained, wherein the word embedding characteristics include at least one of the following: word vectors, word sense vectors, part-of-speech tags, and entity tags. Here, the word vector may be a pre-trained 300-dimensional word vector; the word sense vector can be obtained through a pre-trained BERT model; in addition, because the part of speech of the participle has important meaning in the relation extraction, the part of speech label corresponding to the participle can be used for expressing the participle; further, for the participles identified as entities in the participles, the entity labels are used for expressing the participles, so that the extraction of the relationship between the entities can be carried out more efficiently; and then, splicing the word embedding characteristics of the word segmentation to obtain a first characteristic vector of the word segmentation.
As an example, for each participle, the participle first feature vector t can be obtained by the following equation n
t n =G n +B n +P n +E n
Wherein n is the nth participle in the target sentence, G n A word vector of the participle, B n A word sense vector, P, for the participle n Part-of-speech tags for the participles, E n An entity label for the word segmentation.
And 1013, generating a first feature vector sequence of the target sentence, which contains multiple word embedding features, based on the obtained first feature vector of the participle.
In this step, the first feature vectors of the participles are sequenced according to the sequence of the participles in the target sentence to obtain a first feature vector sequence of the target sentence, specifically, the first feature vector sequence S of the target sentence may be represented by the following equation;
S={t 1 ,t 2 ,…,t n }。
step S102, generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement.
In this step, a semantic feature vector and a syntax dependent feature vector are respectively generated based on a first feature vector sequence of the target sentence, where the semantic feature vector may characterize semantic information of the target sentence, and the syntax dependent feature vector may characterize a dependency relationship between entities in the target sentence. In particular implementation, the semantic feature vector for representing the semantic information of the target sentence can be generated by the following steps:
step 1021, obtaining semantic information of the target sentence through the trained semantic feature conversion model based on the first feature vector sequence of the target sentence.
In this step, the semantic feature conversion model may obtain semantic information of the target Sentence according to the first feature vector of each participle of the input target Sentence to alleviate dependency of the relationship extraction process on the vocabulary, specifically, the semantic feature conversion model may be a sequence-BERT model, which is a neural network model improved according to the BERT model, and it uses a binary group or triple network structure to derive Sentence features of the target Sentence, and uses cosine similarity to compare the Sentence features, and finally obtains the semantic information of the target Sentence.
And 1022, inputting the semantic information of the target sentence into the trained multilayer perceptron to obtain the semantic feature vector of the target sentence.
In the step, the multilayer perceptron is trained in advance, and a plurality of input data sets can be mapped to a single output data set, namely, the semantic information of the target sentence is input into the multilayer perceptron, and the semantic feature vector of the target sentence can be obtained.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of generating syntactic dependency feature vectors characterizing dependencies between entities in a target sentence according to another embodiment of the present application. As shown in fig. 2, the step of generating a syntactic dependency feature vector characterizing a dependency relationship between entities in a target sentence provided by an embodiment of the present application includes:
step S201, for each participle in the target sentence, based on the first feature vector of the participle, generating a second feature vector including the participle in the context layer.
In the step, the first feature vector of each participle in the target sentence is used as input and input to a trained bidirectional long-time memory network, so that a second feature vector sequence comprising a context layer is obtained. In a specific implementation, the second feature vector containing the word segmentation of the context layer may be generated by:
and 2011, acquiring an upper hidden layer state vector of the participle based on the first feature vector of the participle and a trained forward long-and-short term memory network.
In this step, a first feature vector based on the word segmentation and a trained forward long-short term memory network LSTM fw The above hidden layer state vector of the participle is obtained by the following equation
Figure BDA0003200292160000131
Figure BDA0003200292160000132
Step 2012, based on the first feature vector of the participle and the trained backward long-and-short term memory network, obtaining a state vector of a hidden layer below the participle.
In the step, a first feature vector based on the word segmentation and a trained backward long-and-short time memory network LSTM bw The underlying hidden layer state vector for the participle is obtained by the following equation
Figure BDA0003200292160000133
Figure BDA0003200292160000134
And 2013, splicing the state vector of the upper hidden layer and the state vector of the lower hidden layer to generate a second feature vector of the word segmentation.
In this step, the hidden layer state vector above and the hidden layer state vector below the participle are spliced to obtain a second feature vector l of the participle shown in the following equation n
Figure BDA0003200292160000135
Step S202, constructing a syntactic dependency graph of the target sentence, wherein the syntactic dependency graph takes the participles as nodes and the dependency relationship among the participles as edges, based on the generated second feature vectors of the participles.
In the step, based on the second feature vector of the participle in the target sentence, the target sentence is subjected to dependency analysis to obtain a dependency relationship between two participles, each participle is used as a node, the dependency relationship between the participles is used as an edge, and the syntax dependency graph of the target sentence is obtained. As an example, FIG. 3a is a syntactic dependency graph of a target sentence, in FIG. 3a, using N 1 、N 2 、……、N 15 Marking nodes corresponding to each participle in the target sentence, marking verb nodes by V, and marking nodes by E 1 、E 2 And marking entity nodes, wherein the syntactic dependency graph can represent the dependency relationship among all participles in the target sentence.
Step S203, identifying entity nodes from the nodes of the syntax dependence graph of the target statement; the entity node is a node corresponding to the participle containing the entity label.
In this step, the method for extracting a relationship of a target sentence mainly extracts a relationship between entities in the target sentence, and then, the entities in the target sentence need to be identified, specifically, when the word embedding feature of the participle includes an entity tag, the participle is determined to be an entity, and then, a node corresponding to the participle is determined to be an entity node. As an example, in FIG. 3a, node N will be 9 、N 12 Identified as entity nodes and respectively marked as E 1 、E 2
Step S204, aiming at any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target sentence based on the syntactic dependency graph of the target sentence.
In this step, since the syntactic dependency graph of the target sentence further includes nodes that are not involved in extracting the relationship between the entities, it is necessary to extract the syntactic dependency graph between the entities from the syntactic dependency graph of the target sentence, so as to improve the data processing efficiency. In specific implementation, a syntactic dependency graph between entities representing dependency relationships between entities in the target sentence can be extracted through the following steps:
step 2041, identifying an action word node from nodes of the syntactic dependency graph of the target sentence based on the syntactic dependency graph of the target sentence; the verb node is a node corresponding to a participle with a part-of-speech tag as a verb.
In this step, since verbs have an important role in determining relationships between entities, a syntactic dependency graph between entities may be extracted based on entity nodes and verb nodes, specifically, when a part-of-speech tag of a word embedding feature of the participle is a verb, it is determined that the part-of-speech of the participle is a verb, and then a node corresponding to the participle is determined as a verb node. As an example, in FIG. 3a, node N will be 1 、N 5 And N 7 And identifying the verb node as a verb node, and marking the verb node as V.
Step 2042, identifying at least a shortest dependency path between entity nodes passing through a verb node and an associated node of a node on the shortest dependency path between the entity nodes from the syntactic dependency graph of the target sentence.
In this step, based on a syntactic dependency graph of a target statement, a shortest dependency path between entity nodes is identified first, then a node on the shortest dependency path is determined, and a node that hops from a node K on the shortest dependency path is used as its associated node, where K may be 1 or another value, and the applicant does not make any limitation here. By way of example, entity node N in FIG. 3a 9 And a physical node N 12 The nodes on the shortest dependent path therebetween include: n is a radical of 9 、N 5 、N 2 、N 1 、N 4 、N 7 And N 12 And the associated node of the node K hop on the shortest dependent path comprises the following steps: n is a radical of 13 、N 8 、N 3 、N 14 And N 15
Step 2043, based on the shortest dependency path between the entities and the associated node, a syntactic dependency graph between the entities characterizing the dependency relationship between the entities is obtained.
In this step, the edges connected to the verb nodes are given higher weight than other edges to represent the important role of the relationship extraction process between entities. As an example, FIG. 3b is a syntactic dependency graph between entities, and in FIG. 3b, the bold displayed edge is the shortest dependency path between entities, and will be with verb node N 1 、N 5 And N 7 The connected edge is given a weight 2 times that of the other edges and the edge is marked accordingly.
And S205, generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic dependency graph between the entities.
In the step, a syntactic dependency feature vector for representing the dependency relationship between the entities is generated based on the syntactic dependency graph between the entities through a graph convolution neural network. In particular implementation, syntactic dependency feature vectors characterizing dependencies between entities may be generated by:
and step 2051, based on the syntactic dependency graph among the entities, taking the nodes in the syntactic dependency graph among the entities as target nodes.
In the step, a node included in a syntactic dependency graph between entities is taken as a target node, wherein the node can be an entity node, a verb node or an association node; for each target node.
And step 2052, for each target node, determining an adjacent node adjacent to the target node.
In this step, an adjacent node adjacent to the target node is determined according to a syntactic dependency graph between entities.
And step 2053, determining a third feature vector of the target node, which represents the dependency relationship between the target node and the adjacent node, according to the second feature vectors of the target node and the adjacent node.
In the step, the hidden eigenvector of the target node is retrieved and updated according to the second eigenvector of the adjacent node, and after multi-layer updating, a third eigenvector capable of representing the dependency relationship between the target nodes is obtained. As an example, the hidden feature vector of the target node at the l-th layer can be obtained by the following equation
Figure BDA0003200292160000161
Figure BDA0003200292160000162
Where V is the target node, N (V) is the set of neighbor nodes for the target node, including V itself, W and b are the weights corresponding to the edges connected to the target node,
Figure BDA0003200292160000163
is the hidden feature vector of the target node at layer l-1.
Further, after l layers of updating, a third feature vector of the target node is obtained.
And step 2054, splicing the third feature vectors of the target nodes to determine a syntactic splicing vector representing the dependency relationship between the entities.
In this step, the third eigenvectors of the target node are spliced to generate a third eigenvector sequence S G ={g 1 ,g 2 ,…,g m M is a third eigenvector updated by l layers, the third eigenvector sequence can represent the dependency relationship between the entities, the third eigenvector sequence is input into the maximum pooling function, and a plurality of output vectors are mapped into a syntax splicing vector G by the following equation sent
G sent =f(S G )。
And step 2055, generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic stitching vector and the trained multilayer perceptron.
In the step, a third feature splicing vector, a head entity feature vector and a tail entity feature vector are input into a multi-layer perceptron MLP trained in advance, and a syntax dependence feature vector h is obtained through the following equation dependency
h dependency =MLP([G sent ;E head ;E tail ])。
And S103, splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities.
In the step, the semantic feature vector and the syntactic dependency feature vector are spliced to obtain a relation feature vector representing the relation between the entities, and then the relation feature vector carries both the semantic information of the target statement and the dependency relation between the entities, so that the characteristics of the target statement can be fully reflected.
And S104, determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector.
In the step, the relation extraction problem is regarded as a multi-classification problem, relation categories among a plurality of entities can be preset aiming at the field of threat information, and the probability that the relation feature vector is the relation category is obtained aiming at the relation category among each entity through a normalized index function.
According to the method for extracting the entity relationship in the sentence, a first feature vector sequence of a target sentence containing various word embedding features is obtained; the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement; splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities; and determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector. Compared with the prior art, the method and the device have the advantages that the characteristics of the target sentence can be fully extracted, so that the dependency of the relation extraction process on the word list is relieved, the relation among the entities is presented in a probability distribution mode, and the accuracy of the relation extraction result is improved.
Based on the same inventive concept, the embodiment of the present application further provides a device for extracting an entity relationship in a sentence, which corresponds to the method for extracting an entity relationship in a sentence.
Please refer to fig. 4, fig. 4 is a schematic structural diagram of an apparatus for extracting entity relationships in statements according to an embodiment of the present disclosure. As shown in fig. 4, the extracting apparatus 400 for extracting entity relationships in the sentence includes:
an obtaining module 401, configured to obtain a first feature vector sequence of a target sentence including multiple word embedding features;
a generating module 402, configured to generate, based on the first feature vector sequence of the target sentence, a semantic feature vector that characterizes semantic information of the target sentence and a syntactic dependency feature vector that characterizes a dependency relationship between entities in the target sentence;
a splicing module 403, configured to splice the semantic feature vector and the syntax dependent feature vector to obtain a relationship feature vector representing a relationship between entities;
a determining module 404, configured to determine a probability distribution of the relationship between the entities based on the preset relationship category between the entities and the relationship feature vector.
Further, the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; when the obtaining module 401 obtains the first feature vector sequence of the target sentence including the multiple word embedding features, the obtaining module 401 is configured to:
performing word segmentation processing on the target sentence to obtain a plurality of word segments corresponding to the target sentence;
for each word segmentation, splicing one or more word embedding features corresponding to the word segmentation to obtain a first feature vector of the word segmentation;
and generating a first feature vector sequence of the target sentence containing various word embedding features based on the obtained first feature vector of the participle.
Further, when the generating module 402 generates a semantic feature vector characterizing semantic information of the target sentence based on the first feature vector sequence of the target sentence, the generating module 402 is configured to:
obtaining semantic information of the target sentence through a trained semantic feature conversion model based on the first feature vector sequence of the target sentence;
and inputting the semantic information of the target sentence into the trained multilayer perceptron to obtain the semantic feature vector of the target sentence.
Further, when the generating module 402 generates a syntactic dependency feature vector characterizing a dependency relationship between entities in the target sentence based on the first feature vector sequence of the target sentence, the generating module 402 is configured to:
generating a second feature vector containing the participle of a context layer based on the first feature vector of the participle aiming at each participle in the target sentence;
constructing a syntactic dependency graph of the target sentence, which takes the participles as nodes and takes the dependency relationship among the participles as edges, based on the generated second feature vectors of the participles;
identifying entity nodes from the nodes of the syntactic dependency graph of the target statement; the entity node is a node corresponding to the participle containing the entity label;
for any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target statement based on the syntactic dependency graph of the target statement;
and generating a syntactic dependency characteristic vector for characterizing the dependency relationship between the entities based on the syntactic dependency graph between the entities.
Further, when the generating module 402 generates a second feature vector containing the word segmentation of the context layer based on the first feature vector of the word segmentation, the generating module 402 is configured to:
acquiring an upper hidden layer state vector of the participle based on the first feature vector of the participle and a trained forward long-time and short-time memory network;
obtaining a state vector of a lower hidden layer of the participle based on the first feature vector of the participle and a trained backward long-and-short time memory network;
and splicing the state vector of the upper hidden layer and the state vector of the lower hidden layer to generate a second feature vector of the participle.
Further, when the generating module 402 extracts a syntactic dependency graph between entities characterizing dependency relationships between entities in the target sentence based on the syntactic dependency graph of the target sentence, the generating module 402 is configured to:
identifying verb nodes from the nodes of the syntactic dependency graph of the target sentence based on the syntactic dependency graph of the target sentence; the verb node is a node corresponding to a participle with a part-of-speech tag as a verb;
identifying a shortest dependency path between entity nodes passing through at least one verb node and an associated node of a node on the shortest dependency path between the entity nodes from the syntactic dependency graph of the target sentence;
and obtaining a syntactic dependency graph representing the dependency relationship between the entities based on the shortest dependency path between the entities and the associated node.
Further, when the generating module 402 generates a syntactic dependency feature vector characterizing a dependency relationship between entities based on the syntactic dependency graph between the entities, the generating module 402 is configured to:
based on the syntactic dependency graphs among the entities, taking the nodes in the syntactic dependency graphs among the entities as target nodes;
for each target node, determining an adjacent node adjacent to the target node;
determining a third feature vector of the target node representing the dependency relationship between the target node and the adjacent node according to the second feature vectors of the target node and the adjacent node;
splicing the third feature vectors of the target nodes to determine syntax splicing vectors representing the dependency relationship between the entities;
and generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic stitching vector and the trained multilayer perceptron.
The method for extracting the entity relationship in the sentence, provided by the embodiment of the application, comprises the steps of obtaining a first feature vector sequence of a target sentence containing a plurality of word embedding features; the word embedding features include at least one of: word vectors, word sense vectors, part-of-speech tags, and entity tags; generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement; splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities; and determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector. Compared with the prior art, the method and the device have the advantages that the characteristics of the target sentence can be fully extracted, the dependency of the relation extraction process on the word list is relieved, the relation among the entities is presented in a probability distribution mode, and the accuracy of the relation extraction result is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 500 includes a processor 501, a memory 502, and a bus 503.
The memory 502 stores machine-readable instructions executable by the processor 501, when the electronic device 500 runs, the processor 501 and the memory 502 communicate through the bus 503, and when the machine-readable instructions are executed by the processor 501, the steps of the method for extracting entity relationships in statements in the method embodiments shown in fig. 1 and fig. 2 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the step of the method for extracting entity relationships in statements in the method embodiments shown in fig. 1 and fig. 2 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
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 position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present application and are intended to be covered by the appended claims. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A method for extracting entity relations in sentences is characterized in that the method comprises the following steps:
acquiring a first feature vector sequence of a target sentence containing multiple word embedding features; the word embedding features include: word vectors, word sense vectors, part-of-speech tags, and entity tags;
generating a semantic feature vector for representing semantic information of the target statement and a syntactic dependency feature vector for representing dependency relationship between entities in the target statement based on the first feature vector sequence of the target statement;
splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities;
determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector;
the generating, based on the first feature vector sequence of the target sentence, a semantic feature vector characterizing semantic information of the target sentence and a syntactic dependency feature vector characterizing dependency relationships between entities in the target sentence includes:
for each participle in the target sentence, inputting a first feature vector of the participle into a trained bidirectional long-time memory network, and generating a second feature vector containing the participle of a context layer;
constructing a syntactic dependency graph of the target sentence, which takes the participles as nodes and the dependency relationship between the participles as edges, based on the generated second feature vectors of the participles;
identifying entity nodes from nodes of a syntactic dependency graph of the target statement; the entity node is a node corresponding to the participle containing the entity label;
for any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target statement based on the syntactic dependency graph of the target statement;
generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic dependency graph between the entities;
generating a syntactic dependency feature vector characterizing dependency relationships between entities based on the syntactic dependency graph between the entities, the syntactic dependency feature vector comprising:
based on the syntactic dependency graph among the entities, taking the nodes in the syntactic dependency graph among the entities as target nodes;
for each target node, determining an adjacent node adjacent to the target node;
searching and updating the hidden feature vector of the target node according to the second feature vector of the adjacent node, and obtaining a third feature vector representing the dependency relationship between the target nodes after multi-layer updating;
splicing the third eigenvectors of the target nodes to generate a third eigenvector sequence S G ={g 1 ,g 2 ,…,g m M is a third feature vector updated by l layers, and the third feature vector sequence can represent the dependency relationship between the entities;
inputting the third feature vector sequence into a maximal pooling function, and outputting a plurality of outputs by the following equationVector mapping to a syntactic splice vector G sent
G sent =f(S G )
Generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic stitching vector and the trained multilayer perceptron;
the retrieving and updating the hidden eigenvector of the target node according to the second eigenvector of the adjacent node, and obtaining a third eigenvector representing the dependency relationship between the target nodes after multi-layer updating, includes:
obtaining the hidden feature vector of the target node at the l-th layer through the following equation
Figure FDA0003748600030000021
Figure FDA0003748600030000022
Where V is the target node, N (V) is the set of neighbor nodes for the target node, including V itself, W and b are the weights corresponding to the edges connected to the target node,
Figure FDA0003748600030000031
is the hidden feature vector of the target node at the l-1 level;
after l layers of updating, obtaining a third feature vector of the target node;
generating a syntactic dependency feature vector representing dependency relationships between entities based on the syntactic stitching vector and the trained multilayer perceptron, comprising:
inputting the syntax splicing vector, the head entity feature vector and the tail entity feature vector into a pre-trained multilayer perceptron MLP, and obtaining a syntax dependence feature vector h through the following equation dependency
h dependency =MLP([G sent ;E head ;E tail ])。
2. The method of claim 1, wherein obtaining a first feature vector sequence of a target sentence having a plurality of word-embedded features comprises:
performing word segmentation processing on the target sentence to obtain a plurality of words corresponding to the target sentence;
for each word segmentation, splicing one or more word embedding features corresponding to the word segmentation to obtain a first feature vector of the word segmentation;
and generating a first feature vector sequence of the target sentence containing multiple word embedding features based on the obtained first feature vector of the word segmentation.
3. The method of claim 1, wherein generating a semantic feature vector that characterizes semantic information of the target sentence based on the first sequence of feature vectors of the target sentence comprises:
obtaining semantic information of the target sentence through a trained semantic feature conversion model based on the first feature vector sequence of the target sentence;
and inputting the semantic information of the target sentence into the trained multilayer perceptron to obtain the semantic feature vector of the target sentence.
4. The method of claim 1, wherein the inputting the first feature vector of the segmented word into a trained bidirectional long-time memory network to generate a second feature vector of the segmented word including a context layer comprises:
acquiring an upper hidden layer state vector of the word segmentation based on the first feature vector of the word segmentation and a trained forward long-and-short term memory network;
obtaining a state vector of a lower hidden layer of the word segmentation based on the first feature vector of the word segmentation and a trained backward long-and-short term memory network;
and splicing the state vector of the upper hidden layer and the state vector of the lower hidden layer to generate a second feature vector of the participle.
5. The method according to claim 1, wherein extracting a syntactic dependency graph between entities characterizing dependency relationships between entities in the target sentence based on the syntactic dependency graph of the target sentence comprises:
identifying verb nodes from the nodes of the syntactic dependency graph of the target sentence based on the syntactic dependency graph of the target sentence; the verb node is a node corresponding to a participle with a part-of-speech tag as a verb;
identifying a shortest dependency path between entity nodes passing through at least one verb node and associated nodes of nodes on the shortest dependency path between the entity nodes from the syntactic dependency graph of the target statement;
and obtaining a syntactic dependency graph representing the dependency relationship between the entities based on the shortest dependency path between the entities and the associated node.
6. An apparatus for extracting entity relationships in sentences, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first feature vector sequence of a target statement containing multiple word embedding features; the word embedding features include: word vectors, word sense vectors, part-of-speech tags, and entity tags;
a generating module, configured to generate, based on the first feature vector sequence of the target sentence, a semantic feature vector that characterizes semantic information of the target sentence and a syntactic dependency feature vector that characterizes a dependency relationship between entities in the target sentence;
the splicing module is used for splicing the semantic feature vector and the syntax dependence feature vector to obtain a relation feature vector representing the relation between the entities;
the determining module is used for determining the probability distribution condition of the relationship between the entities based on the preset relationship category between the entities and the relationship characteristic vector;
the generating module, when configured to generate a semantic feature vector characterizing semantic information of the target sentence and a syntactic dependency feature vector characterizing dependency between entities in the target sentence based on the first sequence of feature vectors of the target sentence, is configured to:
aiming at each participle in the target sentence, inputting a first feature vector of the participle into a trained bidirectional long-short-term memory network to generate a second feature vector containing the participle of a context layer;
constructing a syntactic dependency graph of the target sentence, which takes the participles as nodes and takes the dependency relationship among the participles as edges, based on the generated second feature vectors of the participles;
identifying entity nodes from the nodes of the syntactic dependency graph of the target statement; the entity node is a node corresponding to the participle containing the entity label;
for any two entity nodes, extracting a syntactic dependency graph between entities representing the dependency relationship between the entities in the target statement based on the syntactic dependency graph of the target statement;
generating a syntactic dependency characteristic vector for representing the dependency relationship between the entities based on the syntactic dependency graph between the entities;
when the generation module is configured to generate syntactic dependency feature vectors characterizing dependencies between entities based on syntactic dependency graphs between the entities, the generation module is configured to:
based on the syntactic dependency graph among the entities, taking the nodes in the syntactic dependency graph among the entities as target nodes;
for each target node, determining an adjacent node adjacent to the target node;
retrieving and updating the hidden eigenvector of the target node according to the second eigenvector of the adjacent node, and obtaining a third eigenvector representing the dependency relationship between the target nodes after multi-layer updating;
splicing the third eigenvectors of the target nodes to generate a third eigenvector sequence S G ={g 1 ,g 2 ,…,g m } of whichIn m, m is a third feature vector updated by l layers, and the third feature vector sequence can represent the dependency relationship between the entities;
inputting the third sequence of feature vectors into a maximal pooling function, mapping a plurality of output vectors to a syntactical stitched vector G by the following equation sent
G sent =f(S G )
Generating a syntactic dependency characteristic vector representing the dependency relationship between the entities based on the syntactic splicing vector and the trained multilayer perceptron;
the generation module is configured to, when the generation module is configured to retrieve and update the hidden feature vector of the target node according to the second feature vector of the adjacent node, and obtain a third feature vector representing a dependency relationship between the target nodes after multi-layer update, the generation module is configured to:
obtaining the hidden feature vector of the target node at the l-th layer by the following equation
Figure FDA0003748600030000061
Figure FDA0003748600030000062
Where V is the target node, N (V) is the set of neighbor nodes for the target node, including V itself, W and b are the weights corresponding to the edges connected to the target node,
Figure FDA0003748600030000063
is the hidden feature vector of the target node at the l-1 level;
after l layers of updating, obtaining a third feature vector of the target node;
when the generating module is configured to generate a syntactic dependency feature vector characterizing dependency relationships between entities based on the syntactic stitching vector and the trained multi-layer perceptron, the generating module is configured to:
splicing the syntax into vector and head entity characterInputting the eigenvector and the tail entity eigenvector into a multi-layer perceptron (MLP) trained in advance, and obtaining a syntax dependence eigenvector h through the following equation dependency
h dependency =MLP([G sent ;E head ;E tail ])。
7. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions, when executed by the processor, performing the steps of the extraction method of any one of claims 1-5.
8. A computer-readable storage medium, having stored thereon a computer program for performing, when being executed by a processor, the steps of the extraction method according to any one of claims 1 to 5.
CN202110902057.0A 2021-08-06 2021-08-06 Method and device for extracting entity relationship in statement Active CN113609846B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110902057.0A CN113609846B (en) 2021-08-06 2021-08-06 Method and device for extracting entity relationship in statement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110902057.0A CN113609846B (en) 2021-08-06 2021-08-06 Method and device for extracting entity relationship in statement

Publications (2)

Publication Number Publication Date
CN113609846A CN113609846A (en) 2021-11-05
CN113609846B true CN113609846B (en) 2022-10-04

Family

ID=78307467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110902057.0A Active CN113609846B (en) 2021-08-06 2021-08-06 Method and device for extracting entity relationship in statement

Country Status (1)

Country Link
CN (1) CN113609846B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192537B (en) * 2023-04-27 2023-07-07 四川大学 APT attack report event extraction method, system and storage medium
CN117591547A (en) * 2024-01-18 2024-02-23 中昊芯英(杭州)科技有限公司 Database query method and device, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710932A (en) * 2018-12-22 2019-05-03 北京工业大学 A kind of medical bodies Relation extraction method based on Fusion Features
CN111291556A (en) * 2019-12-17 2020-06-16 东华大学 Chinese entity relation extraction method based on character and word feature fusion of entity meaning item
CN111985245A (en) * 2020-08-21 2020-11-24 江南大学 Attention cycle gating graph convolution network-based relation extraction method and system
CN112580328A (en) * 2020-12-11 2021-03-30 上海明略人工智能(集团)有限公司 Event information extraction method and device, storage medium and electronic equipment
CN113032571A (en) * 2021-04-19 2021-06-25 广东工业大学 Entity and relationship extraction method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106339412B (en) * 2016-08-12 2019-09-10 中国电子科技集团公司第二十八研究所 A kind of participant's Relation extraction method of Chinese International Politics event
US11281864B2 (en) * 2018-12-19 2022-03-22 Accenture Global Solutions Limited Dependency graph based natural language processing
CN111488734B (en) * 2020-04-14 2022-02-22 西安交通大学 Emotional feature representation learning system and method based on global interaction and syntactic dependency
CN112016312B (en) * 2020-09-08 2023-08-29 平安科技(深圳)有限公司 Data relation extraction method and device, electronic equipment and storage medium
CN112307170A (en) * 2020-10-29 2021-02-02 首都师范大学 Relation extraction model training method, relation extraction method, device and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710932A (en) * 2018-12-22 2019-05-03 北京工业大学 A kind of medical bodies Relation extraction method based on Fusion Features
CN111291556A (en) * 2019-12-17 2020-06-16 东华大学 Chinese entity relation extraction method based on character and word feature fusion of entity meaning item
CN111985245A (en) * 2020-08-21 2020-11-24 江南大学 Attention cycle gating graph convolution network-based relation extraction method and system
CN112580328A (en) * 2020-12-11 2021-03-30 上海明略人工智能(集团)有限公司 Event information extraction method and device, storage medium and electronic equipment
CN113032571A (en) * 2021-04-19 2021-06-25 广东工业大学 Entity and relationship extraction method

Also Published As

Publication number Publication date
CN113609846A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
Nguyen et al. Relation extraction: Perspective from convolutional neural networks
US11544578B2 (en) Method, device and equipment for fusing different instances describing same entity
US10430610B2 (en) Adaptive data obfuscation
EP2728508B1 (en) Dynamic data masking
US20190258648A1 (en) Generating asset level classifications using machine learning
Nguyen et al. Joint learning of local and global features for entity linking via neural networks
CN113609846B (en) Method and device for extracting entity relationship in statement
US11373065B2 (en) Dictionary based deduplication of training set samples for machine learning based computer threat analysis
US11494559B2 (en) Hybrid in-domain and out-of-domain document processing for non-vocabulary tokens of electronic documents
CN109983464B (en) Detecting malicious scripts
CN111931935B (en) Network security knowledge extraction method and device based on One-shot learning
US8386489B2 (en) Applying formal concept analysis to validate expanded concept types
US11507747B2 (en) Hybrid in-domain and out-of-domain document processing for non-vocabulary tokens of electronic documents
CN112052451A (en) Webshell detection method and device
Wu et al. A semi‐supervised active learning algorithm for information extraction from textual data
Trieu et al. Document sensitivity classification for data leakage prevention with twitter-based document embedding and query expansion
Dong et al. Adversarial attack and defense on natural language processing in deep learning: A survey and perspective
US20170132210A1 (en) Method and system for providing semantics based technical support
Martínez et al. Efficient model similarity estimation with robust hashing
JP6777612B2 (en) Systems and methods to prevent data loss in computer systems
CN112099870A (en) Document processing method and device, electronic equipment and computer readable storage medium
Hai et al. An efficient classification of malware behavior using deep neural network
CN115344563B (en) Data deduplication method and device, storage medium and electronic equipment
Eykholt et al. {URET}: Universal Robustness Evaluation Toolkit (for Evasion)
US11868768B2 (en) Detecting secrets in source code

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