A joint entity and relation extraction method for the education field
By using a joint extraction method of pre-trained XLNET language model and Mogrifier BiGRU neural network in the field of education combined with the MultiHead Attention mechanism, the error propagation and dependency problems in entity recognition and relationship extraction in the prior art are solved, and more efficient entities are achieved and relationship extraction effect.
Patent Information
- Application Number
- CN202011252896.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-11
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-11-11
AI Technical Summary
In the information extraction in the field of education, there are error propagation problems and ignorance of dependencies in the prior art in the information extraction of the field of education, resulting in poor performance.
The pre-trained XLNET language model and Mogrifier BiGRU neural network are used to combine the MultiHead Attention mechanism to process entity recognition and relationship classification through joint models, share the coding layer to alleviate error propagation, and label sequence allocation is performed through the CRF model and Viterbi algorithm.
It improves the accuracy of the extraction of entities and relationships, reduces the negative impact of polysemes on model performance, alleviates the dependence between entities and relational subtasks, and improves overall performance.
Smart Images

Figure CN112364654B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an entity and relationship joint extraction method for the education field, belonging to natural language processing technology. Background Art
[0002] With the rapid development of online learning in the field of education, the amount of online course data is growing exponentially. How to efficiently and accurately extract useful entity and relationship information from this data has become a research hotspot. In the past few decades, text mining and natural language processing (NLP) have made great progress; however, there is still a lot of room for improvement in information extraction technology in the field of education. Representative information extraction technologies in the field of online education include extracting specific types of course knowledge point entity information and the relationship between entities from the text information of online courses. The extracted information is used in various types of research. It is not only suitable for various NLP tasks (such as document classification and question-answering systems), but also plays an important role in personalized recommendations for online learning. Since entity recognition and relationship extraction are widely used in knowledge discovery and data mining analysis, the demand for this technology will continue to grow.
[0003] There are several main methods for entity recognition and relationship extraction, including dictionary-based, rule-based, machine learning-based, and deep learning-based methods. In the dictionary-based method, the terms in the dictionary are simply matched with the words in the target sequence for entity extraction. Although this method is simple, the continuous increase in the number of entities and the diversity of symbols in online course text data make extraction difficult. In the rule-based method, entity extraction often shows high performance when applied only to a specific field. In the machine learning-based method, various algorithms and statistical models are used for entity extraction. However, both rule-based and machine learning methods are highly dependent on feature engineering, which is not only labor-intensive and time-consuming, but also requires a lot of domain knowledge. Unlike previous methods, deep learning methods do not require heavy manual work to make features. Deep learning methods use neural networks to automatically extract the most representative features and achieve very good results.
[0004] In the existing research on named entity recognition and relation extraction, most scholars divide this process into two independent tasks, and solve the problem of entity and relation extraction in a pipeline manner. This type of method regards entity and relation extraction as two separate subtasks that are performed in sequence: named entity recognition (NER) and relation extraction (RE). Specifically, the named entities in the sentence are first extracted, and then the extracted named entities are paired in pairs, and finally the semantic relationship between the named entity pairs is identified. However, this type of method has two major drawbacks: the first is error propagation, the error of the named entity recognition module will be passed to the downstream relation extraction module, thereby affecting the performance of relation extraction; the second is that the dependency between the two subtasks is ignored. Summary of the invention
[0005] Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention provides a method for joint extraction of entities and relations in the field of education, which is used to solve the problem that the existing methods lack application in the field of education. At the same time, a pre-trained XLNET language model and an attention mechanism are used to obtain high-level feature embedding, and a joint model is used to simultaneously process entity recognition and relationship classification to alleviate the problem of error propagation.
[0006] Technical solution: To achieve the above purpose, the technical solution adopted by the present invention is:
[0007] A method for joint extraction of entities and relations in the field of education, comprising the following steps:
[0008] (1) Establish a named entity corpus of course knowledge points, which consists of text data containing course knowledge points;
[0009] (2) Distribute the preprocessed text data containing course knowledge points, take sentences as input, and obtain text pre-trained vectors through the XLNET language model (shuffled language model);
[0010] (3) Input the obtained text pre-training vector into the Mogrifier BiGRU neural network (deformable bidirectional gated recurrent neural network) for text feature extraction;
[0011] (4) The MultiHead Attention mechanism is introduced after the Mogrifier BiGRU neural network to capture the more important parts of the text features; the more important parts refer to the parts of the text features that can constitute knowledge entities;
[0012] (5) Combined with the CRF model (conditional random field model), the relationship between the named entities of the course knowledge points and the knowledge entities is obtained.
[0013] Specifically, in step (1), the text data in the course knowledge point named entity corpus is first annotated with the BIO annotation method (a standard method for converting a sequence into an original annotation), that is, the text data is divided into P categories, each category is a label, and the pth category is represented by label p, p = 1, 2, ..., P; then the relationship between knowledge entities is divided into Q types of relationships, and the qth relationship is represented by relationship q, q = 1, 2, ..., Q; then the text data is divided into a training set and a test set; in the BIO annotation method, B represents the beginning of a knowledge entity, I represents the rest of the knowledge entity, and O represents a non-knowledge entity.
[0014] Specifically, in step (2), the sentence input into the XLNET language model is represented as S = [s1, s2, ..., s N ], the text pre-training vector output by the XLNET language model is represented as X = [x1, x2, …, x N ]; where s i represents the i-th word that makes up the sentence S, x i For the word s i Representation vector, i=1,2,…,N.
[0015] Specifically, the Mogrifier BiGRU neural network is different from the traditional GRU network (supplemented Chinese explanation) in that it can enhance the context modeling ability of the overall model through pre-interaction; the Mogrifier BiGRU neural network includes a forward GRU network and a backward GRU network. The input and hidden layer output of the Mogrifier BiGRU neural network are X = [x1, x2, ..., x N ] and H=[h1,h2,…,h N ], the input and hidden layer output of the forward GRU network are and The input and hidden layer output of the backward GRU network are and
[0016] The superscript t and t-1 represent the time t and the time t-1. and Through two-way multi-round interaction
[0017] For the forward GRU network, the interaction process is as follows:
[0018] (a41) Yes and Interact and get
[0019] (a42) Yes and Interact and get
[0020] (a43) Yes and Interact and get
[0021] (a44) Yes and Interact and get
[0022] (a45)
[0023] For the backward GRU network, the interaction process is as follows:
[0024] (b41) Yes and Interact and get
[0025] (b42) Yes and Interact and get
[0026] (b43) Yes and Interact and get
[0027] (b44) Yes and Interact and get
[0028] (b45)
[0029] Where: σ is the logistic regression function, R 1 , R 2 , R 3 , R 4 is the model parameter; in order to reduce the number of parameters, R 1 , R 2 , R 3 , R 4 They are all designed as products of low-rank matrices.
[0030] Specifically, in step (4), the MultiHeadAttention mechanism is introduced after the Mogrifier BiGRU neural network to further capture the word s iThe contextual semantics of the sentence S is highlighted, and the significance of the keywords in the sentence S is assigned attention weights, using the MultiHead Attention mechanism as the attention layer. The difference between the MultiHead Attention mechanism and the traditional Attention mechanism is that the MultiHeadAttention mechanism can generate multiple different attention scores in parallel, and finally concatenate multiple attention scores as the final attention score, which can better capture the more important parts of the text features.
[0031] Specifically, the calculation process of the MultiHead Attention mechanism includes the following steps:
[0032] (41) X = [x1, x2, …, x N ]H=[h1,h2,…,h N ] is mapped into three vectors K, Q, and V;
[0033] (42) K, Q, and V correspond to the j-th attention head of the MultiHead Attention mechanism. in: are three global parameter matrices, d N represents the input dimension of the MultiHead Attention mechanism, D represents the total number of attention heads of the MultiHead Attention mechanism, and d k =d q =d v =d N / D;
[0034] (43) Calculate the value of the j-th head attention
[0035] (44) Concatenate the D attention values to get multi-head attention Where: W o is the weight matrix, and the element b in the i-th row and j-th column of B is ij Indicates word s i The weight on the jth attention head;
[0036] (45) Combined with the word s i The hidden state h i and the attention weight b ij Generate word s i Content vector
[0037] (46) The more important part of the text features captured by the MultiHead Attention mechanism after the Mogrifier BiGRU neural network is C = [c1, c2, ..., c N ].
[0038] Specifically, in step (5), the CRF model is used as the label scoring layer. The label score of each word under each label is first calculated using the CRF model, and then the Viterbi algorithm is applied to obtain the label sequence with the highest label score. Then, the relationship between the course knowledge point named entity and the knowledge entity is obtained through the relationship extraction layer.
[0039] More specifically, in step (5), the CRF model is used to calculate the word s i The label score under label p
[0040]
[0041] Where: the superscript (ner) indicates knowledge entity annotation recognition; V (ner) and U (ner) represents the weight matrix, b (ner) represents the bias matrix, V (ner) ∈R p×l , U (ner) ∈R l×2d , b (ner) ∈R l , l is the layer width of the CRF model, d is the number of hidden layer units of the Mogrifier BiGRU neural network; f(·) represents the nonlinear activation function;
[0042] Assign labels to all words in sentence S to get the label sequence of sentence S. Each sentence S has R = N P Calculate the label score of S under the rth label sequence:
[0043]
[0044] Where: Y r represents the rth label sequence, Y = [Y1, Y2, ..., Y R ],r=1,2,…,R, Represents the word s under the rth label sequence i The label score under the assigned label, A represents the label score of sentence S under the assigned label in the rth label sequence, (i,r),(i+1,r) Represents the word s under the rth label sequence i The assigned label is transferred to the word s i+1The transfer score on the , A represents the transfer matrix, A∈R (P+2)×(P+2) ; Because the start and end tags are considered when constructing the scoring layer, the dimension in the transfer process is 2 more than P;
[0045] Label score for label sequence Normalize and get the probability distribution of each label sequence:
[0046]
[0047] Apply the Viterbi algorithm to obtain the tag sequence with the highest tag score
[0048]
[0049] Among them: the label sequence with the highest label score Chinese: S i The assigned label is g i ;
[0050] The label score layer is trained using the method of minimizing the cross entropy loss.
[0051] More specifically, in step (5), when the relationship extraction layer is used to extract the relationship between the course knowledge point named entity and the knowledge entity, the word s under the given relationship q is first calculated. i and the word s j Relationship score between:
[0052] S (re) (m j ,m i ,q)=V (re) f(U (re) m j +W (re) m i +b (re) )
[0053] Where: m i =[c i ; g i ],m j =[c j ; g j ], the superscript (re) indicates relation identification, V (re) , U (re) and W (re) represents the weight matrix, b (r e) represents the bias matrix, V (re) ∈R l , U (re) ∈R l×(2a+d) , W (re) ∈R l×(2a+d) , b(re) ∈R l , l is the layer width of the relation extraction layer, d is the number of hidden layer units of the Mogrifier BiGRU neural network, a is the dimension of the label; f(·) represents the nonlinear activation function;
[0054] Word i and the word s j The probability distribution of the existence of a relationship q is:
[0055]
[0056] The relation extraction layer is trained using the cross entropy loss minimization method.
[0057] Specifically, the cross entropy loss L during the training process of the relationship extraction layer is RE The calculation is done using the following formula:
[0058]
[0059] The objective function is min(L NER +L RE ), where: L NER is the cross entropy loss during training of the label score layer.
[0060] Beneficial effects: The entity and relationship joint extraction method for the education field provided by the present invention has the following advantages over the prior art: 1. The present invention uses a pre-trained XLNET language model to design high-level feature embedding. Instead of directly using fixed word vector information for the same word, it performs dynamic embedding representation based on context information, which can greatly improve the accuracy of converting the word embedding layer text into a low-density embedding vector, reduce the negative impact of polysemous words on model performance, and effectively capture the local and global information of words; 2. The present invention introduces a MultiHead Attention mechanism after the Mogrifier BiGRU neural network to capture the more important part of the text features, effectively solving the problem of a large number of modifier interferences in the entity; 3. The present invention simultaneously extracts entities and relationships by means of joint extraction, and realizes the dependency between entity and relationship subtasks through a parameter sharing coding layer, thereby alleviating the problem of error propagation. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0062] The present invention will be further described below in conjunction with the accompanying drawings.
[0063] like Figure 1The figure shows a joint extraction method of entities and relations for the education field, which includes the following steps:
[0064] Step 1: Establish a named entity corpus of course knowledge points. The named entity corpus of course knowledge points consists of text data containing course knowledge points.
[0065] First, the BIO annotation method is used to annotate the text data in the named entity corpus of course knowledge points. That is, the text data is divided into P categories, each category is a label, and the pth category is represented by label p, p = 1, 2, ..., P; then the relationship between knowledge entities is divided into Q relationships, and the qth relationship is represented by relationship q, q = 1, 2, ..., Q; then the text data is divided into a training set and a test set; in the BIO annotation method, B represents the beginning of a knowledge entity, I represents the rest of the knowledge entity, and O represents a non-knowledge entity.
[0066] Step 2: Distribute the preprocessed text data containing course knowledge points, take sentences as input, and obtain text pre-trained vectors through the XLNET language model.
[0067] The sentence input to the XLNET language model is represented as S = [s1, s2, …, s N ], the text pre-training vector output by the XLNET language model is represented as X = [x1, x2, …, x N ]; where s i represents the i-th word that makes up the sentence S, x i For the word s i Representation vector, i=1,2,…,N.
[0068] Step 3: Input the obtained text pre-training vector into the Mogrifier BiGRU neural network for text feature extraction.
[0069] The Mogrifier BiGRU neural network includes a forward GRU network and a backward GRU network. The input and hidden layer output of the Mogrifier BiGRU neural network are X = [x1, x2, ..., x N ] and H=[h1,h2,…,h N ], the input and hidden layer output of the forward GRU network are and The input and hidden layer output of the backward GRU network are and
[0070] The superscript t and t-1 represent the time t and the time t-1. and Through two-way multi-round interaction
[0071] For the forward GRU network, the interaction process is as follows:
[0072] (a41) Yes and Interact and get
[0073] (a42) Yes and Interact and get
[0074] (a43) Yes and Interact and get
[0075] (a44) Yes and Interact and get
[0076] (a45)
[0077] For the backward GRU network, the interaction process is as follows:
[0078] (b41) Yes and Interact and get
[0079] (b42) Yes and Interact and get
[0080] (b43) Yes and Interact and get
[0081] (b44) Yes and Interact and get
[0082] (b45)
[0083] Where: σ is the logistic regression function, R 1 , R 2 , R 3 , R 4 is the model parameter.
[0084] Step 4: Introduce the MultiHead Attention mechanism after the Mogrifier BiGRU neural network to capture the more important parts of the text features; the more important parts refer to the parts of the text features that can constitute knowledge entities.
[0085] The MultiHead Attention mechanism is introduced after the Mogrifier BiGRU neural network to further capture the word s i The contextual semantics of the sentence S is highlighted, and the significance of the keywords in the sentence S is assigned attention weights, using the MultiHead Attention mechanism as the attention layer. The calculation process of the MultiHead Attention mechanism includes the following steps:
[0086] (41) X = [x1, x2, …, x N ]H=[h1,h2,…,h N ] is mapped into three vectors K, Q, and V;
[0087] (42) K, Q, and V correspond to the j-th attention head of the MultiHead Attention mechanism. in: are three global parameter matrices, d N represents the input dimension of the MultiHead Attention mechanism, D represents the total number of attention heads of the MultiHead Attention mechanism, and d k =d q =d v =d N / D;
[0088] (43) Calculate the value of the j-th head attention
[0089] (44) Concatenate the D attention values to get multi-head attention Where: W o is the weight matrix, and the element b in the i-th row and j-th column of B is ij Indicates word s i The weight on the jth attention head;
[0090] (45) Combined with the word s i The hidden state h i and the attention weight b ij Generate word s i Content vector
[0091] (46) The more important part of the text features captured by the MultiHead Attention mechanism after the Mogrifier BiGRU neural network is C = [c1, c2, ..., c N ].
[0092] Step 5: Combine the CRF model to obtain the relationship between the named entities of the course knowledge points and the knowledge entities.
[0093] The CRF model is used as the label scoring layer. The label score of each word under each label is first calculated using the CRF model. Then the Viterbi algorithm is applied to obtain the label sequence with the highest label score. Then, the relationship between the named entities and knowledge entities of the course knowledge points is obtained through the relationship extraction layer.
[0094] Use CRF model to calculate word s i The label score under label p
[0095]
[0096] Where: the superscript (ner) indicates knowledge entity annotation recognition; V (ner) and U (ner) represents the weight matrix, b (ner) represents the bias matrix, V (ner) ∈R p×l , U (ner) ∈R l×2d , b (ner) ∈R l , l is the layer width of the CRF model, d is the number of hidden layer units of the Mogrifier BiGRU neural network; f(·) represents the nonlinear activation function;
[0097] Assign labels to all words in sentence S to get the label sequence of sentence S. Each sentence S has R = N P Calculate the label score of S under the rth label sequence:
[0098]
[0099] Where: Y r represents the rth label sequence, Y = [Y1, Y2, ..., Y R ],r=1,2,…,R, Represents the word s under the rth label sequence i The label score under the assigned label, A represents the label score of sentence S under the assigned label in the rth label sequence, (i,r),(i+1,r) Represents the word s under the rth label sequence iThe assigned label is transferred to the word s i+1 The transfer score on the , A represents the transfer matrix, A∈R (P+2)×(P+2) ;
[0100] Label score for label sequence Normalize and get the probability distribution of each label sequence:
[0101]
[0102] Apply the Viterbi algorithm to obtain the tag sequence with the highest tag score
[0103]
[0104] Among them: the label sequence with the highest label score Chinese: S i The assigned label is g i ;
[0105] The label score layer is trained using the method of minimizing the cross entropy loss.
[0106] When using the relation extraction layer to extract the relationship between the named entities of the course knowledge points and the knowledge entities, first calculate the word s under the given relationship q i and the word s j Relationship score between:
[0107] S (re) (m j ,m i ,q)=V (re) f(U (re) m j +W (re) m i +b (re) )
[0108] Where: m i =[c i ; g i ],m j =[c j ; g j ], the superscript (re) indicates relation identification, V (re) , U (re) and W (re) represents the weight matrix, b (re) represents the bias matrix, V (re) ∈R l , U (re) ∈R l×(2a+d) , W (re) ∈R l×(2a+d) , b (re) ∈R l, l is the layer width of the relation extraction layer, d is the number of hidden layer units of the Mogrifier BiGRU neural network, a is the dimension of the label; f(·) represents the nonlinear activation function;
[0109] Word i and the word s j The probability distribution of the existence of a relationship q is:
[0110]
[0111] The relation extraction layer is trained using the cross entropy loss minimization method.
[0112] Cross entropy loss L during training of the relation extraction layer RE The calculation is done using the following formula:
[0113]
[0114] The objective function is min(L NER +L RE ), where: L NER is the cross entropy loss during training of the label score layer.
[0115] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for joint extraction of entities and relations in the field of education, characterized by: The steps include: (1) Establish a named entity corpus of course knowledge points, which consists of text data containing course knowledge points; First, the BIO annotation method is used to annotate the text data in the named entity corpus of course knowledge points. That is, the text data is divided into P categories, each category is a label, and the pth category is represented by label p, p = 1, 2, ..., P; then the relationship between knowledge entities is divided into Q types of relationships, and the qth relationship is represented by relationship q, q = 1, 2, ..., Q; then the text data is divided into a training set and a test set; in the BIO annotation method, B represents the beginning of the knowledge entity, I represents the other parts of the knowledge entity, and O represents the non-knowledge entity; (2) Distribute the preprocessed text data containing course knowledge points, take sentences as input, and obtain text pre-trained vectors through the XLNET language model; The sentence input to the XLNET language model is represented as S = [s1, s2, …, s N ], the text pre-training vector output by the XLNET language model is represented as X = [x1, x2, …, x N ]; where s i represents the i-th word that makes up the sentence S, x i For the word s i Representation vector, i=1,2,…,N; (3) Input the obtained text pre-training vector into the Mogrifier BiGRU neural network for text feature extraction; The Mogrifier BiGRU neural network includes a forward GRU network and a backward GRU network. The input and hidden layer output of the Mogrifier BiGRU neural network are X = [x1, x2, ..., x N ] and H=[h1,h2,…,h N ], the input and hidden layer output of the forward GRU network are and The input and hidden layer output of the backward GRU network are and The superscript t and t-1 represent the time t and the time t-1. and Through two-way multi-round interaction For the forward GRU network, the interaction process is as follows: (a41) Yes and Interact and get (a42) Yes and Interact and get (a43) Yes and Interact and get (a44) Yes and Interact and get (a45) For the backward GRU network, the interaction process is as follows: (b41) Yes and Interact and get (b42) Yes and Interact and get (b43) Yes and Interact and get (b44) Yes and Interact and get (b45) Where: σ is the logistic regression function, R 1 , R 2 , R 3 , R 4 are model parameters; (4) The MultiHead Attention mechanism is introduced after the Mogrifier BiGRU neural network to capture the more important parts of the text features; the more important parts refer to the parts of the text features that can constitute knowledge entities; The MultiHead Attention mechanism is introduced after the Mogrifier BiGRU neural network to further capture the word s i The contextual semantics of the sentence S is highlighted, and the significance of the keywords in the sentence S is highlighted, and the attention weights are assigned, and the MultiHead Attention mechanism is used as the attention layer; the calculation process of the MultiHead Attention mechanism includes the following steps: (41) X = [x1, x2, …, x N ]H=[h1,h2,…,h N ] is mapped into three vectors K, Q, and V; (42) K, Q, and V correspond to the j-th attention head of the MultiHead Attention mechanism. in: are three global parameter matrices, d N represents the input dimension of the MultiHead Attention mechanism, D represents the total number of attention heads of the MultiHead Attention mechanism, and d k =d q =d v =d N / D; (43) Calculate the value of the jth head attention (44) Concatenate the D attention values to get multi-head attention Where: W o is the weight matrix, and the element b in the i-th row and j-th column of B is ij Indicates word s i The weight on the jth attention head; (45) Combined with the word s i The hidden state h i and the attention weight b ij Generate word s i Content vector (46) The more important part of the text features captured by the MultiHead Attention mechanism after the Mogrifier BiGRU neural network is C = [c1, c2, ..., c N ]; (5) The CRF model is used as the label scoring layer. The label score of each word under each label is calculated using the CRF model. Then the Viterbi algorithm is applied to obtain the label sequence with the highest label score. Then, the relationship between the named entity and the knowledge entity of the course knowledge point is obtained through the relationship extraction layer. Use CRF model to calculate word s i The label score under label p Where: the superscript (ner) indicates knowledge entity annotation recognition; V (ner) and U (ner) represents the weight matrix, b (ner) represents the bias matrix, V (ner) ∈R p×l , U (ner) ∈R l×2d , b (ner) ∈R l , l is the layer width of the CRF model, d is the number of hidden layer units of the Mogrifier BiGRU neural network; f(·) represents the nonlinear activation function; Assign labels to all words in sentence S to get the label sequence of sentence S. Each sentence S has R = N P Calculate the label score of S under the rth label sequence: Where: Y r represents the rth label sequence, Y = [Y1, Y2, ..., Y R ], r = 1, 2, ..., R, Represents the word s under the rth label sequence i The label score under the assigned label, A represents the label score of sentence S under the assigned label in the rth label sequence, (i,r),(i+1,r) Represents the word s under the rth label sequence i The assigned label is transferred to the word s i+1 The transfer score on the , A represents the transfer matrix, A∈R (P+2)×(P+2) ; Label score for label sequence Normalize and get the probability distribution of each label sequence: Apply the Viterbi algorithm to obtain the tag sequence with the highest tag score Among them: the label sequence with the highest label score Chinese: S i The assigned label is g i ; Train the label score layer using the cross entropy loss minimization method; When using the relation extraction layer to extract the relationship between the named entities of the course knowledge points and the knowledge entities, first calculate the word s under the given relationship q i and the word s j Relationship score between: S (re) (m j ,m i ,q)=V (re) f(U (re) m j +W (re) m i +b (re) ) Where: m i =[c i ; g i ],m j =[c j ; g j ], the superscript (re) indicates relation identification, V (re) , U (re) and W (re) represents the weight matrix, b (re) represents the bias matrix, V (re) ∈R l , U (re) ∈R l×(2a+d) , W (re) ∈R l×(2a+d) , b (re) ∈R l , l is the layer width of the relation extraction layer, d is the number of hidden layer units of the Mogrifier BiGRU neural network, a is the dimension of the label; f(·) represents the nonlinear activation function; Word i and the word s j The probability distribution of the existence of a relationship q is: The relation extraction layer is trained using the cross entropy loss minimization method.
2. The entity and relationship joint extraction method for the education field according to claim 1 is characterized by: The cross entropy loss L during the training process of the relationship extraction layer RE The calculation is done using the following formula: The objective function is min(L NER +L RE ), where: L NER is the cross entropy loss during training of the label score layer.
